redland-1.0.17/0000755000175000017500000000000012257576340010225 500000000000000redland-1.0.17/Redland.i0000644000175000017500000005366211666557107011707 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * Redland.i - SWIG interface file for interfaces to Redland * * Copyright (C) 2000-2010 David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005 University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ %module Redland %include typemaps.i #ifdef REDLAND_TYPEMAP_I %include #endif %{ /* compile-time include (inside a % ... % block) */ #ifdef REDLAND_PRE_I #include #endif #include /* * Thanks to the patch in this Debian bug for the solution * to the crash inside vsnprintf on some architectures. * * "reuse of args inside the while(1) loop is in violation of the * specs and only happens to work by accident on other systems." * * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=104325 */ #ifndef va_copy #ifdef __va_copy #define va_copy(dest,src) __va_copy(dest,src) #else #define va_copy(dest,src) (dest) = (src) #endif #endif /* compile-time include (inside a % ... % block) */ #ifdef REDLAND_POST_I #include #endif /* Internal prototypes */ /* FOR TESTING ERRORS ONLY - NOT PART OF API */ void librdf_internal_test_error(librdf_world *world); void librdf_internal_test_warning(librdf_world *world); /* prototypes for internal routines called below - NOT PART OF API */ void librdf_test_error(librdf_world* world, const char* message); void librdf_test_warning(librdf_world* world, const char* message); /* FOR TESTING ERRORS ONLY - NOT PART OF API */ void librdf_internal_test_error(librdf_world *world) { librdf_test_error(world, "test error message number 1."); } void librdf_internal_test_warning(librdf_world *world) { librdf_test_warning(world, "test warning message number 2."); } %} %init %{ /* compile-time include (inside a % ... % block) */ #ifdef REDLAND_INIT_I #include #endif %} /* SWIG-time include (outside a % ... % block) */ #ifdef REDLAND_TYPES_I %include #endif typedef struct librdf_world_s librdf_world; typedef struct librdf_digest_s librdf_digest; typedef struct librdf_hash_s librdf_hash; typedef struct librdf_uri_s librdf_uri; typedef struct librdf_iterator_s librdf_iterator; typedef struct librdf_node_s librdf_node; typedef struct librdf_statement_s librdf_statement; typedef struct librdf_model_s librdf_model; typedef struct librdf_storage_s librdf_storage; typedef struct librdf_stream_s librdf_stream; typedef struct librdf_parser_s librdf_parser; typedef struct librdf_serializer_s librdf_serializer; /* rdf_digest.h */ %newobject librdf_new_digest; librdf_digest* librdf_new_digest(librdf_world *world, char *name); void librdf_free_digest(librdf_digest *digest); void librdf_digest_init(librdf_digest* digest); void librdf_digest_update(librdf_digest* digest, const char* buf, size_t length); void librdf_digest_update_string(librdf_digest* digest, const char* string); void librdf_digest_final(librdf_digest* digest); %newobject librdf_digest_to_string; char* librdf_digest_to_string(librdf_digest* digest); /* rdf_hash.h */ %newobject librdf_new_hash; %newobject librdf_new_hash_from_string; %newobject librdf_new_hash_from_array_of_strings; librdf_hash* librdf_new_hash(librdf_world *world, const char *name); librdf_hash* librdf_new_hash_from_string(librdf_world *world, const char* name, const char* string); librdf_hash* librdf_new_hash_from_array_of_strings(librdf_world *world, const char* name, const char* *string); %newobject librdf_hash_to_string; char* librdf_hash_to_string(librdf_hash* hash, const char *filter[]); void librdf_free_hash(librdf_hash *hash); /* rdf_init.h */ %newobject librdf_new_world; librdf_world* librdf_new_world(void); void librdf_free_world(librdf_world *world); void librdf_world_open(librdf_world *world); %newobject librdf_world_get_feature; librdf_node* librdf_world_get_feature(librdf_world* world, librdf_uri *feature);int librdf_world_set_feature(librdf_world* world, librdf_uri *feature, librdf_node* value); %newobject librdf_parser_get_accept_header; char* librdf_parser_get_accept_header(librdf_parser* parser); void librdf_world_set_logger(librdf_world* world, void *user_data, librdf_log_func log_handler); /* rdf_iterator.h */ void librdf_free_iterator(librdf_iterator*); int librdf_iterator_end(librdf_iterator* iterator); librdf_node* librdf_iterator_get_object(librdf_iterator* iterator); librdf_node* librdf_iterator_get_context(librdf_iterator* iterator); int librdf_iterator_next(librdf_iterator* iterator); /* rdf_uri.h */ %newobject librdf_new_uri; %newobject librdf_new_uri_from_uri; %newobject librdf_new_uri_from_filenam; librdf_uri* librdf_new_uri (librdf_world *world, char *string); librdf_uri* librdf_new_uri_from_uri (librdf_uri* uri); librdf_uri* librdf_new_uri_from_filename(librdf_world* world, const char* filename); void librdf_free_uri(librdf_uri *uri); %newobject librdf_uri_to_string; char* librdf_uri_to_string (librdf_uri* uri); int librdf_uri_equals(librdf_uri* first_uri, librdf_uri* second_uri); int librdf_uri_compare(librdf_uri* first_uri, librdf_uri* second_uri); /* rdf_node.h */ %newobject librdf_new_node; %newobject librdf_new_node_from_uri_string; %newobject librdf_new_node_from_uri; %newobject librdf_new_node_from_uri_local_name; %newobject librdf_new_node_from_normalised_uri_string; %newobject librdf_new_node_from_literal; %newobject librdf_new_node_from_typed_literal; %newobject librdf_new_node_from_node; %newobject librdf_new_node_from_blank_identifier; librdf_node* librdf_new_node(librdf_world *world); librdf_node* librdf_new_node_from_uri_string(librdf_world *world, const char* string); librdf_node* librdf_new_node_from_uri(librdf_world *world, librdf_uri *uri); librdf_node* librdf_new_node_from_uri_local_name(librdf_world* world, librdf_uri *uri, const char *local_name); librdf_node* librdf_new_node_from_normalised_uri_string(librdf_world* world, const char *uri_string, librdf_uri *source_uri, librdf_uri *base_uri); librdf_node* librdf_new_node_from_literal(librdf_world *world, const char* string, const char* inStrOrNull /* string */ =NULL, int is_wf_xml=0); librdf_node* librdf_new_node_from_typed_literal(librdf_world *world, const char* string, const char* inStrOrNull /* string */ =NULL, librdf_uri* inUriOrNull /* datatype_uri */ =NULL); librdf_node* librdf_new_node_from_node(librdf_node* node); librdf_node* librdf_new_node_from_blank_identifier(librdf_world *world, const char* inStrOrNull /* identifier */ =NULL); void librdf_free_node(librdf_node* r); librdf_uri* librdf_node_get_uri(librdf_node* node); int librdf_node_get_type(librdf_node* node); char* librdf_node_get_literal_value(librdf_node* node); char* librdf_node_get_literal_value_as_latin1(librdf_node* node); char* librdf_node_get_literal_value_language(librdf_node* node); librdf_uri* librdf_node_get_literal_value_datatype_uri(librdf_node* node); int librdf_node_get_literal_value_is_wf_xml(librdf_node* node); int librdf_node_get_li_ordinal(librdf_node* node); %newobject librdf_node_to_string; char *librdf_node_to_string(librdf_node* node); char *librdf_node_get_blank_identifier(librdf_node* node); int librdf_node_is_resource(librdf_node* node); int librdf_node_is_literal(librdf_node* node); int librdf_node_is_blank(librdf_node* node); int librdf_node_equals(librdf_node* first_node, librdf_node* second_node); /* rdf_statement.h */ %newobject librdf_new_statement; %newobject librdf_new_statement_from_statement; %newobject librdf_new_statement_from_nodes; librdf_statement* librdf_new_statement(librdf_world *world); librdf_statement* librdf_new_statement_from_statement(librdf_statement* statement); librdf_statement* librdf_new_statement_from_nodes(librdf_world *world, librdf_node* subject, librdf_node* predicate, librdf_node* object); void librdf_free_statement(librdf_statement* statement); librdf_node* librdf_statement_get_subject(librdf_statement *statement); void librdf_statement_set_subject(librdf_statement *statement, librdf_node* subject); librdf_node* librdf_statement_get_predicate(librdf_statement *statement); void librdf_statement_set_predicate(librdf_statement *statement, librdf_node* predicate); librdf_node* librdf_statement_get_object(librdf_statement *statement); void librdf_statement_set_object(librdf_statement *statement, librdf_node* object); int librdf_statement_equals(librdf_statement* statement1, librdf_statement* statement2); int librdf_statement_match(librdf_statement* statement, librdf_statement* partial_statement); %newobject librdf_statement_to_string; char *librdf_statement_to_string(librdf_statement *statement); int librdf_statement_is_complete(librdf_statement *statement); /* rdf_model.h */ %newobject librdf_new_model; %newobject librdf_new_model_with_options; %newobject librdf_new_model_from_model; librdf_model* librdf_new_model(librdf_world *world, librdf_storage *storage, char* options_string); librdf_model* librdf_new_model_with_options(librdf_world *world, librdf_storage *storage, librdf_hash* options); librdf_model* librdf_new_model_from_model(librdf_model* model); void librdf_free_model(librdf_model* model); int librdf_model_size(librdf_model* model); int librdf_model_add(librdf_model* model, librdf_node* subject, librdf_node* predicate, librdf_node* object); int librdf_model_add_string_literal_statement(librdf_model* model, librdf_node* subject, librdf_node* predicate, const char* literal, const char *inStrOrNull /* xml_language */ =NULL, int is_wf_xml =0); int librdf_model_add_typed_literal_statement(librdf_model* model, librdf_node* subject, librdf_node* predicate, char* string, char* inStrOrNull /* xml_language */, librdf_uri *inUriOrNull /* datatype_uri */ =NULL); int librdf_model_add_statement(librdf_model* model, librdf_statement* statement); int librdf_model_add_statements(librdf_model* model, librdf_stream* statement_stream); int librdf_model_remove_statement(librdf_model* model, librdf_statement* statement); int librdf_model_contains_statement(librdf_model* model, librdf_statement* statement); %newobject librdf_model_as_stream; librdf_stream* librdf_model_as_stream(librdf_model* model); %newobject librdf_model_find_statements; librdf_stream* librdf_model_find_statements(librdf_model* model, librdf_statement* statement); %newobject librdf_model_find_statements_in_context; librdf_stream* librdf_model_find_statements_in_context(librdf_model* model, librdf_statement* statement, librdf_node* inNodeOrNull /* context_node */ =NULL); %newobject librdf_model_get_sources; librdf_iterator* librdf_model_get_sources(librdf_model* model, librdf_node* arc, librdf_node* target); %newobject librdf_model_get_arcs; librdf_iterator* librdf_model_get_arcs(librdf_model* model, librdf_node* source, librdf_node* target); %newobject librdf_model_get_targets; librdf_iterator* librdf_model_get_targets(librdf_model* model, librdf_node* source, librdf_node* arc); %newobject librdf_model_get_source; librdf_node* librdf_model_get_source(librdf_model* model, librdf_node* arc, librdf_node* target); %newobject librdf_model_get_arc; librdf_node* librdf_model_get_arc(librdf_model* model, librdf_node* source, librdf_node* target); %newobject librdf_model_get_arcs_out; librdf_iterator* librdf_model_get_arcs_out(librdf_model* model,librdf_node* node); %newobject librdf_model_get_arcs_in; librdf_iterator* librdf_model_get_arcs_in(librdf_model* model,librdf_node* node); int librdf_model_has_arc_in(librdf_model* model,librdf_node* node,librdf_node* property); int librdf_model_has_arc_out(librdf_model* model,librdf_node* node,librdf_node* property); %newobject librdf_model_get_target; librdf_node* librdf_model_get_target(librdf_model* model, librdf_node* source, librdf_node* arc); int librdf_model_context_add_statement(librdf_model* model, librdf_node* context, librdf_statement* statement); int librdf_model_context_add_statements(librdf_model* model, librdf_node* context, librdf_stream* stream); int librdf_model_context_remove_statement(librdf_model* model, librdf_node* context, librdf_statement* statement); int librdf_model_context_remove_statements(librdf_model* model, librdf_node* context); %newobject librdf_model_context_as_stream; librdf_stream* librdf_model_context_as_stream(librdf_model* model, librdf_node* context); void librdf_model_sync(librdf_model* model); %newobject librdf_model_get_contexts; librdf_iterator* librdf_model_get_contexts(librdf_model* model); int librdf_model_contains_context(librdf_model* model, librdf_node* context); %newobject librdf_model_get_feature; librdf_node* librdf_model_get_feature(librdf_model* model, librdf_uri* feature); int librdf_model_set_feature(librdf_model* model, librdf_uri* feature, librdf_node* value); int librdf_model_load(librdf_model* model, librdf_uri *uri, const char* inStrOrNull /* name */ =NULL, const char* inStrOrNull /* mime_type */ =NULL, librdf_uri *type_uri=NULL); %newobject librdf_model_query_execute; librdf_query_results* librdf_model_query_execute(librdf_model* model, librdf_query* query); %newobject librdf_model_to_string; char* librdf_model_to_string(librdf_model* model, librdf_uri *uri /* or NULL */, const char* inStrOrNull /* name */ =NULL /* */ , const char* inStrOrNull /* mime_type */ =NULL, librdf_uri* inUriOrNull /*type_uri */ =NULL); int librdf_model_transaction_start(librdf_model* model); int librdf_model_transaction_commit(librdf_model* model); int librdf_model_transaction_rollback(librdf_model* model); /* rdf_storage.h */ %newobject librdf_new_storage; %newobject librdf_new_storage_from_storage; librdf_storage* librdf_new_storage(librdf_world *world, char *storage_name, char *name, char *options_string); librdf_storage* librdf_new_storage_from_storage (librdf_storage* old_storage); void librdf_free_storage(librdf_storage *storage); /* rdf_parser.h */ int librdf_parser_check_name(librdf_world* world, const char *name); %newobject librdf_new_parser; librdf_parser* librdf_new_parser(librdf_world *world, const char* name, const char* mime_type, librdf_uri *type_uri); void librdf_free_parser(librdf_parser *parser); %newobject librdf_parser_parse_as_stream; librdf_stream* librdf_parser_parse_as_stream(librdf_parser* parser, librdf_uri* uri, librdf_uri* inUriorNull /* base_uri */ = NULL); int librdf_parser_parse_into_model(librdf_parser* parser, librdf_uri* uri, librdf_uri* inUriOrNull /* base_uri */, librdf_model* model); %newobject librdf_parser_parse_string_as_stream; librdf_stream* librdf_parser_parse_string_as_stream(librdf_parser* parser, const char* string, librdf_uri* base_uri); int librdf_parser_parse_string_into_model(librdf_parser* parser, const char* string, librdf_uri* base_uri, librdf_model* model); librdf_stream* librdf_parser_parse_counted_string_as_stream(librdf_parser* parser, const char* string, size_t length, librdf_uri* base_uri); int librdf_parser_parse_counted_string_into_model(librdf_parser* parser, const char* string, size_t length, librdf_uri* base_uri, librdf_model* model); %newobject librdf_parser_get_feature; librdf_node* librdf_parser_get_feature(librdf_parser* parser, librdf_uri *feature); int librdf_parser_set_feature(librdf_parser* parser, librdf_uri *feature, librdf_node* value); const char* librdf_parser_guess_name(const char *mime_type, const char *buffer, const char *identifier); const char* librdf_parser_guess_name2(librdf_world* world, const char *mime_type, const char *buffer, const char *identifier); const char* librdf_parser_get_namespaces_seen_prefix(librdf_parser* parser, int offset); librdf_uri* librdf_parser_get_namespaces_seen_uri(librdf_parser* parser, int offset); int librdf_parser_get_namespaces_seen_count(librdf_parser* parser); /* rdf_query.h */ %newobject librdf_new_query; %newobject librdf_new_query_from_query; librdf_query* librdf_new_query(librdf_world* world, const char* name, librdf_uri* inUriOrNull /* uri */, const char* query_string, librdf_uri* inUriOrNull /* base_uri */); librdf_query* librdf_new_query_from_query (librdf_query* old_query); void librdf_free_query(librdf_query *query); /* methods */ %newobject librdf_query_execute; librdf_query_results* librdf_query_execute(librdf_query* query, librdf_model* model); int librdf_query_get_limit(librdf_query *query); int librdf_query_set_limit(librdf_query *query, int limit); int librdf_query_get_offset(librdf_query *query); int librdf_query_set_offset(librdf_query *query, int offset); %newobject librdf_query_results_as_stream; librdf_stream* librdf_query_results_as_stream(librdf_query_results* query_results); int librdf_query_results_get_count(librdf_query_results* query_results); int librdf_query_results_next(librdf_query_results* query_results); int librdf_query_results_finished(librdf_query_results* query_results); %newobject librdf_query_results_get_binding_value; librdf_node* librdf_query_results_get_binding_value(librdf_query_results* query_results, int offset); const char* librdf_query_results_get_binding_name(librdf_query_results* query_results, int offset); %newobject librdf_query_results_get_binding_value_by_name; librdf_node* librdf_query_results_get_binding_value_by_name(librdf_query_results* query_results, const char* name); int librdf_query_results_get_bindings_count(librdf_query_results* query_results); int librdf_query_results_to_file(librdf_query_results *query_results, const char* name, librdf_uri *format_uri, librdf_uri *base_uri); int librdf_query_results_to_file2(librdf_query_results *query_results, const char *name, const char *mime_type, librdf_uri *format_uri, librdf_uri *base_uri); %newobject librdf_query_results_to_string; char* librdf_query_results_to_string(librdf_query_results *query_results, librdf_uri *format_uri, librdf_uri *base_uri); %newobject librdf_query_results_to_string2; char* librdf_query_results_to_string2(librdf_query_results *query_results, const char *name, const char *mime_type, librdf_uri *format_uri, librdf_uri *base_uri); void librdf_free_query_results(librdf_query_results* query_results); int librdf_query_results_is_bindings(librdf_query_results *query_results); int librdf_query_results_is_boolean(librdf_query_results *query_results); int librdf_query_results_is_graph(librdf_query_results *query_results); int librdf_query_results_is_syntax(librdf_query_results* query_results); int librdf_query_results_get_boolean(librdf_query_results *query_results); /* rdf_serializer.h */ int librdf_serializer_check_name(librdf_world* world, const char *name); %newobject librdf_new_serializer; librdf_serializer* librdf_new_serializer(librdf_world* world, const char* name, const char* mime_type, librdf_uri *type_uri); void librdf_free_serializer(librdf_serializer *serializer); int librdf_serializer_serialize_stream_to_file(librdf_serializer* serializer, const char *name, librdf_uri* base_uri, librdf_stream* stream); int librdf_serializer_serialize_model_to_file(librdf_serializer* serializer, const char* name, librdf_uri* inUriOrNull /* base_uri */, librdf_model* model); %newobject librdf_serializer_serialize_stream_to_string; char* librdf_serializer_serialize_stream_to_string(librdf_serializer *serializer, librdf_uri *base_uri, librdf_stream *stream); %newobject librdf_serializer_serialize_model_to_string; char* librdf_serializer_serialize_model_to_string(librdf_serializer* serializer, librdf_uri* inUriOrNull /* base_uri */, librdf_model* model); librdf_node* librdf_serializer_get_feature(librdf_serializer* serializer, librdf_uri *feature); int librdf_serializer_set_feature(librdf_serializer* serializer, librdf_uri *feature, librdf_node* value); int librdf_serializer_set_namespace(librdf_serializer* serializer, librdf_uri *nspace, const char* prefix); /* rdf_stream.h */ void librdf_free_stream(librdf_stream* stream); int librdf_stream_end(librdf_stream* stream); int librdf_stream_next(librdf_stream* stream); librdf_statement* librdf_stream_get_object(librdf_stream* stream); librdf_node* librdf_stream_get_context(librdf_stream* stream); /* rdf_log.h and raptor.h */ int librdf_log_message_code(librdf_log_message *message); int librdf_log_message_level(librdf_log_message *message); int librdf_log_message_facility(librdf_log_message *message); const char* librdf_log_message_message(librdf_log_message *message); raptor_locator* librdf_log_message_locator(librdf_log_message *message); int raptor_locator_line(raptor_locator *locator); int raptor_locator_column(raptor_locator *locator); int raptor_locator_byte(raptor_locator *locator); const char* raptor_locator_file(raptor_locator *locator); const char* raptor_locator_uri(raptor_locator *locator); /* FOR TESTING ERRORS ONLY - NOT PART OF API */ void librdf_internal_test_error(librdf_world *world); void librdf_internal_test_warning(librdf_world *world); /* SWIG world - declare variables wanted from rdf_init.h */ %immutable; extern const char* const librdf_short_copyright_string; extern const char* const librdf_copyright_string; extern const char* const librdf_version_string; extern const unsigned int librdf_version_major; extern const unsigned int librdf_version_minor; extern const unsigned int librdf_version_release; extern const unsigned int librdf_version_decimal; extern const char * const raptor_version_string; extern const unsigned int raptor_version_major; extern const unsigned int raptor_version_minor; extern const unsigned int raptor_version_release; extern const unsigned int raptor_version_decimal; extern const char* const rasqal_version_string; extern const unsigned int rasqal_version_major; extern const unsigned int rasqal_version_minor; extern const unsigned int rasqal_version_release; extern const unsigned int rasqal_version_decimal; %mutable; /* SWIG-time include (not inside a % ... % block) */ #ifdef REDLAND_DECL_I %include #endif redland-1.0.17/build/0000755000175000017500000000000012257576337011332 500000000000000redland-1.0.17/build/missing0000755000175000017500000002415212155164577012651 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: redland-1.0.17/build/ltmain.sh0000644000175000017500000105202612155164572013067 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 redland-1.0.17/build/config.sub0000755000175000017500000010532712155164577013241 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: redland-1.0.17/build/install-sh0000755000175000017500000003325612155164577013263 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: redland-1.0.17/build/compile0000755000175000017500000001615212155164577012631 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-03-05.13; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free # Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: redland-1.0.17/build/depcomp0000755000175000017500000005064312155164577012633 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: redland-1.0.17/build/config.guess0000755000175000017500000012743212155164577013577 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: redland-1.0.17/build/ar-lib0000755000175000017500000001330312155164577012342 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2012-03-01.08; # UTC # Copyright (C) 2010, 2012 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat < * Snapshotted redland_1_0_17 for 1.0.17 release (GIT e5c2c5f99a4ae18dc9ca62b971797ca7f9c1ab9a) 2013-12-12 Dave Beckett * scripts/process-changes.pl: Add version_for_sort to sort versionwise 2013-11-24 Dave Beckett * src/rdf_serializer.c: Handle raptor stricter checks in serializing * examples/example8.c: Initialise model vars to NULL for error path [llvm] 2013-11-13 Dave Beckett * src/rdf_query_virtuoso.c, src/rdf_storage_virtuoso.c: Ignore noisy llvm warning about deprecated ODBC sql.h functions 2013-11-12 Dave Beckett * configure.ac: Restore CPPFLAGS around virtuoso test * configure.ac: whitespace * src/Makefile.am: librdf_storage_virtuoso_la uses rasqal symbols; link with it 2013-11-08 Dave Beckett * src/rdf_digest_md5.c: Use unions to align unsigned char and u32 [clang] 2013-11-02 Dave Beckett * configure.ac: Check for clang to enable correct discovery of supported warnings 2013-10-27 Dave Beckett * Merge pull request #4 from jackolantern/fix-error-message Fix error message. 2013-08-27 Dave Beckett * src/rdf_concepts.h: remove , 2013-08-23 Dave Beckett * src/rdf_concepts.c: comma 2013-08-22 Dave Beckett * src/rdf_concepts.c, src/rdf_concepts.h: Add rdf:HTML and rdf:langString from RDF 1.1 concepts RDF 1.1 Concepts and Abstract Syntax W3C Last Call Working Draft 23 July 2013 http://www.w3.org/TR/2013/WD-rdf11-concepts-20130723/ http://www.w3.org/TR/2013/WD-rdf11-concepts-20130723/#section-html http://www.w3.org/TR/2013/WD-rdf11-concepts-20130723/#section-Datatypes 2013-06-17 Dave Beckett * autogen.sh: update autogen.sh 2013-06-09 Dave Beckett * configure.ac: Fix some test operators 2013-04-27 Dave Beckett * src/rdf_query_rasqal.c: Avoid an assert inside rasqal_query_results_next_triple (librdf_query_rasqal_query_results_next_statement): check that "result" pointer is not NULL before calling rasqal_query_results_next_triple() Patch from Michael Stahl Fixes Issue #0000543 http://bugs.librdf.org/mantis/view.php?id=543 2013-04-08 Dave Beckett * src/rdf_digest_md5.c: Do not destroy MD5 digest 2013-04-07 Dave Beckett * src/rdf_digest_md5.c: memset fixes [gcc 4.8] 2013-04-05 Dave Beckett * src/win32_rdf_config.h.in: Make win32_rdf_config.h work on MSVC2008 Patch from Michael Stahl Fixes Issue #0000542 http://bugs.librdf.org/mantis/view.php?id=542 * configure.ac, src/Makefile.am, src/rdf_storage_sqlite.c, src/win32_rdf_config.h.in: Remove SQLITE V2 support and switch to PKG_CHECK_MODULES in configure - Remove ancient sqlite V2 API support, removing lots of conditional code. - Alter configure to use PKG_CHECK_MODULES for sqlite3 and then the SQLITE_CFLAGS and SQLITE_LIBS envars * build/pkg.m4, configure.ac: Use PKG_CHECK_MODULES() for calling and overriding pkg-config - macro is in build/pkg.m4 from pkg-config 0.28 - Use _CFLAGS and _LIBS envars. - Enables overriding of pkg-config if needed. Patch from Michael Stahl Fixes Issue #0000541 http://bugs.librdf.org/mantis/view.php?id=541 * configure.ac: remove obsolete --with-xml-parser/--with-openssl-digests Patch from Michael Stahl Fixes Issue #0000540 http://bugs.librdf.org/mantis/view.php?id=540 2013-03-12 Dave Beckett * autogen.sh: Handle variations of header macro * .gitignore, build/.gitignore: Ignore more 2013-02-27 Dave Beckett * Merge pull request #3 from olberger/master Fixing the deprecated TYPE= construct 2013-01-02 Dave Beckett * FAQS.html, INSTALL.html, LICENSE.html, NEWS.html, README.html, RELEASE.html, TODO.html, configure.ac: Bumped version to 1.0.17 2012-12-29 Dave Beckett * NEWS.html: 1.0.16 * Snapshotted redland_1_0_16 for 1.0.16 release (GIT c8281fff2c618b63d338b296d4d8e352a5de1101) * src/rdf_query_rasqal.c: (rasqal_literal_to_redland_node): Add fix for integer subtype Workaround for a rasqal literal type RASQAL_LITERAL_INTEGER_SUBTYPE that avoids requiring rasqal 0.9.30 or newer Fixes Issue #0000519 http://bugs.librdf.org/mantis/view.php?id=519 2012-12-16 Dave Beckett * src/rdf_query_rasqal.c, src/rdf_storage_mysql.c, src/rdf_storage_postgresql.c, src/rdf_storage_virtuoso.c: Remove abort() from regular code * src/rdf_storage.c: Attempt to load a storage module only once This bug is probably caused by scanning a directory of storage modules and finding a .la file (libtool) as well as the .so (module) and trying to load the same module twice via librdf_storage_register_factory that calls librdf_storage_load_module. Fixing by two changes: (librdf_storage_load_module): If the dynamically loaded module has a >1 ref count, it is already loaded so do not initialise it (that eventually calls the initialisation function below). (librdf_storage_register_factory): If it gets to this stage and finds the same module name twice, ignore this error. Fixes Issue #0000460 http://bugs.librdf.org/mantis/view.php?id=460 * src/rdf_parser_raptor.c: Reset bnode hash at end of parsing - do not free it Fixes Issue #0000518 http://bugs.librdf.org/mantis/view.php?id=518 2012-08-31 Dave Beckett * autogen.sh, configure.ac: Update autogen.sh and configure.ac via autoupdate * autogen.sh: autogen.sh: Added -Wall to aclocal and autoconf invocations 2012-08-26 Dave Beckett * src/rdf_serializer_raptor.c: Set statement graph during serializing with raptor. Issue seen: serializing to N-Quads did not work in redstore. (librdf_serializer_raptor_serialize_statement): Lose useless graph parameter. (librdf_serializer_raptor_serialize_stream_to_file_handle, librdf_serializer_raptor_serialize_stream_to_counted_string, (librdf_serializer_raptor_serialize_stream_to_iostream): Set and restore the statement graph around call to librdf_serializer_raptor_serialize_statement. 2012-07-21 Dave Beckett * configure.ac, src/Makefile.am: Add Rasqal libs to @LIBRDF_DIRECT_LIBS@ and use in all src test cases * src/rdf_node.c: (librdf_node_normalize): Do nothing for NULL node * src/rdf_concepts.c, src/rdf_init_internal.h, src/rdf_node.c, src/rdf_serializer_raptor.c: Normalize librdf_node boolean values on construction Add a quick fix to normalize the literal strings for xsd:boolean in the same fashion as rasqal does when invoking raptor. This code really should be calling a raptor or rasqal datatype-aware normalizer but will work. Fixes Issue #0000443 http://bugs.librdf.org/mantis/view.php?id=443 (librdf_xsd_boolean_value_from_string): Added from rasqal XSD routine (librdf_node_normalize): Added internal normalize node r outine, just handing xsd:boolean. (librdf_new_node_from_literal, librdf_new_node_from_typed_literal) (librdf_new_node_from_typed_counted_literal): Update all node constructors to call librdf_node_normalize(). Big downside: makes all construction slightly slower but raptor_uri_equals should be a pointer compare. 2012-07-15 Dave Beckett * src/rdf_storage_postgresql.c: Tidy librdf_log call messages * src/rdf_storage_postgresql.c: The name is PostgreSQL 2012-07-01 Dave Beckett * src/rdf_storage_virtuoso.c, src/rdf_storage_virtuoso_internal.h: More virtuoso column type changes - use wider int for u/short * src/rdf_storage_virtuoso.c: Good casts for calloc / memcpy calculations [gcc warnings] (librdf_storage_virtuoso_get_handle): Good cast to size_t for figuring out the byte sizes. * src/rdf_storage_virtuoso.c, src/rdf_storage_virtuoso_internal.h: Use SQLUSMALLINT for ODBC column integer [gcc warnings] (vGetDataCHAR, vGetDataINT, rdf2node): Take SQLUSMALLINT col instead of short col. (librdf_storage_virtuoso_find_statements_in_context_next_statement) (librdf_storage_virtuoso_get_contexts_next_context): Use SQLUSMALLINT colNum * src/rdf_storage_postgresql.c: (librdf_storage_postgresql_get_handle): Cast for memcpy [gcc warnings] * src/rdf_storage_postgresql.c: Good casts for PQnfields to size_t [gcc warnings] (librdf_storage_postgresql_find_statements_with_options): Good casts in calloc. * src/rdf_storage_virtuoso.c, src/rdf_storage_virtuoso_internal.h: Move 4K Virtuoso output DSN buffer from stack to storage context. Added LIBRDF_VIRTUOSO_CONTEXT_DSN_SIZE macro librdf_storage_virtuoso_instance gains field outdsn (librdf_storage_virtuoso_get_handle): Use above when calling SQLDriverConnect() * src/rdf_hash_bdb.c: BDB DBT field size is a u_int32_t so cast bad to that * src/rdf_node.c: (librdf_node_decode): Casts from binary to size_t are good [gcc warnings] * src/rdf_node.c: (librdf_node_decode): Casts from binary to size_t are good [gcc warnings] * src/rdf_hash_bdb.c: Code style * src/rdf_query_results.c: Range check of index for query results value/name gets (librdf_query_results_get_binding_value) (librdf_query_results_get_binding_name): Fail with negative offset always and note FIXME that this should be an unsigned int in future. * src/rdf_hash_bdb.c: Use u_int32_t to store BDB flags [gcc warnings] * utils/rdfproc.c: Use int v_idx for indexing into result values and names 2012-06-28 Dave Beckett * RELEASE.html: 1.0.16 * docs/tmpl/general.sgml, docs/tmpl/unicode.sgml, docs/tmpl/unused.sgml, docs/tmpl/world.sgml: Update tmpls * src/rdf_storage_mysql.c: Code fixes [gcc warnings] librdf_storage_mysql_instance: Use char* for all char* fields (librdf_storage_mysql_get_handle): Cast size_t connections count array computations [gcc warnings] (librdf_storage_mysql_init): Get port as a long and use it if it was set it fits into int (librdf_storage_mysql_terminate): Remove un-necessary casts for non-const char* configuration variables. * src/rdf_node.c: Use size_t for language length in internal calculations [gcc warnings] (librdf_node_encode, librdf_node_decode): use size_t casts to help code clarity and mix of size_t and char-promoted-to-int warnings. * src/rdf_node.c: (librdf_node_get_literal_value_as_latin1): Use size_t for len * utils/rdfproc.c: Add a none command and use index 0 as not found sentinel * docs/redland-changes.tsv, src/rdf_utf8.c, src/rdf_utf8.h: (librdf_utf8_to_latin1_2): unsigned char discard arg * src/rdf_node.c: (librdf_node_get_literal_value_as_latin1): Use librdf_utf8_to_latin1_2() * docs/redland-changes.tsv, docs/redland-sections.txt, src/rdf_utf8.c, src/rdf_utf8.h: Deprecate latin1/utf8 routines that use int sizes (librdf_latin1_to_utf8_2): Added deprecating librdf_latin1_to_utf8 (librdf_utf8_to_latin1_2): Added deprecating librdf_utf8_to_latin1 * src/rdf_query_virtuoso.c: Code cleanups for strcpy and size_t [gcc warnings] (librdf_query_virtuoso_init): Replace strcpy for known length strings with memcpy (librdf_query_virtuoso_execute): Capture strlens and use memcpy twice rather than strcpy and strcat. Cast context->numCols to size_t for array calloc [gcc warnings]. Use size_t for col names length. (librdf_query_virtuoso_results_formatter_write): Use memcpy Replace strcpy for known length string with memcpy * src/rdf_hash_memory.c: Revert d2d6a7a54342deff47ee686fda8d9b87e17ffefa - broke hash memory * utils/rdfproc.c: unsigned int i for indexing [gcc warnings] * src/rdf_storage_postgresql.c: (librdf_storage_postgresql_get_handle): pool size casting [gcc warnings] * src/rdf_storage_mysql.c: (librdf_storage_mysql_hash): Use size_t length arg [gcc warnings] * src/rdf_log.c, src/rdf_log_internal.h: Mark librdf_fatal as REDLAND_NORETURN [gcc warnings] * src/librdf.h.in: Add REDLAND_NORETURN using gcc 3.2+ attribute __noreturn__ * src/rdf_utf8.c: Simplify size_t UTF to/from latin1 work [gcc warnings] (librdf_utf8_to_latin1, librdf_latin1_to_utf8): Make a slength first then do everything in size_t * src/rdf_utf8.c: Do UTF to/from latin1 work in size_t and make bad casts at end (librdf_utf8_to_latin1, librdf_latin1_to_utf8): Truncate final results after working in size_t * src/rdf_hash_memory.c: unsigned int for keys, values, capacity and bucket sizes [gcc warnings] (librdf_hash_memory_find_node): u32 for hash_key computation but then put in an unsigned int bucket Rest of code: Code style fixes - many whitespace added around operators. - pulled assigments out of if - broke long lines * src/rdf_storage_sqlite.c: (sqlite_string_escape): Use size_t for lengths [gcc warnings] * src/rdf_storage_trees.c: Good int cast comparing node types [gcc warning] (librdf_storage_trees_node_compare): Cast to ints is ok when comparing node types. * src/rdf_storage_hashes.c: (librdf_storage_hashes_init_common): Good casts to size_t [gcc warnings] * src/rdf_log.c: Good casts to size_t from int for log lengths [gcc warnings] log messages are short (librdf_log_simple, librdf_fatal): Add size_t length variables for rewriting more clearly. * src/rdf_serializer_raptor.c: unsigned int for indexing [gcc warnings] (librdf_serializer_raptor_constructor): unsigned int it * src/rdf_utf8.c: Many bad size_t casts for utf8/latin1 work [gcc warnings] (librdf_unicode_char_to_utf8, librdf_utf8_to_unicode_char, librdf_utf8_to_latin1, librdf_latin1_to_utf8): Added casts and updated docs with warnings. Turned some existing bad casts into explicit ones. * src/rdf_heuristics.c, src/rdf_parser_raptor.c, src/rdf_storage.c, src/rdf_storage_sql.c: More fixes for #if LIBRDF_DEBUG when it is not defined. * src/rdf_heuristics.c: (librdf_heuristic_gen_name): Good cast for length calc [gcc warnings] Code style fixes * src/rdf_storage_sql.c: (librdf_new_sql_config): Good cast for predicates count [gcc warnings] * src/rdf_serializer.c: (librdf_serializer_enumerate): Good cast for signed seq offset [gcc warnings] * src/rdf_parser.c: (librdf_parser_enumerate): Good cast for signed seq offset [gcc warnings] * src/rdf_storage.c: (librdf_storage_enumerate): Good cast for signed seq offset [gcc warnings] * src/rdf_model.c: (librdf_model_enumerate): Good cast for signed seq offset [gcc warnings] * src/rdf_init.c: (librdf_new_world): Good cast signed long time_t to unsigned long * src/rdf_hash.c: (librdf_hash_from_string): Do pointer arithmetic in size_t [gcc warnings] * src/rdf_hash.c: Good casts to size_t between pointers that increase [gcc warnings] (librdf_hash_from_string, librdf_hash_interpret_template): Add good casts from pointer arithmetic (int) to size_t that will always be positive. * src/rdf_storage_sqlite.c: Protect #if use of undefined LIBRDF_DEBUG * src/rdf_query_rasqal.c: Protect #if use of undefined LIBRDF_DEBUG * src/rdf_list.c: Protect #if use of undefined LIBRDF_DEBUG * src/rdf_init.c: long and size_t fixes (librdf_world_set_feature): use long for time_t (librdf_world_get_genid): Calculate length in size_t * src/librdf.h.in: Add prototypes for license and home url strings * docs/redland-changes.tsv, docs/redland-sections.txt, src/rdf_init.c, utils/rdfproc.c: Add license and home url constant strings to API Added librdf_license_string and librdf_home_url_string to public API following Raptor and Rasqal naming convention. (rdfproc main): Use in help. 2012-06-27 Dave Beckett * configure.ac: Require raptor 2.0.7+ * INSTALL.html, configure.ac, examples/Makefile.am, src/Makefile.am, src/rdf_init.c, src/rdf_internal.h, src/win32_rdf_config.h.in, utils/Makefile.am: Remove dmalloc and memory signing Removed --with-dmalloc and --with-memory-signing configure options. * src/rdf_init.c: 2012 * NEWS.html, RELEASE.html: 1.0.16 2012-06-26 Dave Beckett * Makefile.am: EXTRA_DIST: Remove ChangeLog NEWS since they are in dist by default * src/rdf_storage_virtuoso.c: Error path cleanups [clang] (vGetDataCHAR): On query failure, free pLongData. (librdf_storage_virtuoso_get_handle): On connection falloc failure, free connections before returning. Protect looking up connection to make clang happier. (librdf_storage_virtuoso_context_remove_statement): Protect multiple strlens from a statement to prevent NULL lookup. (librdf_storage_virtuoso_get_contexts0: Protect looking up storage to make clang happier. * src/rdf_storage_sqlite.c: (librdf_storage_sqlite_query_flush): Add NULL storage check [clang] * src/rdf_storage_list.c: Error path cleanups [clang] (librdf_storage_list_get_contexts): On alloc failure for key, free icontext * src/rdf_storage_hashes.c: Error path cleanups [clang] (librdf_storage_hashes_register): Protect from NULL source_desc to make clang happier (librdf_storage_hashes_init_common): Protect from NULL hash descriptions to make clang happier (librdf_storage_hashes_get_contexts): On alloc failure for key, free icontext * src/rdf_storage_file.c: Error path cleanups [clang] (librdf_storage_file_sync): free backup_name on failure * src/rdf_query_virtuoso.c: Error path cleanups [clang] (librdf_query_virtuoso_execute): free results on failure (librdf_query_virtuoso_results_as_stream): Free scontext on failure * src/rdf_query_rasqal.c: Fix allocation of stream context [clang] (librdf_query_rasqal_results_as_stream): Allocate correct stream context size. * src/rdf_heuristics.c: (librdf_heuristic_object_is_literal): Protect a lookup to make clang happier * src/rdf_hash.c: Error path cleanups [clang] (librdf_hash_keys_iterator_finished): Protect a lookup to make clang happier (librdf_hash_print): Free key on alloc failure of value * src/rdf_storage_sqlite.c: Type length casts for sqlite3 (sqlite_string_escape): Turn sqlite rowid into narrower int (BAD CAST) (librdf_storage_sqlite_serialise) (librdf_storage_sqlite_find_statements) (librdf_storage_sqlite_context_serialise) (librdf_storage_sqlite_get_contexts): Narrow known query string lengths to int from size_t - good since we construct the query strings inside this module. * src/rdf_query_virtuoso.c, src/rdf_storage_virtuoso.c: bad casts for narrowing size_t to SQLUINTEGER (librdf_query_virtuoso_init, BindCtxt, BindSP, BindObject): Multiple bad casts for turning size_t from a strlen into SQLUINTEGER (which seems to be smaller). * src/rdf_storage_postgresql.c: size_t for length (librdf_storage_postgresql_hash) (librdf_storage_postgresql_node_hash): Now take size_t args Update callers (librdf_storage_postgresql_size): Bad cast for turning PGgetvalue into long via atol and then returning an int. * src/rdf_hash_bdb.c: LIBRDF_BAD_CAST BDB key sizes to int * configure.ac, src/rdf_storage_trees.c: Use ptrdiff_t for comparing void pointers * src/rdf_query_rasqal.c, src/rdf_storage_hashes.c: size_t for len in multiple places query rasqal module: (librdf_query_rasqal_init): size_t for len storage hashes module: (librdf_storage_hashes_register, librdf_storage_hashes_init) (librdf_storage_hashes_add_remove_statement) (librdf_storage_hashes_contains_statement) (librdf_storage_hashes_context_add_statement) (librdf_storage_hashes_context_remove_statement): size_t for len * src/rdf_digest_sha1.c: (SHA1Update): Bad cast a size_t len to u32 :/ * src/rdf_internal.h: Add LIBRDF_GOOD_CAST LIBRDF_BAD_CAST * src/rdf_utf8.c: (librdf_utf8_print): Cast to char when in range * src/rdf_hash.c: (librdf_hash_get_as_long): strtol returns long (!) * src/rdf_digest.c, src/rdf_hash.c, src/rdf_hash_memory.c, src/rdf_parser.c, src/rdf_parser_raptor.c: Use size_t for len in multiple places digest module (librdf_digest_to_string): use size_t for mdlen and index. hash module (librdf_hash_from_string): size_t for len and index var. (macro ONE_AT_A_TIME_HASH): use size_t for len parser module (librdf_parser_guess_name2) (librdf_parser_raptor_get_next_statement) (librdf_parser_raptor_parse_uri_as_stream_write_bytes_handler): size_t for len * src/rdf_digest_internal.h: Use void* for digest context librdf_digest_s field context is void* * src/rdf_uri.c: (librdf_new_uri_normalised_to_base): size_t for len * src/rdf_init.c, src/rdf_init_internal.h: Genid are now unsigned long (librdf_world_get_genid): Format as %lu * src/rdf_query_rasqal.c: #if LIBRDF_DEBUG * configure.ac: Update warnings * src/rdf_storage_postgresql.c: Supply default host 'localhost' for postgresql storage. (librdf_storage_postgresql_init): Check for missing host and set it to localhost. Report required storage config parameters in error failure message. * src/rdf_storage_mysql.c: Supply default host 'localhost' for mysql storage. (librdf_storage_mysql_init): Check for missing host and set it to localhost. Report required storage config parameters in error failure message. * src/rdf_storage_hashes.c: Make statement present (ASK) work for hashes storage and contexts (librdf_storage_hashes_contains_statement): Get index contexts flag from context not storage. Why? Not immediately clear at a glance Fixes Issue #0000515 http://bugs.librdf.org/mantis/view.php?id=515 * autogen.sh: autogen.sh updates - Abort run if a configuring program fails. - Generate NEWS with old timestamp if missing so automake can run - small doc and message updates 2012-06-19 Dave Beckett * configure.ac: Search for BDB 5.3 * src/rdf_storage_postgresql.c: Make loading triples from a stream to postgresql actually work (librdf_storage_postgresql_context_add_statements): Skip to next statement in non bulk mode. 2012-06-17 Dave Beckett * autogen.sh: Support NOCONFIGURE variable, like Lib{XML2,XSLT} 2012-05-20 Dave Beckett * ChangeLog, RELEASE.html: 1.0.16 2012-05-17 Dave Beckett * src/rdf_query.c: sparql 2012-05-17 Dave Beckett * utils/rdfproc.1: typo 2012-03-07 Dave Beckett * Merge pull request #2 from zoggy/master Fixing bad test on query allocation (postgresql storage) + WS changes 2012-02-13 Lauri Aalto * autogen.sh: require automake 1.11.2+ for -Wextra-portability 2012-02-11 Dave Beckett * INSTALL.html: Doc corrections Remove docs of --with-raptor=internal and --with-rasqal=internal These were removed from configure.ac on Mon Mar 30 02:07:57 2009 +0000 in commit 94687555d3b328fc920dd8180b1b2a563199fea0 Emphasise --prefix=/usr more 2012-02-10 Dave Beckett * build/.gitignore, configure.ac, docs/tmpl/world.sgml: Add automake option -Wextra-portability and AM_PROG_AR to make it happy * docs/redland-sections.txt: Remove librdf_world_get_raptor librdf_world_set_raptor from unused * docs/redland-sections.txt: add librdf_world_get_raptor librdf_world_set_raptor 2012-02-01 Lauri Aalto * src/rdf_storage.c: (librdf_storage_contains_statement): Return >0 only for invalid statements according to API contract. Treat NULL storage as empty storage not containing statements. Use librdf_statement_is_complete() for testing statement validity. * src/rdf_model.c: (librdf_model_contains_statement): Treat NULL statement as invalid * src/rdf_model.c: (librdf_model_contains_statement): Return >0 only for invalid statements according to API contract. Fixes Issue #0000489 http://bugs.librdf.org/mantis/view.php?id=489 2012-01-02 Dave Beckett * ChangeLog, ChangeLog.12, FAQS.html, INSTALL.html, LICENSE.html, Makefile.am, NEWS.html, README.html, RELEASE.html, TODO.html: 2012 * docs/redland-changes.tsv, docs/redland-sections.txt, src/rdf_init.h, src/rdf_init_internal.h, src/rdf_query_rasqal.c, src/rdf_raptor.c: Add handlers to allow application code to configure raptor and rasqal (librdf_world_set_raptor_init_handler, librdf_world_set_rasqal_init_handler): Added methods to set handlers for configuring internal raptor and rasqal after they have been constructed but before they are initialized; before raptor_world_open() or rasqal_world_open() are run, respectively. Added librdf_raptor_init_handler and librdf_rasqal_init_handler typedefs for the handlers. 2012-01-02 Dave Beckett * src/rdf_init.c: (librdf_world_set_rasqal): reset rasqal_world_allocated_here 2012-01-02 Dave Beckett * Remove doc references to Raptor V1 redland-1.0.17/redland.rdf.in0000644000175000017500000000732711516602654012664 00000000000000 Redland librdf RDF API Library 2000-06-21 A library for the Resource Description Framework (RDF) allowing it to be parsed from XML, stored, queried and manipulated. Redland librdf is a library that provides a high-level interface for the Resource Description Framework (RDF) allowing the RDF graph to be parsed from XML, stored, queried and manipulated. Redland librdf implements each of the RDF concepts in its own class via an object based API, reflected into the language APIs, currently C#, Java, Perl, PHP, Python, Ruby and Tcl. Several classes providing functionality such as for parsers, storage are built as modules that can be loaded at compile or run-time as required. Dave Beckett 970987f991961f2553a1bf2574166fa29befbccb stable 2011-01-22 @VERSION@ git://github.com/dajobe/librdf.git librdf Dave Beckett 970987f991961f2553a1bf2574166fa29befbccb redland-1.0.17/README.html0000644000175000017500000001107412071146235011761 00000000000000 Redland librdf RDF API Library

Redland librdf RDF API Library

Dave Beckett

Overview

Redland librdf is a library that provides a high-level interface for the Resource Description Framework (RDF) allowing the RDF graph to be parsed from XML, stored, queried and manipulated. Redland librdf implements each of the RDF concepts in its own class via an object based API, reflected into the language APIs, currently C#, Java, Perl, PHP, Python, Ruby and Tcl. Several classes providing functionality such as for parsers, storage are built as modules that can be loaded at compile or run-time as required.

This is a mature and stable RDF library developed since 2000 used in multiple projects. See the FAQS for general information and the Redland issue tracker for known bugs and issues. A summary of the changes can be found in the NEWS file, detailed API changes in the release notes and file-by-file changes in the Subversion ChangeLog.

Redland librdf provides:

  • A modular, object based library written in C
  • APIs for manipulating the RDF graph and parts - Statements, Resources and Literals
  • Language Bindings in Perl, PHP, Python and Ruby via the Redland Bindings package.
  • Reading and writing multiple RDF syntaxes with Parsers and Serializers via the Raptor RDF Parser Toolkit.
  • Storage for graphs in memory and persistently with Sleepycat/Berkeley DB, MySQL 3-5, PostgreSQL, SQLite, Openlink Virtuoso, in-memory Trees, files or URIs.
  • Query language support for SPARQL 1.0 (some 1.1) and RDQL using Rasqal.
  • APIs for accessing the graph by Statement (triples) or by Nodes and Arcs
  • Contexts for managing aggregating named graphs and recording provenance.
  • Statement Streams for efficient construction, parsing and serialisation of graphs
  • rdfproc RDF processor utility program
  • No memory leaks.

Sources

The packaged sources are available from http://download.librdf.org/source/ (master site) and also from the SourceForge site. The development GIT sources can also be browsed on GitHub or checked out at git://github.com/dajobe/librdf.git

librdf requires Raptor 1.4.19 or newer (or Raptor V2 1.9.0 or newer) and Rasqal 0.9.19 or newer to build and run, which can be downloaded from the same area as the librdf source and binaries.

License

This library is free software / open source software released under the LGPL 2.1 (GPL) or Apache 2.0 licenses. See LICENSE.html for full details.

Installation and Documentation

See INSTALL.html for general installation and configuration information.

Further documentation is available in the documents area including the API reference document and detailed storage modules information.

Mailing Lists

The Redland mailing lists discuss the development and use of the Redland libraries as well as future plans and announcement of releases.


Copyright (C) 2000-2013 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

redland-1.0.17/README0000644000175000017500000001024112130720506011004 00000000000000 #[1]DOAP Redland librdf RDF API Library [2]Dave Beckett Overview [3]Redland librdf is a library that provides a high-level interface for the Resource Description Framework (RDF) allowing the RDF graph to be parsed from XML, stored, queried and manipulated. Redland librdf implements each of the RDF concepts in its own class via an object based API, reflected into the language APIs, currently C#, Java, Perl, PHP, Python, Ruby and Tcl. Several classes providing functionality such as for parsers, storage are built as modules that can be loaded at compile or run-time as required. This is a mature and stable RDF library developed since 2000 used in multiple projects. See the [4]FAQS for general information and the [5]Redland issue tracker for known bugs and issues. A summary of the changes can be found in the [6]NEWS file, detailed API changes in the [7]release notes and file-by-file changes in the Subversion [8]ChangeLog. Redland librdf provides: * A modular, [9]object based library written in C * APIs for manipulating the RDF [10]graph and parts - [11]Statements, [12]Resources and Literals * Language Bindings in Perl, PHP, Python and Ruby via the [13]Redland Bindings package. * Reading and writing multiple RDF syntaxes with [14]Parsers and [15]Serializers via the [16]Raptor RDF Parser Toolkit. * [17]Storage for graphs in memory and persistently with Sleepycat/Berkeley DB, MySQL 3-5, PostgreSQL, SQLite, Openlink Virtuoso, in-memory Trees, files or URIs. * [18]Query language support for SPARQL 1.0 (some 1.1) and RDQL using [19]Rasqal. * APIs for accessing the graph by Statement (triples) or by Nodes and Arcs * Contexts for managing aggregating named graphs and recording provenance. * [20]Statement Streams for efficient construction, parsing and serialisation of graphs * [21]rdfproc RDF processor utility program * No memory leaks. Sources The packaged sources are available from [22]http://download.librdf.org/source/ (master site) and also from the [23]SourceForge site. The development GIT sources can also be [24]browsed on GitHub or checked out at git://github.com/dajobe/librdf.git librdf requires [25]Raptor 1.4.19 or newer (or Raptor V2 1.9.0 or newer) and [26]Rasqal 0.9.19 or newer to build and run, which can be downloaded from the same area as the librdf source and binaries. License This library is free software / open source software released under the LGPL 2.1 (GPL) or Apache 2.0 licenses. See [27]LICENSE.html for full details. Installation and Documentation See [28]INSTALL.html for general installation and configuration information. Further documentation is available in the [29]documents area including the [30]API reference document and [31]detailed storage modules information. Mailing Lists The [32]Redland mailing lists discuss the development and use of the Redland libraries as well as future plans and announcement of releases. __________________________________________________________________ Copyright (C) 2000-2013 [33]Dave Beckett Copyright (C) 2000-2005 [34]University of Bristol References 1. redland.rdf 2. http://www.dajobe.org/ 3. http://librdf.org/ 4. FAQS.html 5. http://bugs.librdf.org/ 6. NEWS.html 7. RELEASE.html 8. ChangeLog 9. docs/api/objects.html 10. docs/api/model.html 11. docs/api/statement.html 12. docs/api/node.html 13. http://librdf.org/bindings/ 14. docs/api/parser.html 15. docs/api/serializer.html 16. http://librdf.org/raptor/ 17. docs/api/storage.html 18. docs/api/query.html 19. http://librdf.org/rasqal/ 20. docs/api/stream.html 21. utils/rdfproc.html 22. http://download.librdf.org/source/ 23. http://sourceforge.net/projects/librdf/ 24. http://github.com/dajobe/librdf 25. http://librdf.org/raptor/ 26. http://librdf.org/rasqal/ 27. LICENSE.html 28. INSTALL.html 29. docs/README.html 30. docs/api/index.html 31. docs/storage.html 32. http://librdf.org/lists/ 33. http://www.dajobe.org/ 34. http://www.bristol.ac.uk/ redland-1.0.17/Makefile.am0000644000175000017500000000434711772662730012211 00000000000000# -*- Mode: Makefile -*- # # Makefile.am - top level automake file for Redland # # Copyright (C) 2000-2009 David Beckett http://www.dajobe.org/ # Copyright (C) 2000-2005 University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # bin_SCRIPTS = redland-config noinst_SCRIPTS = redland-src-config man_MANS = redland-config.1 dist_pkgdata_DATA = Redland.i pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = redland.pc DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc # Subdirectories to build/install/distribute etc. SUBDIRS=$(subdirs) src examples utils demos docs data scripts EXTRA_DIST=\ ChangeLog.1 ChangeLog.2 ChangeLog.3 ChangeLog.4 \ ChangeLog.5 ChangeLog.6 ChangeLog.7 ChangeLog.8 ChangeLog.9 ChangeLog.10 \ ChangeLog.11 ChangeLog.12 \ README LICENSE.txt TODO \ README.html NEWS.html LICENSE.html TODO.html \ RELEASE.html INSTALL.html FAQS.html \ LICENSE-2.0.txt NOTICE \ HACKING.md HACKING.html \ redland.rdf.in \ autogen.sh \ redland-config.in \ redland-src-config.in \ $(man_MANS) \ redland.sln \ gtk-doc.make \ redland.pc.in if MAINTAINER_MODE # Create some text files from HTML sources LYNX=lynx HTML_TO_TEXT=TERM=vt100 $(LYNX) -dump $< | sed -e 's,file://localhost.*librdf/,,' > $@ SUFFIXES = .html .txt .html.txt: $(HTML_TO_TEXT) README: README.html $(HTML_TO_TEXT) NEWS: NEWS.html $(HTML_TO_TEXT) TODO: TODO.html $(HTML_TO_TEXT) HACKING.html: HACKING.md $(top_srcdir)/scripts/markdown-to-html.pl $(PERL) $(top_srcdir)/scripts/markdown-to-html.pl $< $@ endif @SET_MAKE@ install-data-hook: $(PERL) $(srcdir)/scripts/touch-mtime.pl $(srcdir)/Redland.i $(DESTDIR)$(pkgdatadir)/Redland.i redland-1.0.17/COPYING.LIB0000644000175000017500000006363710254306540011610 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! redland-1.0.17/ChangeLog.90000644000175000017500000007145211311353451012061 000000000000002008-12-01 Dave Beckett * docs/redland-docs.xml: 2008 2008-11-22 Lauri Aalto * librdf/rdf_node.c: (librdf_new_node_from_blank_identifier): Fixed a read memory after free bug. Fixes Issue #0000283 http://bugs.librdf.org/mantis/view.php?id=283 * docs/redland-chapter-objects.xml, docs/redland-chapter-storage-modules.xml, docs/storage.html: Documentation fixes from Issue #0000282 http://bugs.librdf.org/mantis/view.php?id=282 * librdf/Makefile.am, librdf/rdf_storage.c, librdf/rdf_storage_file.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_trees.c: Fixes to modular storages to get "make check" pass before install. "memory", "hashes", "trees", "file", "uri" storages now always built-in regardless of MODULAR_LIBRDF. Not building them as storage modules and removed the storage module entry point as unnecessary. (ltdl_module_callback): Check that storage module file name contains the string "librdf_storage" to prevent lots of module loading failure messages. (librdf_memstr): Pulled helper function from raptor_memstr.c. (librdf_storage_load_all_modules): Added logic for figuring out a reasonable module path. Uses REDLAND_MODULE_PATH environment variable if defined. If env var defined but empty, uses libtool defaults (used in local "make check" tests through TESTS_ENVIRONMENT). If env var not defined, use the install target dir. (librdf_storage_load_module): Fixed compiler warning about shadowing world variable. 2008-11-21 Lauri Aalto * librdf/rdf_storage.c, librdf/rdf_storage.h: (librdf_storage_get_world): New API function for accessing the librdf_world associated with a storage. Required e.g. by storage modules not build with LIBRDF_INTERNAL. * librdf/rdf_iterator.h, librdf/rdf_iterator_internal.h, librdf/rdf_stream.h, librdf/rdf_stream_internal.h: Moved iterator/stream get_method flags to public API. They are required e.g. for storage modules not built with LIBRDF_INTERNAL. 2008-11-20 Dave Robillard * librdf/rdf_storage.c: (librdf_storage_get_instance): Fix documentation. 2008-11-20 Lauri Aalto * librdf/rdf_storage.c: (librdf_new_storage_from_factory): Fixed double deletion. storage init() always takes ownership of the options hash. 2008-11-18 Lauri Aalto * librdf/rdf_query_results.c: (librdf_query_results_get_bindings): Fixed docs. * librdf/rdf_query.c: (main): Fixed rdf_query_test. Do not assume get_bindings returns bindings_count names in a NULL-terminated array (current rasqal HEAD returns all variables, not just bindings; array not NULL terminated) 2008-11-14 Dave Robillard * librdf/Makefile.am, librdf/librdf_storage_module.h, librdf/rdf_storage.h, librdf/rdf_storage_internal.h, librdf/rdf_storage_module.h (from /librdf/trunk/librdf/librdf_storage_module.h:14904): Publicly install storage module interface redland/rdf_storage_module.h. * librdf/librdf_storage_module.h (from /librdf/trunk/librdf/rdf_storage_factory.h:14903), librdf/rdf_storage_factory.h, librdf/rdf_storage_internal.h: Give storage module interface header a more standalone-sensible name. External projects should now be able to implement this header and install a module to PREFIX/lib/redland and be discovered/used by redland at runtime. * librdf/rdf_storage_factory.h: Document discovery mechanism in rdf_storage_factory.h * configure.ac: Make modular backends the default. * librdf/rdf_storage_file.c, librdf/rdf_storage_mysql.c: Fix forward declarations. * configure.ac, librdf/Makefile.am, librdf/rdf_internal.h, librdf/rdf_storage.c, librdf/rdf_storage_file.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage_trees.c, librdf/rdf_storage_tstore.c: Dynamically discover storage backends at runtime. * librdf/rdf_storage.c, librdf/rdf_storage_file.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage_trees.c, librdf/rdf_storage_tstore.c: Make storages clean up after themselves. * librdf/rdf_storage_hashes.c: Oops: (librdf_storage_hashes_clone): Remove debug printf. * librdf/rdf_storage.c, librdf/rdf_storage.h, librdf/rdf_storage_factory.h, librdf/rdf_storage_file.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_internal.h, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage_trees.c: What was called the storage "context" is now less confusingly called the storage "instance". Make the storage instance opaque to librdf. Remove context_length from librdf_storage_factory interface (abstraction violation). Add instance getter/setter method to librdf_storage so storages can be implemented without access to internals. Rework existing storages to use the above scheme. * librdf/rdf_storage_factory.h, librdf/rdf_storage_file.c, librdf/rdf_storage_internal.h: Separate storage "factory" interface from storage internals. * librdf/rdf_init_internal.h: Revert previous commit (unnecessary). * librdf/rdf_init_internal.h: Forward declare raptor_world if necessary. 2008-10-16 Lauri Aalto * librdf/rdf_files.c, librdf/rdf_init.c, librdf/rdf_iterator.c, librdf/rdf_model.c, librdf/rdf_parser.c, librdf/rdf_serializer.c, librdf/rdf_storage.c: Wrapped deprecated function definitions in #ifndef REDLAND_DISABLE_DEPRECATED ... #endif 2008-10-13 Lauri Aalto * librdf/rdf_init.c, librdf/rdf_raptor.c, librdf/rdf_raptor_internal.h: (librdf_world_open,librdf_init_raptor): Changed librdf_init_raptor() to not return anything and abort() on failure to be consistent with error handling in other librdf init functions. 2008-10-09 Lauri Aalto * librdf/rdf_log.c, librdf/rdf_log.h, librdf/rdf_log_internal.h: (librdf_log,librdf_log_simple): Pulled librdf_log(), librdf_log_simple() from library internals to API so that e.g. external storage modules can log messages. * librdf/Makefile.am, librdf/librdf.h, librdf/rdf_init.c, librdf/rdf_init_internal.h, librdf/rdf_log.c, librdf/rdf_model.c, librdf/rdf_parser.c, librdf/rdf_parser.h, librdf/rdf_parser_raptor.c, librdf/rdf_query_rasqal.c, librdf/rdf_raptor.c, librdf/rdf_raptor.h, librdf/rdf_raptor_internal.h, librdf/rdf_serializer_raptor.c, librdf/rdf_storage_sql.c, utils/rdfproc.c: Refactored librdf to use Raptor v2 APIs if available. Flagged with RAPTOR_V2_AVAILABLE. Pulled Raptor init/finish and librdf_uri adaptation code from rdf_parser_raptor to a new rdf_raptor module. API/ABI break: (librdf_parser_guess_name): API function now requires a librdf_world param. Other API changes: (librdf_world_get_raptor,librdf_world_set_raptor): New API functions. Other changes: (librdf_init_raptor,librdf_finish_raptor): New internal functions. (librdf_free_world,librdf_world_open): Use librdf_init_raptor(),librdf_finish_raptor(). Removed outdated comments related to raptor init order. (librdf_world_s): Internal struct gains raptor_world_ptr, raptor_world_allocated_here. (librdf_query_rasqal_constructor): Use rasqal_world_set_raptor() to set the raptor library instance before rasqal_world_open(). (log_handler): Pass librdf_world to rdfproc log handler in user_data. 2008-09-30 Dave Robillard * librdf/rdf_avltree.c: 'Fix' entirely irrelevant preprocessor macro, again. * librdf/rdf_avltree.c: Everyone's a critic. * librdf/rdf_avltree.c: Fix typo. 2008-09-29 Dave Robillard * librdf/rdf_parser_raptor.c, librdf/rdf_storage_trees.c: Revert warning removal from r14573. Make trees storage only return failure on actual failure (not when triple already exists), like other storages. * librdf/rdf_internal.h: Revert accidentally committed change to LIBRDF_ASSERT_DIE. * librdf/rdf_internal.h, librdf/rdf_parser_raptor.c: (librdf_parser_raptor_new_statement_handler): Remove unnecessary "fatal" error message when encountering duplicate triples. * librdf/rdf_avltree.c: Fix test case (last commit) to be correct (previous commit failed falsely, test now exposes segfault bug). (librdf_avltree_delete_internal): update parent pointers when deleting (courtesy Aymeric Barthe). * librdf/Makefile.am, librdf/rdf_avltree.c: Fix compilation of rdf_avltree_test. Change elements deleted in rdf_avl_tree_test to cause failure and expose bug. 2008-09-22 Lauri Aalto * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_get_next_common): Do not leak context nodes. 2008-09-08 Lauri Aalto * librdf/librdf.h, librdf/rdf_internal.h: Moved EXTERN_C definitions to internal header - no need to expose in API. * librdf/librdf.h, librdf/rdf_hash.c, librdf/rdf_iterator.c, librdf/rdf_list.c, librdf/rdf_model.c, librdf/rdf_parser.c, librdf/rdf_query.c, librdf/rdf_serializer.c, librdf/rdf_storage.c, librdf/rdf_stream.c: Workaround for an armcc c++ mode issue regarding function pointers as arguments: Need explicit extern "C" to get C linkage for C function pointers. 2008-09-07 Dave Beckett * redland-config.1: manpage .l is bad 2008-09-06 Dave Beckett * librdf/rdf_cache.c: (main): Cast for c++ 2008-09-05 Dave Beckett * librdf/rdf_cache.c, librdf/rdf_concepts.c: Casts for g++ from Issue#0000272 http://bugs.librdf.org/mantis/view.php?id=272 2008-08-12 Lauri Aalto * examples/example5.c: Switch query_string,base_uri to correct order in example5 2008-08-11 Dave Beckett * Makefile.am: Remove raptor and rasqal subdir possibilities * configure.ac: Use pkg-config to find raptor and rasqal unless in maintainer mode in which case --with-raptor / --with-rasqal allows a choice of system or sibling dirs ../raptor and ../rasqal * redland-src-config.in: prefer pkg-config raptor and adjust src dirs to be siblings of this, not children 2008-08-09 Dave Beckett * INSTALL.html: Note how to build examples on cygwin. FIxes Issue#0000267 * examples/Makefile.am: Add EXE suffix to * examples/example7.c: Return from main * examples/example6.c: Casts * examples/example5.c: Casts * examples/example4.c: Replace use of deprecated librdf_serializer_serialize_model() with librdf_serializer_serialize_model_to_file_handle() 2008-08-07 Lauri Aalto * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_transaction_start): Prevent deadlocks with BEGIN IMMEDIATE instead of the default BEGIN DEFERRED. Set in_transaction flag only if the SQL exec returns success. (librdf_storage_sqlite_transaction_commit, librdf_storage_sqlite_transaction_rollback): Clear in_transaction flag only if the SQL exec returns success. Added missing semicolon to END. 2008-07-17 Dave Beckett * librdf/rdf_cache.c: (librdf_cache_cleanup): Adjust usage after cache cleanup by largest ejected node usage count seen. * librdf/rdf_cache.c: If capacity is 0, handle a cache that grows and dynamically allocate the nodes. (main): Update tests to try this. * librdf/rdf_cache.c: autodocs * librdf/rdf_cache.c: tidy WITH_THREADS code * librdf/rdf_cache.c: DEFAULT_FLUSH_PERCENT 20 is more realistic * librdf/Makefile.am: Add rdf_cache_test to tests * librdf/rdf_cache.c: (librdf_hist_node_compare): Invert order to eject low use objects. (main): Update tests 2008-07-16 Dave Beckett * librdf/rdf_cache.c: (librdf_cache_delete): Adjust size. * librdf/rdf_cache.c: (librdf_cache_cleanup): Sort hists array not hists array pointer * librdf/rdf_cache.c: (librdf_hist_node_compare): Try to fix compare * librdf/rdf_cache.c: small cache for testing * librdf/rdf_cache.c: tests pass * librdf/rdf_cache.c, librdf/rdf_cache.h: Initial object cache impl - tests fail * librdf/Makefile.am: Add rdf_cache_test * librdf/rdf_internal.h: Add rdf_cache.h * librdf/Makefile.am: Added rdf_cache.c rdf_cache.h * librdf/rdf_cache.c (from /librdf/trunk/librdf/rdf_uri.c:14278), librdf/rdf_cache.h (from /librdf/trunk/librdf/rdf_uri.h:14278): Copy rdf_uri* to rdf_cache.[ch] 2008-07-05 Dave Beckett * docs/tmpl/concepts.sgml, docs/tmpl/parser.sgml: tmpl docs 2008-07-05 Dave Beckett * Snapshotted redland_1_0_8 for 1.0.8 release (SVN 14222) 2008-07-04 Dave Beckett * /librdf/trunk, librdf: props * librdf/rdf_log.c: (librdf_log_simple): Do not format and print locator string if raptor_format_locator() returns an error (or 0) when getting the locator string length. 2008-07-04 Dave Beckett * redland.pc.in: Add swig variable 2008-07-03 Dave Beckett * Makefile.am: re-order pkgconfig * Makefile.am, configure.ac, librdf/Makefile.am, librdf/redland.pc.in, redland.pc.in (from /librdf/trunk/librdf/redland.pc.in:14197): Move redland.pc to root dir * RELEASE.html: deprecate redland-config * configure.ac: RAPTOR_MIN_VERSION now 1.4.17 to match rasqal * configure.ac: Add another way to find berkeleydb / sleepycatdb with libs in subdirs named after major versions 2008-07-02 Dave Beckett * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_node_hash_common): Init some variables to NULL to prevent GCC warnings 2008-07-01 Lauri Aalto * librdf/rdf_storage_sql_test.c: Fixed file name in boilerplate comments 2008-06-30 Dave Beckett * librdf/rdf_parser.h: Make librdf_parser_parse_file_handle_as_stream arg be fh to match docs. * librdf/rdf_parser.h: Make librdf_parser_parse_file_handle_into_model arg be fh to match docs. * docs/redland-sections.txt: Added librdf_get_concept_ms_namespace, librdf_get_concept_schema_namespace, librdf_parser_parse_file_handle_as_stream and librdf_parser_parse_file_handle_into_model * docs/Makefile.am: Exclude rdf_avltree_internal.h * librdf/Makefile.am, librdf/rdf_avltree.c, librdf/rdf_avltree.h, librdf/rdf_avltree_internal.h: Rename rdf_avltree.h to rdf_avltree_internal.h * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_get_handle): Use HAVE_MYSQL_OPT_RECONNECT to known when to apply reconnections Fixes Issue#0000256 http://bugs.librdf.org/mantis/view.php?id=256 * configure.ac: Update checks for programs to use AC_PROG_CC and AM_PROG_CC_C_O Add a compile test for MYSQL_OPT_RECONNECT since newer mysql versions have it as an enum, not a macro. Fixes Issue#0000256 http://bugs.librdf.org/mantis/view.php?id=256 * redland-config.in: Add datarootdir * Redland.i, FAQS.html, INSTALL.html, LICENSE.html, NEWS.html, README.html, RELEASE.html, TODO.html, redland-config.1, redland-config.in, redland-src-config.in, redland.rdf.in, demos/demo.pl, demos/ntriples.pl, demos/parser-tests.pl, demos/rss-show.pl, examples/example1.c, examples/example2.c, examples/example3.c, examples/example4.c, examples/example5.c, examples/example6.c, examples/example7.c, examples/redland_dbus.c, examples/rss2ical.c, librdf/librdf.h, librdf/rdf_concepts.c, librdf/rdf_concepts.h, librdf/rdf_concepts_internal.h, librdf/rdf_digest.c, librdf/rdf_digest.h, librdf/rdf_digest_internal.h, librdf/rdf_digest_md5.c, librdf/rdf_digest_openssl.c, librdf/rdf_digest_sha1.c, librdf/rdf_files.c, librdf/rdf_files.h, librdf/rdf_hash.c, librdf/rdf_hash.h, librdf/rdf_hash_bdb.c, librdf/rdf_hash_cursor.c, librdf/rdf_hash_internal.h, librdf/rdf_hash_memory.c, librdf/rdf_heuristics.c, librdf/rdf_heuristics.h, librdf/rdf_init.c, librdf/rdf_init.h, librdf/rdf_init_internal.h, librdf/rdf_internal.h, librdf/rdf_iterator.c, librdf/rdf_iterator.h, librdf/rdf_iterator_internal.h, librdf/rdf_list.c, librdf/rdf_list.h, librdf/rdf_list_internal.h, librdf/rdf_log.c, librdf/rdf_log.h, librdf/rdf_log_internal.h, librdf/rdf_model.c, librdf/rdf_model.h, librdf/rdf_model_internal.h, librdf/rdf_model_storage.c, librdf/rdf_node.c, librdf/rdf_node.h, librdf/rdf_node_internal.h, librdf/rdf_parser.c, librdf/rdf_parser.h, librdf/rdf_parser_internal.h, librdf/rdf_parser_raptor.c, librdf/rdf_query.c, librdf/rdf_query.h, librdf/rdf_query_internal.h, librdf/rdf_query_rasqal.c, librdf/rdf_query_results.c, librdf/rdf_query_triples.c, librdf/rdf_serializer.c, librdf/rdf_serializer.h, librdf/rdf_serializer_internal.h, librdf/rdf_serializer_raptor.c, librdf/rdf_statement.c, librdf/rdf_statement.h, librdf/rdf_statement_internal.h, librdf/rdf_storage.c, librdf/rdf_storage.h, librdf/rdf_storage_file.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_internal.h, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_sql.c, librdf/rdf_storage_sql_test.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage_trees.c, librdf/rdf_storage_tstore.c, librdf/rdf_stream.c, librdf/rdf_stream.h, librdf/rdf_stream_internal.h, librdf/rdf_types.h, librdf/rdf_uri.c, librdf/rdf_uri.h, librdf/rdf_uri_internal.h, librdf/rdf_utf8.c, librdf/rdf_utf8.h, librdf/redland.h, librdf/win32_rdf_config.h: 2008 * examples/Makefile.am, utils/db_upgrade.c, utils/rdfproc.1, Redland.i, data/Makefile.am, demos/demo.pl, demos/ntriples.pl, demos/parser-tests.pl, examples/example1.c, examples/example3.c, examples/example4.c, examples/example5.c, examples/example6.c, examples/example7.c, librdf/Makefile.am, librdf/librdf.h, librdf/rdf_concepts.c, librdf/rdf_concepts.h, librdf/rdf_concepts_internal.h, librdf/rdf_digest.c, librdf/rdf_digest.h, librdf/rdf_digest_internal.h, librdf/rdf_digest_md5.c, librdf/rdf_digest_openssl.c, librdf/rdf_digest_sha1.c, librdf/rdf_files.c, librdf/rdf_files.h, librdf/rdf_hash.c, librdf/rdf_hash.h, librdf/rdf_hash_bdb.c, librdf/rdf_hash_cursor.c, librdf/rdf_hash_internal.h, librdf/rdf_hash_memory.c, librdf/rdf_heuristics.c, librdf/rdf_heuristics.h, librdf/rdf_init.h, librdf/rdf_init_internal.h, librdf/rdf_internal.h, librdf/rdf_iterator.c, librdf/rdf_iterator.h, librdf/rdf_iterator_internal.h, librdf/rdf_list.c, librdf/rdf_list.h, librdf/rdf_list_internal.h, librdf/rdf_log.c, librdf/rdf_log.h, librdf/rdf_log_internal.h, librdf/rdf_model.c, librdf/rdf_model.h, librdf/rdf_model_internal.h, librdf/rdf_model_storage.c, librdf/rdf_node.c, librdf/rdf_node.h, librdf/rdf_node_internal.h, librdf/rdf_parser.c, librdf/rdf_parser.h, librdf/rdf_parser_internal.h, librdf/rdf_parser_raptor.c, librdf/rdf_query.c, librdf/rdf_query.h, librdf/rdf_query_internal.h, librdf/rdf_query_rasqal.c, librdf/rdf_query_results.c, librdf/rdf_query_triples.c, librdf/rdf_serializer.c, librdf/rdf_serializer.h, librdf/rdf_serializer_internal.h, librdf/rdf_serializer_raptor.c, librdf/rdf_statement.c, librdf/rdf_statement.h, librdf/rdf_statement_internal.h, librdf/rdf_storage.c, librdf/rdf_storage.h, librdf/rdf_storage_file.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_internal.h, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_sql.c, librdf/rdf_storage_sql_test.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage_trees.c, librdf/rdf_storage_tstore.c, librdf/rdf_stream.c, librdf/rdf_stream.h, librdf/rdf_stream_internal.h, librdf/rdf_types.h, librdf/rdf_uri.c, librdf/rdf_uri.h, librdf/rdf_uri_internal.h, librdf/rdf_utf8.c, librdf/rdf_utf8.h, librdf/redland.h, redland-config.in, utils/getopt.c, utils/rdfproc.c, utils/rdfproc_getopt.h, utils/redland-db-upgrade.1: Remove old CVS Id: from sources * configure.ac: boost RASQAL_MAX_VERSION to 0.9.99 to allow for future compatible versions 2008-06-22 Lauri Aalto * librdf/rdf_query_rasqal.c: (rasqal_literal_to_redland_node): RASQAL_LITERAL_FLOATING removed from Rasqal API in r14084, replaced with RASQAL_LITERAL_DOUBLE. * librdf/rdf_parser_raptor.c: indent tabs->spaces 2008-06-20 Dave Beckett * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_parse_file_handle_as_stream): Take a close_fh flag, remove world arg to match factory method. Use world from parser object. (librdf_parser_raptor_parse_into_model_common): Renamed from librdf_parser_raptor_parse_uri_into_model_common and also take a FILE* to use if URI and string are NULL. (librdf_parser_raptor_parse_file_handle_into_model): Added (librdf_parser_raptor_parse_counted_string_into_model): Use librdf_parser_raptor_parse_into_model_common (librdf_parser_raptor_register_factory): Register librdf_parser_raptor_parse_file_handle_as_stream and librdf_parser_raptor_parse_file_handle_into_model * librdf/rdf_parser.c: (librdf_parser_parse_file_handle_as_stream, librdf_parser_parse_file_handle_into_model): Added. * librdf/rdf_parser_internal.h: struct librdf_parser_factory_s gains parse_file_handle_into_model and parse_file_handle_as_stream methods * librdf/rdf_parser.h: Added librdf_parser_parse_file_handle_as_stream and librdf_parser_parse_file_handle_into_model 2008-06-15 Dave Beckett * librdf/rdf_concepts.c: (main): librdf_get_concept_resource_by_index returns a librdf_node, not librdf_uri * librdf/rdf_storage_trees.c: (librdf_storage_trees_node_compare): Use char* pointer subtraction. * librdf/rdf_avltree.c: (librdf_avltree_dump): Use %zd for size_t (librdf_avltree_print_node): Not need unless LIBRDF_DEBUG > 1 (librdf_avltree_node_rightmost): Not needed yet. * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_node_hash_common): Init pointer datatype to NULL [sparse]l * librdf/rdf_storage_trees.c: (librdf_storage_trees_node_compare): Try to avoid what gcc calls "potentially expensive pointer subtraction" (librdf_statement_compare_spo, librdf_statement_compare_sop, librdf_statement_compare_ops, librdf_statement_compare_pso, librdf_storage_trees_avl_free): Declare static. * librdf/rdf_avltree.c: (librdf_avltree_dump): Use %z for size_t (librdf_avltree_check_node): Not need unless LIBRDF_DEBUG > 1 (librdf_avltree_node_prev): Not used yet * librdf/rdf_hash_memory.c: (librdf_hash_memory_cursor_init): Should be declared static. [sparse] * librdf/rdf_node.c: (librdf_node_get_literal_value_datatype_uri): Return NULL [sparse] * configure.ac, librdf/rdf_types.h: Use autoconf 2.5.x AC_CHECK_TYPES for byte u32 and u64 2008-06-13 Dave Beckett * librdf/rdf_model.c: (librdf_model_add_statement): Remove contains statement check since it is already part of the storage add statement API and it can be expensive. 2008-06-12 Dave Beckett * librdf/rdf_parser_raptor.c: (librdf_raptor_new_uri_for_rdf_concept): Prevent use of NULL uri 2008-06-11 Dave Beckett * librdf/Makefile.am: Add rdf_avltree.h to dist * librdf/rdf_serializer_raptor.c: (librdf_serializer_raptor_serialize_stream_to_counted_string): Revert r13840: remove call to raptor_free_iostream() as raptor_serialize_start has old (<1.4.18) semantics again. 2008-06-10 Dave Beckett * examples/rss2atom.c: my ns * examples/Makefile.am, examples/rss2atom.c: Added rss2atom example 2008-05-21 Lauri Aalto * librdf/rdf_iterator.c, librdf/rdf_iterator_internal.h, librdf/rdf_stream.c, librdf/rdf_stream_internal.h: Allow get_context calls in stream/iterator map functions. Use is_updating flag to prevent infinite looping. Originally reported in http://lists.usefulinc.com/pipermail/redland-dev/2008-May/001756.html 2008-05-19 Lauri Aalto * librdf/rdf_model.c: (test_model_cloning): Use parametrized storage type for message 2008-05-19 Dave Beckett * librdf/rdf_model_storage.c: (librdf_model_storage_find_statements_in_context): Added to use storage factory method find_statements_in_context if it exists * librdf/rdf_model.c: Get the storage parameters from envariables for testing 2008-05-06 Lauri Aalto * librdf/rdf_storage.c: (librdf_init_storage): Do not init trees storage unless STORAGE_TREES is defined. (main): Do not test trees storage unless STORAGE_TREES is defined. * librdf/rdf_stream.c: (librdf_stream_update_current_statement): Fixed comment * librdf/rdf_iterator.c: (librdf_iterator_update_current_element): Fixed iterator map function callback params. http://lists.usefulinc.com/pipermail/redland-dev/2008-May/001756.html * librdf/rdf_serializer_raptor.c: (librdf_serializer_raptor_serialize_stream_to_counted_string): Memory leak fix - raptor_serializer does not take ownership of the passed in raptor_iostream anymore after r13820 * librdf/rdf_log.c: (librdf_log): Resiliency fix: avoid raptor_free_memory(0) * librdf/rdf_avltree.c: (librdf_avltree_print): Compiler warning fix: initialize rv before use. 2008-05-05 Lauri Aalto * librdf/rdf_stream.c: (librdf_stream_from_node_iterator_get_statement): Removed useless and incorrect typecast. 2008-04-23 Dave Robillard * configure.ac, docs/storage.html, librdf/Makefile.am, librdf/rdf_avltree.c, librdf/rdf_avltree.h, librdf/rdf_storage.c, librdf/rdf_storage_internal.h, librdf/rdf_storage_trees.c: Add new in-memory store, "trees". (librdf_storage_find_statements): Test for storage methods before triple pattern (less comparisons via short circuiting for storages without find_arcs etc.). 2008-04-03 Dave Beckett * librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c: (librdf_storage_mysql_init,librdf_storage_postgresql_init): Do not call terminate factory method on failure, caller will do that 2008-03-27 Dave Beckett * librdf/rdf_parser_raptor.c, librdf/rdf_serializer_raptor.c: (librdf_parser_raptor_set_feature, librdf_serializer_raptor_set_feature): Use raptor_parser_set_feature_string and raptor_serializer_set_feature_string to set feature values to integer or string as appropriate. 2008-03-04 Lauri Aalto * librdf/rdf_concepts.c: (librdf_init_concepts,librdf_finish_concepts): Init/finish also the last concept (rdfs:subPropertyOf). (main): Added test for LIBRDF_CONCEPT_LAST uri. 2008-03-03 Lauri Aalto * librdf/rdf_concepts.c, librdf/rdf_concepts.h: Source compatibility break: Fixed LIBRDF_URI_RDF_MS, LIBRDF_URI_RDF_SCHEMA public API macros broken in r13171. (librdf_get_concept_ms_namespace,librdf_get_concept_schema_namespace): Added two new getters to make the API macros work - cannot access librdf_world_s members outside the API. 2008-02-28 Lauri Aalto * librdf/rdf_storage.c: (librdf_storage_add_statement): fixed comment 2008-02-16 Dave Beckett * autogen.sh, autogen.sh, autogen.sh, autogen.sh, autogen.sh: autogen checks when env prog version is empty. Update all packages to latest autogen.sh 2008-02-07 Lauri Aalto * librdf/rdf_serializer_raptor.c: (librdf_serializer_raptor_serialize_stream_to_counted_string): Fixed memory leak. Ensure any string placed to the passed in string pointer by raptor_write_string_iostream_finish() is freed if not returned to caller. * librdf/rdf_serializer_raptor.c: (librdf_serializer_raptor_serialize_stream_to_counted_string): Should not free passed in stream. * librdf/rdf_query_rasqal.c: (librdf_query_rasqal_query_results_update_statement): Check for statement node allocation failures. 2008-01-14 Lauri Aalto * librdf/rdf_serializer.c: (librdf_serializer_serialize_stream_to_counted_string) Docs * autogen.sh: Do not branch autogen.sh scripts but keep them identical 2008-01-13 Dave Beckett * autogen.sh: automake 1.0 docs 2008-01-10 Lauri Aalto * librdf/rdf_query_rasqal.c: (librdf_query_rasqal_constructor) Die with a fatal error if rasqal_new_world() returns NULL, do not leave the system in a partially initialized state. * utils/rdfproc.c: Updated rdfproc to new rasqal api * librdf/rdf_query_rasqal.c, librdf/rdf_query_results.c: Updated to new rasqal apis. * librdf/rdf_query_rasqal.c: (redland_node_to_rasqal_literal) Updated to new rasqal literal API. 2008-01-09 Lauri Aalto * librdf/rdf_query_rasqal.c: (librdf_query_rasqal_constructor) Use non-deprecated rasqal_set_triples_source_factory2(). * librdf/rdf_query_rasqal.c, librdf/rdf_query_results.c: Updated to non-deprecated rasqal query results API. * librdf/rdf_init_internal.h, librdf/rdf_query_rasqal.c: Renamed rasqal_query variable to rasqal_query_ptr to prevent type<->name problems in C++. 2008-01-07 Lauri Aalto * librdf/rdf_init_internal.h, librdf/rdf_query.c, librdf/rdf_query_internal.h, librdf/rdf_query_rasqal.c: Changed rdf_query_rasqal to use non-deprecated rasqal functions with rasqal_world support. 2008-01-03 Lauri Aalto * utils/rdfproc.c: Replaced call to removed function rasqal_query_results_formats_enumerate_full() with rasqal_query_results_formats_enumerate(). * librdf/rdf_query_results.c: (librdf_query_results_formats_enumerate) Replaced call to removed function rasqal_query_results_formats_enumerate_full() with rasqal_query_results_formats_enumerate(). redland-1.0.17/Makefile.in0000644000175000017500000011147712257575714012231 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- Mode: Makefile -*- # # Makefile.am - top level automake file for Redland # # Copyright (C) 2000-2009 David Beckett http://www.dajobe.org/ # Copyright (C) 2000-2005 University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_pkgdata_DATA) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/redland-config.in $(srcdir)/redland-src-config.in \ $(srcdir)/redland.pc.in $(srcdir)/redland.rdf.in \ $(top_srcdir)/configure AUTHORS COPYING COPYING.LIB ChangeLog \ INSTALL NEWS TODO build/ar-lib build/compile \ build/config.guess build/config.sub build/depcomp \ build/install-sh build/ltmain.sh build/missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/rdf_config.h CONFIG_CLEAN_FILES = redland.rdf redland.pc redland-config \ redland-src-config CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgconfigdir)" SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS) AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(dist_pkgdata_DATA) $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIGEST_OBJS = @DIGEST_OBJS@ DIGEST_SRCS = @DIGEST_SRCS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HASH_OBJS = @HASH_OBJS@ HASH_SRCS = @HASH_SRCS@ HAVE_RAPTOR2_API = @HAVE_RAPTOR2_API@ HTML_DIR = @HTML_DIR@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IODBC_CONFIG = @IODBC_CONFIG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBRDF_CPPFLAGS = @LIBRDF_CPPFLAGS@ LIBRDF_DIRECT_LIBS = @LIBRDF_DIRECT_LIBS@ LIBRDF_EXTERNAL_CPPFLAGS = @LIBRDF_EXTERNAL_CPPFLAGS@ LIBRDF_EXTERNAL_LIBS = @LIBRDF_EXTERNAL_LIBS@ LIBRDF_INTERNAL_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ LIBRDF_INTERNAL_DEPS = @LIBRDF_INTERNAL_DEPS@ LIBRDF_INTERNAL_LIBS = @LIBRDF_INTERNAL_LIBS@ LIBRDF_LDFLAGS = @LIBRDF_LDFLAGS@ LIBRDF_LIBTOOLLIBS = @LIBRDF_LIBTOOLLIBS@ LIBRDF_LIBTOOL_VERSION = @LIBRDF_LIBTOOL_VERSION@ LIBRDF_PKGCONFIG_PRIVATE_LIBS = @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ LIBRDF_VERSION_DECIMAL = @LIBRDF_VERSION_DECIMAL@ LIBRDF_VERSION_MAJOR = @LIBRDF_VERSION_MAJOR@ LIBRDF_VERSION_MINOR = @LIBRDF_VERSION_MINOR@ LIBRDF_VERSION_RELEASE = @LIBRDF_VERSION_RELEASE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEM = @MEM@ MEM_LIBS = @MEM_LIBS@ MKDIR_P = @MKDIR_P@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ODBC_CFLAGS = @ODBC_CFLAGS@ ODBC_LIBS = @ODBC_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSTGRESQL_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ POSTGRESQL_LIBS = @POSTGRESQL_LIBS@ RANLIB = @RANLIB@ RAPTOR2_CFLAGS = @RAPTOR2_CFLAGS@ RAPTOR2_LIBS = @RAPTOR2_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ RASQAL_CFLAGS = @RASQAL_CFLAGS@ RASQAL_LIBS = @RASQAL_LIBS@ RASQAL_MAX_VERSION = @RASQAL_MAX_VERSION@ RASQAL_MIN_VERSION = @RASQAL_MIN_VERSION@ RECHO = @RECHO@ RECHO_C = @RECHO_C@ RECHO_N = @RECHO_N@ REDLAND_MODULE_PATH = @REDLAND_MODULE_PATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TAR = @TAR@ TSTORE_CONFIG = @TSTORE_CONFIG@ TSTORE_CPPFLAGS = @TSTORE_CPPFLAGS@ TSTORE_LIBS = @TSTORE_LIBS@ VERSION = @VERSION@ VIRTUOSO_CPPFLAGS = @VIRTUOSO_CPPFLAGS@ VIRTUOSO_LIBS = @VIRTUOSO_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ bin_SCRIPTS = redland-config noinst_SCRIPTS = redland-src-config man_MANS = redland-config.1 dist_pkgdata_DATA = Redland.i pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = redland.pc DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc # Subdirectories to build/install/distribute etc. SUBDIRS = $(subdirs) src examples utils demos docs data scripts EXTRA_DIST = \ ChangeLog.1 ChangeLog.2 ChangeLog.3 ChangeLog.4 \ ChangeLog.5 ChangeLog.6 ChangeLog.7 ChangeLog.8 ChangeLog.9 ChangeLog.10 \ ChangeLog.11 ChangeLog.12 \ README LICENSE.txt TODO \ README.html NEWS.html LICENSE.html TODO.html \ RELEASE.html INSTALL.html FAQS.html \ LICENSE-2.0.txt NOTICE \ HACKING.md HACKING.html \ redland.rdf.in \ autogen.sh \ redland-config.in \ redland-src-config.in \ $(man_MANS) \ redland.sln \ gtk-doc.make \ redland.pc.in # Create some text files from HTML sources @MAINTAINER_MODE_TRUE@LYNX = lynx @MAINTAINER_MODE_TRUE@HTML_TO_TEXT = TERM=vt100 $(LYNX) -dump $< | sed -e 's,file://localhost.*librdf/,,' > $@ @MAINTAINER_MODE_TRUE@SUFFIXES = .html .txt all: all-recursive .SUFFIXES: .SUFFIXES: .html .txt am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): redland.rdf: $(top_builddir)/config.status $(srcdir)/redland.rdf.in cd $(top_builddir) && $(SHELL) ./config.status $@ redland.pc: $(top_builddir)/config.status $(srcdir)/redland.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ redland-config: $(top_builddir)/config.status $(srcdir)/redland-config.in cd $(top_builddir) && $(SHELL) ./config.status $@ redland-src-config: $(top_builddir)/config.status $(srcdir)/redland-src-config.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) installcheck-binSCRIPTS: $(bin_SCRIPTS) bad=0; pid=$$$$; list="$(bin_SCRIPTS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-dist_pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @case `sed 15q $(srcdir)/NEWS` in \ *"$(VERSION)"*) : ;; \ *) \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1;; \ esac @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_pkgdataDATA install-man \ install-pkgconfigDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: installcheck-binSCRIPTS maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-dist_pkgdataDATA \ uninstall-man uninstall-pkgconfigDATA uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-data-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-data-hook install-dist_pkgdataDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man1 install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installcheck-binSCRIPTS \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-dist_pkgdataDATA uninstall-man uninstall-man1 \ uninstall-pkgconfigDATA @MAINTAINER_MODE_TRUE@.html.txt: @MAINTAINER_MODE_TRUE@ $(HTML_TO_TEXT) @MAINTAINER_MODE_TRUE@README: README.html @MAINTAINER_MODE_TRUE@ $(HTML_TO_TEXT) @MAINTAINER_MODE_TRUE@NEWS: NEWS.html @MAINTAINER_MODE_TRUE@ $(HTML_TO_TEXT) @MAINTAINER_MODE_TRUE@TODO: TODO.html @MAINTAINER_MODE_TRUE@ $(HTML_TO_TEXT) @MAINTAINER_MODE_TRUE@HACKING.html: HACKING.md $(top_srcdir)/scripts/markdown-to-html.pl @MAINTAINER_MODE_TRUE@ $(PERL) $(top_srcdir)/scripts/markdown-to-html.pl $< $@ @SET_MAKE@ install-data-hook: $(PERL) $(srcdir)/scripts/touch-mtime.pl $(srcdir)/Redland.i $(DESTDIR)$(pkgdatadir)/Redland.i # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: redland-1.0.17/TODO0000644000175000017500000000063612130720506010623 00000000000000 Redland librdf RDF API Library - To Do list Bugs and Features Bugs should be reported at the [1]Redland Issue Tracker. __________________________________________________________________ Copyright (C) 2000-2013 [2]Dave Beckett Copyright (C) 2000-2005 [3]University of Bristol References 1. http://bugs.librdf.org/ 2. http://www.dajobe.org/ 3. http://www.bristol.ac.uk/ redland-1.0.17/ChangeLog.70000644000175000017500000014300111171007721012045 000000000000002006-12-13 Dave Beckett * librdf/Makefile.am, librdf/rdf_query_results.c: (librdf_query_results_as_stream) docs 2006-12-09 Dave Beckett * librdf/rdf_storage.c: (librdf_storage_stream_to_node_iterator_get_method): Do not try to copy a NULL context node. * utils/rdfproc.c: Added --transactions/-T for enabling transactions 2006-12-07 Dave Beckett * librdf/rdf_node.c: (main): Cast for size_t * librdf/rdf_storage_mysql.c: off by 1 in table loop * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_release_handle): Do not release if doing a transaction. (librdf_storage_mysql_transaction_commit, librdf_storage_mysql_transaction_rollback): Debug message and zap transaction_handle before releasing it. * librdf/rdf_storage_mysql.c: Put SQL configuration and variables inside the mysql context Added LIBRDF_DEBUG_SQL define and macro around all SQL queries. (librdf_storage_mysql_init): Init context->config and context->vars (librdf_storage_mysql_terminate): Free config, vars. * librdf/mysql-v1.ttl, librdf/mysql-v2.ttl: MyISAM and InnoDB * librdf/rdf_storage_mysql.c: Add layout and config_dir to context. (librdf_storage_mysql_init): Init layout and config_dir from options. Use librdf_new_sql_config_for_storage() to get SQL create statements and then invoke them with templated variables in a hash using librdf_hash_interpret_template(). (librdf_storage_mysql_terminate): Free layout and config_dir * librdf/mysql-v1.ttl: Only var is $(STATEMENTS_NAME) * librdf/rdf_storage_sql.c: (librdf_new_sql_config_for_storage) Add dir arg with default set if NULL. * librdf/rdf_storage_internal.h: librdf_new_sql_config_for_storage prototype gets dir arg 2006-12-06 Dave Beckett * librdf/rdf_model_storage.c: extra static defines * librdf/Makefile.am, librdf/rdf_storage_sql.c, librdf/rdf_storage_sql_test.c: Split out sql config test * librdf/mysql.ttl: renamed mysql.ttl to mysql-v1.ttl * librdf/rdf_storage_internal.h: Move librdf_sql_config definitions and declarations to rdf_storage_internal.h * librdf/rdf_storage_sql.c: (librdf_new_sql_config, librdf_new_sql_config_for_storage): Add layout arg (main): Test NULL and mysql v2 layout * librdf/Makefile.am, librdf/mysql-v1.ttl (from /librdf/trunk/librdf/mysql.ttl:11717), librdf/mysql-v2.ttl: mysql-v1.ttl mysql-v2.ttl 2006-12-05 Dave Beckett * librdf/rdf_storage_sql.c: (librdf_new_sql_config_for_storage): Added. * librdf/Makefile.am, librdf/rdf_storage_sql.c: Added SQL config reading from file 2006-12-04 Dave Beckett * librdf/mysql.ttl: $(NAME) * Makefile.am: No need for Makefile.PL here * Makefile.PL: No need for Makefile.PL here * librdf/Makefile.am, librdf/mysql.ttl: Add mysql.ttl * Redland.i: Export librdf_model_transaction_start librdf_model_transaction_commit and librdf_model_transaction_rollback * librdf/rdf_storage_postgresql.c: Added transaction support. librdf_storage_postgresql_context gains PGconn* transaction_handle; (librdf_storage_postgresql_get_handle): Return transaction_handle if there is one. (librdf_storage_postgresql_terminate): Free transaction_handle (librdf_storage_postgresql_close): Rollback transaction on close. (librdf_storage_postgresql_transaction_start, librdf_storage_postgresql_transaction_start_with_handle, librdf_storage_postgresql_transaction_commit, librdf_storage_postgresql_transaction_rollback and librdf_storage_postgresql_transaction_get_handle): Added. (librdf_storage_postgresql_register_factory): register transaction functions. * librdf/rdf_storage_mysql.c: Added transaction support. librdf_storage_mysql_context gains MYSQL* transaction_handle; (librdf_storage_mysql_get_handle): Return transaction_handle if there is one. (librdf_storage_mysql_terminate): Free transaction_handle (librdf_storage_mysql_close): Rollback transaction on close. (librdf_storage_mysql_transaction_start, librdf_storage_mysql_transaction_start_with_handle, librdf_storage_mysql_transaction_commit, librdf_storage_mysql_transaction_rollback and librdf_storage_mysql_transaction_get_handle): Added. (librdf_storage_mysql_register_factory): register transaction functions. * librdf/rdf_storage.c: (librdf_storage_transaction_start, librdf_storage_transaction_start_with_handle, librdf_storage_transaction_commit, librdf_storage_transaction_rollback and librdf_storage_transaction_get_handle): Added, all optional if the factories support them. * librdf/rdf_storage_internal.h: struct librdf_storage_factory_s gains factory methods transaction_start, transaction_start_with_handle, transaction_commit, transaction_rollback and transaction_get_handle * librdf/rdf_storage.h: Added prototypes for librdf_storage_transaction_start, librdf_storage_transaction_start_with_handle, librdf_storage_transaction_commit, librdf_storage_transaction_rollback and librdf_storage_transaction_get_handle * librdf/rdf_model_storage.c: (librdf_model_storage_transaction_start, librdf_model_storage_transaction_start_with_handle, librdf_model_storage_transaction_commit, librdf_model_storage_transaction_rollback and librdf_model_storage_transaction_get_handle): Added, all calling the librdf_storage_* equivalent. * librdf/rdf_model_internal.h: struct librdf_model_factory_s gains factory methods transaction_start, transaction_start_with_handle, transaction_commit, transaction_rollback and transaction_get_handle * librdf/rdf_model.c: (librdf_model_transaction_start, librdf_model_transaction_start_with_handle, librdf_model_transaction_commit, librdf_model_transaction_rollback and librdf_model_transaction_get_handle): Added, all optional if the factories support them. * librdf/rdf_model.h: Added prototypes for librdf_model_transaction_start, librdf_model_transaction_start_with_handle, librdf_model_transaction_commit, librdf_model_transaction_rollback and librdf_model_transaction_get_handle 2006-12-03 Dave Beckett * librdf/rdf_hash.c: (main): Check for expected template result. * librdf/rdf_hash.c: (librdf_hash_interpret_template): Free returned librdf_hash_datum * librdf/rdf_hash.c: (librdf_hash_interpret_template): Added, to interpret key/values into a template. (main): Test for the above. * librdf/rdf_hash.h: Added prototype librdf_hash_interpret_template 2006-12-02 Dave Beckett * librdf/rdf_query_rasqal.c: (rasqal_redland_bind_match): Do not throw away the rasqal node type information now, it is needed later on in FILTER comparisons. Fixes Issue#0000153 http://bugs.librdf.org/mantis/view.php?id=153 2006-11-30 Dave Beckett * librdf/rdf_storage.c: (librdf_storage_remove_reference): Call librdf_storage_free to clean up if this is the last reference * configure.ac: No need to add LIBRDF_CPPFLAGS to LIBRDF_EXTERNAL_CPPFLAGS - they are only needed building inside redland 2006-11-23 Dave Beckett * librdf/rdf_storage_file.c: (librdf_storage_file_init): Free options when finished with them. 2006-11-21 Dave Beckett * configure.ac: Minimum raptor version is 1.4.11 2006-11-19 Dave Beckett * Snapshotted redland_1_0_5 for 1.0.5 release 2006-11-18 Dave Beckett * librdf/rdf_storage_sqlite.c: Track when a stream is active and store pending queries for SQLite in a list an apply after. (librdf_storage_sqlite_exec): When the execution returns SQLITE_LOCKED and in a stream, save the query for running later. (librdf_storage_sqlite_serialise, librdf_storage_sqlite_find_statements, librdf_storage_sqlite_context_serialise, librdf_storage_sqlite_get_contexts): Mark in stream. (librdf_storage_sqlite_serialise_finished, librdf_storage_sqlite_find_statements_finished librdf_storage_sqlite_context_serialise_finished): End in stream. (librdf_storage_sqlite_query_flush): Added. Fixes Issue #0000139 http://bugs.librdf.org/mantis/view.php?id=139 2006-11-13 Dave Beckett * librdf/rdf_model.c: (main): Add, still commented out, sqlite3 test. 2006-10-31 Dave Beckett * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_find_statements): Tidy up correctly with librdf_storage_sqlite_find_statements_finished if librdf_new_statement_from_statement, librdf_storage_sqlite_statement_helper or sqlite_compile fails. (librdf_storage_sqlite_context_serialise): Tidy up correctly with librdf_storage_sqlite_context_serialize_finished if librdf_storage_sqlite_statement_helper or sqlite_compile fails. Fixes Issue#0000137 http://bugs.librdf.org/mantis/view.php?id=137 * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_find_statements): Tidy up correctly with librdf_storage_sqlite_find_statements_finished if librdf_new_statement_from_statement, librdf_storage_sqlite_statement_helper or sqlite_compile fails. (librdf_storage_sqlite_context_serialise): Tidy up correctly with librdf_storage_sqlite_context_serialize_finished if librdf_storage_sqlite_statement_helper or sqlite_compile fails. * librdf/Makefile.am: FIx AM_CPPFLAGS AM_CFLAGS * Redland.i: Export raptor and rasqal version strings and integers 2006-10-22 Dave Beckett * configure.ac, librdf/win32_rdf_config.h: Bump version to 1.0.5 2006-10-21 Dave Beckett * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_literal_helper): Check for no language or no datatype when they are NULL. Fixes Issue#0000136 http://bugs.librdf.org/mantis/view.php?id=136 2006-10-14 Dave Beckett * librdf/rdf_storage_sqlite.c: Add a 'sychronous' storage option for the sqlite store with values off, normal or full. (librdf_storage_sqlite_init, librdf_storage_sqlite_open): set synchronous flag and do creation in a transaction. (librdf_storage_sqlite_contains_statement, librdf_storage_sqlite_context_add_statement): Add transaction around operation. (librdf_storage_sqlite_context_remove_statement): Add trailing ; * librdf/rdf_storage_mysql.c: Revert change: > r11074 | dajobe | 2006-07-29 17:18:34 -0700 (Sat, 29 Jul 2006) | 5 lines > (librdf_storage_mysql_add_statements): Use > librdf_storage_mysql_context_add_statements. > (librdf_storage_mysql_context_add_statements): Add check for adding > duplicate statements and remove the check when in bulk mode. * examples/rss2ical.c: Skip results with non-resource node rather than abort all results 2006-10-08 Dave Beckett * librdf/rdf_storage_hashes.c: (librdf_storage_hashes_add_remove_statement, librdf_storage_hashes_contains_statement): Fix debug calls. Fixes Issue#0000132 http://bugs.librdf.org/mantis/view.php?id=132 * librdf/rdf_query.c: (librdf_query_register_factory): Fix debug call. Fixes Issue#0000132 http://bugs.librdf.org/mantis/view.php?id=132 * configure.ac: Fix --with-threads arg Fixes Issue#0000125 http://bugs.librdf.org/mantis/view.php?id=125 * docs/storage.html: Added sqlite and postgresql * librdf/rdf_serializer.c: (main): Reuse serializer * librdf/rdf_node.c: (main): Free test big literal. * librdf/rdf_node.c: (main): Add test for big 100,000-length literal. * librdf/rdf_node.c: (librdf_new_node_from_literal): Call librdf_new_node_from_typed_counted_literal directly. (librdf_new_node_from_typed_counted_literal): Added, with guts of librdf_new_node_from_typed_literal. (librdf_new_node_from_typed_literal): Call librdf_new_node_from_typed_counted_literal with additional strlen()s. (librdf_node_encode, librdf_node_decode): Added new long literal type 'N' when the string length > 0xFFFF. Does not affect existing shorter literal encoding. Use librdf_new_node_from_typed_counted_literal to save un-necessary strlen()s. * librdf/rdf_node.h: Added librdf_new_node_from_typed_counted_literal prototype. * librdf/rdf_node_internal.h: struct librdf_node_s now counts XML language length * librdf/rdf_node.c: Add tests for node encoding URIs, literals * librdf/rdf_list.c, librdf/rdf_list_internal.h: rdf_list_context restores current and next fields. When a node is deleted, just adjust the next pointer. 2006-10-07 Dave Beckett * librdf/rdf_list.c: (librdf_list_iterators_replace_node): Remove next field, just use librdf_iterator_next() to move on. (librdf_list_get_iterator, librdf_list_iterator_next_method): Remove use of next field. * librdf/rdf_list_internal.h: struct librdf_list_iterator_context_s looses the next field. * librdf/rdf_storage_list.c: (librdf_storage_list_context_add_statement): Free some fields before freeing the memory the pointers were stored in after errors. * librdf/rdf_storage.c: The stream to node iterator code was altered to now save the grabbed object node and/or context nodes taken from the shared librdf_stream that it converts so even if the librdf_stream moves on, the librdf_nodes are preserved. (librdf_storage_stream_to_node_iterator_next_method): Delete any saved object/context nodes so they will get refreshed. (librdf_storage_stream_to_node_iterator_get_method): Save object/context nodes after retrieving them from the shared librdf_statement got from the librdf_stream. (librdf_storage_stream_to_node_iterator_finished): Free the new saved node fields. (librdf_storage_node_stream_to_node_create): Copy the node1, node2 explicitly rather than fake around with NULLing out them in the librdf_storage_stream_to_node_iterator_finished function. * librdf/rdf_serializer.c: (main): tests for serialize stream to string/file handle * librdf/Makefile.am: add test.rdf to CLEANFILES * librdf/rdf_serializer_raptor.c: Removed unused var * configure.ac: Add sys/stat.h * librdf/ChangeLog: #changes * librdf/rdf_serializer_internal.h: Added factory methods: serialize_stream_to_file_handle, serialize_stream_to_counted_string and serialize_stream_to_iostream * librdf/rdf_serializer_raptor.c: (librdf_serializer_raptor_serialize_stream_to_file_handle, librdf_serializer_raptor_serialize_stream_to_counted_string librdf_serializer_raptor_serialize_stream_to_iostream): Added * librdf/rdf_serializer.c: (librdf_serializer_serialize_stream_to_file_handle, librdf_serializer_serialize_stream_to_file, librdf_serializer_serialize_stream_to_string, librdf_serializer_serialize_stream_to_counted_string librdf_serializer_serialize_stream_to_iostream): Added to satisfy the request in Issue#000092 http://bugs.librdf.org/mantis/view.php?id=92 * librdf/rdf_serializer.h: Added prototypes for librdf_serializer_serialize_stream_to_file_handle, librdf_serializer_serialize_stream_to_file, librdf_serializer_serialize_stream_to_string, librdf_serializer_serialize_stream_to_counted_string and librdf_serializer_serialize_stream_to_iostream * librdf/rdf_parser.c: docs * docs/redland-sections.txt: REDLAND_PRINTF_FORMAT unused * docs/redland-sections.txt: add new fns * Redland.i: Added librdf_parser_get_accept_header * librdf/rdf_parser.c: (main): Add accept header test * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_get_accept_header): fix * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_get_accept_header): Added. * librdf/rdf_parser.c: (librdf_parser_get_accept_header): Added. * librdf/rdf_parser.h: Added librdf_parser_get_accept_header prototype. * librdf/rdf_parser_internal.h: struct librdf_parser_factory_s gains get_accept_header * librdf/rdf_serializer_raptor.c: (librdf_serializer_raptor_constructor): Grab and register the label with librdf_serializer_register_factory. * librdf/rdf_serializer_internal.h: struct librdf_serializer_factory_s gains label field * librdf/rdf_serializer.h: librdf_parser_register_factory gains Add label arg. Added librdf_serializer_enumerate prototype * librdf/rdf_serializer.c: Replace world->serializers with raptor_sequence of parsers (librdf_serializer_register_factory): Add label arg. * librdf/rdf_init_internal.h: struct librdf_world_s field serializers is now a raptor_sequence * librdf/rdf_init_internal.h: struct librdf_world_s field parsers is now a raptor_sequence * librdf/rdf_parser_internal.h: struct librdf_parser_factory_s gains label field * librdf/rdf_parser.h: librdf_parser_register_factory gains Add label arg. Added librdf_parser_enumerate prototype * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_constructor): Grab and register the label with librdf_parser_register_factory. * librdf/rdf_parser.c: Replace world->parsers with raptor_sequence of parsers (librdf_parser_register_factory): Add label arg. * librdf/rdf_list.c: Less debugging of list iterator changes 2006-10-06 Dave Beckett * librdf/rdf_model.c: (test): During an iteration delete the current triple item and the next triple item. * librdf/rdf_list.c: Rename iterator_context fields to next_ic, prev_ic. Store next pointer and use that to handle deleting the next item. * librdf/rdf_list_internal.h: Rename fields to next_ic, prev_ic * librdf/rdf_list.c: Move structs to rdf_list_iternal.h * librdf/rdf_list_internal.h: Add iterator contexts * librdf/rdf_list.c: Added librdf_list_iterators_replace_node to move iterators past deleted nodes. * librdf/rdf_list.c: Moved internal structs here. (librdf_list_add_iterator_context, librdf_list_remove_iterator_context): Added. (librdf_list_get_iterator): Add to list of iterators with librdf_list_add_iterator_context on success. (librdf_list_iterator_finished): Remove from list of iterators * Redland.i: Fix typo to declare librdf_query_results_get_binding_value to return a new object * librdf/rdf_list.c: (librdf_free_list): Warn if iterators were running at exit. * librdf/rdf_list_internal.h: Add struct librdf_list_iterator_context_s * librdf/rdf_internal.h: Remove rdf_list_internal.h * librdf/rdf_parser_raptor.c: statements field is now a dynamic librdf_list* * librdf/rdf_heuristics.c: statements field is now a dynamic librdf_list* * librdf/rdf_parser.c: (librdf_parser_parse_as_stream, librdf_parser_parse_into_model): Allow NULL base_uri (librdf_parser_parse_string_as_stream, librdf_parser_parse_string_into_model, librdf_parser_parse_counted_string_as_stream, librdf_parser_parse_counted_string_into_model): Allow NULL base_uri, remove assertion failure. (main): Add const and count failures. * librdf/rdf_parser_raptor.c: Changes to allow NULL base uris in parsing, but to fail if it is omitted but required. (librdf_parser_raptor_new_statement_handler): Incoming URIs are always absolute so just use librdf_new_node_from_uri. (librdf_parser_raptor_parse_file_handle_as_stream): Fail if base_uri is NULL but required. (librdf_parser_raptor_parse_as_stream_common): Fail if base_uri is NULL but required. Report fopen failure as an error. (librdf_parser_raptor_parse_uri_into_model_common): docs allowing NULL base_uri. (librdf_parser_raptor_parse_into_model_common): Fail if base_uri is NULL but required. (librdf_parser_raptor_parse_uri_into_model): docs allowing NULL base_uri. * librdf/rdf_heuristics.c: const in test data * librdf/rdf_node.c: const in test data * librdf/rdf_storage_postgresql.c: (librdf_storage_postgresql_hash): Take const type, string. * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_hash): Take const type, string. * librdf/rdf_storage_hashes.c: const in test data * librdf/rdf_storage.c: (librdf_storage_enumerate): Do not check unsigned int < 0 * librdf/rdf_serializer.c: const in test data * librdf/rdf_query_results.c: (librdf_query_results_to_file): log fopen failure error * librdf/rdf_query.c: const in test data * librdf/rdf_model.c: (librdf_model_enumerate): Do not check unsigned int < 0 * librdf/rdf_log_internal.h: librdf_log prototype takes REDLAND_PRINTF_FORMAT * librdf/rdf_hash_internal.h: librdf_hash factory method open Take const identifier. librdf_hash_open prototype changed to take const identifier * librdf/rdf_hash_memory.c: (librdf_hash_memory_open): Take const identifier. * librdf/rdf_hash_bdb.c: (librdf_hash_bdb_open): Take const identifier. * librdf/rdf_hash.h: Change librdf_hash_print_values prototype to take const key_string. * librdf/rdf_hash.c: (librdf_hash_open, librdf_hash_print_values): Take const identifier, key_string. const in test data * librdf/rdf_digest.c: const in test data * librdf/librdf.h: Added REDLAND_PRINT_FORMAT 2006-10-05 Dave Beckett * configure.ac: Add -W flags that CC supports 2006-10-01 Dave Beckett * utils/rdfproc.c: Do not read from stream when parsing returns a NULL pointer. Fixes Issue#0000130 http://bugs.librdf.org/mantis/view.php?id=130 * utils/rdfproc.c: Allow base URI (for parsing) to be set to null with -. Adjust info messages to handle this. 2006-09-10 Dave Beckett * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_literal_helper): Move stringbuffer allocation to after sqlite_string_escape so if it fails, no memory is lost. (librdf_storage_sqlite_contains_statement): If librdf_storage_sqlite_statement_operator_helper fails, free the stringbuffer. (librdf_storage_sqlite_context_remove_statement): If librdf_storage_sqlite_statement_operator_helper fails, free the stringbuffer. Fixes issue #0000116 http://bugs.librdf.org/mantis/view.php?id=116 2006-09-04 Dave Beckett * librdf/rdf_serializer.c: (librdf_serializer_serialize_model_to_file): Report an error when failed to fopen to create a file. * librdf/rdf_storage_postgresql.c: (librdf_storage_postgresql_hash): Take const char* string arg. * librdf/rdf_storage_mysql.c: Add mysql reconnect option 2006-08-26 Dave Beckett * librdf/rdf_node.c: (librdf_new_node_from_blank_identifier): Autodocs Fixes issue#00001114 http://bugs.librdf.org/mantis/view.php?id=114 2006-08-25 Dave Beckett * docs/Makefile.am: Use touch to build redland.3 when not in maintainer mode 2006-08-24 Dave Beckett * utils/rdfproc.c: free uri_string * configure.ac: Add missing sed op 2006-08-20 Dave Beckett * autogen.sh: Track where programs are discovered. * docs/redland-sections.txt: Added librdf_basename librdf_model_enumerate * librdf/rdf_internal.h: tweak debug macros 2006-08-18 Dave Beckett * configure.ac: Strip more -O flags from incoming CFLAGS, CXXFLAGS and CPPFLAGS. Do the same from the output of mysql_config --cflags * configure.ac: Patch configure.ac to remove un-necessary tests for C++ or F77++ compilers that libtool stupidly insists on 2006-08-16 Dave Beckett * librdf/rdf_storage.c: (librdf_storage_context_remove_statements): Doc fix 2006-08-11 Dave Beckett * librdf/rdf_query_rasqal.c: (rasqal_redland_new_triples_source): Do not die if a sequence of data graphs is found, instead empty the sequence of data graphs. 2006-07-29 Dave Beckett * librdf/rdf_heuristics.c, librdf/rdf_heuristics.h: Add some more const fixes. Fixes Issue #0000107 http://bugs.librdf.org/mantis/view.php?id=107 * utils/rdfproc.c: Add world args to librdf_get_storage_factory and librdf_storage_enumerate calls. * librdf/rdf_init_internal.h: struct librdf_world_s gains raptor_sequence of models * librdf/rdf_model.c: Switch to a raptor_sequence of models. (librdf_finish_model): Use raptor_free_sequence. (librdf_delete_model_factories): Deleted. (librdf_free_model_factory): Added helper for raptor_free_sequence. (librdf_model_register_factory, librdf_get_model_factory): Switch to use sequences. (librdf_model_enumerate): Added. * librdf/rdf_model.h: Added librdf_model_enumerate * librdf/rdf_model_storage.c: (librdf_init_model_storage): Update for librdf_model_register_factory world arg. * librdf/rdf_model_internal.h: struct librdf_model_factory_s loses world, next fields, gains label. librdf_model_register_factory gains label field librdf_get_model_factory gains world field * librdf/rdf_storage.h: librdf_storage_enumerate gains world args. * librdf/rdf_storage_internal.h: librdf_get_storage_factory gains world args. * librdf/rdf_storage.c: (librdf_get_storage_factory, librdf_storage_enumerate): Add world args. * librdf/rdf_storage.c: Switch to a raptor_sequence of storages. (librdf_init_storage): Re-order, first thing registered is the default. (librdf_finish_storage): Use raptor_free_sequence. (librdf_delete_storage_factories): Deleted. (librdf_free_storage_factory): Added helper for raptor_free_sequence. (librdf_storage_register_factory, librdf_get_storage_factory, librdf_storage_enumerate): Switch to use sequences. * librdf/rdf_init_internal.h: (struct librdf_world_s): Add raptor_sequence of storages * librdf/rdf_storage_internal.h: (struct librdf_storage_factory_s): Lose world and next fields. * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_context_remove_statements): Remove unused vars * utils/rdfproc.c: Check for invalid storage name with '-s' option * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_context_remove_statements): Added. Fixes Issue #0000103 http://bugs.librdf.org/mantis/view.php?id=103 * librdf/rdf_storage_sqlite.c: Wrap all sqlite_FREE calls on error messages so that they are only called with SQLITE API v2. Fixes Issue #0000105 http://bugs.librdf.org/mantis/view.php?id=105 * librdf/rdf_storage_postgresql.c: (librdf_storage_postgresql_add_statements): Use librdf_storage_postgresql_context_add_statements. (librdf_storage_postgresql_context_add_statements): Add check for adding duplicate statements and remove the check when in bulk mode. * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_add_statements): Use librdf_storage_mysql_context_add_statements. (librdf_storage_mysql_context_add_statements): Add check for adding duplicate statements and remove the check when in bulk mode. 2006-07-11 Dave Beckett * librdf/rdf_storage_mysql.c: cast 2006-07-05 Dave Beckett * librdf/rdf_hash.c, librdf/rdf_heuristics.c, librdf/rdf_iterator.c, librdf/rdf_model.c, librdf/rdf_node.c, librdf/rdf_parser.c, librdf/rdf_query.c, librdf/rdf_serializer.c, librdf/rdf_statement.c, librdf/rdf_storage.c, librdf/rdf_stream.c, librdf/rdf_uri.c, librdf/rdf_utf8.c: (main): More const decls for program 2006-07-04 Dave Beckett * librdf/rdf_digest.c: (main): Revalidate digest answers * librdf/rdf_digest.c, librdf/rdf_hash.c, librdf/rdf_heuristics.c, librdf/rdf_iterator.c, librdf/rdf_node.c, librdf/rdf_parser.c, librdf/rdf_query.c, librdf/rdf_serializer.c, librdf/rdf_statement.c, librdf/rdf_storage_internal.h, librdf/rdf_stream.c, librdf/rdf_uri.c, librdf/rdf_utf8.c: Fixes for calls to librdf_basename in unit tests * librdf/rdf_storage_file.c: Add const for some char* args: (librdf_storage_file_init): argument name * librdf/rdf_storage_sqlite.c: Add const for some char* args: (librdf_storage_sqlite_init): argument name * librdf/rdf_storage_tstore.c: Add const for some char* args: (librdf_storage_tstore_init): argument name * librdf/rdf_storage_mysql.c: Add const for some char* args: (librdf_storage_mysql_init): argument name * librdf/rdf_storage_list.c: Add const for some char* args: (librdf_storage_list_init): argument name * librdf/rdf_storage_postgresql.c: Add const for some char* args: (librdf_storage_postgresql_init): argument name * librdf/rdf_init.c: Added string.h and (protected by HAVE_UNISTD_H) unistd.h headers * librdf/rdf_storage_hashes.c: Add const for some char* args: (librdf_storage_hashes_register): argument name (librdf_storage_hashes_register): argument name (librdf_storage_hashes_init): argument name * librdf/rdf_storage.c: Add const for some char* args: (librdf_new_storage): argument storage_name (librdf_new_storage_with_options): arguments storage_name, name (librdf_new_storage_from_factory): argument name * librdf/rdf_storage.h: Add const for some char* args: librdf_new_storage argument storage_name librdf_new_storage_with_options arguments storage_name, name librdf_new_storage_from_factory argument name * librdf/rdf_model.c: Update to add const for some char* args: (librdf_new_model): argument options_string (librdf_model_add_string_literal_statement): argument xml_language (librdf_model_add_typed_literal_statement): argument xml_language * librdf/rdf_digest.h: Add const for some char* args: librdf_new_digest argument name * librdf/rdf_model.h: Add const for some char* args: librdf_new_model argument options_string librdf_model_add_string_literal_statement argument xml_language librdf_model_add_typed_literal_statement argument xml_language * librdf/rdf_log.c: (librdf_log_simple): Handle attempting to fputs a NULL message. * librdf/rdf_storage_hashes.c: (librdf_storage_hashes_init_common): Do not free any options here. (librdf_storage_hashes_open): Free any options after passing them to librdf_hash_open * librdf/rdf_digest.c: (main): Count failures in digest checks and return them in the return. * librdf/rdf_digest.c, librdf/rdf_hash.c, librdf/rdf_heuristics.c, librdf/rdf_iterator.c, librdf/rdf_model.c, librdf/rdf_node.c, librdf/rdf_parser.c, librdf/rdf_query.c, librdf/rdf_serializer.c, librdf/rdf_statement.c, librdf/rdf_storage.c, librdf/rdf_stream.c, librdf/rdf_uri.c, librdf/rdf_utf8.c: use librdf_basename * librdf/rdf_init.h: Added internal prototype for librdf_basename * librdf/rdf_init.c: (librdf_basename): Added 2006-07-03 Dave Beckett * librdf/rdf_storage_postgresql.c: make it legal C again 2006-07-02 Dave Beckett * librdf/rdf_query_rasqal.c: (rasqal_redland_bind_match): Tidy docs and make the graph field (aka origin) match redland context. (rasqal_redland_init_triples_match): If a context node is given, use librdf_model_find_statements_in_context * utils/rdfproc.c: Allow parse command to take an optional CONTEXT argument * configure.ac: postgresql test does not need pkg_config 2006-06-30 Dave Beckett * librdf/rdf_storage_postgresql.c: (librdf_storage_postgresql_init): Use option 'database' like mysql does as well as 'dbname'. If neither is present, allocate memory for copying the user name rather than use a shared pointer. 2006-06-29 Dave Beckett * librdf/rdf_serializer_raptor.c: remove ORDINAL code comment references 2006-06-18 Dave Beckett * librdf/rdf_storage.c: (librdf_storage_add_statement, librdf_storage_add_statements, librdf_storage_contains_statement): Document and enforce that only legal RDF triples are only allowed. * librdf/rdf_statement.c: (librdf_statement_is_complete): Document and enforce that only complete and legal RDF triples are only allowed. * librdf/rdf_model.c: (librdf_model_add_statement, librdf_model_add, librdf_model_add_typed_literal_statement, librdf_model_add_string_literal_statement, librdf_model_contains_statement): Document and enforce legal RDF triples are only allowed. 2006-06-05 Dave Beckett * librdf/rdf_model.c: docucomments typos 2006-05-11 Dave Beckett * examples/rss2ical.c: malloc +1 for nul * examples/Makefile.am: make rss2ical 2006-05-10 Dave Beckett * examples/rss2ical.c: docs 2006-05-08 Dave Beckett * examples/rss2ical.c: (iso2vcaldate): handle shorter iso dats * examples/rss2ical.c: (uri_to_calid): Added to form icalendar identifiers from URIs * examples/rss2ical.c: Use optional creator in query * examples/rss2ical.c: (remove_html_entities): Remove leading white space * examples/rss2ical.c: Add dc:creator - bogus, but works for planetRDF (ical_format): Just use \n when wrapping long lines (main): Output ATTENDEE name with value of creator * examples/rss2ical.c: (remove_html_entities): Added, to get rid of &#NNN; mostly, also doing amp, lt, gt. * examples/rss2ical.c: Delete duration * examples/rss2ical.c: rss2ical 2006-05-05 Dave Beckett * NEWS.html: 05-05 not 05-15 * NEWS.html, RELEASE.html: 1.0.4 * librdf/win32_rdf_config.h: bumped to 1.0.4 * Snapshotted redland_1_0_4 for 1.0.4 release 2006-05-02 Dave Beckett * librdf/rdf_utf8.c: (librdf_utf8_to_unicode_char, librdf_utf8_to_latin1, librdf_utf8_print, main): Use raptor_utf8_to_unicode_char. * librdf/rdf_node.c: (librdf_new_node_from_literal, librdf_new_node_from_typed_literal): An empty language string is equivalent to a NULL pointer. This makes calling this slightly easier from higher-level languages. 2006-05-01 Dave Beckett * Makefile.am: Added ChangeLog.6 2006-04-24 Dave Beckett * librdf/rdf_uri.c: (librdf_uri_is_file_uri): Replace raptor 1.4.9-deprecated raptor_uri_is_file_uri with raptor_uri_uri_string_is_file_uri * librdf/rdf_files.c: (main): Remove test for deprecated function. * librdf/rdf_storage_postgresql.c: Use UINT64_T_FMT instead of %llu for portability. (librdf_storage_postgresql_init): Use escaped_name in query. * librdf/rdf_storage_mysql.c: Use UINT64_T_FMT instead of %llu for portability. (librdf_storage_mysql_init): Use escaped_name in query. * librdf/rdf_types.h: Define UINT64_T_FMT with the portable sprintf formatting for a 64-bit unsigned int %I64u on win32, %llu (gcc) elsewhere. 2006-04-09 Dave Beckett * docs/redland-chapter-intro.xml, docs/redland-chapter-objects.xml, docs/redland-docs.xml: DocBook XML V4.3 2006-03-27 Dave Beckett * redland.sln: redland win32 build files update from John Barstow * librdf/win32/librdf.vcproj: redland win32 build files update from John Barstow * librdf/win32_rdf_config.h: redland win32 build files update from John Barstow * librdf/rdf_init.c: Protect #include with defines as elsewhere * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_new_statement_handler): Allow RAPTOR_IDENTIFIER_TYPE_RESOURCE and RAPTOR_IDENTIFIER_TYPE_PREDICATE raptor predicate types again. * examples/example5.c: Update to librdf_new_query change from long ago 2006-03-18 Dave Beckett * librdf/Makefile.am: fix make libraptor.la & librasqal.la rules 2006-03-15 Dave Beckett * COPYING, COPYING.LIB, README.html, TODO.html, librdf/rdf_parser_raptor.c: docs 2006-03-14 Dave Beckett * configure.ac: require rasqal 0.9.12 2006-03-13 Dave Beckett * configure.ac: BDB 4.4 now exists 2006-03-10 Dave Beckett * librdf/rdf_query.c: (main): Cast for size_t 2006-03-09 Dave Beckett * librdf/rdf_parser_raptor.c: Add close_fh flag to librdf_parser_raptor_stream_context to manage tidying up a FILE*. (librdf_parser_raptor_parse_file_handle_as_stream): Added close_fh flag to ask for fclose(fh) on exit. (librdf_parser_raptor_parse_as_stream_common): Do not fclose(fh) before it actually likely gets read. (librdf_parser_raptor_serialise_finished): fclose(fh) here if asked for. * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_parse_file_handle_as_stream): Work with NULL base_uri. 2006-03-05 Dave Beckett * configure.ac: Require raptor 1.4.9 now 2006-03-02 Dave Beckett * librdf/rdf_log.h, librdf/rdf_serializer.h, librdf/rdf_serializer_internal.h: Include raptor.h when raptor definitions are used in headers 2006-02-19 Dave Beckett * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_get_next_statement): Remove bad use of fclose() on a FILE* not opened here. * AUTHORS: update me 2006-02-15 Dave Beckett * configure.ac, src/win32_rdf_config.h: Bumped version to 1.0.4 * Switched to Subversion version control. CVS tag for redland 1.0.3: redland_1_0_3 Subversion revision ID for redland 1.0.3: r8564 * Snapshotted redland_1_0_3 for 1.0.3 release 2006-02-11 Dave Beckett * librdf/rdf_node.c (librdf_new_node_from_literal, librdf_new_node_from_typed_literal): Fail if both a datatype URI/datatype flag and a language is given. Fixes issue 0000069 http://bugs.librdf.org/mantis/view.php?id=69 (main): Add tests for this. * librdf/rdf_digest_sha1.c (librdf_digest_sha1_constructor): Fix over eager docstring fix. * librdf/rdf_digest_md5.c (librdf_digest_md5_constructor): Fix over eager docstring fix. 2006-01-26 Dave Beckett * configure.ac, Makefile.am, librdf/rdf_storage.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_internal.h: Added PostgreSQL storage backend contributed by Shi Wenzhong based on the MySQL backend. Fixes issue 0000046 http://bugs.librdf.org/mantis/view.php?id=46 * librdf/rdf_init.c (librdf_world_get_genid): Include process ID in generated blank ID . Fixes bug 0000037 http://bugs.librdf.org/mantis/view.php?id=37 (patch from Marc Powell) * utils/rdfproc.1: update storage, parser, query names * docs/redland-sections.txt: move REDLAND_DEPRECATED to general * docs/tmpl/unused.sgml: internal tokens 2006-01-25 Dave Beckett * raptor/docs/tmpl/section-feature.sgml: Sort RAPTOR_FEATURE_WRITER_XML_DECLARATION * configure.ac: Adjust byte, u32, u64 check * docs/redland-sections.txt: Removed never-existed function prototype librdf_world_set_uris_hash * librdf/rdf_init.h: Removed never-existed function prototype librdf_world_set_uris_hash * librdf/rdf_query_results.c, librdf/rdf_node.c, librdf/rdf_stream.h, librdf/rdf_node.h, librdf/rdf_storage.c: autodocs * librdf/rdf_storage.h: Removed never-existed function prototype librdf_storage_get * docs/redland-sections.txt: librdf_storage_get does not exist * docs/redland-sections.txt: Removed never-existed function prototype librdf_iterator_finished * librdf/rdf_iterator.h: Removed never-existed function prototype librdf_iterator_finished * librdf/rdf_files.h: Deprecated librdf_files_temporary_file_name * librdf/rdf_files.c (librdf_files_temporary_file_name): Deprecated * docs/redland-sections.txt: Add librdf_serializer_serialize_model_to_iostream 2006-01-16 Dave Beckett * redland.rdf.in: use download.librdf.org * rasqal/docs/librasqal.3: Updates for 0.9.11 * rasqal/fix-groff-xhtml: style edits 2006-01-15 Dave Beckett * rasqal/src/rasqal_query.c: Change results indexing when using ORDER; the query->results_count is now a count (again) so starts from 1 when there is at least 1 result, indexing into item 0 of the query->results_sequence sequence. (rasqal_query_results_update): If result_count goes beyond range, adjust it down and return. (rasqal_query_execute): If a results sequence is created, but it is empty, set result count to 0, otherwise immediately check if it is finished by the limit/offset rules. (rasqal_query_results_next): Check result_count is finished and adjust down if it was. (rasqal_query_results_get_bindings, rasqal_query_results_get_binding_value, rasqal_query_results_get_binding_value_by_name): Adjusted to use result_count offset -1. * rasqal/src/rasqal_engine.c (rasqal_engine_check_limit_offset): Do not muck about with result_count here. 2006-01-12 Dave Beckett * rasqal/src/Makefile.am: Add strcasecmp_test_LDADD to link in libraries on some platforms. * rasqal/src/Makefile.am, rasqal/src/rasqal-config.1, rasqal/src/rasqal-config.in, rasqal/src/rasqal_general.c, rasqal/src/rasqal.h, rasqal/src/rasqal_engine.c, rasqal/src/rasqal_expr.c, rasqal/src/rasqal_graph_pattern.c, rasqal/src/rasqal_internal.h, rasqal/src/rasqal_map.c, rasqal/src/rasqal_query_test.c, rasqal/src/rasqal_raptor.c, rasqal/src/rasqal_redland.c, rasqal/src/rasqal_skiplist.c, rasqal/src/rasqal_xsd_datatypes.c, rasqal/src/rdql_common.h, rasqal/src/rdql_lexer.l, rasqal/src/rdql_parser.y, rasqal/src/sparql_common.h, rasqal/src/sparql_lexer.l, rasqal/src/sparql_parser.y, rasqal/src/win32_rasqal_config.h: Copyright 2006 * rasqal/src/rasqal_query.c (rasqal_query_results_get_triple): Skip ill-formed triples with an unbound variable or the wrong type and give a warning. * rasqal/tests/sparql/ValueTesting/Makefile.am: Add boolean tests to dist. * rasqal/src/rasqal_literal.c (rasqal_literal_string_to_native): Accept "1" as an xsd:boolean true. 2006-01-11 Dave Beckett * rasqal/tests/sparql/ValueTesting/boolean-0.n3, rasqal/tests/sparql/ValueTesting/boolean-equiv-FALSE-result.n3, rasqal/tests/sparql/ValueTesting/boolean-equiv-FALSE.rq, rasqal/tests/sparql/ValueTesting/boolean-equiv-TRUE-result.n3, rasqal/tests/sparql/ValueTesting/boolean-equiv-TRUE.rq, rasqal/tests/sparql/ValueTesting/boolean-equiv-xsdType-result.n3, rasqal/tests/sparql/ValueTesting/boolean-equiv-xsdType.rq, rasqal/tests/sparql/ValueTesting/boolean-logical-OR-result.n3, rasqal/tests/sparql/ValueTesting/boolean-logical-OR.rq, rasqal/tests/sparql/ValueTesting/manifest.n3: Added more boolean tests from DAWG (unapproved) 2006-01-10 Dave Beckett * rasqal/src/rasqal_engine.c: (rasqal_graph_pattern_get_next_match, rasqal_engine_get_next_result): Return errors when query fails due to unimplemented sequence/union of graph patterns. * rasqal/utils/Makefile.am: Add src dir to CPPFLAGS * rasqal/src/rasqal_query.c: (rasqal_query_results_get_triple, rasqal_query_results_next_triple): Do not crash with DESCRIBE, return an empty graph always. 2006-01-06 Dave Beckett * rasqal/configure.ac: Add --disable-pcre and --disable-xml2 options to configure to prevent automatic use of libpcre or libxml2 when found. Patch from Mike Frysinger. Addresses Issue#0000052 - http://bugs.librdf.org/mantis/view.php?id=52 * rasqal/tests/sparql/ExprBuiltins/Makefile.am: Add u/iri tests to dist * rasqal/tests/sparql/ExprBuiltins/Makefile.am: Add langMatches tests to dist * rasqal/tests/sparql/ValueTesting/Makefile.am: Add typePromotion tests to dist * rasqal/src/rasqal.h: rasqal_op: RASQAL_EXPR_LANGMATCHES is last * rasqal/src/rasqal_expr.c (rasqal_expression_evaluate): Make LANG() return "" for non-literals as tests depend on it. Return "" not "-". Update LANGMATCHES() to make the wildcard the second arg; still does not do proper subtag matches. * rasqal/tests/sparql/ExprBuiltins/Makefile.am: q-langMatches-1 works 2006-01-05 Dave Beckett * rasqal/src/rasqal_query.c: Do not emit XML header here as raptor 1.4.8 xml writer does that automatically now. 2006-01-03 Dave Beckett * rasqal/src/rasqal_expr.c (rasqal_expression_evaluate): Add proper error checking to expression evaluating for arguments to unary operators UMINUS, TILDE and BANG. * rasqal/tests/sparql/ExprEquals/result-eq2-1.ttl, rasqal/tests/sparql/ExprEquals/result-eq2-graph-1.ttl, rasqal/tests/sparql/ValueTesting/dateTime-tz0.rq, rasqal/tests/sparql/ValueTesting/dateTime-tz1.rq, rasqal/tests/sparql/ValueTesting/extendedType-ne-pass.rq, rasqal/tests/sparql/ValueTesting/manifest.n3, rasqal/tests/sparql/ValueTesting/roman-result.n3, rasqal/tests/sparql/ValueTesting/typePromotion-0.n3, rasqal/tests/sparql/ValueTesting/typePromotion-decimal-decimal-fail-result.n3, rasqal/tests/sparql/ValueTesting/typePromotion-decimal-decimal-fail.rq, rasqal/tests/sparql/ValueTesting/typePromotion-decimal-decimal-pass-result.n3, rasqal/tests/sparql/ValueTesting/typePromotion-decimal-decimal-pass.rq: Updated DAWG test cases from CVS 2006-01-02 * rasqal/tests/sparql/ValueTesting/Makefile.am: Added expected test failures: typePromotion-decimal-decimal-fail * rasqal/tests/sparql/ExprBuiltins/Makefile.am: Added expected test failures: datatype-1 LangMatches-1 LangMatches-2 LangMatches-3 LangMatches-4 * rasqal/tests/sparql/ExprBuiltins/data-builtin-1.ttl, rasqal/tests/sparql/ExprBuiltins/data-langMatches.ttl, rasqal/tests/sparql/ExprBuiltins/manifest.ttl, rasqal/tests/sparql/ExprBuiltins/q-iri-1.rq, rasqal/tests/sparql/ExprBuiltins/q-langMatches-1.rq, rasqal/tests/sparql/ExprBuiltins/q-langMatches-2.rq, rasqal/tests/sparql/ExprBuiltins/q-langMatches-3.rq, rasqal/tests/sparql/ExprBuiltins/q-langMatches-4.rq, rasqal/tests/sparql/ExprBuiltins/result-iri-1.ttl, rasqal/tests/sparql/ExprBuiltins/result-langMatches-1.ttl, rasqal/tests/sparql/ExprBuiltins/result-langMatches-2.ttl, rasqal/tests/sparql/ExprBuiltins/result-langMatches-3.ttl, rasqal/tests/sparql/ExprBuiltins/result-langMatches-4.ttl, rasqal/tests/sparql/ExprBuiltins/result-str-4.ttl: Updated DAWG test cases from CVS 2006-01-02 * raptor/src/raptor_namespace.c (main): Cast for string 2006-01-02 Dave Beckett * raptor/src/n3_lexer.l: Apply more turtle to n3 changes for names. * raptor/src/n3_parser.y: Update N3 parser to turtle. * raptor/src/n3_lexer.l: Update N3 lexer to turtle. * raptor/src/raptor_general.c, raptor/src/raptor_namespace.c, raptor/src/turtle_parser.y, raptor/src/turtle_lexer.l: 2006 and urls * raptor/tests/turtle/Makefile.am: Added test-23 * raptor/tests/turtle/test-23.out, raptor/tests/turtle/test-23.ttl: Test long literal ending in a double quote * raptor/tests/turtle/manifest.ttl: Added test-23 testing long literal ending in a double quote * raptor/src/turtle_common.c (raptor_stringbuffer_append_turtle_string): Fix comment to match code and report hex char of bad escapes. * raptor/src/turtle_lexer.l: Try to handle \-escapes inside """ properly. * raptor/tests/turtle/README.txt: url * raptor/tests/turtle/Makefile.am: Add TEST_MANIFEST_FILES to tests.zip * raptor/tests/turtle/manifest-bad.ttl, raptor/tests/turtle/manifest.ttl: Updated manifests from Arjohn Kampman * raptor/src/turtle_parser.y (DECIMAL_LITERAL): Added turtle decimal and double after SPARQL 2005-11-23 * raptor/src/turtle_lexer.l: Added turtle decimal and double after SPARQL 2005-11-23 * raptor/tests/turtle/Makefile.am, raptor/tests/turtle/test-19.out, raptor/tests/turtle/test-21.out, raptor/tests/turtle/test-21.ttl, raptor/tests/turtle/test-22.out, raptor/tests/turtle/test-22.ttl: Added decimal/double/integer + and - checks from http://lists.w3.org/Archives/Public/public-cwm-talk/2005OctDec/0017.html * rasqal/tests/sparql/ExprEquals/result-eq2-graph-1.ttl: new result * rasqal/docs/tmpl/section-literal.sgml: Added rasqal_new_decimal_literal * rasqal/docs/tmpl/section-expression.sgml: Added @RASQAL_EXPR_LANGMATCHES: * rasqal/docs/rasqal-sections.txt: Added rasqal_new_decimal_literal * rasqal/src/sparql_parser.y: Updates for SPARQL Query Language for RDF, 23 November 2005 http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/ Including many renamings of tokens to match grammar. (DECIMAL_LITERAL): Added. (GraphNodeListNotEmpty): Renamed from ItemList (GraphNode): Renamed from Object (GraphTerm): Renamed from RDFTerm. Added DECIMAL_LITERAL option. (VarOrTerm): Added. (VarOrBnodeOrURI): Replaced by VarOrBlankNodeOrIRIref. (Select/Construct/Describe/AskQuery): Renamed from *Clause. (Prolog): Re-added. (BuiltInCall): Added LANGMATCHES option. * rasqal/src/sparql_lexer.l (DECIMAl, DOUBLE, EXPONENT): Added. Support SPARQL decimal and double literal syntax and return new DECIMAL_LITERAL when there is a '.' else FLOATING_LITERAL with an EXPONENT * rasqal/src/rasqal_literal.c (rasqal_new_decimal_literal): Added to make a decimal literal (xsd:decimal). * rasqal/src/rasqal.h: Added prototype for rasqal_new_decimal_literal * rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/Makefile.am: syntax-general-03.rq and syntax-function-01.rq now work (7 failures remain) * rasqal/tests/sparql/ExprEquals/result-eq2-1.ttl, rasqal/tests/sparql/ExprEquals/query-eq-2.rq, rasqal/tests/sparql/ExprEquals/query-eq-graph-2.rq, rasqal/tests/sparql/ExprEquals/Makefile.am, rasqal/tests/sparql/ExprEquals/data-eq.ttl, rasqal/tests/sparql/ExprEquals/manifest.n3: Updates for decimal syntax changes and equality rules 2006-01-01 Dave Beckett * rasqal/src/sparql_parser.y (PrefixDeclOpt): gcc const string warning fix. * rasqal/src/sparql_parser.y (PrefixDeclOpt): Generate a warning if a PREFIX appears more than once. Check added after update in http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/ * raptor/src/raptor_namespace.c (raptor_namespaces_find_namespace): Handle searching for default namespace with prefix=NULL. (main): Add test code for above. * rasqal/src/rasqal_expr.c (rasqal_expression_evaluate): Added SPARQL trinary logic evaluation of AND and OR expressions for T,F,E following the truth table in http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/#truthTable * rasqal/src/rasqal_expr.c (rasqal_expression_clear, rasqal_expression_visit, rasqal_expression_print, rasqal_expression_is_constant): Added SPARQL_EXPR_LANGMATCHEs to switch statements as a new 2-argument expression. (rasqal_expression_evaluate): Added a simple evaluation for SPARQL_EXPR_LANGMATCHES that handles '*' and otherwise does a case independent string compare. This is not a full implementation by any means. Support for the new SPARQL keyword langMatches added in http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/ * rasqal/src/sparql_parser.y (BuiltInCall): Added SPARQL langMatches 2-argument expresson after addition in http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/ * rasqal/src/rasqal.h: Added SPARQL_EXPR_LANGMATCHES for SPARQL langMatches expression * rasqal/src/sparql_lexer.l: Allow _ at the start of sparql variable names, as changed in http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/ (enum sparql_name_check_flags): Remove SPARQL_NAME_CHECK_NO_UL_FIRST for varname. (NCCHAR1p): Renamed from NCCHAR1 - no _. (NCCHAR1): Added to aloow _ (VARNAME, NCCHAR, NCNAME): No need to use _ here, NCCHAR1 has it. (NCNAME_PREFIX): Use NCCHAR1p at start, no _ still. * rasqal/src/sparql_lexer.l, rasqal/src/sparql_parser.y: Added LANGMATCHES token (case independent) new in http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/ * rasqal/src/sparql_lexer.l: Allow isiri (case independent) returning ISURI token redland-1.0.17/redland.sln0000644000175000017500000001035610412162550012262 00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rasqal", "rasqal\win32\rasqal.vcproj", "{B72BB9A4-C889-4242-8188-34133944DC65}" ProjectSection(ProjectDependencies) = postProject {D24FB457-A295-4237-8D5E-92ACBBA10139} = {D24FB457-A295-4237-8D5E-92ACBBA10139} {F48C108E-B937-4D8C-A308-9C257C5D0D3D} = {F48C108E-B937-4D8C-A308-9C257C5D0D3D} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librdf", "librdf\win32\librdf.vcproj", "{2EF6F83E-DACB-4958-B0C0-A9F34476127A}" ProjectSection(ProjectDependencies) = postProject {B72BB9A4-C889-4242-8188-34133944DC65} = {B72BB9A4-C889-4242-8188-34133944DC65} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rapper", "raptor\win32\rapper.vcproj", "{1FFF7A31-D1A9-4516-AB07-4D415ABAB733}" ProjectSection(ProjectDependencies) = postProject {F48C108E-B937-4D8C-A308-9C257C5D0D3D} = {F48C108E-B937-4D8C-A308-9C257C5D0D3D} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raptor", "raptor\win32\raptor.vcproj", "{F48C108E-B937-4D8C-A308-9C257C5D0D3D}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curllib", "..\curl-7.13.2\lib\curllib.vcproj", "{59ED01CF-49C8-42C5-846F-AAF0A5F3B437}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "roqet", "rasqal\win32\roqet.vcproj", "{143A879E-BD81-4EF4-88EE-851D978304FE}" ProjectSection(ProjectDependencies) = postProject {B72BB9A4-C889-4242-8188-34133944DC65} = {B72BB9A4-C889-4242-8188-34133944DC65} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcre", "..\pcre\6.4\pcre-6.4-src\pcre\pcre.vcproj", "{D24FB457-A295-4237-8D5E-92ACBBA10139}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {B72BB9A4-C889-4242-8188-34133944DC65}.Debug.ActiveCfg = Debug|Win32 {B72BB9A4-C889-4242-8188-34133944DC65}.Debug.Build.0 = Debug|Win32 {B72BB9A4-C889-4242-8188-34133944DC65}.Release.ActiveCfg = Release|Win32 {B72BB9A4-C889-4242-8188-34133944DC65}.Release.Build.0 = Release|Win32 {2EF6F83E-DACB-4958-B0C0-A9F34476127A}.Debug.ActiveCfg = Debug|Win32 {2EF6F83E-DACB-4958-B0C0-A9F34476127A}.Debug.Build.0 = Debug|Win32 {2EF6F83E-DACB-4958-B0C0-A9F34476127A}.Release.ActiveCfg = Release|Win32 {2EF6F83E-DACB-4958-B0C0-A9F34476127A}.Release.Build.0 = Release|Win32 {1FFF7A31-D1A9-4516-AB07-4D415ABAB733}.Debug.ActiveCfg = Debug|Win32 {1FFF7A31-D1A9-4516-AB07-4D415ABAB733}.Debug.Build.0 = Debug|Win32 {1FFF7A31-D1A9-4516-AB07-4D415ABAB733}.Release.ActiveCfg = Release|Win32 {1FFF7A31-D1A9-4516-AB07-4D415ABAB733}.Release.Build.0 = Release|Win32 {F48C108E-B937-4D8C-A308-9C257C5D0D3D}.Debug.ActiveCfg = Debug|Win32 {F48C108E-B937-4D8C-A308-9C257C5D0D3D}.Debug.Build.0 = Debug|Win32 {F48C108E-B937-4D8C-A308-9C257C5D0D3D}.Release.ActiveCfg = Release|Win32 {F48C108E-B937-4D8C-A308-9C257C5D0D3D}.Release.Build.0 = Release|Win32 {59ED01CF-49C8-42C5-846F-AAF0A5F3B437}.Debug.ActiveCfg = Debug|Win32 {59ED01CF-49C8-42C5-846F-AAF0A5F3B437}.Debug.Build.0 = Debug|Win32 {59ED01CF-49C8-42C5-846F-AAF0A5F3B437}.Release.ActiveCfg = Release|Win32 {59ED01CF-49C8-42C5-846F-AAF0A5F3B437}.Release.Build.0 = Release|Win32 {143A879E-BD81-4EF4-88EE-851D978304FE}.Debug.ActiveCfg = Debug|Win32 {143A879E-BD81-4EF4-88EE-851D978304FE}.Debug.Build.0 = Debug|Win32 {143A879E-BD81-4EF4-88EE-851D978304FE}.Release.ActiveCfg = Release|Win32 {143A879E-BD81-4EF4-88EE-851D978304FE}.Release.Build.0 = Release|Win32 {D24FB457-A295-4237-8D5E-92ACBBA10139}.Debug.ActiveCfg = Debug|Win32 {D24FB457-A295-4237-8D5E-92ACBBA10139}.Debug.Build.0 = Debug|Win32 {D24FB457-A295-4237-8D5E-92ACBBA10139}.Release.ActiveCfg = Release|Win32 {D24FB457-A295-4237-8D5E-92ACBBA10139}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal redland-1.0.17/ChangeLog.50000644000175000017500000065516711317770025012076 000000000000002004-12-31 Dave Beckett * raptor/raptor_rss.c (raptor_rss10_serialize_terminate): Free all namespaces, now they are not stacked explicitly. Free namespace stack. (raptor_rss10_build_xml_names): Use raptor_new_namespace and don't start the rdf namespace. (raptor_rss10_build_xml_names): Use raptor_new_namespace and don't start the namespaces ((raptor_rss10_serialize_end): Make a namespace stack here, with only xml: defined. * raptor/raptor_xml_writer.c (raptor_xml_writer_start_namespace_full): Deleted. (main): Declare the foo namespace but don't start it, so that the xml writer will do that. * raptor/raptor_xml_writer.c: Optionally declare a namespace stack internally. (raptor_new_xml_writer): Add optional raptor_namespace_stack parameter, if NULL declare one internally. * rasqal/rasqal_query.c (rasqal_query_results_write): Added, writing query results in form of http://www.w3.org/TR/2004/WD-rdf-sparql-XMLres-20041221/ * rasqal/sparql_parser.y: Undef RASQAL_DEBUG 2 always * raptor/turtle_lexer.l, raptor/turtle_parser.y: Delete unused WS token * raptor/raptor_xml_writer.c, raptor/raptor_sax2.c, raptor/raptor_rss.c, raptor/raptor_rdfxml.c, raptor/raptor_internal.h, raptor/raptor.h, raptor/libraptor.3: Rename raptor_sax2_element to raptor_xml_element throughout. * raptor/raptor_internal.h: Added feature_start_uri to raptor_serializer * raptor/raptor_serialize.c (raptor_free_serializer): Tidy up any feature_start_uri set. (raptor_serializer_set_feature_string): Added, handling feature_start_uri. created from a passed in string. (raptor_serializer_get_feature_string): Added, handling feature_start_uri as a returned shared string. * raptor/raptor_parse.c (raptor_parser_set_feature_string): Added, always failing. (raptor_parser_get_feature_string): Added, always failing. * raptor/raptor.h: Added feature RAPTOR_FEATURE_START_URI Added prototypes for raptor_parser_set_feature_string, raptor_parser_get_feature_string, raptor_serializer_set_feature_string, raptor_serializer_get_feature_string and raptor_feature_value_type * raptor/raptor_feature.c: Added flag bits for string valued features. Added startUri (RAPTOR_FEATURE_START_URI) with a string value. (raptor_feature_value_type): Added, to return value of a feature. 2004-12-30 Dave Beckett * raptor/libraptor.3: Added SAX2 XML Element and XML Writer classes. * raptor/raptor_internal.h, raptor/raptor.h: Moved raptor_sax2_element and raptor_xml_writer to public API. * raptor/libraptor.3: Added rss-1.0 to raptor_new_serializer description. * raptor/libraptor.3: More updates for 1.4.3 2004-12-29 Dave Beckett * librdf/rdf_storage_sqlite.c: Make get_contexts fail rather than do useless things. * librdf/rdf_storage_sqlite.c: Moved GET_COLUMN* defines to top. Deleted all index_contexts - always supported. (librdf_storage_sqlite_statement_helper): Work when statement=NULL. (librdf_storage_sqlite_add_statements): Handle when max=4 for contexts. (librdf_storage_sqlite_serialise): Debug prepared query. (librdf_storage_sqlite_context_add_statement): Handle when max=4 for contexts. librdf_storage_sqlite_context_serialise_stream_context updated to add sqlite fields. (librdf_storage_sqlite_context_serialise): Implemented, based on librdf_storage_sqlite_serialise and related functions. * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_context_add_statement): Kill fixme, done. * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_set_helper): Add length arg. (librdf_storage_sqlite_uri_helper, librdf_storage_sqlite_blank_helper, librdf_storage_sqlite_literal_helper): Pass length to librdf_storage_sqlite_set_helper. (librdf_storage_sqlite_statement_helper): Do context nodes. (librdf_storage_sqlite_add_statements): Do context node field when present. (librdf_storage_sqlite_statement_operator_helper): Added, with content mostly from librdf_storage_sqlite_contains_statement. (librdf_storage_sqlite_contains_statement): Use above. (librdf_storage_sqlite_serialise, librdf_storage_sqlite_find_statements): Always free stringbuffer. (librdf_storage_sqlite_context_add_statement): Do context node field when present. (librdf_storage_sqlite_context_remove_statement): Implemented using librdf_storage_sqlite_statement_operator_helper. * librdf/rdf_storage_sqlite.c: Added sqlite_DB define for another 2/3 hide (librdf_storage_sqlite_serialise): Use raptor_stringbuffer_length(sb) for request length. * librdf/rdf_storage_sqlite.c: Alter GET_COLUMN* defines to take vm arg. * librdf/rdf_storage_sqlite.c: Fix sqlite_FREE and GET_COLUMN defines for sqlite API v3 * librdf/rdf_storage_sqlite.c: casts for c++ * librdf/rdf_storage_sqlite.c: Replace all use of fields with unsigned char* fields. * librdf/rdf_storage_sqlite.c (sqlite_string_escape): Emit 'string' - 2 more chars. (librdf_storage_sqlite_uri_helper, librdf_storage_sqlite_blank_helper): Malloc expressions based on actual lengths. (librdf_storage_sqlite_literal_helper): Remove ''s * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_set_helper): Take unsigned values string. (librdf_storage_sqlite_get_helper): Take unsigned expression string. (librdf_storage_sqlite_uri_helper): Use unsigned expression. (librdf_storage_sqlite_literal_helper): Use stringbuffer to build expression. (librdf_storage_sqlite_contains_statement): use stringbuffer to build request. * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_open): Auto-set new if file is missing. * librdf/rdf_storage_sqlite.c: Revert over EXEC named change. * librdf/rdf_storage_sqlite.c: Add macros sqlite_STATEMENT, sqlite_EXEC, sqlite_CLOSE, sqlite_FREE to hide more V2/V3 differences. (librdf_storage_sqlite_open): For V2 open failing, set rc. * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_get_next_common): Free temporary datatype uri * librdf/rdf_node.c (librdf_node_to_counted_string): Free temporary datatype_uri_string. * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_serialise_finished): Free any statement, context node. librdf_storage_sqlite_find_statements_stream_context add to store query_statement (librdf_storage_sqlite_find_statements): Store query statement. (librdf_storage_sqlite_find_statements_finished): Free any query statement, statement or context node. * librdf/rdf_storage_sqlite.c: Change context parts pzTail, ppVm to zTail, vm and for sqlite V2 use vm not vm & ppVm. * librdf/rdf_storage_sqlite.c: Use SQLITE_API with 2 or 3 to distinguish apis * configure.ac: Added --with-sqlite-version to choose V2 or V3. pkg-config gets the details. * librdf/rdf_storage_sqlite.c: Casts for c++ * librdf/rdf_serializer_raptor.c (librdf_serializer_raptor_set_namespace): Cast for c++ 2004-12-28 Dave Beckett * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_exec): Turn fprintf to debug message. (librdf_storage_sqlite_get_next_common): turn printing all column data into debug messages. (librdf_storage_sqlite_find_statements): Turn fprintf to debug message. * configure.ac: Set -g -DLIBRDF_DEBUG in maintainer mode - was lost somehow. * librdf/rdf_storage_sqlite.c: code style * librdf/rdf_storage_sqlite.c (sqlite_construct_select_helper): Added, to build serialise and find_statements query parts. (librdf_storage_sqlite_serialise): Move most of query building into sqlite_construct_select_helper and now call it. (librdf_storage_sqlite_find_statements): Use sqlite_construct_select_helper to build guts of query, then add the WHERE ... * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_serialise): Use raptor_stringbuffer to construct big request. (librdf_storage_sqlite_get_next_common): Add pointer to statement, context_node args. Fill in statement and context node from column values. Debug print out column names, values. (librdf_storage_sqlite_serialise_end_of_stream, librdf_storage_sqlite_serialise_next_statement, librdf_storage_sqlite_find_statements_next_statement, ): Update call to librdf_storage_sqlite_get_next_common. 2004-12-27 Dave Beckett * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_get_helper, librdf_storage_sqlite_add_statements, librdf_storage_sqlite_context_add_statement): Use raptor_stringbuffer to construct requests. * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_set_helper): Use raptor_stringbuffer to construct request. * librdf/rdf_storage_sqlite.c: Added TRIPLE_NONE node_type (librdf_storage_sqlite_node_helper): Fail with NULL node. (librdf_storage_sqlite_statement_helper): Handle NULL nodes, set ID to -1, type to TRIPLE_NONE. (librdf_node_to_sqlite_string): Deleted, not used. (librdf_storage_sqlite_find_statements): Use raptor_stringbuffer to construct request. * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_literal_helper): Use IDs for datatype URI. (librdf_storage_sqlite_open): Make uriindex. * librdf/rdf_storage_sqlite.c (sqlite_string_escape): Escape ' as '' not \' (librdf_storage_sqlite_uri_helper): Renamed from librdf_storage_sqlite_store_uri_helper (librdf_storage_sqlite_blank_helper): Renamed from librdf_storage_sqlite_store_blank_helper (librdf_storage_sqlite_literal_helper): Added (librdf_storage_sqlite_node_helper): Use librdf_storage_sqlite_literal_helper. (librdf_storage_sqlite_open): If new, unlink the file so no need to do DROP TABLE. * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_init): is_new flag set right, really really. Added data-driven table descriptions - table_info, NTABLES, sqlite_table_numbers, sqlite_tables, triple_part, triple_node_type, triples_fields. Reorder helper functions. (sqlite_string_escape): Now always obeys raw_len and nul-terminates the output. (librdf_storage_sqlite_exec): Debug print all SQL exec (librdf_storage_sqlite_set_helper, librdf_storage_sqlite_get_helper): Added, using table info. (librdf_storage_sqlite_store_uri_helper): Added, returns or makes an ID for the given URI. (librdf_storage_sqlite_store_blank_helper): Added, returns or makes an ID for the given blank node ID. (librdf_storage_sqlite_node_helper): Added, turns a librdf_node into appropriate table IDs, node type and returns to user. (librdf_storage_sqlite_statement_helper): Uses librdf_storage_sqlite_node_helper to get node ids, types and field names for all of a statement. (librdf_storage_sqlite_open): Use data tables for DROP TABLE, CREATE TABLE (librdf_storage_sqlite_size): Use librdf_storage_sqlite_exec only. (librdf_storage_sqlite_add_statements): Updated dummy INSERT for new schema. (librdf_storage_sqlite_contains_statement): Use librdf_storage_sqlite_statement_helper to build query. (librdf_storage_sqlite_context_add_statement): Use librdf_storage_sqlite_statement_helper to build INSERT. Ignores context fields for now. 2004-12-26 Dave Beckett * utils/rdfproc.c: Added size command calling librdf_model_size. * librdf/rdf_storage_sqlite.c: Handle sqlite3 and sqlite2 (librdf_storage_sqlite_init): Init is_new correctly. (librdf_storage_sqlite_open): Create tables, indexes when new. (librdf_storage_sqlite_get_1int_callback): Grab count value from argv[0] (librdf_storage_sqlite_size): Works. (librdf_storage_sqlite_add_statements): Dummy INSERT works. (librdf_storage_sqlite_contains_statement): Dummy sql added. librdf_storage_sqlite_serialise_stream_context added sqlite3 fields (librdf_storage_sqlite_serialise, librdf_storage_sqlite_get_next_common, librdf_storage_sqlite_serialise_finished): sqlite3 support librdf_storage_sqlite_find_statements_stream_context added sqlite3 fields (librdf_storage_sqlite_find_statements, librdf_storage_sqlite_find_statements_finished): sqlite3 support (librdf_storage_sqlite_context_add_statement): Dummy INSERT added. (librdf_init_storage_sqlite): Storage name now 'sqlite'. 2004-12-25 Dave Beckett * configure.ac: Check for sqlite3.h or sqlite.h after getting sqlite paths. * configure.ac: Use pkg-config sqlite3 or pkg-config sqlite2 * librdf/rdf_serializer.c, librdf/rdf_model.c (main): Cast for size_t to int * librdf/rdf_concepts.c: Removed librdf_concept_labels - never used. * raptor/raptor_rss.c (raptor_rss_parser_processNode): Turn val into (raptor_rss10_emit_item): Always serialize rss:items at the end of an rss channel. * raptor/raptor_xml_writer.c, raptor/raptor_xml.c, raptor/raptor_utf8.c, raptor/raptor_sax2.c, raptor/raptor_rss.c, raptor/raptor_general.c: Casts for c++. Rename variables namespace to nspace. 2004-12-24 Dave Beckett * raptor/raptor_www_test.c (main): Cast for size_t 2004-12-23 Dave Beckett * raptor/raptor_rss.c (raptor_rss10_serialize_statement): Fix item URI check to use correct URI. In debugging unknown typed node, print type URI. * raptor/raptor_rss.c (raptor_rss10_serialize_statement): Do not look in items with no URI. (raptor_rss10_build_xml_names): Do not make qnames for types with no namespace. * raptor/raptor_rss.c (raptor_rss10_build_items): Do nothing if there is no seq_uri * raptor/raptor_rss.c (raptor_init_serializer_rss10): Give rss 1.0 a URI * librdf/rdf_serializer.c (librdf_get_serializer_factory): Ensure that if mime_type or type_uri are not NULL, the factory must have a non-NULL item and it must match. * librdf/rdf_serializer.c (librdf_get_serializer_factory): Ensure that if mime_type or type_uri are not NULL, the factory must have a non-NULL item and it must match. * librdf/rdf_parser.c (librdf_get_parser_factory): Ensure that if mime_type or type_uri are not NULL, the factory must have a non-NULL item and it must match. 2004-12-21 Dave Beckett * librdf/rdf_storage_mysql.c (librdf_storage_mysql_init): Applied patch from Morten to only use mysql_real_escape_string if a connection was made. (librdf_storage_mysql_find_statements_in_context_next_statement): Do not call librdf_storage_mysql_find_statements_in_context_finished when errors happen, the iterator class will do that on destruction. (librdf_storage_mysql_get_contexts_next_context): Do not call librdf_storage_mysql_get_contexts_finished when errors happen, the iterator class will do that on destruction. * raptor/raptor_rss.c: Added rss_namespace_prefix_strings to list namespaces to declare. raptor_rss10_serializer_context gains raptor_namespace_stack nstack field. (raptor_rss10_serialize_init): Init the namespace stack. (raptor_rss10_serialize_terminate): Clean namespace stack and any defined qnames. (raptor_rss10_emit_item): Padding. (raptor_rss10_serialize_end): Write namespace decls using stack. * raptor/raptor_rss.c: Rename some destructors more normally: (raptor_free_rss_item): Renamed from raptor_item_free. (raptor_free_rss_items): Renamed from raptor_rss_items_free. (raptor_rss10_move_statements, raptor_rss10_store_statement): Record field counts per item. (raptor_rss10_build_items): Find the rdf:_ items and put them into a raptor sequence. (raptor_rss10_emit_item): Skeleton rss item writer. (raptor_rss10_serialize_end): Make the final structures and do the serializing in skeleton form. 2004-12-20 Dave Beckett * raptor/raptor_rss.c: Added seq_uri to raptor_rss10_serializer_context (raptor_rss10_serialize_terminate): Tidy seq_uri (raptor_rss10_move_statements, raptor_rss10_store_statement): Ignore checking fields with no URI. (raptor_rss10_serialize_statement): For rdf:Seq node, store the URI or blank node - as fake URI. Make fake object node correctly for general statements. * raptor/raptor_rss.c (raptor_rss_common_init): Prevent 2x initialising. (raptor_item_free): Free type URI (raptor_rss10_serialize_terminate): Call raptor_rss_common_terminate. (raptor_rss10_move_statements): Use RAPTOR_IDENTIFIER_TYPE_PREDICATE set raptor_sequence_set_at destroy overwritten object. (raptor_rss10_store_statement): Use RAPTOR_IDENTIFIER_TYPE_PREDICATE Make fake URIs from blank node strings and free them. * raptor/raptor_general.c (raptor_free_statement): Handle more statement part types. * raptor/raptor_rss.c: RAPTOR_RSS_FIELDS_SIZE now stops before UNKNOWN for real field names. (raptor_rss10_move_statements): Added, to move statements from the sequence of triples to below a typed node once a new typed node of the given type appears. (raptor_rss10_store_statement): Added, to store a given statement either below an existing typed node or in a sequence of triples if it can't be found one. * raptor/raptor_rss.c (raptor_rss10_serialize_statement): iostream write turned into debug. 2004-12-19 Dave Beckett * raptor/raptor_uri.c (raptor_uri_print): Cast for gcc * raptor/raptor_rss.c: Use raptor_uri in raptor_rss_item. (raptor_rss_context_init, raptor_rss_context_terminate): Added and used in parser and serializer init and terminate. (raptor_rss10_serialize_init): Initialise list of triples, items. (raptor_rss10_serialize_terminate): Tidy up triples, items. (raptor_rss10_serialize_statement): Look for known typed nodes, identify ones matching rss 1.0 model and also look for the rdf:Seq. Store other triples for later. (raptor_rss10_serialize_end): Added skeleton. 2004-12-18 Dave Beckett * raptor/raptor_uri.c (raptor_uri_print): Added. * raptor/raptor.h: Added raptor_uri_print * raptor/raptor_general.c (raptor_statement_copy): Added statement copy constructor (raptor_free_statement): Added statement destructor. * raptor/raptor_internal.h: Added raptor_statement_copy and raptor_free_statement * raptor/raptor_rss.c: Moved parser namespace URIs to common code rss_namespace_uris. (raptor_rss_common_init, raptor_rss_common_terminate): Added to initialise and free up common rss items - namespace URIs, URIs for types and uris for properties. Added skeleton RSS 1.0 serializer (raptor_rss10_serialize_init, raptor_rss10_serialize_terminate, raptor_rss10_serialize_statement, raptor_rss10_serialize_finish_factory, raptor_rss10_serializer_register_factory, raptor_init_serializer_rss10): Added skeleton RSS 1.0 serializer factory and methods. * raptor/raptor_general.c (raptor_init): Added call to raptor_init_serializer_rss10 * raptor/raptor_internal.h: Added raptor_init_serializer_rss10 * raptor/raptor_rss.c (raptor_rss_parse_recognise_syntax): Add atom checks. 2004-12-17 Dave Beckett * raptor/tests/Makefile.am: Added RDF_MAYFAIL_XML_TEST_FILES,RDF_MAYFAIL_XML_OUT_FILES and rule check-mayfail-xml-rdf to run checks that may fail due to XML parser bugs. * raptor/raptor_iostream.c, raptor/raptor_nfc.c, raptor/raptor_rdfxml.c, raptor/raptor_sax2.c, raptor/raptor_serialize.c: Initialising possibly using uninitialised vars * raptor/raptor.h, raptor/raptor_internal.h, raptor/raptor_iostream.c, raptor/raptor_namespace.c, raptor/raptor_rdfxml.c, raptor/raptor_serialize.c, raptor/raptor_xml_writer.c, raptor/rdfdump.c: Casts for c++ * raptor/raptor_rdfxml.c: Fix using wrong element name in warnings. * raptor/raptor_rdfxml.c (raptor_xml_start_element_handler): Use raptor_sax2_element_set_attributes. * raptor/raptor_xml_writer.c (raptor_xml_writer_empty_element): Added. (raptor_xml_writer_start_element, raptor_xml_writer_end_element): Updated raptor_iostream_write_sax2_element calls (main): Add attributes and test writing empty element. * raptor/raptor_internal.h: Added raptor_sax2_element_set_attributes Added is_empty arg to raptor_iostream_write_sax2_element Added raptor_xml_writer_empty_element * raptor/raptor_sax2.c (raptor_sax2_element_set_attributes): Added. (raptor_print_sax2_element): tidy (raptor_iostream_write_sax2_element): Added is_empty arg and use it for form. 2004-12-14 Dave Beckett * raptor/libraptor.3: Updated for 1.4.3 so far * raptor/tests/turtle/README.txt, raptor/tests/turtle/rdfq-results.out, raptor/tests/turtle/test-00.out, raptor/tests/turtle/Makefile.am: Switch to base URI http://www.w3.org/2001/sw/DataAccess/df1/tests/ * raptor/tests/turtle/bad-08.ttl, raptor/tests/turtle/bad-09.ttl, raptor/tests/turtle/bad-10.ttl, raptor/tests/turtle/bad-11.ttl, raptor/tests/turtle/bad-12.ttl, raptor/tests/turtle/bad-13.ttl, raptor/tests/turtle/manifest-bad.ttl, raptor/tests/turtle/manifest.ttl, raptor/tests/turtle/test-13.out, raptor/tests/turtle/test-13.ttl, raptor/tests/turtle/Makefile.am, raptor/tests/turtle/bad-04.ttl, raptor/tests/turtle/bad-05.ttl, raptor/tests/turtle/bad-06.ttl, raptor/tests/turtle/bad-07.ttl: Import more bad turtle tests, initial manifest files * raptor/raptor_namespace.c (raptor_iostream_write_namespace): Handle ns->uri is NULL and no prefix, i.e. emitting xmlns="" * raptor/raptor_namespace.c (raptor_namespaces_format): Handle ns->uri is NULL and no prefix, i.e. emitting xmlns="" 2004-12-08 Dave Beckett * librdf/rdf_uri.c (librdf_new_uri_relative_to_base): Ask for 1 more char for new URI buffer for raptor_uri_resolve_uri_reference to allow inserting of a missing "/" path. * librdf/rdf_uri.c (librdf_new_uri_relative_to_base): Ask for 1 more char for new URI buffer for raptor_uri_resolve_uri_reference to allow inserting of a missing "/" path. * raptor/raptor_uri.c (raptor_default_new_uri_relative_to_base): Ask for 1 more char for new URI to allow inserting of a missing "/" path. * raptor/raptor_rfc2396.c (raptor_uri_resolve_uri_reference): Add debug message. When adding a missing path "/", set the path_len and the uri_len to match. (main): Added test when a missing abs / path is added. * rasqal/tests/rdql/testsuite/Makefile.am (check-rdql-correct): Set PATH then use -s $(srcdir) rather than lots of envariable passing. * rasqal/tests/rdql/testsuite/check-rdql: Merged in changes from check-sparql - use -s . argument now. * configure.ac: Delete changing PATH here for OSX. A bad idea as it makes the configure environment different from the user's. Added /opt/local to BDB search path for darwinports. * rasqal/rasqal_engine.c (rasqal_engine_execute_init): Init current_graph_pattern only if there are graph patterns. (rasqal_engine_get_next_result): Handle 0 graph patterns. * rasqal/tests/sparql/syntax/Makefile.am: Added manifest.n3 Invoke check-sparql-correct test * rasqal/tests/sparql/syntax/manifest.n3: Test manifest * rasqal/tests/sparql/syntax/result-0triples.n3: select with 0 triples result * rasqal/tests/sparql/syntax/Makefile.am: Added 0triples.rq * rasqal/tests/sparql/syntax/0triples.rq: Zero graph pattern triples * rasqal/tests/sparql/syntax/data.n3: typo * raptor/raptor_sequence.c (raptor_sequence_set_at, raptor_sequence_get_at): Check for non-negative idx * raptor/raptor_sequence.c (raptor_sequence_get_at): Fix index offset check 2004-12-07 Dave Beckett * rasqal/sparql_parser.y (PatternElementForms): Handle empty GraphPattern1 (NULL sequences) * rasqal/tests/sparql/part1/dawg-data-01.n3, rasqal/tests/sparql/part1/dawg-query-002, rasqal/tests/sparql/simple/dawg-tp-04.rq, rasqal/tests/sparql/simple/dawg-data-01.n3: foaf:knowns to foaf:knows 2004-12-02 Dave Beckett * raptor/rdfdump.c: Make a raptor_sequence of namespace declarations declared by '-f xmlns:foo="bar"' and then add them to the serializer when initialised. (rdfdump_free_namespace_decl): Added, to provide a helper to cleanup. * raptor/raptor_serialize.c (raptor_serialize_set_namespace): Call factory method declare_namespace. (raptor_rdfxml_serialize_declare_namespace): Copy the passed in namespace prefix, URI before storing the namespace. (raptor_rdfxml_serialize_start): Delete the namespace sequence contents as the namespaces are declared on the namespace stack, which is the new owner of the namespaces. * raptor/raptor_namespace.c (raptor_new_namespace_parts_from_string): Added, to decode things like "xmlns:foo='bar'" into prefix, uri strings. * raptor/raptor.h: Added prototype for raptor_new_namespace_parts_from_string. raptor_sequence_free_handler prototype changed to return void 2004-11-30 Dave Beckett * rasqal/tests/sparql/examples/ex2-1a-result.n3, rasqal/tests/sparql/examples/ex2-2a-result.n3, rasqal/tests/sparql/examples/ex2-3a-result.n3, rasqal/tests/sparql/examples/ex2-4a-result.n3, rasqal/tests/sparql/examples/ex3-result.n3: . * raptor/raptor_serialize.c (raptor_rdfxml_serialize_init): Add a sequence of user-declared namespaces. (raptor_rdfxml_serialize_terminate): Tidy sequence. (raptor_rdfxml_serialize_declare_namespace): Use sequence to store declared namespaces. (raptor_rdfxml_serialize_start): Declare used-defined namespaces and start them in the namespace stack. * raptor/raptor_namespace.c (raptor_new_namespace_from_uri): Added with raptor_new_namespace code. (raptor_new_namespace): Now a wrapper around raptor_new_namespace_from_uri. (raptor_namespace_copy): Use raptor_new_namespace_from_uri. * raptor/raptor_qname.c (raptor_iostream_write_qname): Added to write a qname to an iostream. * raptor/raptor.h: Add prototypes for raptor_iostream_write_qname, raptor_new_namespace_from_uri * raptor/raptor_rdfxml.c (raptor_xml_start_element_handler, raptor_xml_end_element_handler, raptor_xml_comment_handler, raptor_start_element_grammar, raptor_end_element_grammar, raptor_cdata_grammar): Update the use of xml_writer for building parseType="Literal" content to use an iostream. Use more sax2 methods rather than direct access to internals - still some left. (raptor_xml_parse_init, raptor_xml_parse_start, raptor_xml_parse_terminate, raptor_inscope_xml_language, raptor_inscope_base_uri): Move expat/libxml details to raptor_new_sax2, raptor_sax2_parse_start, raptor_free_sax2, raptor_sax2_inscope_xml_language, raptor_sax2_inscope_base_uri respectively. (raptor_xml_parse_chunk_): Deleted, moved to raptor_sax2_parse_chunk * raptor/raptor_xml_writer.c: Change to output to an iostream not build up a stringbuffer. (raptor_new_xml_writer): Add iostream arg, delete never-used canonicalize. (raptor_free_xml_writer): Remvoe stringbuffer. (raptor_xml_writer_start_element, raptor_xml_writer_end_element): Delete stringbuffer and use raptor_iostream_write_sax2_element. (raptor_xml_writer_cdata): Delete stringbuffer and use raptor_iostream_write_xml_escaped_string. (raptor_xml_writer_raw): Added to write just the bytes. (raptor_xml_writer_comment): Fixed to emit (raptor_xml_writer_as_string): Deleted. (main): Added with test case. * raptor/raptor_sax2.c (raptor_new_sax2, raptor_free_sax2, raptor_sax2_inscope_xml_language, raptor_sax2_inscope_base_uri, raptor_sax2_get_depth, raptor_sax2_inc_depth, raptor_sax2_dec_depth, raptor_sax2_parse_start, raptor_sax2_parse_chunk, raptor_sax2_element_get_element): Added. (raptor_iostream_write_sax2_element): Renamed from raptor_format_sax2_element and now writing to a raptor_iostream with no allocing/freeing buffers. * raptor/raptor_xml.c (raptor_iostream_write_xml_escaped_string): Added, to write an XML-escaped version of a string to an iostream 2004-11-29 Dave Beckett * raptor/raptor_namespace.c (raptor_iostream_write_namespace): Added to write a namespace to a raptor_iostream * raptor/raptor.h: Added raptor_iostream_write_namespace * raptor/Makefile.am: Added raptor_xml_writer_test * raptor/raptor_expat.c (raptor_expat_init): Take void* user data * raptor/raptor_internal.h: raptor_exp_init takes void* Add user_data to raptor_sax2 Added prototypes or raptor_new_sax2, raptor_free_sax2, raptor_sax2_parse_start, raptor_sax2_parse_chunk, raptor_sax2_parse_handle_errors, raptor_sax2_get_depth, raptor_sax2_inc_depth, raptor_sax2_dec_depth, raptor_sax2_inscope_xml_language, raptor_sax2_inscope_base_uri, raptor_sax2_element_get_element, raptor_iostream_write_sax2_element Deleted raptor_format_sax2_element, raptor_xml_writer_as_string and raptor_xml_writer_write_to_iostream Changed raptor_new_xml_writer to write to a raptor_iostream * raptor/raptor.h: Added raptor_iostream_write_xml_escaped_string and raptor_namespace_write * rasqal/rasqal_expr.c (rasqal_expression_evaluate): UMINUS, PLUS, MINUX, STAR, SLASH are now done with floating literals. * rasqal/rasqal_internal.h: Export rasqal_literal_as_floating * rasqal/rasqal_literal.c (rasqal_new_floating_literal): Changed to take a double arg (rasqal_literal_as_floating): Export. (rasqal_literal_compare): Improve promotion. Promote to float where needed, especially assuming strings could be a float. * rasqal/sparql_lexer.l, rasqal/rdql_lexer.l: Do sscanf here and call rasqal_new_floating_literal with the double. * rasqal/rasqal.h: rasqal_new_floating_literal takes a double arg * rasqal/tests/sparql/check-sparql, rasqal/tests/rdql/testsuite/check-rdql: diff backwards * rasqal/tests/sparql/part1/dawg-result-002.n3, rasqal/tests/sparql/part1/dawg-result-003.n3, rasqal/tests/sparql/simple/result-tp-01.n3, rasqal/tests/sparql/simple/result-tp-02.n3, rasqal/tests/sparql/simple/result-tp-03.n3, rasqal/tests/sparql/simple/result-tp-04.n3, rasqal/tests/sparql/part1/dawg-result-001.n3: Update to DAWG latest results removing rs:size triples. * rasqal/rasqal_literal.c (rasqal_literal_as_integer): For RASQAL_LITERAL_STRING, also try to evaluate it as a double with strtod, then return that cast to int if it worked. * rasqal/sparql_parser.y, rasqal/rdql_parser.y (UnaryExpression): Make unary plus and minus work; removes 2 shift/reduce conflicts. * rasqal/rasqal_expr.c: (rasqal_free_expression, rasqal_expression_foreach, rasqal_expression_evaluate, rasqal_expression_print): Added RASQAL_EXPR_UMINUS support. rasqal_op_labels: added uminus * rasqal/rasqal.h: Added RASQAL_EXPR_UMINUS 2004-11-26 Dave Beckett * raptor/raptor_internal.h: Added prototype for raptor_xml_writer_write_to_iostream * raptor/raptor_xml_writer.c (raptor_xml_writer_write_to_iostream): Added * raptor/raptor.h: Added prototype for raptor_iostream_write_stringbuffer * raptor/raptor_iostream.c: (raptor_iostream_write_stringbuffer) Added * configure.ac, rasqal/configure.ac, raptor/configure.ac: --with-dmalloc default is now no * librdf/Makefile.am: Remove rdf_storage_tstore.h rdf_storage_mysql.h 2004-11-25 Dave Beckett * raptor/configure.ac: If expat_source is empty, set it to auto so no path-to-source is added to libs, includes 2004-11-23 Dave Beckett * raptor/tests/ex-55.out, raptor/tests/ex-55.rdf: ex-55 * raptor/tests/Makefile.am: Added ex-55 * librdf/rdf_storage_mysql.h, librdf/rdf_storage_tstore.h: Deleted * configure.ac: Rip out STORAGE_OBJS code and make all storage modules have available/enabled set. memory is always available and required file, hashes are always available and enabled by default. Test for sqlite.h Reduce mysql min to 3.23.56 - should go lower. 2004-11-22 Dave Beckett * librdf/Makefile.am: Use STORAGE_ conditionals instead of @STORAGE_OBJS@ * librdf/rdf_storage.c: Delete rdf_storage_hashes.h and rdf_storage_list.h includes, they are called from rdf_storage.h already. (librdf_init_storage) Use STORAGE_ defines. * librdf/rdf_storage_sqlite.c: don't sleep now, this should be fixed later * librdf/rdf_storage.h: Use STORAGE_ defines. Delete rdf_storage_tstore.h and rdf_storage_mysql.h includes * librdf/rdf_storage.c (librdf_init_storage): Added call to librdf_init_storage_sqlite * librdf/Makefile.am: Added rdf_storage_sqlite.c * librdf/rdf_storage.h: added librdf_init_storage_sqlite prototype * librdf/rdf_storage_sqlite.c: sqlite storage 2004-11-21 Dave Beckett * rasqal/rasqal_engine.c (rasqal_new_graph_pattern_from_triples): Init current column to -1 so no execution or tidy happens. (rasqal_free_graph_pattern): Clean up until reach start_column, not 0. (rasqal_graph_pattern_init): Do triple init work only if there are triples. * rasqal/sparql_parser.y: s/puts/fputs(..., stdout)/ * rasqal/rasqal_engine.c (rasqal_new_graph_pattern_from_sequence): Fold sequence of 1 graph pattern into the return value, tidying up. (rasqal_graph_pattern_print): Print just the triple columns that are used. Print flags using words. (rasqal_graph_pattern_get_next_match): Note failing not-implemented sequence of graph_patterns. (rasqal_engine_prepare): Do not invoke rasqal_query_order_triples - does not make sense to do with the graph_pattern code. (rasqal_engine_get_next_result): Note failing not-implemented sequence of graph_patterns. Debug message when an optional graph pattern failed to patch. * rasqal/rasqal_expr.c (rasqal_variable_set_value): Debug fatal error when there is no name. 2004-11-20 Dave Beckett * rasqal/rasqal_engine.c (rasqal_new_graph_pattern_from_sequence): lose triples argument (rasqal_graph_pattern_get_next_match, rasqal_engine_get_next_result): Check and fail for sequence of graph_patterns. * rasqal/rasqal_internal.h: Update rasqal_new_graph_pattern_from_sequence to lose triples argument * rasqal/rdql_parser.y (rasqal_rdql_query_engine_prepare): Use rasqal_new_graph_pattern_from_triples * rasqal/rasqal_query.c (rasqal_new_query): Init triples here. (rasqal_query_print): Print graph_patterns * rasqal/rasqal_internal.h: Add graph_patterns sequence to rasqal_graph_pattern. Added prototypes for rasqal_new_graph_pattern_from_triples and rasqal_new_graph_pattern_from_sequence * rasqal/rasqal_engine.c (rasqal_new_graph_pattern_from_triples): Renamed from rasqal_new_graph_pattern (rasqal_new_graph_pattern_from_sequence): Added to handle a graph pattern as a sequence of graph patterns. (rasqal_free_graph_pattern): Handle cleanup for sequence. (rasqal_graph_pattern_print): Handle sequence and simplify. (rasqal_engine_execute_init): Abort with messsage if sequence has a NULL graph pattern in it. 2004-11-19 Dave Beckett * rasqal/rasqal_engine.c (rasqal_engine_execute_init): Init current_graph_pattern. (rasqal_engine_get_next_result): Attempt to walk through graph_patterns without failing on optional ones. * rasqal/rasqal_internal.h: Added current_graph_pattern to rasqal_query. * rasqal/sparql_lexer.l (sparql_token_print): Added UNION token * rasqal/sparql_parser.y: Added UNION token * rasqal/sparql_lexer.l: Added UNION|union keyword * rasqal/sparql_parser.y (rasqal_sparql_query_engine_prepare): Add graph pqttern of all triples found. * rasqal/rdql_parser.y (rasqal_rdql_query_engine_prepare): Add graph pqttern of all triples found. * rasqal/rasqal_engine.c (rasqal_new_graph_pattern): No triples_size. Don't init triple_meta here but on each execution. (rasqal_free_graph_pattern, rasqal_graph_pattern_get_next_match): update triple_meta offset (rasqal_graph_pattern_init): Added, to init for execution. (rasqal_graph_pattern_print): Added for debug printing. (rasqal_engine_execute_init): Use query->graph_patterns - init them with rasqal_graph_pattern_init (rasqal_engine_execute_finish): Do not delete query->graph_pattern. (rasqal_engine_get_next_result): Pick 0th item from query->graph_patterns to execute. * rasqal/rasqal_query.c (rasqal_new_query, rasqal_free_query): Init/free query->graph-patterns sequence * rasqal/rasqal_internal.h: Delete triples_count from rasqal_graph_pattern. Only use exactly what's needed - end-start+1 columns Added rasqal_graph_pattern_init and rasqal_graph_pattern_print prototypes * configure.ac: Doc fix, --with-mysql works for mysql 3/4 * rasqal/sparql_parser.y (PatternElementForms): 'SOURCE * ...' Warn this is ignored. 'Source VarOrURI ...' Set triple origin from the literal (UnaryExpressionNotPlusMinus): Delete ignored ArgList for now. * rasqal/rasqal_internal.h: Added rasqal_graph_pattern_adjust prototype * rasqal/rasqal_engine.c (rasqal_new_graph_pattern, rasqal_free_graph_pattern): Docs, code tidy. (rasqal_graph_pattern_adjust): Added, to shift graph pattern columns. (rasqal_graph_pattern_get_next_match): Code tidy. 2004-11-17 Dave Beckett * raptor/examples/grapper.c: Extensively updated to use GTK 2.4, 2.5 features when available. Triples/Errors windows have a scalable pane between them Triple columns can be sorted by clicking, width resized. All known parser features are available on the preferences menu. Added parser guessing button. Moved syntax menu to top of display. Updated about box fields to include more info when possible to display. * rasqal/rasqal_engine.c (rasqal_engine_get_next_result): More code tweaks * rasqal/rasqal_engine.c (rasqal_engine_get_next_result): Evaluate constraint_expression 2004-11-16 Dave Beckett * rasqal/rasqal_internal.h, rasqal/rasqal_engine.c: pattern_graph to graph_pattern * rasqal/rasqal_engine.c (rasqal_engine_get_next_result): Inner loop logic tidying. * rasqal/rasqal_engine.c (rasqal_engine_get_next_result): triples_size deleted, never used. * rasqal/rasqal_engine.c: source re-ordering * rasqal/rasqal_engine.c (rasqal_engine_prepare): set flags here. (rasqal_engine_execute_init): Always init a new pattern_graph. * rasqal/rasqal_engine.c (rasqal_engine_execute_init, rasqal_engine_run): Remove remaining use of query->column field. * rasqal/rasqal_internal.h: rasqal_query remove column field * rasqal/rasqal.h: words * rasqal/rasqal_engine.c: (rasqal_engine_execute_init); Added pattern_graph field, using rasqal_new_pattern_graph (rasqal_engine_execute_finish): Tidy up, deleting pattern_graph. (rasqal_graph_pattern_get_next_triple): Renamed from rasqal_engine_get_next_triple_pattern_result and using rasqal_pattern_graph argument. (rasqal_new_pattern_graph): tidy. (rasqal_free_pattern_graph): Delete the triple_meta array. (rasqal_engine_get_next_result): Use rasqal_graph_pattern_get_next_triple and evaluate the constraints here. * rasqal/rasqal_internal.h: rasqal_query rename to pattern_graph field * rasqal/rasqal_internal.h: rasqal_pattern_graph add column Remove rasqal_triple_meta field from rasqal_query and add graph_pattern field * rasqal/rasqal_internal.h: Update rasqal_new_pattern_graph prototype. * rasqal/rasqal_expr.c: Replace calloc() with RASQAL_CALLOC(type,...) * rasqal/rasqal_internal.h: Added rasqal_pattern_flags enum. Added rasqal_pattern_graph Added rasqal_new_pattern_graph, rasqal_free_pattern_graph prototypes. * rasqal/rasqal_engine.c (rasqal_new_pattern_graph, rasqal_free_pattern_graph): Added. * rasqal/rasqal_engine.c (rasqal_engine_get_next_triple_pattern_result): Added, split off from rasqal_engine_get_next_result. * rasqal/sparql_parser.y (rasqal_sparql_query_engine_prepare): Call rasqal_engine_prepare. * rasqal/rdql_parser.y (rasqal_rdql_query_engine_prepare): Call rasqal_engine_prepare. * rasqal/rasqal_engine.c (rasqal_engine_prepare): Added, split some bits from rasqal_engine_execute_init that were just query preparation, rather than execution. * rasqal/rasqal_internal.h: Added rasqal_engine_prepare prototype 2004-11-12 Dave Beckett * rasqal/sparql_parser.y (PatternElementForms): Set triple optional flags. * rasqal/rasqal_expr.c: Added rasqal_triple_flag_strings consts (rasqal_triple_print): Use rasqal_triple_flag_strings to print flags out. * rasqal/roqet.c: Cast for c++ * rasqal/rasqal_engine.c (rasqal_engine_execute_init): Set triple flags RASQAL_TRIPLE_FLAGS_EXACT rather than triple meta is_exact. (rasqal_engine_get_next_result): Use triple flags RASQAL_TRIPLE_FLAGS_EXACT rather than using triple meta is_exact. * rasqal/rasqal_expr.c (rasqal_triple_set_flags, rasqal_triple_get_flags): Added * rasqal/rasqal.h: Added enum rasqal_triple_flags Added flags field to rasqal_triple. Added prototypes for rasqal_triple_set_flags and rasqal_triple_get_flags * raptor/rapper.1: Updated -f for serializer features 2004-11-11 Dave Beckett * rasqal/sparql_parser.y (GraphPattern): Only join non-empty PatternElement (PatternElement.1): Return something. (PatternElementForms): Return NULL for AND Expression part. 2004-11-10 Dave Beckett * rasqal/sparql_parser.y (rasqal_init_query_engine_sparql): URL now http://www.w3.org/TR/rdf-sparql-query/ * rasqal/sparql_parser.y (rasqal_init_query_engine_sparql): No alias. * rasqal/sparql_parser.y: typo * rasqal/rdql_lexer.l, rasqal/rdql_parser.y, rasqal/sparql_lexer.l, rasqal/sparql_parser.y: Rename terminals: PLUS MINUS STAR SLASH REM TILDE BANG to be the single symbol they are. * rasqal/rdql_parser.y, rasqal/rdql_lexer.l: Rename terminals: COMMA LPAREN RPAREN VARPREFIX to be the single symbol they are. * rasqal/sparql_lexer.l: Rename terminals: COMMA LPAREN RPAREN LSQUARE RSQUARE LCURLY RCURLY VARPREFIX AMP to be the single symbol they are. * rasqal/sparql_parser.y: Enable YYERROR_VERBOSE for now Rename terminals: COMMA LPAREN RPAREN LSQUARE RSQUARE LCURLY RCURLY VARPREFIX AMP to be the single symbol they are. * rasqal/sparql_parser.y: Removed ()s for groups * rasqal/sparql_parser.y: Added {}s for groups * rasqal/tests/sparql/syntax/Makefile.am, rasqal/tests/sparql/syntax/groups.rq: Added groups.rq * librdf/rdf_serializer_raptor.c (librdf_serializer_raptor_set_namespace): raptor_serialize_set_namespace * utils/rdfproc.c: Init partial_statement, uri_string * librdf/rdf_serializer_raptor.c (librdf_serializer_raptor_set_namespace): raptor_serialize_set_namespace, typo * utils/rdfproc.c: Init partial_statement, uri_string * configure.ac: Need raptor 1.4.3 and rasqal 0.9.5 * raptor/raptor_sequence.c (raptor_sequence_join): Copy pointers correctly * rasqal/rdql_parser.y (ConstraintClause): Don't add constraint sequence here. (CommaAndConstraintClause): Instead, add constraints here. * rasqal/sparql_parser.y (GraphPattern): Use raptor_sequence_join * rasqal/rdql_parser.y (Query): Don't set contraints here. (ConstraintClause): Use rasqal_query_add_constraint. * rasqal/configure.ac: require raptor 1.4.3 * raptor/raptor_sequence.c (raptor_sequence_join): Added, to move all items between two sequences leaving one empty. * raptor/raptor.h: Added raptor_sequence_join * librdf/rdf_serializer.c (librdf_serializer_set_namespace): Note may not be implemented. * librdf/rdf_query_results.c (librdf_query_results_as_stream): Docs, note implemented. * librdf/rdf_serializer_raptor.c (librdf_serializer_raptor_get_feature, librdf_serializer_raptor_set_feature): Added to use new serializer features. (librdf_serializer_raptor_set_namespace): Added calling raptor_serializer_set_namespace which should work sometime. * raptor/raptor.h: Added raptor_serialize_set_namespace * raptor/raptor_serialize.c (raptor_serialize_set_namespace): Added, not implemented. * librdf/rdf_query_results.c (librdf_free_query_results): Add docs. * raptor/raptor_rss.c (raptor_rss_parse_recognise_syntax): Boost in recognising xml rss * rasqal/rasqal.h, librdf/redland.h, librdf/rdf_utf8.h, librdf/rdf_node.h, librdf/rdf_model.h, librdf/rdf_list.h, librdf/librdf.h: Applied patch from René Puls to allow for Redland public headers to be in a different directory structure. If LIBRDF_OBJC_FRAMEWORK is defined, the headers are in a Redland subdirectory. Only applies to public Redland header files that #include other public header files. rasqal.h includes raptor.h so needs modifying also. * librdf/rdf_storage_mysql.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_file.c: Changed sync methods to return an int status. * librdf/rdf_storage.c (librdf_storage_sync): Changed to return an int. API change but most C won't care much. * librdf/rdf_storage.h: sync factory method returns a status int API CHANGE: librdf_storage_sync returns an int * librdf/rdf_model_storage.c (librdf_model_storage_sync): Changed to return an int. * librdf/rdf_model.c (librdf_model_sync): Changed to return an int. API change but most C won't care much. * librdf/rdf_model.h: sync factory method returns a status int API CHANGE: librdf_model_sync returns an int 2004-11-09 Dave Beckett * Redland.i: Add base_uri argumemt to librdf_new_query * utils/rdfproc.c: Add NULL base_URI arg to librdf_new_query calls. * librdf/rdf_query_triples.c (librdf_query_triples_init): Add new base_uri argument, not used. * librdf/rdf_query_rasqal.c (librdf_query_rasqal_init): Use new base_uri argument and store that, not language URI. * librdf/rdf_query.h: Update query factory init method to add base_uri argument. API CHANGE: Add base_uri argument to librdf_new_query and librdf_new_query_from_factory * librdf/rdf_query.c (librdf_new_query, librdf_new_query_from_factory): Add optional base_uri argument. Stop overloading query language identifier URI and base URI. (main): Update test to match. * librdf/rdf_query.c (librdf_get_query_factory): librdf_uri_equals test was negated 2004-11-08 Dave Beckett * librdf/rdf_storage_mysql.c (librdf_storage_mysql_init): Return failure early if connection failed. * raptor/rdfdump.c: allow -f to set serializer features * raptor/raptor_feature.c (raptor_features_enumerate_common): return -1 2004-11-07 Dave Beckett * raptor/raptor_uri.c (raptor_uri_path_make_relative_path): C style, indenting, const unsigned char. Remove a small memcpy. (raptor_uri_to_relative_counted_uri_string) C style, indentng, docs. Remove a large if {} block. Rename 'reference' var since libxml2 defines it (SEP). Use buildresult to make empty string result. * raptor/raptor_serialize.c (raptor_rdfxml_serialize_statement): use feature feature_relative_uris to decide when to emit an absolute or relative URI, the latter using raptor_uri_to_relative_uri_string. * raptor/raptor_uri.c: Added raptor relative URI generating code patch from René Puls (raptor_uri_path_common_base_length): Added. Helper to return the common base length of two paths (raptor_uri_path_make_relative_path): Added. Helper to build the result relative URI string from already analysed parts. (raptor_uri_to_relative_counted_uri_string): Added. Get the relative URI string between a base and reference URI. (raptor_uri_to_relative_uri_string): Added. Wrapper about the above. (assert_uri_to_relative): Added. Helper for tests for above. (main): Added relative URI string generation tests. * raptor/raptor.h: Added prototypes for raptor_uri_to_relative_counted_uri_string and raptor_uri_to_relative_uri_string * librdf/rdf_storage_mysql.c (librdf_storage_mysql_find_statements_with_options): Ensure subject, predicate and object are initialised. * librdf/rdf_query_triples.c (librdf_query_triples_init): Ensure subject, predicate are initialised. Free them only if they are set. * librdf/rdf_node.c (librdf_node_to_counted_string): Init datatype_uri_string, language_len. * raptor/raptor_rss.c (raptor_rss_parser_processNode): Add cast for name when returned from xmlTextReaderConstLocalName. * raptor/raptor_rss.c (raptor_rss_parser_processNode): Always declare name as xmlChar* 2004-11-06 Dave Beckett * raptor/rdfdump.c: Tidy help messages about features, other words. * raptor/raptor_parse.c (raptor_feature_from_uri): Moved to raptor_feature.c * raptor/raptor.h: Moved raptor_feature_from_uri to separate section, not just parsers * raptor/raptor_internal.h: Deleted raptor_feature_from_uri_common * raptor/raptor_feature.c (raptor_feature_from_uri): Defined here, no need for raptor_feature_from_uri_common * raptor/rdfdump.c: In feature help code, list parser and serializer features separately, using new raptor_features_enumerate. * raptor/raptor_serialize.c (raptor_serializer_features_enumerate): Added, a wrapper around raptor_features_enumerate_common. (raptor_serializer_set_feature): Added. (raptor_serializer_get_feature): Added. * raptor/raptor_parse.c: Moved raptor_features_list to raptor_feature.c (raptor_features_enumerate): Changed to be a wrapper around raptor_features_enumerate_common now containing the body of the code. (raptor_feature_from_uri): Changed to be a wraper around raptor_feature_from_uri_common now containing the body of the code. * raptor/raptor_internal.h: Added feature_relative_uris for raptor_serializer. Added prototypes for raptor_features_enumerate_common and raptor_feature_from_uri_common * raptor/raptor.h: Added RAPTOR_FEATURE_RELATIVE_URIS for serializing. Added prototypes for raptor_serializer_features_enumerate, raptor_serializer_set_feature and raptor_serializer_get_feature * raptor/Makefile.am: Added raptor_feature.c * raptor/raptor_feature.c: Moved common raptor_feature code from raptor_parse.c * raptor/raptor_rss.c: Added entry to raptor_rss_fields_info so that when indexed with RAPTOR_RSS_FIELDS_NONE, does not access invalid data. Fixes for xmlReader API for older libxml2s: Added node type defines for <2.5.9 Use xmlTextReaderLocalName, xmlTextReaderNamespaceUri instead of the Const versions with additional corresponding xmlFree()s for <2.6.0 2004-11-02 Dave Beckett * rasqal/rasqal_raptor.c (ordinal_as_uri): Utterly broken * rasqal/tests/sparql/check-sparql (run_test): Take array of data files and use them to invoke roqet Tidy some rapper invoking. Add more debug messages. * rasqal/sparql_parser.y (GraphPattern): Merge the two sequences to make one sequence of triples. (PatternElement): Pass on PatternElementForms sequence (GraphPattern1:) Make a new triple sequence and pass on PatternElementForms. * rasqal/roqet.c (main): Add sources before prepare. * rasqal/roqet.c (main): Form a list of files/source URIs to add using a raptor_sequence and add them once the query is created. * librdf/win32_rdf_config.h, configure.ac: Bumped version to 0.9.20 * rasqal/configure.ac, rasqal/win32_rasqal_config.h: Bumped version to 0.9.5 2004-11-01 Dave Beckett * raptor/configure.ac, raptor/win32_raptor_config.h: Bumped version to 1.4.3 * Snapshotted redland_0_9_19 for 0.9.19 release * LICENSE-2.0.txt, LICENSE.html, MPL.html, Makefile.am, NOTICE, README.html, TODO.html, librdf/redland.spec.in: LGPL / Apache 2.0 license - remove MPL MPL.html add Apache2 LICENSE-2.0.txt NOTICE * Switched to LGPL / Apache 2.0 license in the sources CVS tags before: redland_license_lgpl_mpl, and after: redland_license_lgpl_apache2 * rasqal/configure.ac, configure.ac: Need raptor 1.4.2 * raptor/win32_raptor_config.h, raptor/configure.ac: Bumped version to 1.4.2 * raptor/raptor_xml_writer.c (raptor_xml_writer_cdata): Return when raptor_xml_escape_string fails. * raptor/raptor_xml.c (raptor_xml_escape_string): Return -1 on UTF-8 encoding failure * raptor/raptor_xml.c: docs * utils/rdfproc.c (log_handler): Check level against fatal, not facility. * librdf/rdf_serializer_raptor.c, librdf/rdf_serializer.c, librdf/rdf_query_rasqal.c, librdf/rdf_query.c, librdf/rdf_parser.c, librdf/rdf_model.c, librdf/rdf_init.c: Casts for C++ 2004-10-29 Dave Beckett * rasqal/configure.ac: Minimum raptor 1.4.1 * rasqal/rasqal_raptor.c (ordinal_as_uri): Helper, added to Properly calculate uri_string from rdf:_n ordinals (raptor_statement_as_rasqal_triple): Use above for subject, predicate, object * rasqal/rasqal_expr.c (rasqal_free_triple): Handle a partially constructed triple. 2004-10-28 Dave Beckett * raptor/raptor_xml.c (raptor_xml_escape_string): Ensure an empty string is copied out; write a NUL. * rasqal/sparql_parser.y, rasqal/rdql_parser.y, rasqal/rasqal_query_test.c: Casts for C++ * raptor/libraptor.3: int return on raptor_xml_escape_string in body * raptor/libraptor.3: 1.4.1 raptor_xml_escape_string return value now int, <0 on failure. * raptor/raptor_xml_writer.c (raptor_xml_writer_cdata): Use int for raptor_xml_escape_string return variables and use error return <0 * raptor/raptor_serialize.c: (raptor_rdfxml_serialize_write_xml_attribute, raptor_rdfxml_serialize_statement) Use int for raptor_xml_escape_string return variables. Handle empty string attribute when len=0. * raptor/raptor_sax2.c (raptor_format_sax2_element): Use int for raptor_xml_escape_string return. * raptor/raptor.h: raptor_xml_escape_string changed return value to int * raptor/raptor_xml.c (raptor_xml_escape_string): Return value now int, <0 on failure to allow escaping an empty string to return 0 bytes required. (main): Add empty string escaping test. Check for failure of first raptor_xml_escape_string call. * raptor/raptor_rss.c (raptor_rss_parser_processNode): Fix url attribute failing for non-enclosure. * rasqal/tests/sparql/check-sparql: Use PATH to find programs. (run-test): More debug messages Add -s $srcdir arg to find manifest * rasqal/tests/sparql/syntax/Makefile.am, rasqal/tests/sparql/simple/Makefile.am, rasqal/tests/sparql/part1/Makefile.am, rasqal/tests/sparql/examples/Makefile.am: Invoke check-sparql with PATH set and -s $(srcdir) arg * rasqal/tests/sparql/simple/manifest.n3, rasqal/tests/sparql/part1/manifest.n3: Update to latest DAWG tests, no file: * rasqal/sparql_lexer.l, rasqal/rdql_lexer.l: Remove YY_INPUT since it never worked. (main): Read query string into a buffer and use *_lexer__scan_buffer * rasqal/sparql_parser.y (main): Use full rasqal_init/finish sequence since setup and cleanup is rather complex now. 2004-10-27 Dave Beckett * rasqal/sparql_parser.y (sparql_parse): Added workaround to crash when regex is at very end of input, by appending a space to the parsed query string. * rasqal/rdql_parser.y (rdql_parse): Added workaround to crash when regex is at very end of input, by appending a space to the parsed query string. * raptor/raptor_rfc2396.c (raptor_new_uri_detail): Do not add schema_len twice to dest pointer; stop buffer overrun * rasqal/tests/sparql/check-sparql, rasqal/tests/rdql/testsuite/check-rdql: OK to assume raptor 1.4.0 * rasqal/roqet.1: updated RDQL URL * rasqal/tests/sparql/syntax/data.n3: skeleton data file * rasqal/tests/sparql/syntax/Makefile.am: Added check-bad-sparql rule Added nojam.rq bad test * rasqal/tests/sparql/syntax/nojam.rq: failure with ? and non var * rasqal/rdql_lexer.l: Restore ID state which is used to allow things like ?select. However, make sure ID state is left on errors. * rasqal/sparql_lexer.l: In state with unknown token, return to INITIAL and report the error. * rasqal/rdql_lexer.l: Remove ID state - not used and jams parser with non-matched chars in state. * rasqal/tests/sparql/Makefile.am: Added syntax dir * rasqal/sparql_parser.y (VarOrURIList): Fix calls to rasqal_new_variable_literal. * rasqal/configure.ac: Added dir tests/sparql/syntax * rasqal/tests/sparql/syntax/Makefile.am, rasqal/tests/sparql/syntax/describe1.rq: syntax tests for SPARQL * rasqal/tests/sparql/examples/Makefile.am: Remove check-sparql-works * rasqal/tests/rdql/testsuite/Makefile.am: Remove check-rdql-works * rasqal/rasqal_internal.h: Note that describe is a sequence of rasqal_literal* * rasqal/sparql_parser.y (VarOrURIList): Build a list of rasqal_literal* 2004-10-26 Dave Beckett * rasqal/roqet.c: fix file reading * rasqal/roqet.c: Tidy up after failure to get query document * rasqal/rasqal_raptor.c (rasqal_raptor_error_handler): Added to pass on raptor parser errors to rasqal, and onwards. (rasqal_raptor_new_triples_source): On failure to parser, abort and tidy up. * raptor/raptor_locator.c (raptor_format_locator): Only print line if > 0 * rasqal/rasqal_query.c (rasqal_free_query): Tidy up any half-constructed rasqal_expression sequence when query parsing/execution fails. * rasqal/sparql_lexer.l (sparql_token_free): Free raptor_uri objects in URI_LITERAL. Debug function. * rasqal/rdql_lexer.l (rdql_token_free): Free raptor_uri objects in URI_LITERAL. Debug function. * rasqal/rdql_parser.y (main): Use full rasqal_init/finish sequence since setup and cleanup is rather complex now. * rasqal/rasqal_engine.c (rasqal_new_triples_source): Do not abort when no explict list of sources are given. * rasqal/sparql_lexer.l: More renames * rasqal/rdql_lexer.l: Rename static functions to have rdql_ prefix to aid setting breakpoints in debugging. (.): Only return PATTERN_LITERAL if rdql_copy_regex_token worked. (rdql_copy_regex_token): Report EOF in regex rather than continue. (rdql_copy_string_token): Fix debug message parameters. * rasqal/sparql_lexer.l: Rename static functions to have sparql_ prefix to aid setting breakpoints in debugging. (.): Only return PATTERN_LITERAL if sparql_copy_regex_token worked. (sparql_copy_regex_token): Report EOF in regex rather than continue. * rasqal/rasqal-config.1: zap ASCII 160 * rasqal/rasqal-config.1, raptor/raptor-config.1: Fix --libtool-libs desc 2004-10-25 Dave Beckett * librdf/rdf_query_rasqal.c (librdf_query_rasqal_execute): Fix for rasqal bug in rasqal_new_triples_source that refuses to run if query->sources is NULL. Remove this when rasqal 0.9.4 is out. * rasqal/win32_rasqal_config.h, rasqal/configure.ac: Bumped version to 0.9.4 * rasqal/configure.ac: Use AC_TRY_LINK correctly for regcomp test. * rasqal/configure.ac: Use AC_TRY_LINK for regcomp test; no need to run it. * rasqal/roqet.c: Many casts for c++ (roqet_xml_print_xml_attribute, roqet_query_results_print_as_xml): Use type raptor_simple_message_handler for error callbacks. * rasqal/rasqal_expr.c: Casts for C++ * rasqal/rasqal_expr.c (rasqal_prefix_print): Handle NULL prefix * rasqal/configure.ac: Do a 'return 0' after regcomp check to ensure the program exits ok * rasqal/tests/rdql/testsuite/check-rdql: Handle empty list of vars * rasqal/Makefile.am: Execute rasqal_query_test specially, passing in full path to $(srcdir)/data/dc.rdf * rasqal/rasqal_query_test.c: Pass in data file as an argument and allocate the query string with path to the file burnt in. * rasqal/roqet.c: (roqet_xml_print_xml_attribute, roqet_query_results_print_as_xml): Move experimental XML output code here. * rasqal/Makefile.am: Remove rasqal_xml.c from library for now. * rasqal/rasqal.h: Remove rasqal_query_results_print_as_xml from pre-release public API * rasqal/sparql_parser.y (FromClauseOpt): Store the list of sources got from URIList (URIList): Use rasqal_literal_as_uri to make a list of raptor_uri* from individual rasqal_literal* made by term URI. * rasqal/rasqal_literal.c (rasqal_literal_as_uri): Added for getting a URI out of a literal. * rasqal/rasqal_internal.h: Added rasqal_literal_as_uri * rasqal/sparql_parser.y (sparql_query_error_full): Added, allowing varags. (Literal, URI): Use above to report failure to expand qnames immediately. * rasqal/sparql_parser.y (Literal, URI): Invoke rasqal_literal_expand_qname when handling a QNAME_LITERAL, RASQAL_LITERAL_QNAME. (sparql_parse): Check for unexpanded QNames. SPARQL does the expansion in order, so do not invoke expansions here. * rasqal/rasqal_literal.c (rasqal_literal_has_qname): Added, for checking when a QName is leftover. * rasqal/rasqal_internal.h: Added rasqal_engine_sequence_has_qname, rasqal_engine_constraints_has_qname, rasqal_literal_has_qname, rasqal_expression_has_qname * rasqal/rasqal_expr.c (rasqal_expression_has_qname): Added for use with rasqal_expression_foreach to check for a leftover QName. * rasqal/rasqal_engine.c (rasqal_engine_sequence_has_qname, rasqal_engine_constraints_has_qname): Added, for checking when a QName is leftover. * rasqal/roqet.c: Set the raptor_www error_handler * rasqal/rasqal.h: Added rasqal_prefix depth field. * rasqal/rasqal_engine.c (rasqal_engine_declare_prefix): Use query->prefix_depth and increment * rasqal/rasqal_query.c (rasqal_query_add_prefix): Undeclare older prefixes with the same prefix. * rasqal/rasqal_internal.h: Added prefix_depth to rasqal_query_s Added rasqal_engine_undeclare_prefix prototype 2004-10-24 Dave Beckett * rasqal/tests/sparql/examples/Makefile.am: Added missing ex-24a files * rasqal/roqet.c (main): C99 fix - Move FILE*fh declaration to start of block. * rasqal/librasqal.3: Updates for 0.9.3 * librdf/rdf_query.c (librdf_query_register_factory): Take a uri_string argument. * librdf/rdf_query.h: Modify librdf_query_register_factory to take a uri_string * utils/rdfproc.c: Allow query command to give '-' for default query language name. * librdf/rdf_query_rasqal.c (librdf_query_rasqal_constructor): Use rasqal_languages_enumerate to register all languages that rasqal has. * rasqal/roqet.c (main): Use raptor_www_fetch_to_string from raptor 1.4.0 * raptor/win32_raptor_config.h, raptor/configure.ac: Bumped version to 1.4.1 * raptor/libraptor.3: typo * raptor/raptor_rss.c: Added generation of triples for RSS enclosures based on a patch from Suzan Foster. Changes made include correcting the enclosures namespace, tidying some memory leaks and printing some debug information. * raptor/raptor_serialize.c (raptor_rdfxml_serialize_statement): Make rdf:_ 'ordinal' properties serialize correctly. * raptor/raptor_www_test.c (main): Use raptor_www_fetch_to_string for testing. * raptor/raptor_iostream.c (raptor_string_iostream_finish): Code tidy. * raptor/libraptor.3, raptor/raptor.h: Added raptor_www_fetch_to_string * raptor/raptor_www.c (raptor_www_fetch_to_string_write_bytes): Added handler for following function: (raptor_www_fetch_to_string): Added, to get content back as a string. * rasqal/roqet.c: (roqet_get_www_content); Use raptor_stringbuffer_copy_to_string. * rasqal/configure.ac: enable sparql for regular users 2004-10-23 Dave Beckett * raptor/libraptor.3: Updates for 1.4.0 * raptor/raptor.h, raptor/raptor_iostream.c: s/fh/handle/ for clarity. * rasqal/configure.ac, rasqal/Makefile.am: Added rasqal.rdf.in * rasqal/rasqal.rdf.in: Rasqal DOAP description * raptor/raptor.spec.in: Update descriptions to include serializers 2004-10-21 Dave Beckett * rasqal/Makefile.am, rasqal/rasqal.spec.in, rasqal/LICENSE-2.0.txt, NOTICE: LGPL / Apache 2.0 license * rasqal/tests/sparql/simple/Makefile.am, rasqal/docs/build-docs, rasqal/tests/Makefile.am, rasqal/tests/rdql/Makefile.am, rasqal/tests/rdql/testsuite/Makefile.am, rasqal/tests/rdql/testsuite/check-rdql, rasqal/tests/sparql/Makefile.am, rasqal/tests/sparql/check-sparql, rasqal/tests/sparql/examples/Makefile.am, rasqal/tests/sparql/part1/Makefile.am, rasqal/docs/Makefile.am, rasqal/sparql_parser.y, rasqal/win32_rasqal_config.h, rasqal/rdql_parser.y, rasqal/roqet.c, rasqal/sparql_common.h, rasqal/sparql_lexer.l, rasqal/Makefile.am, rasqal/configure.ac, rasqal/rasqal-config.in, rasqal/rasqal-src-config.in, rasqal/rasqal.h, rasqal/rasqal.spec.in, rasqal/rasqal_engine.c, rasqal/rasqal_expr.c, rasqal/rasqal_general.c, rasqal/rasqal_internal.h, rasqal/rasqal_literal.c, rasqal/rasqal_query.c, rasqal/rasqal_query_test.c, rasqal/rasqal_raptor.c, rasqal/rasqal_redland.c, rasqal/rasqal_xml.c, rasqal/rdql_common.h, rasqal/rdql_lexer.l: LGPL / Apache 2.0 license * rasqal/win32/rasqal.dsp, rasqal/win32/rasqal.dsw: win32 updates including sparql (not tested) * librdf/rdf_parser_raptor.c (librdf_parser_raptor_new_statement_handler): Do not copy datatype URIs for new statements. * raptor/raptor_namespace.c: less namespace debugs * raptor/raptor_xml_writer.c: less cdata debugs * raptor/raptor_namespace.c: Make most namespace debug messages appear only if #ifdef RAPTOR_DEBUG_VERBOSE * raptor/raptor_rdfxml.c: Make most rdf/xml parsing debug messages appear only if #ifdef RAPTOR_DEBUG_VERBOSE * librdf/rdf_serializer.c (librdf_serializer_serialize_model_to_counted_string, librdf_serializer_serialize_model_to_string): Do not require a base_uri. * examples/example6.c: Redland example code using model methods load and to_string * librdf/rdf_serializer_raptor.c (librdf_serializer_raptor_serialize_statement): Convert statement object URI correctly. (librdf_serializer_raptor_serialize_model_to_counted_string): Zap string, string_length before starting. * raptor/raptor_serialize.c: (raptor_serialize_start, raptor_serialize_start_to_filename, raptor_serialize_start_to_string, raptor_serialize_start_to_file_handle, raptor_serialize_statement, raptor_serialize_end): Fail if no iostream is made or available. * raptor/raptor_iostream.c (raptor_new_iostream_to_string): Docs, zap string and length before starting. * examples/Makefile.am: Added example6.c * raptor/raptor_serialize.c (raptor_rdfxml_serialize_statement): Print datatype URIs correctly. 2004-10-20 Dave Beckett * librdf/rdf_query_rasqal.c: Update redland support to rasqal changes after addition of origin. * rasqal/rasqal_redland.c (rasqal_redland_bind_match): Take array of 4 bindings. * rasqal/rasqal_redland.c: Update redland support to changes after addition of origin. * rasqal/rasqal_general.c: Added rasqal_initialising and rasqal_finishing statics (rasqal_init, rasqal_finish): Use the above to prevent recursion in these methods when rasqal uses redland using rasqal. * rasqal/configure.ac: use $srcdir not .. when looking for raptor sources nearby * configure.ac: rasqal minimum version 0.9.3 * raptor/configure.ac, raptor/win32_raptor_config.h: 1.4.0 * configure.ac, rasqal/configure.ac: raptor minimum version 1.4.0 * rasqal/roqet.c: cast for fprintf * librdf/rdf_model.h: Change librdf_model_to_counted_string and librdf_model_to_string to return unsigned char* * librdf/rdf_model.c (librdf_model_to_counted_string,librdf_model_to_string): Return unsigned char* * Redland.i: Added librdf_serializer_serialize_model_to_string * Redland.i: Added librdf_model_to_string * librdf/rdf_model.c (librdf_model_to_counted_string, librdf_model_to_string): Added. (main): Added test for above. * librdf/rdf_model.h: Added librdf_model_to_counted_string, librdf_model_to_string * librdf/rdf_serializer_raptor.c: Added errors, warnings counting in context. (librdf_serializer_raptor_error_handler, librdf_serializer_raptor_warning_handler): Added, called by raptor serializing code. (librdf_serializer_raptor_serialize_model_to_file_handle): Link to error, warning handlers above. (librdf_serializer_raptor_serialize_model_to_counted_string): Added. (librdf_serializer_raptor_register_factory): Update for new factory method names. * librdf/rdf_serializer.c (librdf_serializer_serialize_model_to_counted_string): Added to return string length. (main): Test serialize to string. * librdf/rdf_serializer.h: Rename factory method to serialize_model_to_counted_string Added librdf_serializer_serialize_model_to_counted_string * librdf/rdf_serializer.c (main): rdf/xml bad predicate URI is now an error * raptor/raptor_internal.h: Added warning_user_data, warning_handler to serializer Added prototypes for raptor_serializer_warning and raptor_serializer_warning_varargs * raptor/raptor_serialize.c (raptor_serializer_warning, raptor_serializer_warning_varargs): Added (raptor_serializer_set_warning_handler): Added * raptor/raptor.h: Added raptor_serializer_set_warning_handler * librdf/rdf_serializer.c (main): Use librdf_serializer_serialize_model_to_file_handle * raptor/configure.ac, rasqal/configure.ac, configure.ac: autoconf mode * raptor/rdfdump.c: default serializer simple * utils/rdfproc.c: allow base URI to serialize command * librdf/rdf_serializer_rdfxml.c: Deleted. raptor does all this now * librdf/Makefile.am: Remove rdf_serializer_rdfxml.c * librdf/rdf_serializer.h: Renamed factory method serialize_model to serialize_model_to_file_handle. Added factory method serialize_model_to_string. Deprecated librdf_serializer_serialize_model Added librdf_serializer_serialize_model_to_file_handle as new name Added librdf_serializer_serialize_model_to_string * librdf/rdf_serializer.c (librdf_serializer_serialize_model): Deprecate name. (librdf_serializer_serialize_model_to_file_handle): Added, new name for above. (librdf_serializer_serialize_model_to_string): Added. (librdf_init_serializer): Let raptor make all * librdf/rdf_storage_file.c (librdf_storage_file_sync): Use librdf_serializer_serialize_model_to_file_handle not deprecated librdf_serializer_serialize_model * librdf/rdf_serializer_raptor.c: Converted to use raptor_serializer. (librdf_serializer_raptor_serialize_model_to_file_handle): Renamed from librdf_serializer_raptor_serialize_model. (librdf_serializer_raptor_serialize_model_to_string): Added. (librdf_serializer_raptor_constructor): Register from raptor's enumeration of serializers. * raptor/raptor_serialize.c (raptor_rdfxml_serialize_statement): Handle URI subject, object right. * raptor/raptor_serialize.c (raptor_serialize_start_to_filename, raptor_serialize_start_to_string, raptor_serialize_start_to_file_handle): Don't enforce base URI is required. 2004-10-19 Dave Beckett * raptor/raptor.h: Updated raptor_new_iostream_to_string with malloc_handler argument * raptor/raptor_serialize.c (raptor_serialize_start_to_string): Update raptor_new_iostream_to_string for malloc_handler argument * raptor/raptor_iostream.c (raptor_string_iostream_finish): Use passed-in malloc_handler to make string, raptor_stringbuffer_copy_to_string to copy directly in. (raptor_new_iostream_to_string): Add optional malloc_handler argument so caller can control allocation. (main): Update tests for above. * raptor/raptor.h: Added raptor_stringbuffer_copy_to_string * raptor/raptor_stringbuffer.c (raptor_stringbuffer_copy_to_string): Added to allow exporting to externally alloced buffers - handy for cross-library/heap work. (main): Added test for above. * raptor/raptor_general.c (raptor_init): Don't register 'simple' type. * configure.ac: Raptor minimum version 1.3.4 for serializer * redland-src-config.in: pick up raptor libs for --libs * raptor/raptor_iostream.c, raptor/raptor_namespace.c, raptor/raptor_serialize.c, raptor/raptor_iostream.c: Casts for C++ * raptor/tests/Makefile.am, raptor/tests/turtle/Makefile.am: Replace direct dependency on $(top_builddir)/rapper with build-rapper so re-compile check is forced before testing. * raptor/raptor.h, raptor/raptor_namespace.c, raptor/raptor_serialize.c: Fix a bunch of constitency typos in namespace URIs * raptor/raptor_internal.h: Add locator, error_user_data and error_handler to raptor_serializer. Add raptor_init_serializer_rdfxml, raptor_serializer_error, raptor_serializer_simple_error and raptor_serializer_error_varargs. * raptor/raptor_namespace.c: Export raptor_xml_namespace_uri, raptor_rdf_namespace_ms_uri, raptor_rdf_namespace_schema_uri, raptor_xmlschema_datatypes_namespace_uri, raptor_owl_namespace_uri, raptor_rdf_namespace_ms_uri_len * raptor/raptor_general.c (raptor_init): Call raptor_init_serializer_rdfxml * raptor/raptor.h: Export raptor_xml_namespace_uri, raptor_rdf_namespace_ms_uri, raptor_rdf_namespace_schema_uri, raptor_xmlschema_datatypes_namespace_uri, raptor_owl_namespace_uri, raptor_rdf_namespace_ms_uri_len Add raptor_serializer_set_error_handler, raptor_serializer_get_locator * raptor/raptor_serialize.c: Added RDF/XML serializer. Added locator to serializer. (raptor_serializer_error, raptor_serializer_simple_error, raptor_serializer_error_varargs): Added internal support for errors. (raptor_serializer_set_error_handler, raptor_serializer_get_locator): Added public methods 2004-10-18 Dave Beckett * raptor/raptor_iostream.c: (main) casts for fprintf * raptor/rdfdump.c: Remove ad-hoc serializing code and use raptor_serializer. Update help and usage messages to use raptor_serializers_enumerate * raptor/raptor_internal.h: Added raptor_serializer_factory and declarations for factories raptor_init_serializer_ntriples, raptor_init_serializer_simple and raptor_delete_serializer_factories * raptor/raptor_general.c (raptor_init): Call raptor_init_serializer_ntriples and raptor_init_serializer_simple * raptor/raptor.h: Added raptor_serializer class and methods: raptor_serializers_enumerate, raptor_serializer_syntax_name_check, raptor_new_serializer, raptor_free_serializer, raptor_serialize_start, raptor_serialize_start_to_filename, raptor_serialize_start_to_string, raptor_serialize_start_to_file_handle, raptor_serialize_statement, raptor_serialize_end, raptor_serializer_get_iostream. Added new raptor_iostream class constructor raptor_new_iostream_to_sink and methods: raptor_iostream_write_end, raptor_iostream_write_string, raptor_iostream_write_counted_string, raptor_iostream_get_bytes_written_count, raptor_iostream_write_decimal, raptor_iostream_format_hexadecimal * raptor/Makefile.am: Added raptor_serialize.c Added $(LIBS) to rfc2396 tests for -ldmalloc when present * raptor/raptor_serialize.c: Serializers * raptor/raptor_iostream.c (raptor_iostream_write_counted_string): Added as a wrapper. * raptor/raptor_iostream.c (raptor_iostream_format_hexadecimal): Added for writing field-formatted hex. * raptor/raptor_iostream.c (raptor_iostream_get_bytes_written_count): Renamed from raptor_get_bytes_written_count (raptor_iostream_write_decimal): Added to print a decimal to the iostream. * raptor/raptor_iostream.c (raptor_new_iostream_to_file_handle): Do not fclose at end. (raptor_string_iostream_finish): Free malloced context. (raptor_iostream_write_string): Helper to write C string. * raptor/raptor_iostream.c: Added sink iostream (raptor_sink_iostream_write_byte, raptor_sink_iostream_write_bytes): Added. (raptor_new_iostream_to_sink): Added to create a throwaway data iostream. (raptor_free_iostream): Ensure write_end is always called once only. (main): Test sink. * raptor/raptor_iostream.c: Added ended flag, once write_end is done, all further calls fail. (raptor_filename_iostream_finish): Removed; write_end does this. (raptor_filename_iostream_write_end): Added to fclose() on end (raptor_string_iostream_finish): More checks when stringbuffer is empty. (raptor_new_iostream_to_string): Handle error tidy up better. (raptor_iostream_write_end): Added. (main): Code tidy. * raptor/raptor_iostream.c: casts for c++ * raptor/raptor.h: Added raptor_iostream class and methods. * raptor/Makefile.am: Added raptor_iostream.c and raptor_iostream_test * raptor/raptor_iostream.c: Raptor I/O stream class * raptor/n3_lexer.l, raptor/n3_parser.y, raptor/turtle_lexer.l, raptor/turtle_parser.y, rasqal/rdql_lexer.l, rasqal/rdql_parser.y, rasqal/sparql_lexer.l, rasqal/sparql_parser.y: Rename rather generic define ERROR to ERROR_TOKEN to help win32. * rasqal/rdql_lexer.l, rasqal/sparql_lexer.l: words * rasqal/rasqal_engine.c (rasqal_set_triples_source_factory): Export this, to match rasqal.h and add docs. 2004-10-17 Dave Beckett * rasqal/roqet.c: Tidy some #defines (main): Don't print all of huge query_string on errors. * rasqal/roqet.1: formatting 2004-10-16 Dave Beckett * rasqal/tests/sparql/check-sparql: Destroy duff relative file: URIs only * rasqal/tests/sparql/check-sparql: validate $roqet path No Data::Dumper * rasqal/roqet.c: Remove extra print of query URI * rasqal/roqet.c (roqet_get_www_content): Remove goto * rasqal/roqet.1: Update for options changes. Note SPARQL support. * raptor/rapper.1: die .UE * rasqal/roqet.c (roqet_error_handler): Added, used by www fetching. (roqet_get_www_write_bytes): Added, used by roqet_get_www_content (roqet_get_www_content): Added, creates a big string of a URI content using the raptor_www class routines to retrieve it and raptor_stringbuffer to assemble it. (main): Use roqet_get_www_content to retrieve queries from URIs. * rasqal/sparql_lexer.l, rasqal/sparql_parser.y: Deleted FOR and USING tokens * rasqal/sparql_parser.y: Remove PatternLiteral * rasqal/tests/sparql/examples/Makefile.am, rasqal/tests/sparql/examples/ex2-1a-result.n3, rasqal/tests/sparql/examples/ex2-1a.n3, rasqal/tests/sparql/examples/ex2-1a.rq, rasqal/tests/sparql/examples/ex2-1b.rq, rasqal/tests/sparql/examples/ex2-1c.rq, rasqal/tests/sparql/examples/ex2-1d.n3, rasqal/tests/sparql/examples/ex2-1e.rq, rasqal/tests/sparql/examples/ex2-1f.n3, rasqal/tests/sparql/examples/ex2-2a-result.n3, rasqal/tests/sparql/examples/ex2-2a.n3, rasqal/tests/sparql/examples/ex2-2a.rq, rasqal/tests/sparql/examples/ex2-3a-result.n3, rasqal/tests/sparql/examples/ex2-3a.n3, rasqal/tests/sparql/examples/ex2-3a.rq, rasqal/tests/sparql/examples/ex2-4a-result.n3, rasqal/tests/sparql/examples/ex2-4a.n3, rasqal/tests/sparql/examples/ex2-4a.rq, rasqal/tests/sparql/examples/ex3-result.n3, rasqal/tests/sparql/examples/ex3.n3, rasqal/tests/sparql/examples/ex3.rq, rasqal/tests/sparql/examples/manifest.n3: SPARQL examples from query WD * rasqal/tests/rdql/Makefile.am, rasqal/tests/rdql/testsuite/Makefile.am, rasqal/tests/sparql/Makefile.am, rasqal/tests/sparql/part1/Makefile.am, rasqal/tests/sparql/simple/Makefile.am: Use indirect rules for the lexer, parser tests for rdql, sparql and roqet * rasqal/configure.ac: Added tests/sparql/examples/Makefile * rasqal/sparql_parser.y: Added SPARQL URI token replacing URI_LITERAL | QNAME_LITERAL for clarity. Makes several List tokens shorter * rasqal/sparql_parser.y (VarOrURIList, VarList): Made left recursive. (VarOrURI): Don't allow a QName. * rasqal/rdql_parser.y (TriplePatternList): rewrite as left recursive * rasqal/rdql_parser.y (VarList): rewrite as left recursive * rasqal/roqet.c (main): When adding source_uri as a triple source, URI is now managed by the query, so drop the source_uri pointer. 2004-10-15 Dave Beckett * rasqal/sparql_parser.y (PrefixDeclOpt): Actually use query->prefixes list. * rasqal/sparql_parser.y (PrefixDeclOpt): Add new prefix to existing prefixes list. (main): Update test code to initialise/free static query.prefixes. * rasqal/rdql_parser.y (Query): Do not initialise query->prefixes. (PrefixDeclList): Shift new prefixes to existing prefixes list. (main): Update test code to initialise/free static query.prefixes. * rasqal/rasqal_query.c (rasqal_new_query): Init query->prefixes here rather than in each QL implementation. * rasqal/sparql_parser.y: Remove prefix from %union - not needed * rasqal/rasqal_internal.h, rasqal/sparql_lexer.l, rasqal/sparql_parser.y: Updated SPARQL parser to approximately http://www.w3.org/TR/2004/WD-rdf-sparql-query-20041012/#grammar * librdf/rdf_serializer.c (main): Add serializer error and warning report tests * librdf/rdf_query_rasqal.c (librdf_query_rasqal_results_get_bindings): Casts for variable names array. * librdf/rdf_serializer_rdfxml.c (rdf_serializer_rdfxml_print_xml_attribute): Take serializer arg. Use librdf_log directly to give a better error message since raptor_xml_escape_string only dies on UTF-8 errors. (librdf_serializer_print_statement_as_rdfxml): Replcae librdf_serializer_warning with direct librdf_log call as above. * librdf/rdf_serializer.h: Deleted librdf_serializer_error and librdf_serializer_warning * librdf/rdf_serializer.c (librdf_serializer_error, librdf_serializer_warning): Deleted. * librdf/rdf_serializer_rdfxml.c (rdf_serializer_rdfxml_print_as_xml_content): Deleted and inlined. Use raptor_xml_escape_string to properly escape UTF-8. * librdf/rdf_serializer_rdfxml.c (rdf_serializer_rdfxml_print_xml_attribute): Add an error return value and pass on failures. librdf_serializer_print_statement_as_rdfxml): Add an error return value and pass on failures. Try to slightly recover from errors. * librdf/rdf_serializer_rdfxml.c (librdf_serializer_rdfxml_serialize_model): Use raptor_free_memory. * raptor/raptor_xml.c (raptor_xml_escape_string): Call error_handler correctly. 2004-10-12 Dave Beckett * rasqal/tests/sparql/part1/Makefile.am: Use EXPECTED_SPARQL_CORRECT_FAILURES and count the list at run time 2004-10-10 Dave Beckett * rasqal/sparql_parser.y, rasqal/sparql_lexer.l, rasqal/rdql_parser.y, rasqal/rdql_lexer.l, rasqal/rasqal_query_test.c, rasqal/rasqal_expr.c: Use rasqal_basename to make 'program' in test code messages. * rasqal/rasqal_engine.c (rasqal_engine_execute_finish): Do a terminating loop through columns. * rasqal/rasqal_internal.h: Added rasqal_basename prototype * rasqal/rasqal_general.c (rasqal_basename): Added utility function * rasqal/rasqal_query_test.c (main): Check prepares and multiple executes work. * rasqal/win32/rasqal.dsp: Rename parser, lexer files Add sparql * rasqal/win32_rasqal_config.h: Add RDQL and SPARQL defines * rasqal/rasqal_expr.c: Make all RASQAL_INLINE functions static. * rasqal/rasqal_expr.c: RASQAL_INLINE at start of line 2004-10-08 Dave Beckett * rasqal/sparql_parser.y, rasqal/sparql_lexer.l, rasqal/sparql_common.h, rasqal/rasqal_internal.h, rasqal/rasqal_general.c, rasqal/Makefile.am: BRQL to SPARQL 2004-10-07 Dave Beckett * Redland.i: Export librdf_world_get_feature and librdf_world_set_feature * librdf/rdf_init.h: Update librdf_world_get_feature and librdf_world_set_feature to use librdf_node* * librdf/rdf_init.c (librdf_world_get_feature): Document and change to return librdf_node* (librdf_world_set_feature): Document and change to use librdf_node* value. 2004-09-30 Dave Beckett * rasqal/tests/sparql/check-sparql: -warnings, new perl only * rasqal/roqet.c: On query failure (prepare or execute) tidy and exit * rasqal/tests/rdql/testsuite/Makefile.am: count expected failures the old way * rasqal/tests/rdql/testsuite/check-rdql, rasqal/tests/sparql/check-sparql: Handle query parsing, execution errors * rasqal/tests/rdql/testsuite/Makefile.am: Handle test failures with/without a regex library * rasqal/tests/sparql/simple/Makefile.am, rasqal/tests/sparql/part1/Makefile.am: echo messages for correct, works targets * rasqal/tests/sparql/check-sparql: A few more fixes predicting optional results working. Unique test works * rasqal/tests/rdql/testsuite/check-rdql, rasqal/tests/sparql/check-sparql: Handle missing vars or with undef value * rasqal/tests/sparql/part1/Makefile.am, rasqal/tests/sparql/simple/Makefile.am: Use check-sparql to run queries driven by manifests and check results are correct. Enable this in check-local * rasqal/tests/sparql/check-sparql: Read manifest * rasqal/tests/sparql/simple/Makefile.am: Remove expected test failures code. * rasqal/tests/sparql/Makefile.am: Added check-sparql * rasqal/tests/sparql/check-sparql: run sparql tests * rasqal/tests/rdql/testsuite/check-rdql: Relative to root is ../../.. use -d on roqet to dump query Added -d flag here to run in debug mode * rasqal/roqet.c: Added -d/--dump-query to print query to stdout * rasqal/tests/sparql/Makefile.am: sparql tests * rasqal/Makefile.am: sparql parser/lexer tests * rasqal/brql_parser.y: sparql label * rasqal/Makefile.am: BRQL to SPARQL * rasqal/rasqal_general.c: brql to sparql * rasqal/tests/sparql/part1/Makefile.am, rasqal/tests/sparql/simple/Makefile.am: list files * rasqal/configure.ac: Added sparql subdirs * rasqal/tests/sparql/part1/Makefile.am, rasqal/tests/sparql/part1/dawg-data-01.n3, rasqal/tests/sparql/part1/dawg-query-001, rasqal/tests/sparql/part1/dawg-query-002, rasqal/tests/sparql/part1/dawg-query-003, rasqal/tests/sparql/part1/dawg-result-001.n3, rasqal/tests/sparql/part1/dawg-result-002.n3, rasqal/tests/sparql/part1/dawg-result-003.n3, rasqal/tests/sparql/part1/manifest.n3: sparql part1 tests * rasqal/tests/sparql/simple/Makefile.am, rasqal/tests/sparql/simple/data-01.n3, rasqal/tests/sparql/simple/data-02.n3, rasqal/tests/sparql/simple/dawg-data-01.n3, rasqal/tests/sparql/simple/dawg-tp-01.rq, rasqal/tests/sparql/simple/dawg-tp-02.rq, rasqal/tests/sparql/simple/dawg-tp-03.rq, rasqal/tests/sparql/simple/dawg-tp-04.rq, rasqal/tests/sparql/simple/manifest.n3, rasqal/tests/sparql/simple/result-tp-01.n3, rasqal/tests/sparql/simple/result-tp-02.n3, rasqal/tests/sparql/simple/result-tp-03.n3, rasqal/tests/sparql/simple/result-tp-04.n3: Added sparql simple tests * rasqal/configure.ac: brql to sparql * rasqal/tests/Makefile.am: brql to sparql * rasqal/tests/brql/D.n3, rasqal/tests/brql/E.n3, rasqal/tests/brql/Makefile.am, rasqal/tests/brql/Q-C-1, rasqal/tests/brql/Q-C-2, rasqal/tests/brql/Q-D-1, rasqal/tests/brql/Q-D-2, rasqal/tests/brql/Q-D-3, rasqal/tests/brql/Q-F2F3-1, rasqal/tests/brql/Q-F2F3-2, rasqal/tests/brql/Q-OPT-1, rasqal/tests/brql/Q-OPT-2, rasqal/tests/brql/Q-S-1, rasqal/tests/brql/Q-S-2, rasqal/tests/brql/Q-SOURCE-1, rasqal/tests/brql/Q-SOURCE-2: Deleted * rasqal/Makefile.am: Add rasqal_xml.c * rasqal/roqet.c: Use rasqal_query_results_print_as_xml * rasqal/rasqal.h: Added rasqal_query_results_print_as_xml * rasqal/rasqal_xml.c: Rasqal XML * rasqal/roqet.c (roqet_print_results_as_xml): If xml, don't print datatype attribute. * rasqal/roqet.c: indent * rasqal/roqet.c (roqet_print_results_as_xml): no need to malloc/free when escaped string is same len as original. * rasqal/roqet.c: debug * rasqal/roqet.c (roqet_print_results_as_xml): Print XML Literals raw. * rasqal/roqet.c: Added OUTPUT_FORMAT_XML experiment (roqet_print_xml_attribute): Added, based on librdf_serialize_rdfxml code. (roqet_print_results_as_xml): Added, printing an entire result stream to the given handle in XML. (main): Added the xml output format. * rasqal/rasqal_literal.c, rasqal/rasqal.h: Export rasqal_literal_print_type * rasqal/roqet.c: source_uri check * rasqal/brql_parser.y: brql to sparqal (keeping alias) * rasqal/roqet.c: terminology s/data/source/ -d/-s --data/--source * rasqal/rasqal_query.c (rasqal_query_add_source, rasqal_query_get_source): Handle NULL query->sources and initialise it first time when adding. (rasqal_query_add_variable, rasqal_query_get_variable, rasqal_query_has_variable, rasqal_query_set_variable): Handle NULL query->selects and initialise it first time when adding. (rasqal_query_add_triple, rasqal_query_get_triple):Handle NULL query->triples and initialise it first time when adding. (rasqal_query_add_constraint, rasqal_query_get_constraint): Handle NULL query->constraints and initialise it first time when adding. (rasqal_query_add_prefix, rasqal_query_get_prefix): Handle NULL query->prefixes and initialise it first time when adding. * rasqal/roqet.c: Added -d URI to specify a data URI to load before running the query. 2004-09-29 Dave Beckett * Redland.i: Added REDLAND_TYPEMAP_I protecting redland-typemap.i early on 2004-09-26 Dave Beckett * rasqal/brql_parser.y: (TriplePatternList) Append constraint to right sequence. * rasqal/brql_parser.y: Merged CommaAndConstraintClause into TriplePatternList to remove another shift/reduce conflict with AND. * rasqal/brql_parser.y: CommaAndConstraintClause tidy * rasqal/brql_parser.y: Removed SOURCE alias for FROM, reducing a shift/reduce cnflict * rasqal/brql_parser.y: URIList tidy * rasqal/fix-bison: Delete yyerrlab1 label only if used in a goto * rasqal/tests/brql/Q-F2F3-1, rasqal/tests/brql/Q-F2F3-2: F2F3 bits * rasqal/rasqal_general.c: debug messages * rasqal/tests/brql/Q-SOURCE-1, rasqal/tests/brql/Q-SOURCE-2: PREFIX syntax * rasqal/rasqal.h: rasqal_triples_source_s: remove source_index. rasqal_triples_source_factory: remove UI from new_triples_source method. * rasqal/rasqal_redland.c: rasqal_redland_triples_source_user_data: Add source_uris array of size source_uris_count and source_index to use it when loading data. (rasqal_redland_new_triples_source): Walk through each source URI in turn and load data. (rasqal_redland_free_triples_source): Tidy up new array of uris. * rasqal/rasqal_raptor.c (rasqal_raptor_new_triples_source, rasqal_raptor_free_triples_source): Allocate and free source_uris and source_literals array. * rasqal/rasqal_redland.c (rasqal_redland_new_triples_source): Handle 0 sources * rasqal/rasqal_raptor.c: rasqal_raptor_triples_source_user_data: Add source_uris and source_literals array of size source_uris_count and source_index to use it when loading data. (rasqal_raptor_statement_handler): set origin URI as pointer into URI literals array. (rasqal_raptor_new_triples_source): Remove URI arg. Walk through each source URI in turn and load data. (rasqal_raptor_triple_match): Remove URi arg, use origin_uri from triple. (rasqal_raptor_free_triples_source): Tidy up new arrays of data. (rasqal_raptor_bind_match): Update call to triple_match with no URI argument. * rasqal/rasqal_engine.c (rasqal_new_triples_source): Do not assume there is just one URI source. (rasqal_triples_source_next_source): Deleted. (rasqal_engine_get_next_result): Remove call to rasqal_triples_source_next_source - sources are not applied in order. * rasqal/brql_parser.y: expect 4 (TriplePatternList): Rewrite and add SOURCE, OPTIONAL (ConstraintClause): Removed, now in TriplePatternList (URIList): No commas * rasqal/Makefile.am: Added fix-bison. Use it for rdql and brql parsers. * rasqal/fix-bison: fix-bison 2004-09-24 Dave Beckett * raptor/raptor-config.1: Restore deleted content 2004-09-22 Dave Beckett * librdf/rdf_storage.c (librdf_storage_context_add_statement, librdf_storage_context_add_statements): With a NULL context, call the non-context method as documented. Fix NULL statement pointer checks. 2004-09-20 Dave Beckett * raptor/win32_raptor_config.h, raptor/configure.ac: Bumped version to 1.3.4 * raptor/examples/Makefile.am, raptor/examples/grapper.c, raptor/examples/raptor_abort.c, raptor/raptor_locator.c, raptor/raptor_namespace.c, raptor/raptor_nfc.c, raptor/raptor_nfc.h, raptor/raptor_nfc_test.c, raptor/raptor_parse.c, raptor/raptor_qname.c, raptor/raptor_rdfxml.c, raptor/raptor_rfc2396.c, raptor/raptor_rss.c, raptor/raptor_sax2.c, raptor/raptor_sequence.c, raptor/raptor_set.c, raptor/raptor_stringbuffer.c, raptor/raptor_uri.c, raptor/raptor_utf8.c, raptor/raptor_win32.c, raptor/raptor_www.c, raptor/raptor_www_curl.c, raptor/raptor_www_libfetch.c, raptor/raptor_www_libwww.c, raptor/raptor_www_libxml.c, raptor/raptor_www_test.c, raptor/raptor_xml.c, raptor/raptor_xml_writer.c, raptor/rdfdump.c, raptor/tests/Makefile.am, raptor/tests/empty.c, raptor/tests/ex-14.out, raptor/tests/ex-20.out, raptor/tests/ex-22.out, raptor/tests/ex-52.out, raptor/tests/turtle/Makefile.am, raptor/tests/turtle/README.txt, raptor/tests/turtle/rdfq-results.out, raptor/tests/turtle/test-00.out, raptor/turtle_common.h, raptor/turtle_lexer.l, raptor/turtle_parser.y, raptor/win32_raptor_config.h, raptor/Makefile.am, raptor/configure.ac, raptor/manifest.pl, raptor/n3_common.h, raptor/n3_lexer.l, raptor/n3_parser.y, raptor/ntriples_parse.c, raptor/raptor-config.1, raptor/raptor-config.in, raptor/raptor-src-config.in, raptor/raptor.h, raptor/raptor.rdf.in, raptor/raptor.spec.in, raptor/raptor_expat.c, raptor/raptor_general.c, raptor/raptor_identifier.c, raptor/raptor_internal.h, raptor/raptor_libxml.c: LGPL / Apache 2.0 license * raptor/configure.ac: Check for libxml 2.5.10+ for RSS tag soup parser requirements, not features. 2004-09-19 Dave Beckett * rasqal/rasqal_internal.h: Added prototype for rasqal_engine_declare_prefix * rasqal/rasqal_engine.c (rasqal_engine_declare_prefix): Added to declare a namespace prefix/uri once only in a query. (rasqal_engine_declare_prefixes): Use above. * rasqal/rasqal.h: Added declared field to rasqal_prefix * rasqal/brql_parser.y: Initial BRQL updates post DAWG F2F3 Deleted OPTIONAL, replaced with []s around set of triples using new terms LSQUARE and RSQUARE Removed USING work and replaced with PREFIX earlier. Declare prefixes as soon as they appear. * rasqal/brql_lexer.l: Added PREF state for post-PREFIX word handling Define PREFIX, NAME, QNAME more precisely (not checked vs spec) Deleted OPTIONAL Made "PREFIX"/"prefix" set state PREF Added [/LSQUARE and ]/RSQUARE Made state handle foo: and : names for namespace prefixes 2004-09-16 Dave Beckett * rasqal/rasqal_internal.h: Added prototype for rasqal_triples_source_next_source * rasqal/rasqal.h: Added origin field to rasqal_triple Added rasqal_triple_set_origin and rasqal_triple_get_origin Made bindings be [4]array Added raptor_uri param to rasqal_triples_soruce_factory method new_triples_source * rasqal/rasqal_redland.c (rasqal_redland_new_triples_match): Added origin, not checked * rasqal/rasqal_raptor.c (rasqal_new_triples_source): Set uri from first in list, call updated factory with that uri. (rasqal_free_triples_source): Tidy triples source and user data only if not alreayd done. (rasqal_triples_source_next_source): Added for switching to next data source. (rasqal_triples_match_bind_match): Handle 4 bindings (rasqal_engine_get_next_result): Handle origin queries and switching to next data source when current one exhausted (goto restart) * rasqal/rasqal_expr.c (rasqal_triple_print): Handle origin. (rasqal_triple_set_origin, rasqal_triple_get_origin): Added * rasqal/rasqal_engine.c (rasqal_new_triples_source): Set uri from first in list, call updated factory with that uri. (rasqal_free_triples_source): Tidy triples source and user data only if not alreayd done. (rasqal_triples_source_next_source): Added for switching to next data source. (rasqal_triples_match_bind_match): Handle 4 bindings (rasqal_engine_get_next_result): Handle origin queries and switching to next data source when current one exhausted (goto restart) * rasqal/brql_parser.y: Added SOURCE ?foo before triple * rasqal/tests/brql/Makefile.am, rasqal/tests/brql/E.n3, rasqal/tests/brql/Q-SOURCE-1, rasqal/tests/brql/Q-SOURCE-2: tests 2004-09-12 Dave Beckett * rasqal/rasqal_literal.c (rasqal_literal_as_string): Handle BLANK 2004-09-11 Dave Beckett * rasqal/rasqal.h: docs * rasqal/brql_parser.y (OptionalClause): Make print handler for seq of seq. * rasqal/rasqal_engine.c (rasqal_engine_assign_variables): Handle no selects * rasqal/rasqal_raptor.c (rasqal_raptor_new_triples_source): Handle no sources * rasqal/roqet.c: Use raptor_free_memory on uri_string * rasqal/Makefile.am: clean up local_tests * rasqal/tests/brql/Makefile.am: fix tool building paths * rasqal/rasqal_query_test.c: Use data/dc.rdf * rasqal/Makefile.am, rasqal/configure.ac: Added data * rasqal/data/Makefile.am, rasqal/data/dc.rdf: data 2004-09-10 Dave Beckett * raptor/raptor_namespace.c: foo * raptor/raptor_namespace.c (raptor_new_namespace): Debug message only when level >1 * rasqal/brql_lexer.l, rasqal/rdql_lexer.l (main): Use raptor_free_memory * rasqal/tests/brql/Makefile.am: BRQL Makefile * rasqal/tests/rdql/Makefile.am: RDQL Makefile * rasqal/rasqal_query.c (rasqal_free_query): Added describes, optional_triples and constructs. (rasqal_query_print): Print describes, optional_triples and constructs when present. Make most things printing only if present. * rasqal/Makefile.am: fix line directives in bison generated files * rasqal/tests/rdql/testsuite/check-rdql, rasqal/tests/rdql/testsuite/tests2turtle.patch: Adjustments for dir renaming * rasqal/rasqal_internal.h: Added constructs, optional_triples, describes sequences Added select_is_describe, construct_all flags. Declare rasqal_init_query_engine_brql prototype * rasqal/rasqal_general.c (rasqal_init): Use conditionals for query language inits. * rasqal/rasqal_engine.c (rasqal_engine_expand_triple_qnames): Don't fail if there are no triples. BRQL doesn't need them. * rasqal/tests/brql/D.n3, rasqal/tests/brql/Q-C-1, rasqal/tests/brql/Q-C-2, rasqal/tests/brql/Q-D-1, rasqal/tests/brql/Q-D-2, rasqal/tests/brql/Q-D-3, rasqal/tests/brql/Q-OPT-1, rasqal/tests/brql/Q-OPT-2, rasqal/tests/brql/Q-S-1, rasqal/tests/brql/Q-S-2: BRQL tests * rasqal/tests/Makefile.am: Switch to just subdirs here * rasqal/Makefile.am: Split tests into BRQL and RDQL ones enabled separately. Use makefile conditionals for sources * rasqal/configure.ac: Added --enable-query-languages and automake conditionals to avoid building them. * rasqal/Makefile.am: Remove rdql-testsuite dir. Add BRQL sources and tests * rasqal/brql_common.h, rasqal/brql_lexer.l, rasqal/brql_parser.y: BRQL * rasqal/tests/rdql/dc.rdf, rasqal/tests/rdql/example1.rdql, rasqal/tests/rdql/example2.rdql, rasqal/tests/rdql/example3.rdql, rasqal/tests/rdql/example4.rdql, rasqal/tests/rdql/example5.rdql, rasqal/tests/rdql/example_at_1.rdql, rasqal/tests/rdql/example_at_2.rdql, rasqal/tests/rdql/example_at_3.rdql, rasqal/tests/rdql/example_at_4.rdql, rasqal/tests/rdql/example_at_5.rdql, rasqal/tests/rdql/example_at_6.rdql, rasqal/tests/rdql/example_at_7.rdql, rasqal/tests/rdql/example_at_8.rdql, rasqal/tests/rdql/note-ex1.rdql, rasqal/tests/rdql/note-ex2.rdql, rasqal/tests/rdql/note-ex3.rdql, rasqal/tests/rdql/note-ex4.rdql, rasqal/tests/dc.rdf, rasqal/tests/example1.rdql, rasqal/tests/example2.rdql, rasqal/tests/example3.rdql, rasqal/tests/example4.rdql, rasqal/tests/example5.rdql, rasqal/tests/example_at_1.rdql, rasqal/tests/example_at_2.rdql, rasqal/tests/example_at_3.rdql, rasqal/tests/example_at_4.rdql, rasqal/tests/example_at_5.rdql, rasqal/tests/example_at_6.rdql, rasqal/tests/example_at_7.rdql, rasqal/tests/example_at_8.rdql, rasqal/tests/note-ex1.rdql, rasqal/tests/note-ex2.rdql, rasqal/tests/note-ex3.rdql, rasqal/tests/note-ex4.rdql: Moved to rdql subdir 2004-09-09 Dave Beckett * raptor/Makefile.am: Just link raptor_uri_test, raptor_uri_win32_test with raptor_rfc2396.lo * raptor/raptor_uri.c: (main) Don't use raptor_basename * raptor/raptor_uri.c: Revert wrapping so that -DWIN32 raptor_uri_win32_test can be compiled. OSX 'make check' will have to live with the moans. * raptor/raptor_uri.c: Wrap functions with #ifndef STANDALONE ... #endif to prevent multiple link warnings on OSX with tests. * raptor/raptor_uri.c (main): Use program and raptor_basename in messages * raptor/raptor_sequence.c, raptor/raptor_stringbuffer.c, raptor/raptor_xml.c, raptor/raptor_rfc2396.c: Wrap functions with #ifndef STANDALONE ... #endif to prevent multiple link warnings on OSX with tests. * raptor/raptor_rss.c, raptor/raptor_rfc2396.c: Fixes for C++ * raptor/NOTICE: NOTICE * raptor/raptor.spec.in, raptor/Makefile.am: Added NOTICE * raptor/raptor.spec.in: Mention atom 0.3 * raptor/raptor.spec.in: Update for LGPL/Apache 2 * raptor/raptor_rfc2396.c: Header 2004-09-08 Dave Beckett * raptor/raptor_rfc2396.c (raptor_new_uri_detail): Handle NULL string - failure. Increase alloced size to compensate for possibly 5 extra \0s for each URI component. (main): Check "" URI parses and NULL doesn't crash it. * raptor/raptor_internal.h: Added raptor_uri_detail. Added internal raptor_basename. * raptor/raptor.h: docs * raptor/Makefile.am: Added raptor_rfc2396.c and raptor_rfc2396_test Link all tests with librdf.la $(LIBS) * raptor/raptor_rfc2396.c: RFC2396 URI detail * raptor/raptor_uri.c: Remove old URI resolving code. * raptor/raptor_xml.c, raptor/raptor_parse.c, raptor/raptor_sequence.c, raptor/raptor_set.c, raptor/raptor_stringbuffer.c, raptor/raptor_nfc_test.c: Use raptor_basename in test code main() * raptor/raptor_general.c (raptor_basename): Added * raptor/raptor_rdfxml.c: correct comment * raptor/Makefile.am: Enable raptor_set_test raptor_xml_test tests only when rdf/xml enabled. * raptor/raptor_parse.c (raptor_stats_print): Only print rdfxml stats if compiled in. * raptor/Makefile.am: Change test to be raptor_parse_test Use raptor_rdfxml.c only if rdf/xml enabled. * raptor/raptor.h: Export raptor_xml_literal_datatype_uri_string_len * raptor/raptor_internal.h: Declare raptor_delete_parser_factories. * raptor/raptor_parse.c, raptor/raptor_general.c: Moved the following parser related functions and methods to raptor_parse.c: raptor_default_generate_id_handler, raptor_delete_parser_factories, raptor_feature_from_uri, raptor_features_enumerate, raptor_free_parser, raptor_generate_id, raptor_get_feature, raptor_get_label, raptor_get_locator, raptor_get_mime_type, raptor_get_name, raptor_get_parser_factory , raptor_guess_parser_name, raptor_new_parser, raptor_new_parser_for_content, raptor_parse_abort, raptor_parse_chunk, raptor_parse_file, raptor_parse_file_stream, raptor_parse_uri, raptor_parse_uri_with_connection, raptor_parse_uri_write_bytes, raptor_parser_error, raptor_parser_error_varargs, raptor_parser_fatal_error, raptor_parser_fatal_error_varargs, raptor_parser_register_factory, raptor_parser_simple_error, raptor_parser_warning, raptor_parser_warning_varargs, raptor_parsers_enumerate, raptor_set_default_generate_id_parameters, raptor_set_error_handler, raptor_set_fatal_error_handler, raptor_set_feature, raptor_set_generate_id_handler, raptor_set_parser_strict, raptor_set_statement_handler, raptor_set_warning_handler, raptor_start_parse, raptor_stats_print, raptor_syntax_name_check, raptor_syntaxes_enumerate * raptor/Makefile.am: -MPL1.1 +Apache2.0 * raptor/LICENSE-2.0.txt: +Apache2 2004-09-07 Dave Beckett * raptor/tests/turtle/test-16.ttl, raptor/tests/turtle/test-16.out: 10000 triples exactly now * raptor/raptor_sequence.c: docs * raptor/turtle_parser.y (blank): Revert mis-edited triple sequence change. * raptor/turtle_parser.y (propertyList): Switch to left-recursion to prevent stack problems with bison. (raptor_turtle_parse_terminate): Call turtle_lexer_lex_destroy properly. * rasqal/rdql_parser.y (rasqal_rdql_query_engine_terminate): Call rdql_lexer_lex_destroy properly. * raptor/tests/turtle/test-14.ttl, raptor/tests/turtle/test-14.out: Use exactly 10000 all different triples. * raptor/tests/turtle/test-15.out, raptor/tests/turtle/test-15.ttl: Use different objects and no collections so there are exactly 10000 triples, all different. * raptor/tests/turtle/test-16.out, raptor/tests/turtle/test-16.ttl: Use different objects so all 10000 triples are different * raptor/turtle_lexer.l (turtle_token_print): Add INTEGER_LITERAL for debugging. * raptor/Makefile.am: Make turtle_parser.c appear as C source name * raptor/turtle_parser.y (statementList, objectList): Switch to using left recursion to prevent stack overflow in bison with 10000 statements (possible) or objects (rarer). * raptor/tests/turtle/Makefile.am, raptor/tests/turtle/test-14.out, raptor/tests/turtle/test-14.ttl, raptor/tests/turtle/test-15.out, raptor/tests/turtle/test-15.ttl, raptor/tests/turtle/test-16.out, raptor/tests/turtle/test-16.ttl: Added large turtle tests test-14,15,16 * raptor/turtle_parser.y (raptor_turtle_parse_chunk): Use RAPTOR_REALLOC for massive speed improvements on some systems. * raptor/raptor_internal.h: Added RAPTOR_REALLOC 2004-09-06 Dave Beckett * rasqal/rasqal_engine.c (rasqal_engine_execute_finish): Don't free triple_meta before checking the columns * rasqal/Makefile.am: Added rasqal_query_test to TESTS * rasqal/rasqal_engine.c (rasqal_engine_execute_init): Init triples_source, triple_meta only if not already done. (rasqal_engine_execute_finish): Free triple_meta and any variables still set if not cleared. * rasqal/rasqal_raptor.c (rasqal_raptor_free_triples_source): Free the rasqal_triple in the loop. * rasqal/rasqal_query.c (rasqal_query_execute): Re-execute if wanted. * rasqal/tests/Makefile.am, rasqal/tests/dc.rdf: Added dc.rdf * rasqal/Makefile.am, rasqal/rasqal_query_test.c: Added rasqal_query_test.c * rasqal/rasqal_literal.c (rasqal_literal_expand_qname): Zap old string pointer. * raptor/raptor_set.c (raptor_free_id_set): Free the set after freeing the list. * rasqal/rasqal_query.c (rasqal_query_prepare): Allow re-prepare when finished or executed. * rasqal/rasqal_engine.c (rasqal_engine_execute_init): Do not overwrite query->variables on a re-execute init. * librdf/rdf_log.c (librdf_fatal): Off by 1 in snprintf on OSX 2004-09-02 Dave Beckett * raptor/tests/turtle/test-13.out, raptor/tests/turtle/test-13.ttl: Make serializable as rdf/xml 2004-09-01 Dave Beckett * utils/rdfproc.c: Init results to NULL * raptor/tests/turtle/Makefile.am, raptor/tests/turtle/README.txt: Turtle tests readme 2004-08-30 Dave Beckett * librdf/rdf_storage_mysql.c (librdf_storage_mysql_get_contexts): Removed bogus '+' in the sql statement. Thanks to DJ Adams for finding this. 2004-08-29 Dave Beckett * rasqal/rdql_lexer.l: Fix copy_regex_token prototype - delim is not const. 2004-08-27 Dave Beckett * raptor/raptor_rss.c: compare namespace URIs the cheaper way * raptor/raptor_rss.c: Added atom:copyright Rewrite atom fields earlier. Compare namespaces too, if they have them. * raptor/raptor_rss.c: Handle atom 0.3 somewhat. - Add atom author type. - Add atom 0.3 NS and atom 0.3 properties - Add DC Ns and all DC element properties. - Always rewrites atom:content into rss:description which is not correct for all situations. - Cannot handle multiple with different attributes; just uses rel=alternate ones. General changes: Use XML_READER type enums. Fix copying properties to use RAPTOR_RSS_FIELDS_SIZE. Allow item field x to have a URI value in item->uri_fields[x] as well as literal in item->fields[x]. 2004-08-23 Dave Beckett * raptor/turtle_parser.y (blank rule): Do not free a generated id here 2004-08-22 Dave Beckett * raptor/configure.ac: Remove old reference to g_utf8_normalize * rasqal/tests/example_at_8.rdql: RDQL @semantics example 8 * rasqal/tests/Makefile.am: Added example_at_8.rdql * rasqal/Makefile.am: Re-fix generation of rdql_parser.c * rasqal/rdql_parser.y: Allow optional comma in prefix declaration lists. * rasqal/Makefile.am: Update rdql_parser bison output fix for no .tab.c 2004-08-19 Dave Beckett * raptor/Makefile.am: Add libraptor_la_SOURCES += for NFC. 2004-08-18 Dave Beckett * raptor/raptor_set.c: Wrap main code with #ifndef STANDALONE * raptor/raptor_general.c (raptor_init, raptor_finish): Use new static raptor_initialised to protect these from being run twice. 2004-08-17 Dave Beckett * raptor/configure.ac: Give nfc_needed a default * raptor/configure.ac, raptor/Makefile.am: Added conditional makefile support for XML parsers (expat, libxml), selecting RDF parsers (RDF/XML, Turtle, N-Triples, RSS tag soup), NFC checking. Added new configure argument --enable-parsers to control this. * raptor/raptor_utf8.c (raptor_utf8_is_nfc): Protect NFC check with define RAPTOR_NFC_CHECK * raptor/raptor_locator.c (raptor_update_document_locator): Protect RDF/XML bits with define RAPTOR_PARSER_RDFXML * raptor/raptor_general.c (raptor_stats_print): Protect RDF/XML bits with define RAPTOR_PARSER_RDFXML * raptor/raptor.h: Added prototype for raptor_calloc_memory * raptor/raptor_set.c, raptor/raptor_nfc.c: Casts for C++ * rasqal/rasqal_literal.c (rasqal_literal_as_integer, rasqal_literal_as_floating): Edit casts near strtol, strtod to cause less moaning and still work with C++. * librdf/win32_rdf_config.h: 0.9.19 * raptor/win32_raptor_config.h: 1.3.3 * rasqal/win32_rasqal_config.h: 0.9.3 * rasqal/configure.ac: Remove link with expat (!) in posix regex check 2004-08-13 Dave Beckett * rasqal/win32/Makefile.am: rasqal not raptor * rasqal/win32/Makefile.am, rasqal/win32/rasqal.dsp, rasqal/win32/rasqal.dsw: win32 build configuration * rasqal/configure.ac, rasqal/Makefile.am: Add win32 dir * rasqal/roqet.c: Use #ifdef HAVE_UNISTD_H ... #endif around include of * rasqal/rasqal_literal.c, rasqal/rasqal_expr.c: Use RASQAL_INLINE instead of inline. * rasqal/win32_rasqal_config.h: win32 updates from Chris Pointon * rasqal/rasqal_internal.h: Define RASQAL_INLINE here but don't condition it. * rasqal/rasqal_internal.h: Add RASQAL_INLINE, empty on WIN32 * rasqal/rasqal.h: Export rasqal_set_triples_source_factory * raptor/turtle_lexer.l, raptor/n3_lexer.l: grammar * rasqal/rdql_parser.y: Use win32_rasqal_config.h * rasqal/rdql_lexer.l, rasqal/fix-flex, raptor/turtle_lexer.l, raptor/n3_lexer.l, raptor/fix-flex: fix-flex now inserts the raptor and win32 config includes block at the top of the lexer C. * raptor/n3_parser.y, raptor/n3_lexer.l: win32 * rasqal/rdql_parser.y, rasqal/rdql_lexer.l, rasqal/Makefile.am: Do not generate *.tab.[ch] for rdql parser but process and rename to make .c, .h. * raptor/win32/raptor.dsw, raptor/win32/raptor.dsp: win32 updates from Chris Pointon * raptor/win32_raptor_config.h: No need for #define YY_NO_UNISTD_H here, it's done in the turtle lexer and parser C source. * raptor/turtle_parser.y, raptor/turtle_lexer.l: Use turtle_parser.h * raptor/raptor_xml_writer.c, raptor/raptor_sax2.c, raptor/raptor_qname.c, raptor/raptor_parse.c, raptor/raptor_namespace.c, raptor/raptor_libxml.c: Calloc fixes. * raptor/Makefile.am: Do not generate *.tab.[ch] for turtle parser but process and rename to make .c, .h. Apply fix-flex to the generated flex header file, to catch another unprotected include of unistd.h. * raptor/libraptor.3: Document raptor_calloc_memory. * raptor/raptor_general.c: Added raptor_calloc_memory * raptor/raptor_www_libwww.c: Add #ifdef RAPTOR_WWW_LIBWWW ... #endif block around content * raptor/raptor_www_libfetch.c: Add #ifdef RAPTOR_WWW_LIBFETCH ... #endif block around content Use #ifdef HAVE_SYS_PARAM_H for sys/param.h * raptor/raptor_www_curl.c: Add #ifdef RAPTOR_WWW_LIBCURL ... #endif block around content * raptor/win32_raptor_config.h: win32 updates from Chris Pointon * raptor/raptor_www.c: Calloc fix. (raptor_www_get_connection): Return NULL if no WWW library available. * raptor/raptor_internal.h: Correct RAPTOR_CALLOC macro param names. * raptor/raptor.h: Export raptor_xml_literal_datatype_uri_string * raptor/win32/Makefile.am, raptor/win32/README.txt, raptor/win32/README: README renamed to README.txt * librdf/rdf_storage_hashes.c, librdf/rdf_storage.c, librdf/rdf_parser.c, librdf/rdf_model_storage.c, librdf/rdf_model.c: Documentation - Note that the model, storage and parser get_feature methods return new librdf_node objects * Redland.i: librdf_model_has_arc_in/out return int not an librdf_iterator. Use %newobject to record that librdf_model_get_feature and librdf_parser_get_feature return new librdf_node objects. 2004-08-12 Dave Beckett * librdf/rdf_model.c (librdf_model_context_add_statement, librdf_model_context_add_statements, librdf_model_context_remove_statement, librdf_model_context_remove_statements, librdf_model_context_as_stream, librdf_model_context_serialize): Return failure when contexts are not supported, don't just carry on. * raptor/raptor_nfc.c: Tidy debug messages. Reset prev_class explicitly. 2004-08-11 Dave Beckett * raptor/raptor_parse.c (raptor_record_ID): c99 * raptor/raptor_nfc.c: Return 0 from raptor_nfc_check on failure * raptor/raptor_nfc_test.c: Raptor NFC test * raptor/Makefile.am: Added raptor_nfc_test.c * raptor/Makefile.am: Add raptor_nfc_data.c raptor_nfc.c raptor_nfc.h Added raptor_nfc_test * raptor/raptor_utf8.c (raptor_utf8_is_nfc): Use raptor_nfc_check. * raptor/raptor_nfc.c, raptor/raptor_nfc.h: Unicode NFC * raptor/raptor_internal.h: Added prototype for raptor_nfc_check * raptor/configure.ac: Check for lengths of u8, u16, u32, char, short, int, long * raptor/raptor_nfc_data.c: Unicode NFC data tables * raptor/raptor_parse.c: Updated for raptor_set to raptor_id_set renaming. (raptor_record_ID): Pass in the base_uri to the raptor_id_set_add, do not malloc / free a larger string. * raptor/raptor_internal.h: Rename the raptor_set* typedef and functions to be raptor_id_set * raptor/raptor_set.c: Change the implementation to a list of (set of IDs)-per base URI. Each time a base URI is checked it is swapped with the first in the list. The set of IDs (raptor_base_id_set) takes a lot less memory since it isn't storing the string concat(base URI,ID) but just ID. The capacity and size parts are part of the raptor_base_id_set. Rename the structures and functions to be raptor_id_set not raptor_set. * raptor/raptor_parse.c (raptor_end_element_grammar): Add check for a non-empty property element with both a node element child and property attributes. For bad test bad-23.rdf * raptor/tests/bad-23.rdf: bad-23.rdf - property attributes and node element content check * raptor/tests/Makefile.am: Added bad-23.rdf * Makefile.am: Add srcdir for Redland.i install * Makefile.am: Preserve the Redland.i timestamp on an install, so that redland-bindings can build against it reliably, not necessarily requiring SWIG to compile. 2004-08-10 Dave Beckett * raptor/libraptor.3: Document check_rdf_id feature 2004-08-03 Dave Beckett * configure.ac: Bumped version to 0.9.19 * Snapshotted redland_0_9_18 for 0.9.18 release * librdf/rdf_statement.h, librdf/rdf_statement.c: Revert statement usage counting. * configure.ac: Bumped version to 0.9.18 * Snapshotted redland_0_9_17 for 0.9.17 release * librdf/rdf_init.c (librdf_free_world): Destroy nodes, statements mutexes. (librdf_world_init_mutex): Init nodes, statements mutexes. * librdf/rdf_init.h: Added statements mutex * librdf/rdf_statement.c: Statements are now usage counted, Removed old macros throughout. (librdf_new_statement): Set usage to 1. (librdf_new_statement_from_statement): Rewrite to use usage. (librdf_free_statement): Free when usage is zero, using mutex to protect shared structures. * librdf/rdf_statement.h: Statements are now usage counted, Removed old macros 2004-08-02 Dave Beckett * librdf/rdf_parser_raptor.c (librdf_parser_raptor_parse_as_stream_common, librdf_parser_raptor_parse_into_model_common): Add a length parameter, calculate it if it is 0. (librdf_parser_raptor_parse_uri_as_stream, librdf_parser_raptor_parse_string_as_stream): Updates for change above. (librdf_parser_raptor_parse_counted_string_as_stream, librdf_parser_raptor_parse_counted_string_into_model): Added, taking a counted string with length>0, calling one of the common functions above. (librdf_parser_raptor_register_factory): Register new methods. * librdf/rdf_parser.c (librdf_parser_parse_counted_string_as_stream, librdf_parser_parse_counted_string_into_model): Added, taking a counted string with length>0, calling the new parser factory methods. (main): Test code updated to test rdfxml, ntriples and turtle with four different parsing methods for one parser. This tests - a) memory model checks for same triples b) parsing works with four methods c) parsing with same parser multiple times works * Redland.i: Added librdf_parser_parse_counted_string_as_stream and librdf_parser_parse_counted_string_into_model * librdf/rdf_parser.h: Added factory methods parse_counted_string_into_model, parse_counted_string_as_stream as variants of the uncounted versions. Added prototypes for librdf_parser_parse_counted_string_as_stream, librdf_parser_parse_counted_string_into_model 2004-07-30 Dave Beckett * raptor/raptor_internal.h: Switch to WWW read buffer size of 4096 (from 256 bytes!) * raptor/raptor_general.c: Switch to read buffer size of 4096 2004-07-28 Dave Beckett * autogen.sh, rasqal/autogen.sh, raptor/autogen.sh: move 'rm's inside configure.ac loop * rasqal/autogen.sh, raptor/autogen.sh, autogen.sh: typo * raptor/autogen.sh, rasqal/autogen.sh, autogen.sh: Ensure subdirs get config.guess, config.sub * librdf/rdf_storage_tstore.c (librdf_storage_list_add_statement): Note FIXME - cannot enforce not adding duplicate statements. * librdf/rdf_storage_mysql.c (librdf_storage_mysql_add_statement, librdf_storage_mysql_add_statements): Enforce not adding duplicate statements. * librdf/rdf_storage_list.c (librdf_storage_list_add_statement): Enforce not adding duplicate statements. (librdf_storage_list_add_statements): Enforce not adding duplicate statements. Tidy the code. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_add_statement): Enforce not adding duplicate statements. This is not needed for librdf_storage_hashes_add_statements since it calls the above method. * librdf/rdf_storage.c: (librdf_storage_add_statement, librdf_storage_add_statements): Document that duplicate statements are ignored on addition. * docs/api.sgml.in: In model class intro, document that duplicate statements are ignored on adding. * librdf/rdf_model.c (librdf_model_add_statement): Document that duplicate statements are ignored and use librdf_model_contains_statement to enforce it. (librdf_model_add_statements): Document that duplicate statements are ignored. * configure.ac: For maintainer-mode, always invoke AC_CONFG_SUBDIR on raptor and rasqal. The extra configures for the maintainer is fine and ensures the tarball is made OK. * Makefile.am: Zap customised DIST_SUBDIRS again * raptor/win32/raptortest.cpp: Added raptor_init, raptor_finish (untested). 2004-07-27 Dave Beckett * librdf/rdf_storage_mysql.c, raptor/raptor_locator.c: casts for c++ 2004-07-27 Morten Frederiksen * Updated to latest version of the MySQL storage written by Morten Frederiksen * librdf/rdf_storage_mysql.c: Add new storage options: bulk - if inserts should be optimized by locking and index optimizations merge - if a table with merged models should be maintained Added a digest object to the storage context for use and re-use of MD5 digesting. (librdf_storage_mysql_hash): Changed to use context digest option. (librdf_storage_mysql_init): Added and documented the bulk and merge options. Document the new option, already implemented, to create tables. Update the MySQL schemas. (librdf_storage_mysql_merge): Added, to re/create merged view of all models. (librdf_storage_mysql_terminate): Tidy up digest from context. (librdf_storage_mysql_sync): Added to flush tables. Now used by librdf_storage_mysql_close. (librdf_storage_mysql_size, librdf_storage_mysql_node_hash): Updated for new schema. (librdf_storage_mysql_start_bulk, librdf_storage_mysql_stop_bulk): Added, to start and stop bulk op. (librdf_storage_mysql_context_add_statements): Add bulk start operations when enabled. (librdf_storage_mysql_context_add_statement_helper, librdf_storage_mysql_contains_statement, librdf_storage_mysql_remove_statement): Docucomments. Updated for new schema. (librdf_storage_mysql_context_remove_statements): Updated for new schema. (librdf_storage_mysql_serialise, librdf_storage_mysql_find_statements, librdf_storage_mysql_find_statements_in_context): Docucomments (librdf_storage_mysql_find_statements_with_options): Docucomments. Updated for new schema. (librdf_storage_mysql_find_statements_in_context_next_statement): Add checking there is a statement to return. (librdf_storage_mysql_get_contexts): Updated for new schema. 2004-07-27 Dave Beckett * rasqal/rasqal_expr.c: Add #ifndef STANDALONE ... #endif around test functions, linked via library. * configure.ac: Remove extra -DLIBRDF_DEBUG when using dmalloc * rasqal/configure.ac: Remove -DLIBRDF_DEBUG * rasqal/configure.ac: raptor-config, redland-config --version-decimal 2>/dev/null * rasqal/configure.ac: Use raptor-config, redland-config --version-decimal * rasqal/configure.ac: Remove duplicate redland-config test * librdf/rdf_query_rasqal.c, librdf/rdf_parser_raptor.c, librdf/rdf_node.c, librdf/rdf_log.c: Casts for C++ * configure.ac: Added DIST_SUBDIRS for maintainer mode * configure.ac, Makefile.am: Replace SD_PRE with LOCAL_SUBDIRS to enable make distcheck to work. Note that this will create a smaller tarball while doing the 'make dist' in the build tree, which should not be used to make the release tarball. * Makefile.am: No need for SD_POST, CONFIG_SUBDIRS (not used here anyway) Tidy DIST_SUBDIRS * configure.ac: No need for SD_POST * configure.ac: Do not configure raptor, rasqal directories unless compiling and using them. That should save a lot of configure time. 2004-07-26 Dave Beckett * AUTHORS: Merged out csharp/AUTHORS * raptor/raptor_general.c: Add #ifndef STANDALONE ... #endif around body. 2004-07-23 Dave Beckett * librdf/rdf_parser.c, librdf/rdf_model.c: Replace parser name "raptor" with "rdfxml" * configure.ac: raptor min version 1.3.2 * examples/example4.c, examples/example2.c: Replace parser name "raptor" with "rdfxml" 2004-07-21 Dave Beckett * rasqal/strcasecmp.c, rasqal/roqet.c, rasqal/rasqal_redland.c, rasqal/rasqal_raptor.c, rasqal/rasqal_query.c, rasqal/rasqal_literal.c, rasqal/rasqal_general.c, rasqal/rasqal_expr.c, rasqal/rasqal_engine.c, rasqal/Makefile.am, rasqal/win32_config.h, rasqal/win32_rasqal_config.h: rename win32_config.h to win32_rasqal_config.h * raptor/configure.ac: Bumped version to 1.3.3 * raptor/configure.ac: Removed configuration for gnome glib, pkgconfig and glib-config to get g_utf8_normalize for Unicode NFC checking. * raptor/raptor_utf8.c (raptor_utf8_is_nfc): Removed use of g_utf8_normalize for Unicode NFC checking, it seems to give false negatives, is also rather slow since it does normalization rather than just checking for NFC. 2004-07-19 Dave Beckett * configure.ac: no need for perl dirs * librdf/redland.spec.in: remove redland-perl, redland-python * redland-src-config.in: Added --libtool-libs * docs/Makefile.am, configure.ac, Makefile.am: Updates for move of files and dirs to redland-bindings package * docs/ruby.html, docs/tcl.html, docs/csharp.html, docs/fix-pod-xhtml, docs/fix-python-xhtml, docs/java.html, docs/perl.html, docs/php.html, docs/python.html: Moved to redland-bindings package * Moved csharp, java, perl, php, python, ruby, tcl directories and supporting doc files in docs to the redland-bindings package. * Redland.i: Remove #include since this is now a public file. 2004-07-16 Dave Beckett * raptor/tests/Makefile.am, raptor/tests/ex-54.out, raptor/tests/ex-54.rdf, raptor/tests/warn-03.out, raptor/tests/warn-03.rdf: Renamed warn-03 to ex-54 - it is not an error or a warning, the data is good 2004-07-14 Dave Beckett * raptor/tests/Makefile.am, raptor/tests/bad-22.rdf: bad-22.rdf testing rdf:li forbidden as a property attribute (Graham Klyne) 2004-07-14 Dave Beckett * raptor/tests/Makefile.am, raptor/tests/bad-22.rdf: bad-22.rdf testing rdf:li forbidden as a property attribute (Graham Klyne) 2004-07-12 Dave Beckett * librdf/redland.spec.in: Ship /usr/share/redland/Redland.i in redland-devel * redland-src-config.in, redland-config.in: Added --swig option to print the path to the SWIG interface file * Makefile.am: Install Redland.i in $(pkgdata) * Redland.i: Split SWIG bits into general and language-specific parts * librdf/rdf_query_results.c (librdf_query_results_get_bindings): Fix docucomment so jade works again * docs/api.sgml.in: id="query-results" 2004-07-09 Dave Beckett * docs/Makefile.am: Don't ship old pictures overview.png overview.ps overview.pdf 2004-07-09 Edd Dumbill * librdf/rdf_log.c: Add accessors for components of the librdf_log_message type. Replace librdf.h, raptor.h with redland.h. * librdf/rdf_log.h: add accessors for components of the librdf_log_message type. 2004-07-09 Dave Beckett * librdf/redland.h: Include rasqal.h, reorder so raptor.h is first. * librdf/rdf_query_results.c, librdf/rdf_utf8.c, librdf/rdf_uri.c, librdf/rdf_stream.c, librdf/rdf_storage_tstore.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_file.c, librdf/rdf_storage.c, librdf/rdf_statement.c, librdf/rdf_serializer_rdfxml.c, librdf/rdf_serializer_raptor.c, librdf/rdf_serializer.c, librdf/rdf_query_triples.c, librdf/ChangeLog, librdf/rdf_query_rasqal.c, librdf/rdf_query.c, librdf/rdf_parser_raptor.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_model_storage.c, librdf/rdf_model.c, librdf/rdf_list.c, librdf/rdf_iterator.c, librdf/rdf_init.c, librdf/rdf_heuristics.c, librdf/rdf_hash_memory.c, librdf/rdf_hash_cursor.c, librdf/rdf_hash_bdb.c, librdf/rdf_hash.c, librdf/rdf_files.c, librdf/rdf_digest_sha1.c, librdf/rdf_digest_openssl.c, librdf/rdf_digest_md5.c, librdf/rdf_digest.c, librdf/rdf_concepts.c: Use redland.h in all files not a selection of librdf.h, raptor.h and rasqal.h * librdf/ChangeLog: ChangeLog in CVS now 2004-07-09 Edd Dumbill * raptor_locator.c: add accessors for parts of the raptor_locator struct. * raptor.h: add prototypes for the accessors 2004-07-09 Dave Beckett * rasqal/ChangeLog, ChangeLog, raptor/ChangeLog: ChangeLog in CVS now 2004-07-08 Dave Beckett * examples/example5.c: Updated to use librdf_query_results * librdf/rdf_query_results.c (librdf_query_results_get_bindings): Added a doc example * librdf/rdf_query_results.c: doc * librdf/rdf_log.c (librdf_log_simple): Use correct user_data. Patch from René Puls. * utils/rdfproc.c (log_handler): Added, used to report things here, rather than let the default code do it. * raptor/raptor_general.c (raptor_parse_uri_with_connection): Pass up WWW errors to the parser error handler. * docs/api.sgml.in: Added QueryResults as a separate file * docs/python.html, docs/perl.html, docs/csharp.html: Link to docs for query_results.html * docs/api.sgml.in: Added QueryResults * docs/Makefile.am: Re-add query_results to DOC_CLASSES * librdf/rdf_query.h: Added internal librdf_query_add_query_result, librdf_query_remove_query_result prototypes * librdf/Makefile.am: Added rdf_query_results.c * librdf/rdf_query.c, librdf/rdf_query_results.c: Moved librdf_query_results to separate file, for doc purposes mostly * docs/Makefile.am: remove query_results * docs/Makefile.am: added query_results to DOC_CLASSES 2004-07-06 Dave Beckett * configure.ac: formatting * configure.ac: Added GACUTIL, SN, ILGAC and report ECMA CLI in languages available * configure.ac: Added ilgac, gacutil, sn 2004-07-05 Dave Beckett * utils/rdfproc.c: fixes for erroring out on query failure * librdf/rdf_storage.c (librdf_storage_node_stream_to_node_create): node2 can be NULL such as when called by librdf_storage_get_arcs_out, librdf_storage_get_arcs_in. 2004-06-30 Dave Beckett * librdf/Makefile.am: Added $(DEFS) to test compile & link lines * librdf/rdf_types.h: Define u64 for WIN32 as a typedef for __int64 * librdf/librdf.h: Added REDLAND_STATIC to define REDLAND_API to nothing. * raptor/configure.ac: Added RAPTOR_PARSER_TURTLE, RAPTOR_PARSER_NTRIPLES and RAPTOR_PARSER_RDFXML all set to 1 * raptor/raptor_general.c (raptor_init): Added RAPTOR_PARSER_TURTLE, RAPTOR_PARSER_NTRIPLES and RAPTOR_PARSER_RDFXML * librdf/Makefile.am: Added win32_rdf_config.h * librdf/win32_rdf_config.h: redland WIN32 hard-coded config * librdf/rdf_storage.c, librdf/rdf_storage_file.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_tstore.c, librdf/rdf_stream.c, librdf/rdf_uri.c, librdf/rdf_utf8.c, librdf/rdf_hash_memory.c, librdf/rdf_heuristics.c, librdf/rdf_init.c, librdf/rdf_iterator.c, librdf/rdf_list.c, librdf/rdf_log.c, librdf/rdf_model.c, librdf/rdf_model_storage.c, librdf/rdf_node.c, librdf/rdf_parser.c, librdf/rdf_parser_raptor.c, librdf/rdf_query.c, librdf/rdf_query_rasqal.c, librdf/rdf_query_triples.c, librdf/rdf_serializer.c, librdf/rdf_serializer_raptor.c, librdf/rdf_serializer_rdfxml.c, librdf/rdf_statement.c, librdf/rdf_concepts.c, librdf/rdf_digest.c, librdf/rdf_digest_md5.c, librdf/rdf_digest_openssl.c, librdf/rdf_digest_sha1.c, librdf/rdf_files.c, librdf/rdf_hash.c, librdf/rdf_hash_bdb.c, librdf/rdf_hash_cursor.c: Added #include when WIN32 defined * raptor/win32_raptor_config.h: 1.3.2 * raptor/turtle_parser.y, raptor/turtle_lexer.l, raptor/strcasecmp.c, raptor/rdfdump.c, raptor/raptor_xml_writer.c, raptor/raptor_xml.c, raptor/raptor_www_test.c, raptor/raptor_www_libxml.c, raptor/raptor_www_libwww.c, raptor/raptor_www_libfetch.c, raptor/raptor_www_curl.c, raptor/raptor_www.c, raptor/raptor_win32.c, raptor/raptor_utf8.c, raptor/raptor_uri.c, raptor/raptor_stringbuffer.c, raptor/raptor_set.c, raptor/raptor_sequence.c, raptor/raptor_sax2.c, raptor/raptor_rss.c, raptor/raptor_qname.c, raptor/raptor_parse.c, raptor/raptor_namespace.c, raptor/raptor_locator.c, raptor/raptor_libxml.c, raptor/raptor_identifier.c, raptor/raptor_general.c, raptor/raptor_expat.c, raptor/ntriples_parse.c, raptor/Makefile.am, raptor/win32_raptor_config.h, raptor/win32_config.h: Renamed win32_config.h to win32_raptor_config.h 2004-06-29 Dave Beckett * librdf/rdf_storage.c (librdf_storage_find_statements_in_context): When applying map, copy the statement so it can be freed later. * librdf/rdf_model.c (librdf_model_find_statements_in_context): When applying map, copy the statement so it can be freed later. 2004-06-25 Dave Beckett * raptor/ntriples_parse.c (raptor_ntriples_parse_line): Make language on a datatyped literal a warning. 2004-06-24 Dave Beckett * raptor/raptor_general.c: docs * raptor/libraptor.3: date * raptor/libraptor.3: Added raptor_alloc_memory. Note where and why it and raptor_free_memory may need to be used in the descriptiona and next to the methods that it applies to. * raptor/raptor_general.c: docs * raptor/raptor_general.c, raptor/raptor.h: Added raptor_alloc_memory * librdf/rdf_node.c (librdf_node_get_li_ordinal): if oops, do not always return -1 2004-06-23 Dave Beckett * rasqal/Makefile.am: Add rule to make libraptor.la 2004-06-22 Dave Beckett * librdf/rdf_query.h: Added results field to query. Added next field to query_results. * librdf/rdf_query.c: (librdf_query_add_query_result, librdf_query_remove_query_result): Now take query_results args. * configure.ac: removed --with-libwww - has not been used for anything for a long while. * librdf/rdf_query.c: Added usage counting of query between query & query-results. (librdf_query_add_query_result, librdf_query_remove_query_result): Added (librdf_free_query, librdf_new_query_from_factory, librdf_new_query_from_query): Added usage counts. (librdf_query_execute): Link query to query_results on success. (librdf_free_query_results): Do not return after factory cleanup but continue to clean up more. * librdf/rdf_query.h: Added usage count to query * librdf/rdf_query_rasqal.c (librdf_query_rasqal_free_results): Do not free query_results here, it is done by librdf_free_query_results * raptor/configure.ac: Added --with-expat-source option to build against an external expat source. Handle old and new style expat source areas. Report expat source dir in summary. Tidy up default messages. Only use expat subdir if it exists. * raptor/tests/Makefile.am: AM_LDFLAGS does not need LIBS, libraptor.la includes it all. 2004-06-21 Dave Beckett * rasqal/configure.ac: Added --with-dmalloc * librdf/rdf_query_rasqal.c (librdf_query_rasqal_free_results): Free the query_results * rasqal/rasqal_redland.c, librdf/rdf_query_rasqal.c (rasqal_redland_bind_match): free the literal returned by redland_node_to_rasqal_literal since a new one is made by rasqal_literal_as_node. * librdf/rdf_query.h: query factory free_results method returns no value * librdf/rdf_query.c (librdf_free_query_results): Add debug assertion 2004-06-17 Dave Beckett * rasqal/Makefile.am, raptor/Makefile.am: Zap extra $@ on rule line * configure.ac: Add CSHARPCFLAGS, CLI_PREFIX 2004-06-17 Dave Beckett * configure.ac: PKG_CONFIG * configure.ac: Add CSHARPCFLAGS, CLI_PREFIX 2004-06-13 Dave Beckett * configure.ac: Added csharp/examples dir * rasqal/configure.ac: Bumped version to 0.9.2 * raptor/configure.ac: pkg-config is too noisy on errors * rasqal/configure.ac: Require raptor 1.3.1 * rasqal/docs/Makefile.am: README should be maintainer-clean * rasqal/configure.ac: removed dup enable-release * rasqal/configure.ac, configure.ac, raptor/configure.ac: Only muck about with removing -O2 from flags in maintainer mode. * rasqal/librasqal.3: Added query results class, moved methods over and renamed. * rasqal/librasqal.3: example updated 2004-06-12 Dave Beckett * rasqal/Makefile.am, raptor/Makefile.am: Added local distclean-compile rule to override the insane one automake uses by default: rm -f *.tab.c * rasqal/librasqal.3: Add 0.9.1 changelog * raptor/configure.ac: Bumped version to 1.3.2 * raptor/tests/Makefile.am: add CLEANFILES * raptor/tests/Makefile.am: Added TESTS with raptor_empty_test the only one right now. Added C include, linking lines * raptor/tests/empty.c: Test of empty C file, just using raptor.h work * raptor/raptor_uri.c (raptor_uri_filename_to_uri_string, raptor_uri_uri_string_to_filename_fragment): Casts and char/unsigned char fixes for C++ 2004-06-08 Dave Beckett * raptor/raptor_uri.c (raptor_default_new_uri): Avoid free(NULL) for filename. * raptor/raptor_general.c (raptor_parse_file): Check before fopen that it is not a directory attempting to be fopen()ed - unix only, with lstat. * raptor/raptor_www.c (raptor_www_file_fetch): Check before fopen that it is not a directory attempting to be fopen()ed - unix only, with lstat. * raptor/rdfdump.c: Add error for failure of raptor_uri_filename_to_uri_string * raptor/raptor_uri.c (raptor_uri_filename_to_uri_string): Unix malloc too large by 2. * raptor/raptor_uri.c (raptor_default_new_uri): Zero fragment pointer. * raptor/raptor_uri.c (raptor_default_new_uri): Do not use a NULL filename. * raptor/raptor_uri.c (raptor_uri_uri_string_to_filename_fragment): Fail if the URI has no path or was going to return an empty string. (assert_filename_to_uri): Test code allow checks for NULL. (main): Test code for silly URIs that should work or fail. 2004-06-06 Dave Beckett * raptor/raptor_internal.h: Added RAPTOR_FATAL3 * raptor/raptor_uri.c: Fix win32 file/URI encoding to use file:///name and escape things better. (raptor_uri_filename_to_uri_string): Calculate new length correctly, with %-escaping. (raptor_uri_uri_string_to_filename_fragment): Calculate new format. Also do less strlen, strcpy. (main): Change tests to match new win32 file URI, test %-escaping and %-unescaping correctly. 2004-06-04 Dave Beckett * raptor/raptor_uri.c: NOTE: Not all below is fully working - 3 tests fail at this point. (raptor_uri_filename_to_uri_string): %-escape ' ' and '%' at least as a minimum. Document this. On Windows, generate file:///c:/ ... not c| (raptor_uri_uri_string_to_filename_fragment): Add %-unescaping. (main): Added test cases for %-escaping, %-expanding * raptor/Makefile.am: Added raptor_uri_win32_test 2004-06-03 Dave Beckett * raptor/tests/turtle/rdfq-results.ttl: Updated to http://www.w3.org/2003/03/rdfqr-tests/recording-query-results.html CVS $Id$ 2004-06-01 Dave Beckett * rasqal/rasqal_query.c (rasqal_free_query_results, rasqal_query_results_get_count, rasqal_query_results_next, rasqal_query_results_finished, rasqal_query_results_get_bindings, rasqal_query_results_get_binding_value, rasqal_query_results_get_binding_name, rasqal_query_results_get_binding_value_by_name, rasqal_query_results_get_bindings_count): Defensive checking for non-NULL query_results. * rasqal/docs/kernel-doc, docs/kernel-doc: ensure id in the SGML is always same size with md5sum * utils/rdfproc.c, Redland.i: Added librdf_query_results. Renamed all librdf_query results methods to match (like rasqal 0.9.1) * librdf/librdf.h: Added librdf_query_results * librdf/rdf_storage.c, librdf/rdf_storage.h: Removed librdf_storage_query_as_stream, librdf_storage_query_as_bindings and replaced with librdf_storage_query_execute * librdf/rdf_model_storage.c: Removed librdf_model_storage_query_as_stream, librdf_model_storage_query_as_bindings and replaced with librdf_model_storage_query_execute * librdf/rdf_model.c: Removed librdf_model_query, librdf_model_query_string, librdf_model_query_as_stream, librdf_model_query_as_bindings and replaced with librdf_model_query_execute * librdf/rdf_model.h: In factory, removed query_as_stream, replaced with query_execute. Removed librdf_model_query, librdf_model_query_string, librdf_model_query_as_stream, librdf_model_query_as_bindings and replaced with librdf_model_query_execute * librdf/rdf_query_triples.c, librdf/rdf_query_rasqal.c, librdf/rdf_query.c, librdf/rdf_query.h: Added librdf_query_results. Renamed all librdf_query results methods to match (like rasqal 0.9.1) * rasqal/rasqal_query.c (rasqal_query_remove_query_result): Init prev. * rasqal/rasqal_query.c: (rasqal_query_results_get_binding_value_by_name) Renamed from rasqal_query_results_get_binding_by_name. * rasqal/rasqal.h: rasqal_query_results_get_binding_by_name to rasqal_query_results_get_binding_value_by_name * rasqal/roqet.c: Use rasqal_query_results apis * configure.ac: require Rasqal 0.9.1 * rasqal/rasqal_query.c (rasqal_new_query, rasqal_free_query): Use usage. (rasqal_query_execute): Return a new rasqal_query_results* object and add it to the query object with rasqal_query_add_query_result. (rasqal_query_add_query_result, rasqal_query_remove_query_result): Added (rasqal_free_query_results): Added to destroy rasqal_query_results* object Renamings: rasqal_query_get_result_count => rasqal_query_results_get_count rasqal_query_next_result => rasqal_query_results_next rasqal_query_results_finished => rasqal_query_results_finished rasqal_query_get_result_bindings => rasqal_query_results_get_bindings rasqal_query_get_result_binding_value => rasqal_query_results_get_binding_value rasqal_query_get_result_binding_name => rasqal_query_results_get_binding_name rasqal_query_get_result_binding_by_name => +rasqal_query_results_get_binding_by_name rasqal_query_get_bindings_count => rasqal_query_results_get_bindings_count * rasqal/rasqal_internal.h: rasqal_query_s: Added usage counts, results pointing to active rasqal_query_results* for this query. Added rasqal_query_results_s structure. * rasqal/rasqal.h: Added rasqal_query_results class. Made rasqal_query_execute return a rasqal_query_result* Renamed all rasqal_query*result* methods to be rasqal_query_result_* Added rasqal_free_query_results to tidy up. * rasqal/rasqal_engine.c (rasqal_engine_build_constraints_expression): Use AND between constraints. 2004-05-31 Dave Beckett * raptor/raptor_general.c (raptor_parser_error_varargs, raptor_parser_warning_varargs): Chop off trailing \n from messages. * raptor/raptor_libxml.c (raptor_libxml_error): Chop off trailing \n correctly. 2004-05-30 Dave Beckett * raptor/turtle_lexer.l: Set the uri union field for ':' qname. * raptor/turtle_parser.y (raptor_turtle_parse_start): Delete any existing buffer content before starting. * raptor/raptor_general.c: Added feature warn_other_parseTypes, default true in lax mode. * raptor/raptor_parse.c: Added feature warn_other_parseTypes and used to warn when a parseType Literal is assumed. * raptor/raptor_internal.h: Added feature warn_other_parsetypes * raptor/raptor.h: Aded feature warn_other_parsetypes * raptor/tests/warn-07.out, raptor/tests/warn-07.rdf: Replaced by warn-07 * raptor/tests/Makefile.am: Remove ex-50, warn-07 covers it * raptor/tests/ex-50.out, raptor/tests/ex-50.rdf: Replaced by warn-07 * raptor/tests/Makefile.am: Add warn-07 Check for right values for warning tests, not just presence of a warning. * rasqal/Makefile.am: Don't use RASQAL_INTERNAL_LIBS except in dependencies of librasqal.la * utils/Makefile.am, librdf/Makefile.am, examples/Makefile.am: Don't use LIBRDF_INTERNAL_LIBS except in dependencies of librdf.la * librdf/rdf_log.h: librdf_log_level_func has a return value * librdf/rdf_log.c (librdf_log_simple): Return if error, warning messages are handled by the specific handlers. * examples/Makefile.am: Tidy up AM_*FLAGS, remove @LIBRDF_LIBS@ * utils/Makefile.am: Remove @LIBRDF_LIBS@ * rasqal/rasqal_internal.h: remove duplicate and broken YYDEBUG lines * Makefile.am: Add data to dist subdirs * data/dc.rdf moved from old perl dir * data/Makefile.am: dc.ttl * data/Makefile.am, data/dc.nt, data/dc.rdf, data/dc.ttl: data * configure.ac, Makefile.am: Added data dir 2004-05-29 Dave Beckett * autogen.sh, rasqal/autogen.sh, raptor/autogen.sh: Add --enable-maintainer-mode * raptor/configure.ac: Add check for glib-2.0 presence rather than an error barf. * librdf/redland.pc.in: Use LIBRDF_PKGCONFIG_LIBS * configure.ac: Made RASQAL_MIN_VERSION 0.9.0 Added LIBRDF_PKGCONFIG_LIBS for redland.pc * librdf/redland.pc.in: Replace LIBRDF_LIBS with LIBRDF_EXTERNAL_LIBS * librdf/Makefile.am: Remove LIBRDF_LIBS and add LIBRDF_INTERNAL_LIBS * redland-src-config.in, redland-config.in: Remove LIBRDF_LIBS * configure.ac: Remove use of LIBRDF_LIBS - merge into LIBRDF_EXTERNAL_LIBS and do not AC_SUBST. Always append to LIBRDF_LIBS, LIBRDF_CPPFLAGS rather than prepend, append mixtures. 2004-05-28 Dave Beckett * configure.ac: Look for BDB in /usr/local/BerkeleyDB.$version * configure.ac: typo: RASQAL_CONFIG * raptor/tests/Makefile.am, rasqal/tests/Makefile.am, rasqal/rdql-testsuite/Makefile.am: Add set +e, set -e around multiple tests so they only fail at the end. * docs/Makefile.am: do not overwrite redland.3 if not in maintainer mode * librdf/Makefile.am: Use automakefile conditional MEMCMP * utils/Makefile.am: Use automakefile conditional GETOPT * configure.ac: Use automakefile conditionals MEMCMP and GETOPT * rasqal/configure.ac: Add flex version check, only in maintainer mode * rasqal/Makefile.am: Make lex and yacc rules be maintainer only. * raptor/configure.ac: Only check flex version in maintainer mode * raptor/Makefile.am: Re-order directives and tidy up. Make lex and yacc rules be maintainer only. * rasqal/configure.ac: Use automakefile conditionals STRCASECMP and GETOPT * rasqal/Makefile.am: Use automakefile conditionals STRCASECMP and GETOPT for conditional sources. Re-order the directives slightly. * raptor/Makefile.am: Use automakefile conditionals STRCASECMP and GETOPT for conditional sources. * raptor/configure.ac: Use automakefile conditionals STRCASECMP and GETOPT 2004-05-27 Dave Beckett * rasqal/configure.ac, raptor/configure.ac: check for perl * rasqal/Makefile.am, raptor/Makefile.am: Add fix-flex and use it * rasqal/fix-flex, raptor/fix-flex: Fix flex output * raptor/raptor_internal.h: Added raptor_libxml_free * raptor/raptor_parse.c (raptor_xml_parse_start, raptor_xml_parse_terminate): Use raptor_libxml_free to tidy up. * raptor/raptor_libxml.c (raptor_libxml_free): Added to tidy up after a parsing. * raptor/raptor_parse.c (raptor_xml_parse_terminate): Clean up sax2_element stack after errors. 2004-05-26 Dave Beckett * raptor/turtle_lexer.l: Allow _ after : in qnames. Make bare ':' work. * raptor/tests/turtle/rdf-schema.out, raptor/tests/turtle/rdf-schema.ttl: RDF namespace document * raptor/tests/turtle/rdfs-namespace.out, raptor/tests/turtle/rdfs-namespace.ttl: RDFS namespace * raptor/tests/turtle/Makefile.am: Added test-13, rdf-schema, rdfs-namespace * raptor/tests/turtle/test-13.out, raptor/tests/turtle/test-13.ttl: test bare : * raptor/turtle_parser.y: Fix RAPTOR_DEBUG args in old format. * raptor/tests/turtle/Makefile.am: Added test-12 * raptor/tests/turtle/test-12.out, raptor/tests/turtle/test-12.ttl: test for _ after : in qnames * raptor/libraptor.3: Describe use of UTF-8 for literals and strings * raptor/libraptor.3: 1.3.1 changes 2004-05-25 Dave Beckett * raptor/raptor.h: Added RAPTOR_STATIC for WIN32 when statically linking Fix raptor_print_statement arg s/const// 2004-05-24 Dave Beckett * raptor/raptor_general.c (raptor_free_memory, raptor_system_free): Do not return, no return value. 2004-05-21 Dave Beckett * raptor/tests/turtle/rdfq-results.ttl, raptor/tests/turtle/rdfq-results.out: Replace XML Schema namespace with 2001 versi 2004-05-19 Dave Beckett * raptor/rdfdump.c: Includes re-order, doc * raptor/rdfdump.c: don't do stdarg.h here - it should be in raptor.h * raptor/raptor.h: Add include for stdarg.h to get va_list for raptor_vsnprintf * raptor/raptor_xml.c (raptor_xml_escape_string): q should be an unsigned char* * raptor/raptor_utf8.c (raptor_unicode_char_to_utf8): Cast for unsigned long to unsigned char * raptor/raptor_parse.c (raptor_xml_start_element_handler): Cast for memcpy. * raptor/win32_config.h: patch from Jose for VC6 2004-05-18 Dave Beckett * Redland.i: Fake librdf_new_query taking char* not unsigned char* * librdf/rdf_query_rasqal.c: Update for renaming of librdf_query_get_result_binding_by_name to librdf_query_get_result_binding_value_by_name and factory equiv. * librdf/rdf_query.h: Renamed librdf_query_get_result_binding_by_name to librdf_query_get_result_binding_value_by_name and factory equiv. * librdf/rdf_query.c (librdf_query_get_result_binding_value_by_name): Renamed from librdf_query_get_result_binding_by_name * Redland.i: Export librdf_query class and methods. Export model methods librdf_model_query_as_stream, librdf_model_query_as_bindings * raptor/ntriples_parse.c (raptor_ntriples_generate_statement): Remove use of ntriples_parser, not used. 2004-05-15 Dave Beckett * rasqal/configure.ac: Bumped version to 0.9.1 * rasqal/rasqal.spec.in, raptor/raptor.spec.in: SNAP * rasqal/rdql-testsuite/Makefile.am: Improve checking works/correct against expected failures. * rasqal/rdql-testsuite/Makefile.am: Check works/correct RDQL tests against expected failures. * rasqal/rdql-testsuite/check-rdql: Use portable diff -u in errors 2004-05-14 Dave Beckett * rasqal/configure.ac: 0.9.0 * rasqal/docs/Makefile.am: Added README, README.html * rasqal/Makefile.am: Add RELEASE.html 2004-05-13 Dave Beckett * librdf/rdf_internal.h: Use positive assert enable defines. * configure.ac: Turn assert enable options into positive form. * rasqal/rasqal_literal.c: docucomments * rasqal/fix-groff-xhtml, raptor/fix-groff-xhtml: update for rasqal * rasqal/librasqal.3: updated for release * rasqal/rasqal.h: dead prototype * librdf/rdf_query_rasqal.c (rasqal_redland_bind_match): use redland_node_to_rasqal_literal * rasqal/rasqal_internal.h, rasqal/rasqal.h: Export rasqal_literal_as_node. * rasqal/rasqal_redland.c (rasqal_redland_bind_match): use redland_node_to_rasqal_literal * rasqal/rasqal_literal.c (rasqal_literal_equals): Boolean literals compare equal to string literals "true" or "false". * rasqal/rasqal_literal.c: Throughout - use RASQAL_CALLOC (rasqal_literal_as_floating): Added (rasqal_literal_compare): Add more debug messages. Promote to floating right. (rasqal_literal_as_node): Make a new string literal for integer, floating here. * rasqal/rdql-testsuite/check-rdql: Do not hack around roqet emitng integer, floating, Do hack around rapper/raptor 1.3.0 bug * rasqal/rasqal_literal.c (rasqal_literal_compare): In promoting comparisons, check both ways round before turning to next type. * rasqal/rasqal_raptor.c (rasqal_raptor_bind_match): Use rasqal_literal_as_node in setting bindings. * rasqal/rasqal_internal.h: Add rasqal_literal_as_node * rasqal/rasqal_literal.c (rasqal_new_string_literal, rasqal_literal_expand_qname): Discard language if datatype is given. * rasqal/rdql-testsuite/check-rdql: Turn internal integer, floating into typed literals. 2004-05-12 Dave Beckett * raptor/turtle_parser.y, raptor/turtle_common.h, raptor/ntriples_parse.c: Do not allow any language with datatype literals. * rasqal/rdql-testsuite/check-rdql: report failures * raptor/tests/turtle/Makefile.am: add zip, tests.zip targets 2004-05-11 Dave Beckett * raptor/configure.ac: Bumped version to 1.3.1 * raptor/raptor.spec.in: Added RELEASE.html * raptor/Makefile.am: Added RELEASE.html * raptor/turtle_lexer.l: Allow - in qnames, prefix qnames. * raptor/tests/turtle/Makefile.am: Added test-11 * raptor/tests/turtle/test-11.out, raptor/tests/turtle/test-11.ttl: - and _ in qnames, prefixes * configure.ac: use = not == in test * configure.ac: Make rasqal build internal and external. Add ruby test, lib dirs. 2004-05-07 Dave Beckett * librdf/rdf_query_rasqal.c: New error/warning handler names * rasqal/rasqal_query.c (rasqal_query_print): Don't try to print NULL sequences. * rasqal/docs/Makefile.am, rasqal/docs/api.sgml.in, rasqal/docs/build-docs, rasqal/docs/kernel-doc: Rasqal docs and API manual * rasqal/configure.ac, rasqal/Makefile.am: Added docs * rasqal/rasqal_query.c: docucomment * rasqal/rasqal_general.c: Rename various functions, moved from here to rasqal_query.c: rasqal_query_get_name, rasqal_query_get_label, rasqal_query_set_fatal_error_handler, rasqal_query_set_error_handler, rasqal_query_set_warning_handler, rasqal_query_set_feature * rasqal/rasqal_query.c: Rename various functions, moved to this rasqal_query.c: rasqal_query_get_name, rasqal_query_get_label, rasqal_query_set_fatal_error_handler, rasqal_query_set_error_handler, rasqal_query_set_warning_handler, rasqal_query_set_feature * rasqal/rasqal.h: Renames: Now rasqal_query* for the following name: rasqal_get_name, rasqal_get_label, rasqal_set_fatal_error_handler, rasqal_set_error_handler, rasqal_set_warning_handler, rasqal_set_feature * rasqal/rasqal_expr.c: Docucomments for variable class. * rasqal/rdql_parser.y (rasqal_rdql_query_engine_prepare): Handle NULL query_string. * rasqal/rasqal_internal.h: Internal: rasqal_literal_as_boolean, rasqal_literal_as_integer * rasqal/rasqal.h: Do not export rasqal_literal_as_boolean * rasqal/Makefile.am: Add rasqal_literal.c * rasqal/rasqal_expr.c, rasqal/rasqal_literal.c: Rasqal literal moved from rasqal_expr.c * rasqal/rasqal_expr.c: docucomment * rasqal/rasqal_expr.c: Docucomments for all literal constructors, destructors, methods, helpers. * rasqal/rasqal_expr.c: code style * rasqal/rasqal_query.c (rasqal_query_prepare): Note query_string can be NULL. * examples/example5.c: Error check model or storage failure; make new store. * librdf/rdf_parser_raptor.c (librdf_parser_raptor_generate_id_handler): Use raptor_free_memory to free raptor alloced id * librdf/rdf_query.c: Don't use uninitialised names. * librdf/rdf_query.c, rasqal/rasqal_query.c: docucomments * utils/rdfproc.c: Use names/values methods for query results, no need for a static array. * rasqal/roqet.c: Use names/values methods for results, no need for a static array. * librdf/rdf_query_rasqal.c (librdf_query_rasqal_get_result_bindings): Use rasqal_query_get_bindings_count. (librdf_query_rasqal_get_bindings_count): Added, calling rasqal_query_get_bindings_count. * librdf/rdf_query.c (librdf_query_get_bindings_count): typo * librdf/rdf_query.h: Added get_bindings_count factory method * librdf/rdf_query.h: Added librdf_query_get_bindings_count * librdf/rdf_query.c (librdf_query_get_bindings_count): Added. * rasqal/rasqal_query.c: Docucomments. (rasqal_query_get_bindings_count): Added * rasqal/roqet.c, utils/rdfproc.c: Don't use uninitialised values. * rasqal/roqet.c: Don't use uninitialised names, values. * utils/rdfproc.c: (query command) Don't use uninitialised names, values, count. Run the query(!) before trying to get results. * rasqal/rasqal.h: Added rasqal_query_get_bindings_count * rasqal/rasqal_query.c (rasqal_query_prepare): Free raptor-alloced memory with raptor_free_memory. (rasqal_query_get_bindings_count): Added. * raptor/raptor_sequence.c, raptor/raptor_internal.h: Add assert macros * utils/rdfproc.c: Add URI field to query arg, allow - for optional name, URI Handle query constructor failing. * librdf/rdf_query_rasqal.c (librdf_query_rasqal_error_handler, librdf_query_rasqal_warning_handler): Added (librdf_query_rasqal_init): Hook up above when initialising a new query. * librdf/rdf_log.c (librdf_log_simple): Too annoying to die for regular errors when debugging. * rasqal/roqet.c: Add list of valid inputs for -i/--input errors. * rasqal/rasqal_query.c: parameter naming consistency (no code changes) docucomments * Redland.i: Added librdf_statement_match * utils/rdfproc.c: Remove check here for contexts and rely on run time warnings from model and/or storage classes. * librdf/rdf_storage_list.c (librdf_storage_list_context_add_statement, librdf_storage_list_context_remove_statement): Run time warning if called with a non-NULL context and contexts are not supported. (librdf_storage_list_context_serialise, librdf_storage_list_get_contexts): Run time warning if called and contexts are not supported. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_get_contexts): Run time warning if called and contexts are not supported. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_context_add_statement, librdf_storage_hashes_context_serialise): Run time warning if called and contexts are not supported. (librdf_storage_hashes_context_remove_statement): Run time warning if called with a non-NULL context and contexts are not supported. * librdf/rdf_model.c (librdf_model_supports_contexts): Added helper, internal. (librdf_new_model_with_options, librdf_new_model_from_model): Initialise supports_contexts. (librdf_model_context_add_statement, librdf_model_context_add_statements, librdf_model_context_remove_statement, librdf_model_context_remove_statements, librdf_model_context_as_stream, librdf_model_context_serialize, librdf_model_get_contexts): Run time warning if called and contexts are not supported. (librdf_model_find_statements_in_context): Run time warning if called with a non-NULL context and contexts are not supported. * librdf/rdf_model.h: Added supports_contexts internal field. * Redland.i: Added librdf_statement_equals 2004-05-06 Dave Beckett * librdf/rdf_query.c (main): Free model, storage * librdf/rdf_query.c: (main) free returned query variable values * examples/example5.c, utils/rdfproc.c: free returned query variable values * examples/example5.c: comments * librdf/rdf_parser.h: Deleted internal librdf_parser_error and librdf_parser_warning Deprecated librdf_parser_set_error and librdf_parser_set_warning. * librdf/rdf_parser.c (librdf_parser_error, librdf_parser_warning): Deleted - internal and never used. (librdf_parser_set_error, librdf_parser_set_warning): Deprecated, never worked. * librdf/rdf_query.c: docucomments * docs/api.sgml.in: remove list * docs/api.sgml.in: less doc classes; no real need for the implementation classes. Removed GFDL. The docs have the same license as Redland now. * docs/Makefile.am: less doc classes; no real need for the implementation classes. * docs/Makefile.am: Added query_rasqal for docs * librdf/rdf_query.c: Added assertions * librdf/rdf_query_rasqal.c: Renamed librdf_query_rasqal_get_result_binding to librdf_query_rasqal_get_result_binding_value. Added librdf_query_rasqal_get_result_binding_name * librdf/rdf_query.h: Renamed librdf_query_get_result_binding to librdf_query_get_result_binding_value. Added librdf_query_get_result_binding_name Changed factory methods to match. * librdf/rdf_query.c (librdf_query_get_result_binding_value): Renamed from librdf_query_get_result_binding. (librdf_query_get_result_binding_name): Added. * rasqal/rasqal.h: Renamed rasqal_query_get_result_binding to rasqal_query_get_result_binding_value. Added rasqal_query_get_result_binding_name * rasqal/rasqal_query.c (rasqal_query_get_result_binding_value): Renamed from rasqal_query_get_result_binding. Fix dubious offset checking. (rasqal_query_get_result_binding_name): Added. * librdf/rdf_query_triples.h: deleted, not needed * librdf/rdf_query.c: docucomment 2004-05-05 Dave Beckett * librdf/rdf_query.c: add vars * librdf/rdf_query.c (main): Added a real query language test. * utils/rdfproc.c: Added query, use of query with variable bindings * librdf/rdf_model.h: Added librdf_model_query_as_stream, librdf_model_query_as_bindings, librdf_model_query_string * librdf/rdf_model.c (librdf_model_query_as_stream, librdf_model_query_as_bindings): Added (librdf_model_query_string): Deprecated * librdf/rdf_storage.h: Added librdf_storage_query_as_stream, librdf_storage_query_as_bindings * librdf/rdf_storage.c (librdf_storage_query_as_stream,librdf_storage_query_as_bindings): Added * librdf/rdf_query.h: Substantially changed. open, close methods gone. Added all the binding access methods from rasqal. * librdf/rdf_query.c: Substantially changed. open, close gone. (librdf_query_run_as_stream,librdf_query_run_as_bindings): Added Added all the binding access methods from rasqal. * librdf/rdf_query_rasqal.c: Querying with Rasqal * librdf/rdf_model_storage.c (librdf_model_storage_query_as_stream, librdf_model_storage_query_as_bindings): Added. * examples/Makefile.am: Added example5 * examples/example5.c: query example * librdf/rdf_query_triples.c: Remove open, close methods. Rename run method. * librdf/rdf_init.h: added query_factories to world * librdf/Makefile.am: Removed rdf_query_triples.h, added rdf_query-rasqal.c * rasqal/rasqal.h: Added rasqal_query_get_user_data and rasqal_query_set_user_data * rasqal/rasqal_query.c (rasqal_query_get_user_data,rasqal_query_set_user_data): Added * rasqal/rasqal_query.c: docucumments * rasqal/rasqal.spec.in: date * rasqal/rasqal.spec.in, rasqal/rasqal.pc.in, rasqal/configure.ac: Use new @RAPTOR_MIN_VERSION@ subst. * rasqal/Makefile.am: Install roqet * rasqal/Makefile.am: Added roqet.1 and roqet.html, add fix-groff-xhtml * rasqal/roqet.1: roqet man page * configure.ac: make PHP_INCLUDES even without --with-php (ie PHP) * rasqal/configure.ac: SUBST with_raptor * rasqal/rasqal-src-config.in: sigh, rasqal uses raptor * rasqal/rasqal-src-config.in, redland-src-config.in: One more remaining bad raptor cut'n' paste * rasqal/rdql-testsuite/Makefile.am: Add check-rdql to dist * rasqal/configure.ac: Added build summary. * rasqal/rasqal_raptor.c: (raptor_statement_as_rasqal_triple) C99. * rasqal/configure.ac: Try to find raptor sources better. * configure.ac: assign rasqal_dir for SD_PRE * Makefile.am: Added ChangeLog.4 * librdf/rdf_internal.h: Removed LIBRDF_DEBUG macros * librdf/rdf_init.h: Removed librdf_error, librdf_warning as no longer used. * librdf/rdf_log.c (librdf_log_simple): When debugging, all errors are fatal. (librdf_error, librdf_warning): Removed, no longer used. * librdf/rdf_stream.c, librdf/rdf_storage_tstore.c, librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage.c, librdf/rdf_statement.c, librdf/rdf_serializer_rdfxml.c, librdf/rdf_serializer_raptor.c, librdf/rdf_query.c, librdf/rdf_parser_raptor.c, librdf/rdf_node.c, librdf/rdf_model.c, librdf/rdf_list.c, librdf/rdf_hash_memory.c, librdf/rdf_hash_bdb.c, librdf/rdf_hash.c, librdf/rdf_digest.c: Replace LIBRDF_DEBUG macro uses with librdf_log * librdf/redland.spec.in, librdf/redland.pc.in, configure.ac: SUBST raptor, rasqal min versions and use in build, packaging files. * librdf/redland.pc.in: added rasqal * redland-src-config.in: more with_rasqal fixes * configure.ac: SUBST with_rasqal * redland-src-config.in, librdf/redland.spec.in: added rasqal * configure.ac: report rasqal source in summary * librdf/Makefile.am, configure.ac: added rasqal * Makefile.am: Added rasqal 2004-05-04 Dave Beckett * raptor/libraptor.3: rewordings * rasqal/rasqal_raptor.c, rasqal/rasqal_expr.c: raptor now exports raptor_xml_literal_datatype_uri_string * raptor/raptor_general.c, raptor/raptor.h: Export raptor_xml_literal_datatype_uri_string * raptor/raptor_internal.h: raptor_xml_literal_datatype_uri_string now exported. * raptor/libraptor.3: Added 1.3.0 items * raptor/raptor_general.c (raptor_parse_uri_with_connection): Document the Accept: header malarky. Only send it if connection is NULL. Use Accept: MIME-TYPE,*/*;q=0.1 * raptor/raptor_www_curl.c (raptor_www_curl_fetch): append to slist right * raptor/raptor_general.c (raptor_parse_uri_with_connection): Send "Accept: MIME-TYPE ;*/*" to prefer the specified one rather than accept only that. * raptor/raptor.h: Added raptor_get_mime_type * raptor/raptor_general.c (raptor_parse_uri_with_connection): Set Accept header with mime type of this syntax if there is one * raptor/raptor_www.c (raptor_www_set_http_accept): Make accept value overwrite \0 from Accept: * raptor/configure.ac: make raptor.rdf * raptor/turtle_parser.y, raptor/raptor_www_libxml.c, raptor/raptor_parse.c, raptor/ntriples_parse.c: Fixes for c++ * raptor/Makefile.am: added raptor.rdf.in * raptor/raptor.rdf.in: DOAP 2004-05-02 Dave Beckett * raptor/turtle_parser.y: Add xml_literal_datatype_uri to parser context. (raptor_turtle_parse_init,raptor_turtle_parse_terminate): use above (raptor_turtle_generate_statement): Use above to remove language from all literals except xml literals. * raptor/turtle_common.h: Add xml_literal_datatype_uri to parser context. * raptor/ntriples_parse.c: Add xml_literal_datatype_uri to parser context. (raptor_ntriples_parse_init,raptor_ntriples_parse_terminate): use above (raptor_ntriples_generate_statement): Use above to remove language from all literals except xml literals. * raptor/raptor_identifier.c (raptor_identifier_print): Use raptor_xml_literal_datatype_uri_string and save a string. 2004-04-29 Dave Beckett * raptor/rdfdump.c (main): Use raptor_free_memory to free memory allocated in libraptor. * raptor/raptor_www_libxml.c (raptor_www_libxml_fetch): Free content type using libxml's xmlFree since it was allocated there. * raptor/raptor_www_libxml.c, raptor/raptor_www_curl.c (raptor_www_libxml_fetch): Make headers for User-Agent: and/or Accept: if they were set in the raptor_www. * raptor/raptor_www.c (raptor_www_set_http_accept): Added. * raptor/raptor_internal.h: Added http_accept to raptor_www * raptor/raptor.h: Added raptor_www_set_http_accept 2004-04-27 Dave Beckett * Redland.i: Added output typemap for ruby returning char NULL. Added some more model api calls used by ruby-rdf 2004-04-25 Dave Beckett * librdf/rdf_node.c (librdf_node_get_blank_identifier): Assert typo. 2004-04-15 Dave Beckett * raptor/raptor_general.c (raptor_guess_parser_name): use strrchr to find *last* . 2004-04-14 Dave Beckett * librdf/rdf_node.c (librdf_node_to_counted_string): Encode language and datatype for literal strings. * raptor/raptor_sequence.c (raptor_new_sequence): Zap sequence field. * raptor/raptor_xml_writer.c (raptor_xml_writer_cdata): Do not copy more bytes than allowed. * raptor/Makefile.am: Added raptor_expat.c * raptor/raptor_parse.c: Export some expat-only handlers: raptor_xml_unparsed_entity_decl_handler, raptor_xml_external_entity_ref_handler. (raptor_xml_parse_init): Do not call expat init code here. (raptor_xml_parse_start): Call new aptor_expat_init to initialise parser state. * raptor/raptor_internal.h: Added RAPTOR_XML_EXPAT only exports including raptor_expat_init prototype. * raptor/raptor_expat.c: raptor expat parser 2004-04-13 Dave Beckett * raptor/raptor.h: Added xsd and owl namespace URIs * raptor/raptor_namespace.c (raptor_namespaces_init): Define xsd, owl when defaults is 2+ 2004-04-12 Dave Beckett * librdf/Makefile.am: Apply local cppflags to AM_CFLAGS, for building tests 2004-04-11 Dave Beckett * raptor/raptor_parse.c: (raptor_xml_parse_start) Free expat/libxml contexts from an earlier parsing to ensure resetting of state * librdf/rdf_parser.c (main): Need to init node, concepts before parser. * Redland.i: set default args on librdf_model_load * Redland.i: Updated to use librdf_test_error and librdf_test_warning for testing errors. * librdf/rdf_log.h, librdf/rdf_log.c (librdf_test_error,librdf_test_warning): Added for testing errors. * Redland.i, librdf/rdf_model.h: Added librdf_model_load * librdf/rdf_model.c (librdf_model_load): Added, using parser guessing via raptor_guess_parser_name if no name is given. * librdf/rdf_parser_raptor.c: Move raptor_new_parser to the init factory method rather than making a new one for each parsing. Add a raptor_parser* rdf_parser field to the context structure. (librdf_parser_raptor_get_feature): Call raptor_get_feature if it is not known here. (librdf_parser_raptor_set_feature): Call raptor_set_feature. * raptor/raptor_stringbuffer.c (raptor_stringbuffer_prepend_string_common): Added (raptor_stringbuffer_prepend_counted_string, raptor_stringbuffer_prepend_string): Added, implemented by above internal function. (main): Added tests for prepending. * raptor/raptor.h: Add RAPTOR_API for newly exported functions. Add raptor_stringbuffer_prepend_counted_string, raptor_stringbuffer_prepend_string * raptor/raptor_stringbuffer.c: (main) printf arg * raptor/raptor_internal.h, raptor/raptor.h: Moved raptor_stringbuffer to public API * raptor/raptor_stringbuffer.c (raptor_stringbuffer_append_stringbuffer): Added. (main): Updated test code for raptor_stringbuffer_append_stringbuffer 2004-04-10 Dave Beckett * raptor/raptor_general.c, raptor/raptor.h (raptor_guess_parser_name): Added new public class method. (raptor_new_parser_for_content): Now uses above. * raptor/raptor_internal.h, raptor/raptor.h: Move raptor_unicode_char_to_utf8, raptor_utf8_to_unicode_char to public API. * raptor/tests/Makefile.am: fix result codes for split off NFC warnings * raptor/tests/Makefile.am: Split off NFC warnings so they can fail noisily when glib isn't present to do the check. * raptor/rapper.1: Document -g/--guess flag to guess the parser to use from the identifier (URI or file name). * raptor/rdfdump.c: Added -g/--guess flag to use raptor_new_parser_for_content guessing the parser to use from the identifier (URI or file name). * raptor/turtle_parser.y, raptor/raptor_rss.c, raptor/raptor_parse.c, raptor/ntriples_parse.c: Added scoring factory method recognise_syntax for rdfxml, ntriples, rss, turtle parsers. * raptor/raptor_internal.h: Added parser scoring factory method recognise_syntax. * raptor/raptor_general.c (raptor_new_parser_for_content): Added, guessing which parser to instance using scoring factory method recognise_syntax. * raptor/raptor.h: Added raptor_new_parser_for_content 2004-04-10 Dave Beckett * raptor/raptor_sequence.c: cast for c++ 2004-04-09 Dave Beckett * raptor/raptor_parse.c: Removed use of raptor_print_statement_detailed * raptor/raptor_internal.h: Removed raptor_print_statement_part_as_ntriples, made static * raptor/raptor.h: Deprecate raptor_print_statement_detailed * raptor/raptor_general.c (raptor_print_statement_detailed): Restored, was in raptor.h but useless. * raptor/raptor_general.c: dates, docucomments (raptor_print_statement_detailed): Deleted - never publically documented or used. 2004-04-09 Dave Beckett * librdf/rdf_uri.c, librdf/rdf_storage_tstore.h, librdf/rdf_storage_tstore.c, librdf/rdf_storage_mysql.h, librdf/rdf_storage_mysql.c, librdf/rdf_storage_list.h, librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.h, librdf/rdf_storage_hashes.c, librdf/rdf_storage_file.c, librdf/rdf_storage.h, librdf/rdf_storage.c, librdf/rdf_serializer.c, librdf/rdf_query_triples.h, librdf/rdf_query_triples.c, librdf/rdf_query.h, librdf/rdf_query.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_model_storage.h, librdf/rdf_model_storage.c, librdf/rdf_model.h, librdf/rdf_model.c, librdf/rdf_internal.h, librdf/rdf_hash.c, librdf/rdf_digest.c, librdf/rdf_concepts.c: Add world field to all LIBRDF_FATAL1 calls. Add world parameter to all factory registrations. * librdf/rdf_log.h: Added more log facilities. * librdf/rdf_digest.h: Added world field * librdf/rdf_internal.h, librdf/rdf_query.c: zap LIBRDF_FATAL2 2004-04-08 Dave Beckett * raptor/Makefile.am: raptor_sequence_test needs to link with libraptor.la * raptor/turtle_parser.y: rename raptor_free_handler,raptor_print_handler -> as raptor_sequence... * raptor/raptor.h, raptor/raptor_internal.h: Move sequence class to public api. * raptor/raptor_sequence.c: rename raptor_free_handler,raptor_print_handler -> as raptor_sequence... (raptor_sequence_print_uri): Added. (raptor_sequence_set_print_handler): Added. * raptor/raptor_internal.h, raptor/raptor.h: Export raptor_vsnprintf public. * configure.ac: require raptor 1.3.0 * librdf/rdf_serializer_rdfxml.c (librdf_serializer_rdfxml_raptor_error_handler): Just pass message on to librdf_log_simple as a single string, don't add a prefix. * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_error_handler, librdf_parser_raptor_warning_handler): Just pass message on to librdf_log_simple with locator, don't add a prefix. * librdf/rdf_storage_mysql.c, librdf/rdf_storage_file.c, librdf/rdf_query_triples.c, librdf/rdf_hash_bdb.c: Replace librdf_error and some LIBRDF_ERROR2 with librdf_log. * librdf/redland.h: Compiling with Redland requires raptor.h * librdf/librdf.h: Use rdf_log.h * librdf/rdf_init.h: Use rdf_log structs inside world. Added librdf_world_set_logger. Deprecated older internal librdf_error/librdf_warning. * librdf/rdf_init.c: Moved error/warning code to rdf_log.c/.h (librdf_world_set_logger): Added. * librdf/Makefile.am: Added rdf_log.c rdf_log.h * librdf/rdf_log.c, librdf/rdf_log.h: RDF logging * Redland.i: Add typemap for ruby inStrOrNull for certain functions that can take an optional string. Additionally, add default parameters for those functions: librdf_new_node_from_literal, librdf_new_node_from_typed_literal and librdf_new_node_from_blank_identifier. 2004-04-06 Dave Beckett * raptor/turtle_parser.y (turtle_parse): Remove un-necessary cast. * raptor/turtle_parser.y (turtle_parse): Free lexer 2004-04-05 Dave Beckett * raptor/rdfdump.c: Added HELP_PAD to format long help description over multiple lines. * raptor/TODO.html: docs 2004-03-30 Dave Beckett * raptor/tests/turtle/test-00.out: Updated base uri * raptor/tests/turtle/Makefile.am: Added rdfq-results * raptor/tests/turtle/rdfq-results.out, raptor/tests/turtle/rdfq-results.ttl: RDF Query result set example from http://www.w3.org/2003/03/rdfqr-tests/recording-query-results.html 2004-03-27 Dave Beckett * raptor/raptor_general.c, raptor/turtle_parser.y, raptor/rdfdump.c: casts for C++ * utils/Makefile.am: redland-db-upgrade doesn't take gnu opts * configure.ac: Do not -Wall automake, override is needed in language dirs. List specific warnings. * configure.ac, autogen.sh: Use some AM_INIT_AUTOMAKE options. Require automake1.7, which requires autoconf 2.54 * redland-src-config.in, redland-config.in: Support --help, emit to stdout and exit 0. * raptor/configure.ac, raptor/autogen.sh: Use some AM_INIT_AUTOMAKE options. Require automake1.7, which requires autoconf 2.54 * raptor/examples/Makefile.am: Drop $(shell .. ) which is not portable between makes * raptor/raptor-src-config.in, raptor/raptor-config.in: emit --help usage to stdout * raptor/raptor-src-config.in, raptor/raptor-config.in: Support --help and exit 0. 2004-03-26 Dave Beckett * raptor/rapper.1: Document -f * raptor/tests/Makefile.am: Add bad-21 * raptor/tests/bad-21.rdf: Check non-namespaced attributes on a property are reported * raptor/raptor_parse.c (raptor_xml_start_element_handler): Check element, attributes for non-namespaces once we know we are in rdf processing. Check all named attributes for lack of namespace, error and zap if found. (raptor_process_property_attributes): Skip any deleted attributes. 2004-03-25 Dave Beckett * raptor/tests/Makefile.am: Added warn-05, warn-06 * raptor/tests/warn-05.out, raptor/tests/warn-06.out, raptor/tests/warn-05.rdf, raptor/tests/warn-06.rdf: Check for warning for unknown rdf namespaced property element, attributes * raptor/raptor_parse.c (raptor_process_property_attributes): Generate an error for forbidden rdf names, warning for unknown rdf names. * raptor/raptor_parse.c: Merged rdf_attr_info into rdf_syntax_terms_info. Now we can check for unknown rdf: names (raptor_forbidden_nodeElement_name, raptor_forbidden_propertyElement_name, raptor_forbidden_propertyAttribute_name): Return -1 on unknown name. (raptor_start_element_grammar): Generate an error for forbidden rdf names, warning for unknown rdf names. * raptor/tests/Makefile.am: Added warn-04 * raptor/tests/warn-04.out, raptor/tests/warn-04.rdf: Check for warning for unknown rdf namespaced node element * raptor/tests/turtle/Makefile.am, raptor/tests/Makefile.am: fix grep for Warning output * raptor/raptor_general.c, raptor/raptor.h: Added raptor_free_memory to dealloc memory returned by raptor functions - some systems need this due to having multiple heaps. * raptor/raptor_general.c (raptor_default_generate_id_handler): doh * raptor/raptor_general.c (raptor_default_generate_id_handler): Rework not to use tmpid before initialising it. * raptor/raptor_general.c (main): Free returned uri * raptor/raptor.h: Added raptor_feature_from_uri * raptor/Makefile.am: Added raptor_general_test * raptor/raptor_general.c (raptor_feature_from_uri): Turn a feature URI into a feature number. (main): Added, testing feature enumerations. * raptor/rdfdump.c: note feature values in -f help * raptor/rdfdump.c: More help message tidying. * raptor/rdfdump.c: Alter HELP_TEXT macro so short arg isn't auto-quoted. Use this to add short option options arg to help. 2004-03-24 Dave Beckett * raptor/raptor_general.c (raptor_default_generate_id_handler): Don't bump default genid counter when a user_bnodeid is present. * raptor/rdfdump.c: Allow setting feature optional values -f NAME=VALUE (integer). * raptor/raptor_general.c, raptor/raptor.h: Use raptor_feature type for enumeration calls. * raptor/raptor_general.c: Tidy feature labels * raptor/rdfdump.c: Tidy -f help message. * raptor/rdfdump.c: Re-ordered long_options to be alphabetical by option char. Added -f/--feature FEATURE to set a parser feature. With the value 'help', lists them all using raptor_features_enumerate. * raptor/raptor.h: Added raptor_get_feature, raptor_features_enumerate. raptor_set_feature gets a return value. * raptor/raptor_general.c (raptor_set_feature): Delete docs, now has an API. Return a failure value. raptor_features_list - static added. (raptor_features_enumerate): Added, to allow returning of parser feature name, URI and/or label. (raptor_get_feature): Added. 2004-03-23 Dave Beckett * raptor/TODO.html: Add turtle use of raptor_generate_id * raptor/turtle_parser.y (blank): Use raptor_generate_id when a blank identifier name is given, to allow application to change it. 2004-03-21 Dave Beckett * raptor/tests/turtle/test-10.out, raptor/tests/turtle/test-09.out, raptor/turtle_parser.y: Make Turtle integers emit xsd:integer 2004-03-19 Dave Beckett * raptor/raptor_parse.c: Twice. * raptor/raptor_parse.c: Remove FIXME for other rdf:parseType values - just fall through to Literal * raptor/raptor_parse.c: FIXME not relevant. * raptor/ntriples_parse.c (raptor_ntriples_generate_statement): Kill a FIXME, fail with an error on bad rdf:_n property. * raptor/tests/Makefile.am: Added bad-06.nt * raptor/tests/bad-06.nt: bad rdf:_n in ntriples 2004-03-18 Dave Beckett * raptor/turtle_parser.y: Added INTEGER_LITERAL. Turn it into a xsd:nonNegativeInteger * raptor/turtle_lexer.l: Added INTEGER_LITERAL. * raptor/tests/turtle/Makefile.am: Added test-09 test-10 * raptor/tests/turtle/test-09.out, raptor/tests/turtle/test-09.ttl, raptor/tests/turtle/test-10.out, raptor/tests/turtle/test-10.ttl: Integer literal tests * raptor/tests/Makefile.am, raptor/Makefile.am: Ensure rapper is up-to-date and built before tests are run. 2004-03-16 Dave Beckett * librdf/rdf_parser_raptor.c, librdf/rdf_parser.c: docs 2004-03-15 Dave Beckett * raptor/tests/warn-03.out, raptor/tests/warn-03.rdf: Added warn-03 warning not dieing on NFC in XML literals * raptor/tests/Makefile.am: Added warn-03 * raptor/raptor_parse.c (raptor_end_element_grammar): For NFC problems in an XML literal, take notice of feature_non_nfc_fatal which defaults to warning, rather than given an error. 2004-03-10 Dave Beckett * librdf/redland.pc.in: Use -lrdf (patch from Curtis Hovey) 2004-02-26 Dave Beckett * redland-config.in: Use LIBRDF_VERSION_DECIMAL * configure.ac: Subsitute LIBRDF_VERSION_DECIMAL * raptor/tests/turtle/Makefile.am: Added bad-04.ttl * raptor/tests/turtle/bad-04.ttl: Check , in collection items fails * raptor/tests/turtle/test-07.ttl: Remove , between items - forbidden. * raptor/turtle_parser.y (objectList): Remove optional commas for triple objects. (itemList): Added with no commas. (collection): Use itemList not objectList. * raptor/tests/turtle/Makefile.am: remove test-09.ttl * raptor/tests/turtle/test-09.out, raptor/tests/turtle/test-09.ttl: Comma is required or not in collections, not optional 2004-02-24 Dave Beckett * raptor/raptor.spec.in: Export library la files * raptor/turtle_parser.y (objectList): Allow optional commas in lists of objects - such as in all triple objects and collections. * raptor/tests/turtle/test-09.out, raptor/tests/turtle/test-09.ttl: Added test for optional comms in a collection * raptor/tests/turtle/Makefile.am: Added test-09.ttl * configure.ac: Bumped version to 0.9.17 * Snapshotted redland_0_9_16 for 0.9.16 release (on branch redland_0_9_15-patches) * RELEASE.html, NEWS.html: Updated to 0.9.16 (from CVS branch redland_0_9_15-patches) * librdf/librdf.h, raptor/raptor.h: Add stdio.h 2004-02-23 Dave Beckett * RELEASE.html, NEWS.html: Updates for 0.9.16 * configure.ac: Bumped version to 0.9.16 * raptor/raptor.h: Add stdio.h * librdf/rdf_uri.h: Remove #include Make librdf_uri_get_digest internal. * librdf/rdf_node.h: Make librdf_node_get_digest internal. * librdf/librdf.h: Add stdio.h * redland-src-config.in: Make --run not discard spaces in arguments. * redland-src-config.in: Don't destroy whitespace in args with --run * librdf/rdf_uri.h: Remove include rdf_digest.h - an internal header, should not be called from a public one. Make librdf_uri_get_digest internal. * librdf/rdf_node.h: Make librdf_node_get_digest internal. 2004-02-19 Dave Beckett * raptor/n3_lexer.l, raptor/turtle_lexer.l (main): Don't re-reset the scanner to it's address. * raptor/n3_lexer.l, raptor/turtle_lexer.l: Remove RAPTOR_IN_REDLAND * raptor/turtle_parser.y (main): Use lineno. * raptor/turtle_parser.y: comment * INSTALL.html: No expat shipped. * INSTALL.html: Try to improve --with-LANGUAGE args docs 2004-02-16 Dave Beckett * python/RDF.py (Node.__init__): Use ._reduri for datatype uri arg 2004-02-02 Dave Beckett * perl/Makefile.am: fix test-perl * perl/Makefile.am: delete first test-perl * Redland.i (librdf_call_perl_message): Remove ENTER / LEAVE from perl - since swig now undefines ENTER. Add %newobject for all constructors and methods returning new objects - all returning librdf_stream, librdf_biterator, librdf_node. * docs/Makefile.am: Add api.html and fragments * docs/api.html.in: Skeleton html API manual * librdf/rdf_stream.c, librdf/rdf_storage_mysql.c, librdf/rdf_parser_raptor.c, librdf/rdf_node.c, librdf/rdf_model.c, librdf/rdf_iterator.c, librdf/rdf_init.c, librdf/rdf_heuristics.c: Docucomment fixes - missing args, renamed args. * docs/kernel-doc: Update to kernel-doc 2003-12-18 2004-02-01 Dave Beckett * librdf/rdf_stream.c, librdf/rdf_statement.c, librdf/rdf_iterator.c: Note explicitly that iterator/stream return SHARED pointers to the current object(or statement), context node 2004-01-31 Dave Beckett * configure.ac: Bumped version to 0.9.16 * Snapshotted redland_0_9_15 for 0.9.15 release * redland-src-config.in: add raptor-config libs dir if building against system raptor * redland-src-config.in: Set library paths search, don't delete any existing ones. * tcl/Makefile.am ruby/Makefile.am, python/Makefile.am, php/Makefile.am, perl/Makefile.am, java/Makefile.am, csharp/Makefile.am: Use redland-src-config --run COMMAND to run test programs with the shared libraries built in the source tree. * redland-src-config.in: Add --run COMMAND to run programs with the shared libraries built in the source tree. * librdf/rdf_parser_raptor.c (librdf_parser_raptor_constructor): Use raptor_syntaxes_enumerate. * python/Makefile.am: PYTHON_INCLUDES * configure.ac: Improve python includes, libs checking. Report what's found. 2004-01-30 Dave Beckett * utils/Makefile.am, raptor/Makefile.am: deps * raptor/fix-groff-xhtml: words * raptor/rapper.1: fix changelog * raptor/Makefile.am: Make rapper.html * raptor/fix-groff-xhtml: Fix to strict * utils/Makefile.am: Use fix-groff-xhtml in the raptor src * librdf/rdf_storage_tstore.c: Switch to use option database, not db. * utils/Makefile.am: Added rdfproc.html fix-groff-xhtml * utils/rdfproc.1: fix storage args urls * raptor/rapper.1: urls * docs/Makefile.am: Added storage.html * librdf/rdf_hash_bdb.c (librdf_hash_bdb_open): Check identifier is not NULL. * librdf/redland.spec.in: Build with mysql, without threestore, Update deps, perl >=5.8.0, python >=2.2.0, require Raptor 1.2.0+ * librdf/redland.spec.in: Fix install for python, remove setup.py * python/setup.cfg, python/setup.py: Junk distutils * python/Makefile.am: Junk distutils. * configure.ac: Get python_include, python_lib and substitute. 2004-01-29 Dave Beckett * java/org/librdf/redland/Model.java (findStatements): Added with context_node. (getContexts): Added. * docs/redland.pod: Updated Model: Added librdf_model_find_statements_in_context, librdf_model_find_statements_with_options, librdf_model_get_contexts, librdf_model_get_feature, librdf_model_set_feature. Parser: Changed librdf_parser_get_feature, librdf_parser_set_feature args to nodes. Serializer: Added, was missing. 2004-01-25 Dave Beckett * utils/rdf-digest.c, utils/rdf-load.c: removed rdf-digest rdf-load * utils/Makefile.am: Remove rdf-load rdf-digest * librdf/rdf_storage_file.c (librdf_storage_file_init): Cast for URI. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_get_contexts_get_method): World in error arg. * librdf/rdf_storage_list.c (librdf_storage_list_get_contexts_get_method): World in error arg. * configure.ac: Added --disable-assert and --disable-assert-messages to prevent (default) compilation of assertion code and outputing of messages when the assertions fail. * librdf/rdf_internal.h: Made assertions print out, but not abort in standard compile. Added LIBRDF_DISABLE_ASSERT_MESSAGES to prevent the output code. Added LIBRDF_DISABLE_ASSERT to prevent the assertions entirely. * librdf/rdf_storage_tstore.c: Use storage usage tracking. (librdf_storage_tstore_serialise, librdf_storage_tstore_serialise_finished): Add/remove storage usage. (librdf_storage_tstore_find_statements, librdf_storage_tstore_find_finished): Add/remove storage usage. * librdf/rdf_storage_mysql.c: Use storage usage tracking. (librdf_storage_mysql_find_statements_with_options, librdf_storage_mysql_find_statements_in_context_finished): Add/remove storage usage. (librdf_storage_mysql_get_contexts, librdf_storage_mysql_get_contexts_finished): Add/remove storage usage. * librdf/rdf_storage_list.c: Use storage usage tracking. (librdf_storage_list_serialise, librdf_storage_list_serialise_finished): Add/remove storage usage. (librdf_storage_list_context_serialise, librdf_storage_list_context_serialise_finished): Add/remove storage usage. (librdf_storage_list_get_contexts_finished, librdf_storage_list_get_contexts): Add/remove storage usage. * librdf/rdf_storage_hashes.c: Use storage usage tracking. (librdf_storage_hashes_serialise_common, librdf_storage_hashes_serialise_finished): Add/remove storage usage. (librdf_storage_hashes_node_iterator_finished, librdf_storage_hashes_node_iterator_create): Add/remove storage usage. (librdf_storage_hashes_context_serialise, librdf_storage_hashes_context_serialise_finished): Add/remove storage usage. (librdf_storage_hashes_get_contexts, librdf_storage_hashes_get_contexts_finished): Add/remove storage usage. * perl/lib/RDF/Redland/Storage.pm, perl/lib/RDF/Redland/Model.pm (DESTROY): Remove debug message fixme. * librdf/rdf_model_storage.c (librdf_model_storage_create, librdf_model_storage_destroy): Add and release a reference to the used storage. * librdf/rdf_storage.h: Add usage tracking to librdf_model. Added librdf_storage_add_reference, librdf_storage_remove_reference * librdf/rdf_storage.c: Add usage tracking. (librdf_new_storage_from_storage,librdf_new_storage_from_factory): Set usage to 1 on creation. (librdf_free_storage): Decrement usage, free if 0. (librdf_storage_add_reference,librdf_storage_remove_reference): Added. (librdf_storage_stream_to_node_iterator_finished, librdf_storage_node_stream_to_node_create); Add storage usage tracking. * librdf/rdf_model.h: Add usage tracking to librdf_model. Added librdf_model_add_reference, librdf_model_remove_reference * librdf/rdf_model.c: Add usage tracking. (librdf_new_model_with_options,librdf_new_model_from_model): Set usage to 1 on creation. (librdf_free_model): Decrement usage, free if 0. (librdf_model_add_reference,librdf_model_remove_reference): Added. * raptor/raptor_general.c (raptor_delete_parser_factories): Free alias if it was set. 2004-01-24 Dave Beckett * configure.ac: RAPTOR_MIN_VERSION=1.2.0 * Makefile.am: Add Changelog.1-3 to dist * raptor/rdfdump.c: Don't print (default) when listing valid args for -i * raptor/rdfdump.c: Use raptor_syntax_name_check to check name; don't make/destroy a parser. * raptor/raptor_general.c (raptor_syntax_name_check): Added, to check names. * raptor/raptor.h: Added raptor_syntax_name_check * raptor/rdfdump.c: Make -i try to make a parser, don't hardcode names. * raptor/rdfdump.c: Use raptor_syntaxes_enumerate in -i error * raptor/rdfdump.c: Use raptor_syntaxes_enumerate in usage -i help * raptor/rapper.1: Updated to mention Turtle. * raptor/configure.ac: Bumped version to 1.3.0 * raptor/libraptor.3: Updated for 1.2.0 * librdf/rdf_storage_mysql.c: Change schema. Table Literals, column Language remove default '' * librdf/rdf_storage_mysql.c: Change schema. Table Literals, column Language varchar(6) to text. 2004-01-22 Dave Beckett * librdf/rdf_model.c (librdf_model_get_source, librdf_model_get_arc, librdf_model_get_target): Fail if iterator returns NULL. * raptor/configure.ac: words * raptor/configure.ac: Use AC_PROG_LEX and handle when there is no lex or flex gracefully. AM_PROG_LEX set LEX to a value that caused odd configure output. 2004-01-21 Dave Beckett * configure.ac: If /sw/bin, add to END of PATH for OSX 2004-01-20 Dave Beckett * utils/rdfproc.c: Added match command, doing a match-substring search using the model find_statements with that option. * librdf/rdf_storage_mysql.c: Literal matching seems to be working. * librdf/rdf_storage_mysql.c: Added basic (LIKE) literal searching when option match-substring=true * librdf/rdf_storage_mysql.c (librdf_storage_mysql_find_statements_with_options): Added, making this the general query method renamed from librdf_storage_mysql_find_statements_in_context, not using the options just yet. * librdf/rdf_model_storage.c (librdf_model_storage_find_statements_with_options): Added, passing it through to the model storage. * librdf/rdf_model.c (librdf_model_find_statements_with_options): Added, optional. * librdf/rdf_model.h: Added factory method find_statements_with_options Added librdf_model_find_statements_with_options Added option LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL * librdf/rdf_storage.c (librdf_storage_find_statements_with_options): Added, optional. * librdf/rdf_storage.h: Added factory method find_statements_with_options Added librdf_storage_find_statements_with_options * raptor/configure.ac: Updated output files check from n3/ntriples plus to turtle * raptor/turtle_parser.y, raptor/raptor_rss.c, raptor/raptor_parse.c, raptor/ntriples_parse.c: Update to use raptor_parser_register_factory alias argument to register any old or alternate names. * raptor/raptor_internal.h: Add alias field to raptor_parser_factory_s. Add alias argument to raptor_parser_register_factory prototype. * raptor/raptor_general.c (raptor_parser_register_factory, raptor_get_parser_factory): Added an alias argument, used to register a alternate name which is never used or returned in parser enumerations. * raptor/examples/grapper.c: Added a tooltip for the errors/warnings output box. * raptor/examples/grapper.c: Use G_TYPE_INT for column 1 of errors * raptor/examples/grapper.c: Added errors/warnings box, updated with results of parsing. * raptor/Makefile.am: Added ChangeLog.1 2004-01-19 Dave Beckett * raptor/raptor_general.c: Define raptor_system_malloc, raptor_system_free * raptor/raptor_internal.h: RAPTOR_... not LIBRDF_ * raptor/raptor_utf8.c (raptor_utf8_is_nfc): Use SYSTEM_FREE * raptor/raptor_internal.h: Define SYSTEM_MALLOC, SYSTEM_FREE 2004-01-18 Dave Beckett * raptor/turtle_parser.y: fix double free of first_identifier * raptor/turtle_parser.y: Collections generating triples. * raptor/turtle_common.h: Add nil/first/rest_uri fields * raptor/tests/turtle/test-07.out: Updated as a collection test result. * raptor/tests/turtle/Makefile.am: Added test-08 * raptor/tests/turtle/test-08.out, raptor/tests/turtle/test-08.ttl, raptor/tests/turtle/test-07.ttl: collection test * raptor/turtle_lexer.l: Added '(' and ')' for collections. * raptor/turtle_parser.y: Added collection grammar parts, triples not right yet. * raptor/raptor_identifier.c (raptor_copy_identifier): Copy literal languages correctly. * raptor/tests/turtle/test-00.out, raptor/tests/turtle/Makefile.am, raptor/tests/Makefile.am, raptor/turtle_parser.y, raptor/turtle_lexer.l, raptor/turtle_common.h, raptor/raptor_internal.h, raptor/raptor_general.c, raptor/configure.ac, raptor/Makefile.am: N-Triples Plus to Turtle, n3_ in filenames to turtle_, .ntp to .ttl * raptor/rdfdump.c: indenting * raptor/rdfdump.c: Allow turtle, don't document ntriples-plus * raptor/n3_parser.y, raptor/turtle_parser.y: Register under the name turtle 2004-01-17 Dave Beckett * python/RDF.py: Added FileStorage * csharp/Makefile.am: touch stamp after build * csharp/Makefile.am: Update clean * csharp/Makefile.am: Update fakery * perl/Makefile.PL: Stop perl linking to destdir * python/setup.py: Tidy, add more libraries * utils/rdfproc.c: Use librdf_storage_enumerate in help * librdf/rdf_storage_tstore.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_file.c: Updated to add store labels. * librdf/rdf_storage.h: Added label to librdf_storage_factory librdf_storage_register_factory gains label arg Added librdf_storage_enumerate prototype. * librdf/rdf_storage.c: Added labels to factory. (librdf_storage_register_factory): Added label arg. (librdf_storage_enumerate): Added, to get basic store info. * librdf/rdf_storage_file.c (librdf_storage_file_size): For consistency, use the model call. * librdf/rdf_storage.h, librdf/rdf_storage.c: Added librdf_init_storage_file * librdf/Makefile.am: Added rdf_storage_file.c * utils/rdfproc.c: Some C++ casts. Init rc correctly. Correct indenting to follow logic near CMD_SERIALIZE. * librdf/rdf_storage_file.c: Persistent store in file (r/w) and uri (r) * librdf/rdf_serializer.h: Re-export librdf_serializer_serialize_model 2004-01-16 Dave Beckett * librdf/rdf_serializer.c (librdf_serializer_serialize_model): re-export * librdf/rdf_serializer.c (librdf_serializer_serialize_model): static, internal. * librdf/rdf_serializer.h: Do not export librdf_serializer_serialize_model 2004-01-15 Dave Beckett * java/Makefile.am: More OSX-only things; the JNI libs install with a different name! * python/RDF.py (Model.get_contexts): Fix Iterator call. * java/Makefile.am: Add DYLD_LIBRARY_PATH to try to make 'make check' work on OSX. * configure.ac: Add OSX dirs to JDK search guesses * ruby/Makefile.am: Try to find the right libruby another way * librdf/rdf_storage_hashes.c (librdf_storage_hashes_get_contexts): Added, implementing get_contexts for hashes storage implementation. * python/RDF.py: Export NS class. (Parser. parse_string_as_stream): Promote string URI to a Redland Uri. 2004-01-14 Dave Beckett * librdf/rdf_serializer_raptor.c (librdf_serializer_print_statement_as_ntriple): Emit literal datatype URI in N-Triples encoding. * librdf/rdf_serializer_raptor.c (librdf_serializer_print_statement_as_ntriple): break * librdf/rdf_serializer_raptor.c (librdf_serializer_print_statement_as_ntriple): Emit subject and predicate URIs in N-Triples encoding. Add some checks. * librdf/rdf_serializer_raptor.c (librdf_serializer_print_statement_as_ntriple): Emit URIs in UTF-8 * librdf/rdf_uri.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage.c, librdf/rdf_statement.c, librdf/rdf_serializer.c, librdf/rdf_query.c, librdf/rdf_parser_raptor.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_model.c, librdf/rdf_internal.h, librdf/rdf_hash_bdb.c, librdf/rdf_hash.c, librdf/rdf_digest.c: LIBRDF_DEBUG* lose their function arg * configure.ac: help message consistency again * configure.ac: help message consistency. * librdf/rdf_storage_mysql.c, librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.c, librdf/rdf_parser_raptor.c: Various casts for C++ (g++) to be happier. * raptor/raptor_xml_writer.c, raptor/raptor_uri.c, raptor/raptor_rss.c, raptor/raptor_qname.c, raptor/raptor_parse.c, raptor/raptor_namespace.c, raptor/raptor_internal.h, raptor/raptor_general.c, raptor/ntriples_parse.c: RAPTOR_ERROR* and RAPTOR_FATAL* lose their function arg, using __func__ * php/redland_wrap.c.patch: Add librdf_php_world_finish() to PHP_MSHUTDOWN_FUNCTION(redland) * php/test.php: Remove world startup/shutdown, now handled by the module. use $world=librdf_php_get_world() * php/Makefile.am: Ensure the .orig is around for patching. * Redland.i: For PHP, initialise the world when the module starts up. Add librdf_serializer definition. * examples/Makefile.am: Restore example4 * librdf/rdf_uri.c, librdf/rdf_stream.c, librdf/rdf_storage_tstore.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage.c, librdf/rdf_statement.c, librdf/rdf_serializer_rdfxml.c, librdf/rdf_serializer.c, librdf/rdf_query.c, librdf/rdf_parser_raptor.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_model.c, librdf/rdf_list.c, librdf/rdf_internal.h, librdf/rdf_hash_memory.c, librdf/rdf_hash_bdb.c, librdf/rdf_hash.c, librdf/rdf_digest.c, librdf/rdf_concepts.c: LIBRDF_ERROR* and LIBRDF_FATAL* lose their function arg * librdf/rdf_serializer.c, librdf/rdf_parser.c, librdf/rdf_storage.c: Add a bunch of LIBRDF_ASSERT* for object pointers. * librdf/rdf_node.c (librdf_node_get_literal_value_is_wf_xml): Only check non-NULL datatype URIs. * librdf/rdf_node.c (librdf_new_node_from_blank_identifier): Removed assertion, can be NULL. * librdf/rdf_model.c: Add a bunch of LIBRDF_ASSERT* for object pointers. * librdf/rdf_internal.h: fix macros again for not debugging. * librdf/rdf_internal.h: fix macros for not debugging. * librdf/rdf_statement.c: Add a bunch of LIBRDF_ASSERT* for object pointers. * librdf/rdf_internal.h: Assert macros tweaks. * librdf/rdf_node.c, librdf/rdf_uri.c: Add a bunch of LIBRDF_ASSERT* for object pointers. * librdf/rdf_internal.h (LIBRDF_ASSERT_RETURN, LIBRDF_ASSERT_OBJECT_POINTER_RETURN, LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE): Added macros. (LIBRDF_ERROR1,LIBRDF_ERROR2,LIBRDF_ERROR3,LIBRDF_FATAL1,LIBRDF_FATAL2): Use ANSI C99 __func__ rather than the function arg, renamed them to "notused" for now. * examples/example4.c: Code now demonstrates serializing. * librdf/rdf_uri.c (librdf_new_uri): Return NULL if string is NULL or empty (0 length). * raptor/raptor_general.c (raptor_finish): Remove direct call of raptor_terminate_parser_rdfxml * raptor/raptor_parse.c (raptor_xml_parse_finish_factory): Renamed from raptor_terminate_parser_rdfxml and now static. * raptor/raptor_internal.h: finish_factory returns void * raptor/raptor_internal.h: Added finish_factory factory cleanup method. Removed raptor_terminate_parser_rdfxml. * raptor/raptor_general.c (raptor_delete_parser_factories): Free mime type, URI string. Call new finish_factory factory method. * librdf/rdf_init.c (librdf_free_world, librdf_world_open): Add raptor dependency notes. 2004-01-13 Dave Beckett * java/org/librdf/redland/Serializer.java, java/org/librdf/redland/Parser.java, java/org/librdf/redland/Model.java: Updated Model/Parser/Serializer get/setFeature methods to use Node not String. * librdf/Makefile.am: Add LIBRDF_EXTERNAL_CPPFLAGS for rdf_uri_test * utils/Makefile.am: Add LIBRDF_EXTERNAL_CPPFLAGS/LIBS * php/redland_wrap.c.patch: offsets * python/RDF.py (Model.find_statements): Add optional context arg. * perl/lib/RDF/Redland/Model.pm (find_statements): Add optional CONTEXT arg and call librdf_model_find_statements_in_context if given. * Redland.i: Added librdf_model_find_statements_in_context Added librdf_model_get_feature, librdf_model_set_feature. Adjust librdf_serializer_get_feature, librdf_serializer_set_feature to use librdf_node not strings. * librdf/rdf_serializer.h, librdf/rdf_serializer.c: Adjust librdf_serializer_get_feature, librdf_serializer_set_feature to use librdf_node not strings. * perl/lib/RDF/Redland/Model.pm: Added contexts method. * python/RDF.py (Model): Added get_contexts * Redland.i: Added librdf_model_get_contexts * python/RDF.py (Model): Added get_feature, set_feature (Parser): Updated get_feature, set_feature for using node values. * perl/lib/RDF/Redland/Model.pm: (feature) Added * perl/Makefile.PL: Add CFLAGS to dynamic_lib to get -g when it is enabled. * perl/Makefile.PL: CORE_PACKAGE must be in main namespace * perl/lib/RDF/Redland/Parser.pm (feature): Use/return nodes. * Redland.i: Adjust librdf_parser_get_feature, librdf_parser_set_feature to use librdf_node not strings. * utils/rdfproc.c: Check contexts return value. Tidy error, warning count nodes, uris. * librdf/rdf_storage_mysql.c (librdf_storage_mysql_get_feature): Added, to return contexts always. * librdf/rdf_storage_list.c (librdf_storage_list_get_feature): Added, to return contexts or not. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_get_feature): Added, to return contexts or not. * utils/rdfproc.c: Use librdf_model_get_feature to find out if contexts are supported. * librdf/rdf_model_storage.c (librdf_model_storage_set_feature): Added, calling librdf_storage_set_feature * librdf/rdf_model_storage.c (librdf_model_storage_get_feature): Added, calling librdf_storage_get_feature * librdf/rdf_storage.h: Added storage methods, factory methods get_feature, set_feature now with librdf_uri* for feature property name, librdf_node* for values. * librdf/rdf_storage.c (librdf_storage_get_feature,librdf_storage_set_feature): Added * librdf/rdf_model.c (librdf_model_get_feature,librdf_model_set_feature): Added * librdf/rdf_model.h: Added parser methods, factory methods get_feature, set_feature now with librdf_uri* for feature property name, librdf_node* for values. * librdf/rdf_parser_raptor.c, librdf/rdf_parser.h, librdf/rdf_parser.c: parser methods, factory methods get_feature, set_feature now use librdf_node* for values. * configure.ac: check for getenv * utils/rdfproc.1: Document environment variables RDFPROC_STORAGE_OPTIONS and RDFPROC_STORAGE_TYPE * utils/rdfproc.c: Use environment variables RDFPROC_STORAGE_OPTIONS and RDFPROC_STORAGE_TYPE to provide default storage options (-t) and type (-s) Apply in order environment variables, options, storage options. 2004-01-12 Dave Beckett * librdf/rdf_storage_mysql.c (librdf_storage_mysql_find_statements_in_context): Copy the query statement and/or query context_node so that they live during the streaming. (librdf_storage_mysql_find_statements_in_context_finished): Free them. * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_find_statements_in_context_next_statement): Clear current_context pointer after free. * configure.ac: MySQL store works with V3.23.58 and maybe others? * librdf/rdf_storage_mysql.c: fix * librdf/rdf_storage_mysql.c (librdf_storage_mysql_init): Default to port 3306. * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_get_contexts_next_context) row= * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_find_statements_in_context_next_statement): Allow a NULL context to be returned. 2004-01-11 Dave Beckett * utils/rdfproc.c: contexts commands has no args * librdf/rdf_storage_list.c (librdf_storage_list_get_contexts_get_method): Use icontext in debug arg. * utils/rdfproc.1: Add find with contexts, contexts, parse-stream with contexts. * utils/rdfproc.c: Added CONTEXT arg to parse-stream to parse into a context. Fixed contexts command, now working. * utils/rdfproc.c: Added contexts command to list all contexts. Tidied warnings about using context commands with contexts disabled. * utils/rdfproc.c: Added 4th arg to find command, to find in a particular context invoking librdf_model_find_statements_in_context * librdf/rdf_storage_hashes.c (librdf_storage_hashes_context_serialise): Return NULL if no contexts. * utils/rdf-tree.c: V0.4 Removed id option Added -m/model, -q/quiet options. Now doesn't follow objects of rdf:type. * utils/rdf-load.c: Removed options id, rdf-parser. Added options input, model, quiet. read password from stdin * librdf/rdf_model_storage.c (librdf_model_storage_get_contexts): Added, implementing get_contexts for model_storage implementation. * librdf/rdf_storage_list.c (librdf_storage_list_get_contexts): Added to implement get_contexts along with: (librdf_storage_list_get_contexts_is_end librdf_storage_list_get_contexts_next_method librdf_storage_list_get_contexts_get_method librdf_storage_list_get_contexts_finished): Helper functions for the get_contexts method. * librdf/rdf_storage_hashes.c: Deleted librdf_storage_hashes_find_map and share the same code now in librdf_stream_statement_find_map * librdf/rdf_stream.h: Added prototoype for librdf_stream_statement_find_map * librdf/rdf_stream.c (librdf_stream_statement_find_map): Added, formerly librdf_storage_list_find_map * librdf/rdf_model.h: Add factory methods find_statements_in_context, get_contexts. Add prototypes for librdf_model_find_statements_in_context and librdf_model_get_contexts * librdf/rdf_model.c (librdf_model_find_statements_in_context): Added, calling the factory method otherwise using librdf_stream_statement_find_map over a stream of the statements in the context. (librdf_model_get_contexts): Added. (main): Test code, add a get_contexts call; does not yet work on memory, hashed stores. * librdf/rdf_storage.c (librdf_storage_stream_in_context_map): Deleted. (librdf_storage_find_statements_in_context): Do not use the above but use librdf_stream_statement_find_map over a stream of the statements in the context. * librdf/rdf_storage_list.c (librdf_storage_list_find_map): Renamed to librdf_stream_statement_find_map and moved to rdf_stream.c * librdf/rdf_storage_mysql.c: Enable factory methods find_statements_in_context, get_contexts. * librdf/rdf_storage.h: Add factory methods find_statements_in_context, get_contexts. Add prototypes for librdf_storage_find_statements_in_context and librdf_storage_get_contexts * librdf/rdf_storage.c (librdf_storage_stream_in_context_map): Added, helper for librdf_storage_find_statements_in_context when not in the factory. (librdf_storage_find_statements_in_context): Added. (librdf_storage_get_contexts): Added. * librdf/rdf_storage_list.c: (librdf_storage_list_find_map, librdf_storage_list_find_statements): Update to new stream map API. * librdf/rdf_storage_hashes.c: (librdf_storage_hashes_find_map, librdf_storage_hashes_find_statements): Update to new stream map API. * librdf/rdf_stream.h, librdf/rdf_stream.c: Change stream mapping to use a list of maps, matching the iterator code exactly except using librdf_statement*, not void*. Add typedefs librdf_stream_map_handler, librdf_stream_map_free_context_handler. Add librdf_stream_map internal structure. Change stream interals to use librdf_stream_map. Deleted librdf_stream_set_map. Added librdf_stream_add_map using typedefs. * librdf/rdf_iterator.h: Add free_context handler to librdf_iterator_map Define typedefs librdf_iterator_map_handler and librdf_iterator_map_free_context_handler Change librdf_iterator_add_map to have free_context handler arg. * librdf/rdf_iterator.c (librdf_iterator_free_iterator_map): Use free_context handler. (librdf_iterator_add_map): Add optional free_context handler, use typedefs. * librdf/rdf_storage_mysql.c: year 2004 assgment in if()s fixes for gcc warnings. * librdf/rdf_storage_mysql.c: Import from morten 2004-01-11 2004-01-08 Dave Beckett * utils/rdfproc.1: Added remove-context command. * utils/rdfproc.c: Use parser features LIBRDF_PARSER_FEATURE_ERROR_COUNT LIBRDF_PARSER_FEATURE_WARNING_COUNT to get and report error and warning counts after parsing, if either of them is not 0. 2004-01-07 Dave Beckett * librdf/rdf_parser_raptor.c: Handle LIBRDF_PARSER_FEATURE_ERROR_COUNT LIBRDF_PARSER_FEATURE_WARNING_COUNT to return error and warning counts after (during?) a parser. Since the first error is fatal, it will either be 0 or 1. Warnings can be larger. (librdf_parser_raptor_get_feature): Added. * librdf/rdf_parser.h: Added LIBRDF_PARSER_FEATURE_ERROR_COUNT LIBRDF_PARSER_FEATURE_WARNING_COUNT * perl/lib/RDF/Redland/Parser.pm (parse_string_into_model): Fix to call the right function librdf_parser_parse_string_into_model * librdf/rdf_types.h, configure.ac: Restore u64 tests * utils/rdfproc.c: add missing closing } * librdf/rdf_storage.h, librdf/rdf_storage.c, librdf/rdf_model.c: Documentation: Note that context methods with a NULL context are equivalent to the equivalent methods without the context argument. * utils/rdfproc.c: On error, free(storage_password) only if set. * utils/rdfproc.c: de-torture some logic * utils/rdfproc.c: Tidy a lot of output and debug messages, s/model/graph/. Add command remove-context to invoke librdf_model_context_remove_statements * utils/rdfproc.1: Note the -p/--password. * utils/rdfproc.c: Added -p/--password to read a password as storage option 'password' from standard input. * utils/rdfproc.1: Note the -o/--output FORMAT * utils/rdfproc.c: Added -o FORMAT to set the output triples format. Presently just for the find command but will apply later to query and others. * utils/Makefile.am: Remove update-api-0912.pl * utils/update-api-0912.pl: Old api script * utils/rdfproc.1: Note blank node, URI, literal syntax. * utils/rdfproc.c: Use librdf_heuristic_is_blank_node, librdf_heuristic_get_blank_node for arcs-in/out, has-arc-in/out * utils/rdfproc.c: add a mini rdf notation to rdfproc help Use librdf_heuristic_is_blank_node, librdf_heuristic_get_blank_node for context nodes with add, add-typed, remove commands. * utils/rdfproc.c: Use librdf_heuristic_is_blank_node, librdf_heuristic_get_blank_node and extend so all source/target/arc &+s commands use them as appropriate so blank nodes can be used wherever. * librdf/rdf_heuristics.h, librdf/rdf_heuristics.c: Added librdf_heuristic_is_blank_node, librdf_heuristic_get_blank_node * utils/rdfproc.c: Allow _:ABC for blank nodes in subject or object of statements. 2004-01-05 Dave Beckett * perl/Makefile.am: Don't pass on PACKAGE variable, Makefile.PL doesn't use it * perl/Makefile.PL: Don't use PACKAGE envariable; the name isn't changing now! Hard code CORE name also. * php/redland_wrap.c.patch: offsets again * librdf/rdf_model_storage.c (librdf_model_storage_context_serialize): Use librdf_storage_context_as_stream * librdf/rdf_storage_hashes.c: Add some int to librdf_statement_part casts. * librdf/redland.spec.in: - added redland-python package - export some more docs 2004-01-04 Dave Beckett * Redland.i: Remove deprecated librdf_iterator_have_elements * docs/redland.pod: Update to match current state; not yet automated. * librdf/rdf_stream.h: Make librdf_new_stream_from_node_iterator final arg be the enum. * librdf/rdf_iterator.h: note deprecation of librdf_iterator_have_elements * docs/Makefile.am: correctly substitute version in redland.3 * Makefile.am: Make generated text files keep their links. Only do the generation in maintainer mode. * examples/Makefile.am: Some reordering of arguments. Add building raptor rule, if needed * examples/Makefile.am: Do not ship example4 * Redland.i: PHP also pollutes the auto* defines into public include files. * php/redland_wrap.c.patch: Updated * php/Makefile.am: Put the patching rules in the Makefile, maintainer mode * Redland.i: Add some extra prototypes for swig python * Redland.i: Do not export deprecated functions: librdf_init_world, librdf_destroy_world, librdf_model_serialise, librdf_model_context_serialize * librdf/rdf_serializer.h, librdf/rdf_parser.h, librdf/rdf_digest.h: Change void *c to void *_context in prototypes. Helps remove some declaration shadowing warnings. * perl/Makefile.PL: Perl 5.8 is $]=5.008 * librdf/rdf_uri.h, librdf/rdf_stream.h, librdf/rdf_stream.c, librdf/rdf_storage.h, librdf/rdf_storage.c, librdf/rdf_statement.h, librdf/rdf_statement.c, librdf/rdf_serializer.h, librdf/rdf_query.h, librdf/rdf_parser.h, librdf/rdf_node.h, librdf/rdf_model.h, librdf/rdf_iterator.h, librdf/rdf_init.h, librdf/rdf_concepts.h: Tidy up the headers, split internal/public stuff more clearly. Export public functions with REDLAND_API * librdf/librdf.h: Moved internal stuff to rdf_internal.h; include it. * librdf/Makefile.am: Made rdf_hash.h rdf_digest.h rdf_types.h rdf_model_storage.h rdf_heuristics.h rdf_list.h rdf_hash_bdb.h rdf_hash_memory. rdf_files.h rdf_storage_list.h rdf_storage_hashes.h rdf_query_triples.h source-only headers, never installed. * librdf/rdf_storage_mysql.h, librdf/rdf_storage_tstore.h: Restored * librdf/rdf_internal.h: rdf_internal.h 2004-01-03 Dave Beckett * librdf/rdf_iterator.c (librdf_iterator_update_current_element): Fix iteration when using a list of map functions. (librdf_iterator_map_remove_duplicate_nodes): Deleted, never used. * librdf/rdf_storage.c (librdf_storage_node_stream_to_node_create): and nearby, remove prototypical duplicate removing options since it never worked and changing it now would confuse. * librdf/rdf_storage.c: Removed rdf_storage_mysql/tstore.h * librdf/rdf_storage.h: Moved mysql, tstore prototypes here. * librdf/rdf_storage_tstore.c: Removed rdf_storage_tstore.h * librdf/rdf_storage_tstore.h, librdf/rdf_storage_mysql.h: 1 function defined here moved to rdf_storage.h * librdf/librdf.h: restore accidently deleted #endif * librdf/librdf.h: No longer NEED_EXPAT_SOURCE * librdf/redland.spec.in, librdf/redland.pc.in: name * librdf/librdf.h: comment * Makefile.am: Make TODO up to date * librdf/rdf_parser_raptor.c: Correctly use SYSTEM_FREE * librdf/rdf_parser_raptor.c: Remove some FIXMEs; replacing LIBRDF_FREE with SYSTEM_FREE now that raptor is never compiled with redland internals enabled even when in the source tree. 2004-01-02 Dave Beckett * librdf/rdf_parser_raptor.c (librdf_parser_raptor_parse_file_as_stream): Use pcontext->parser_name with raptor_new_parser. (librdf_parser_raptor_constructor): Register the default parser last always (rdfxml) and preserve the raptor old name as a true alias. 2004-01-01 Dave Beckett * raptor/raptor_general.c: casts for string ops * raptor/raptor_www.c, raptor/raptor_internal.h, raptor/configure.ac: Added WWW access with BSD libfetch. * raptor/raptor_www_libfetch.c: WWW access with BSD libfetch redland-1.0.17/ChangeLog.40000644000175000017500000051137711171007723012063 000000000000002003-12-31 Dave Beckett * utils/rdfproc.c: tweak help text * librdf/rdf_parser.h: Note parser syntax name, not raptor factory name, which is in the raptor parser context. * librdf/rdf_parser_raptor.c: Separate registered name from raptor parser name for all calls of raptor_new_parser. (librdf_parser_raptor_init): Convert the legacy parser name 'raptor' into 'rdfxml' internally. (librdf_parser_raptor_constructor): Use raptor_parsers_enumerate and hard code mime types, URIs here for now. Can use raptor_syntaxes_enumerate later. * raptor/raptor_rss.c, raptor/raptor_parse.c, raptor/ntriples_parse.c, raptor/n3_parser.y: Use expanded raptor_parser_register_factory with mime_type and uri_string args where appropriate. * raptor/libraptor.3, raptor/raptor.h: Added raptor_syntaxes_enumerate * raptor/raptor_general.c (raptor_parser_register_factory): Add mime_type and uri_string args, both optional. (raptor_syntaxes_enumerate): Added to get syntax name, label, mime_type or uri_string - all optional. (raptor_parsers_enumerate): Uses raptor_syntaxes_enumerate. * raptor/raptor_internal.h: Store parser mime_type, URI in raptor_parser_factory Update raptor_parser_register_factory to take mime_type, uri_string args. * utils/rdfproc.c: tweak help formatting * raptor/configure.ac: Bumped version to 1.2.0 * raptor/configure.ac: Update RAPTOR_LIBTOOL_VERSION to reflect interfaces added, none removed giving current 2:0:1 * raptor/libraptor.3: nroff/man style tweaks * raptor/libraptor.3: Style 2003-12-30 Dave Beckett * raptor/configure.ac: words * raptor/configure.ac: Make flex version warnings mention N-Triples Plus more * librdf/rdf_model_storage.c, librdf/rdf_model.h, librdf/rdf_model.c (librdf_model_get_storage): Added, with factory method to match - optional. The model_storage implementation implements it. 2003-12-29 Dave Beckett * utils/rdf-tree.c, utils/rdf-load.c: indented * raptor/libraptor.3: bump date * raptor/raptor_stringbuffer.c (main): Do not free as_string returned strings * raptor/raptor_stringbuffer.c: brackets * raptor/raptor_stringbuffer.c (raptor_free_stringbuffer): Free any constructed string. * configure.ac: Add AC_DEFINE for local MD5, SHA1, RIPEMD160 * utils/rdfproc.c: Tweak help text to look better without getopt_long * librdf/rdf_serializer_rdfxml.c: Some more unsigned char fixes for URIs (librdf_serializer_print_statement_as_rdfxml): Try harder to find a maximal length legal property element name; now works for foaf:mbox_sha1sum - patch from Morten * docs/api.sgml.in, docs/Makefile.am: Added storage_mysql storage_tstore * raptor/raptor_xml_writer.c: Use raptor_stringbuffer to better grow the output cdata. * raptor/raptor_stringbuffer.c: stringbuffer now uses unsigned char Removed raptor_new|free_stringbuffer_node - used once, now inlined. (raptor_stringbuffer_append_string_common): Added with common append code merged here. (raptor_stringbuffer_append_counted_string, raptor_stringbuffer_append_string): Added do_copy arg. (main): Test code updated for api changes. * raptor/raptor_internal.h: Added prototypes for raptor_stringbuffer class to internal API * raptor/Makefile.am: Re-added raptor_stringbuffer.c and raptor_stringbuffer_test 2003-12-27 Dave Beckett * librdf/rdf_uri.c, librdf/rdf_stream.c, librdf/rdf_statement.c, librdf/rdf_query.c, librdf/rdf_node.c, librdf/rdf_model.c, librdf/rdf_iterator.c, librdf/rdf_hash.c: More C++ cast fixes mostly near URI and literal strings in test code, the main function. * librdf/Makefile.am: Added rdf_digest_sha1.c * librdf/rdf_digest_sha1.c: SHA1 digest code 2003-12-23 Dave Beckett * raptor/rapper.1: Updated for 1.1.0, -a is gone. Added ntriples-plus * raptor/libraptor.3: parser name is ntriples-plus * raptor/libraptor.3: Updated for 1.1.0 * raptor/raptor.h: remove raptor_namespaces_end_namespace - does not exist. 2003-12-22 Dave Beckett * raptor/Makefile.am: Remove raptor_stringbuffer.c/test from dist - not used at present. * raptor/configure.ac: Added --with-xml-names to choose XML 1.0 name checking (default) or 1.1 * raptor/raptor_utf8.c (raptor_unicode_is_namestartchar): Update to Namespaces in XML 1.1 WD http://www.w3.org/TR/2003/PR-xml-names11-20031105/#NT-NCNameStartChar and Extensible Markup Language (XML) 1.1 PR http://www.w3.org/TR/2003/PR-xml11-20031105/#NT-NameStartChar (raptor_unicode_is_namechar): Updated comment, no code changes needed. * raptor/tests/ntriplesplus/Makefile.am: No check-warn-rdf tests yet * raptor/raptor_utf8.c: Use RAPTOR_NFC_CHECK to wrap any use of the glib g_utf8_normalize. * raptor/configure.ac: Define RAPTOR_NFC_CHECK when NFC check is needed * raptor/configure.ac: Added --disable-nfc-check to disable Unicode NFC checking even if a suitable glib is present and providing it. Otherwise, autodetects as before. 2003-12-19 Dave Beckett * raptor/examples/Makefile.am: Removed REDLAND_LIBS 2003-12-18 Dave Beckett * perl/Makefile.PL: OSX old perl before 5.8 * perl/Makefile.PL: Another attempt to handle MakeMaker changes since perl5.8 * perl/Makefile.am: Compile perl without the -W flags; it's just too noisy. * librdf/redland.spec.in: Don't install perl twice. 2003-12-17 Dave Beckett * librdf/rdf_serializer_rdfxml.c (rdf_serializer_rdfxml_print_as_xml_content): Redland strings are always UTF-8 and for now, the output encoding is always UTF-8 so don't encode high bits, emit them. * librdf/rdf_serializer_rdfxml.c: o * librdf/rdf_serializer_rdfxml.c: (librdf_serializer_rdfxml_serialize_model) Free rdf:RDF qname. * raptor/raptor_parse.c, librdf/rdf_parser_raptor.c: Update for changed raptor_generate_id handler calls - no const. * raptor/raptor_general.c, raptor/raptor.h, raptor/raptor_internal.h: raptor_generate_id handler does not take const string * raptor/raptor_general.c, raptor/raptor.h, raptor/raptor_internal.h: raptor_generate_id returns non const * raptor/ntriples_parse.c (raptor_ntriples_parse_line): Casts, unsigned char* for blank node IDs. * raptor/ntriples_parse.c (raptor_ntriples_parse_line): Enforce predicate must be URIref 2003-12-16 Dave Beckett * perl/t/test1.t: Don't use last when not in a loop * raptor/ntriples_parse.c (raptor_ntriples_parse_line): Pass blank node identifier generation through raptor_generate_id. Rewrite returns into setting rc and jump to cleanup to ensure allocated blank node IDs are freed. * utils/Makefile.am: Added EXTRA_PROGRAMS to CLEANFILES * utils/rdf-load.c, utils/rdf-tree.c: Put explicit \n in multiline strings * utils/rdf-tree.c: Updates from Morten to use openssl lhash - this isn't portable. * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_context_serialise_next_statement): Fixes for over-eager use of multi-line string - add spaces before the newlines. Correct subject and object node creations. * librdf/redland.pc.in: Add @LIBRDF_LDFLAGS@ @LIBRDF_LIBS@ to libs * librdf/Makefile.am: Use LIBRDF_EXTERNAL_CPPFLAGS, LIBRDF_EXTERNAL_LIBS * redland-src-config.in: Put redland cflags, links first * redland-config.in: Use LIBRDF_EXTERNAL_CPPFLAGS, LIBRDF_EXTERNAL_LIBS * configure.ac: Added LIBRDF_EXTERNAL_CPPFLAGS, LIBRDF_EXTERNAL_LIBS used for system raptor * raptor/raptor.pc.in: Restore LDFLAGS, LIBS * perl/Makefile.PL: Don't need MEM_LIBS in OBJECT * utils/rdfproc.1: store to store-name in header * utils/rdfproc.c: Added file|uri to parsing help * utils/rdfproc.1: Document -n, -s, -t and parsing now turns files into URIs if they exist. * raptor/raptor-src-config.in: Removed --static-libs * utils/rdfproc.c: Added -n new - default is not to overwrite, i.e. parsing now appends Added -s storage Added -t storage-options Parsing now turns files into URIs if they exist. 2003-12-15 Dave Beckett * php/test.php: tidy prints * librdf/redland.pc.in: redland.pc.in * php/test.php: Better test code. Serializing crashes it - to fix later. * php/Makefile.am: Reorder compile args so PHP libs are first and overridden if need be. * redland-src-config.in: Kill --static-libs Use @with_raptor@ to pick either raptor-src-config or raptor-config * configure.ac: AC_SUBST with_raptor * php/Makefile.am: Apply redland_wrap.c.patch when building redland_wrap.c Use -d extension_dir=. for test-php * php/redland_wrap.c.patch: Patch to PHP wrapper to return empty string not C NULL * librdf/Makefile.am: Install redland.pc to libdir/pkgconfig * librdf/redland.spec.in: Updates: - require raptor 1.1.0 - require libxml 2.4.0 or newer - added pkgconfig redland.pc - split redland/devel package shared libs correctly * configure.ac: Added librdf/redland.pc * librdf/Makefile.am: Added redland.pc.in * raptor/raptor.pc.in: Just link -lraptor * raptor/configure.ac: Remove use of have_redland for expat sources (no longer shipped with redland anyway) * raptor/configure.ac: Remove redland source check. * configure.ac, Makefile.am: Split SD subdirs into SD_PRE (must be made before librdf) and SD_POST (after). raptor goes into PRE so that it is both compiled and installed before librdf. * raptor/Makefile.am: No need for librdf.la rule * raptor/rdfdump.c, raptor/raptor_stringbuffer.c, raptor/raptor_set.c, raptor/raptor_namespace.c, raptor/Makefile.am: Remove all RAPTOR_IN_REDLAND code use of REDLAND_LIBS, REDLAND_CFLAGS. Now the test and rdfdump programs always just use raptor alone. 2003-12-14 Dave Beckett * perl/Makefile.am: Remove use of prefix; install where perl wants it * perl/Makefile.PL: Try again with the MakeMaker PM hash. Remove double RDF/RDF * librdf/rdf_serializer_rdfxml.c (librdf_serializer_rdfxml_terminate): Allow raptor_free_namespaces to free the entire stack, including pcontext->rdf_ns * perl/Makefile.am, perl/update-perl-api.pl: Remove old API updater * librdf/rdf_node.h: librdf_node_get_literal_value_as_latin1 returning char* * librdf/rdf_node.c: (librdf_node_get_literal_value_as_latin1) Returning char* * examples/example4.c: Removed body of code since it was turned into rdfproc. * librdf/rdf_parser.h: Update librdf_parser_parse_string_as_stream prototype * librdf/rdf_model.h: Update librdf_model_query_string prototype * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_node_hash) Casts for node char const strings. * utils/Makefile.am: Add mysql-utils target, don't build the mysql utilities by default. * utils/rdf-digest.c, utils/rdf-load.c, utils/rdf-tree.c: Redland MySQL storage utilities by Morten Frederiksen * utils/rdfproc.c: Updates for raptor changes - all URI strings are unsigned char* Update URI APIs here to match. Update all use of literal (UTF-8) strings to unsigned char* also. Add more casts to make C++ happy especially near string functions and malloc. * utils/Makefile.am: Add redland libs, cppflags, cflags * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_node_hash) Fix to created digest to distinguish URIs 'R', literals 'L' and blank node identifiers 'B' in database. (librdf_storage_mysql_context_serialise_next_statement): Call error functions with the right world value. * examples/example4.c, examples/example3.c, examples/example2.c, examples/example1.c, librdf/rdf_uri.h, librdf/rdf_uri.c, librdf/rdf_stream.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_list.c, librdf/rdf_storage.c, librdf/rdf_statement.h, librdf/rdf_statement.c, librdf/rdf_serializer_rdfxml.c, librdf/rdf_serializer_raptor.c, librdf/rdf_serializer.h, librdf/rdf_serializer.c, librdf/rdf_query_triples.c, librdf/rdf_query.h, librdf/rdf_query.c, librdf/rdf_parser_raptor.c, librdf/rdf_parser.h, librdf/rdf_parser.c, librdf/rdf_node.h, librdf/rdf_node.c, librdf/rdf_model_storage.c, librdf/rdf_model.h, librdf/rdf_model.c, librdf/rdf_iterator.c, librdf/rdf_init.h, librdf/rdf_init.c, librdf/rdf_hash_memory.c, librdf/rdf_hash_bdb.c, librdf/rdf_hash.h, librdf/rdf_hash.c, librdf/rdf_concepts.c: Updates for raptor changes - all URI strings are unsigned char* Update URI APIs here to match. Update all use of literal (UTF-8) strings to unsigned char* also. Add more casts to make C++ happy especially near string functions and malloc. * raptor/raptor_general.c (raptor_print_statement_part_as_ntriples): Update call of raptor_print_ntriples_string * raptor/raptor.h: Update raptor_print_ntriples_string prototype * raptor/raptor_general.c (raptor_print_ntriples_string): Take unsigned const char* 2003-12-08 Dave Beckett * configure.ac: mysql version reporting * configure.ac: make --with-threestore, --with-mysql take CONFIG|yes|no * configure.ac: Add BDB 4.2 to the list. Fixes for 3store (--with-threestore) else search for 3store-config; add glib to cflags/libs using pkg-config. Report raptor version. Report triple stores found. 2003-12-06 Dave Beckett * librdf/rdf_uri.h, librdf/rdf_uri.c, librdf/rdf_parser_raptor.c: Updates for raptor API use of unsigned char* for URI strings. Change redland URIs to take/return unsigned char* for URI strings * librdf/rdf_hash.c (librdf_hash_print): replaced fprintf * raptor/Makefile.am: Narrower yyerrlabl fix since bison 1.875a no longer requires it * raptor/examples/grapper.c: Casts and updates to use URI strings from raptor as unsigned char* and converting to/from gchar* * raptor/rdfdump.c, raptor/raptor_xml_writer.c, raptor/raptor_xml.c, raptor/raptor_www_libxml.c, raptor/raptor_www.c, raptor/raptor_uri.c, raptor/raptor_sax2.c, raptor/raptor_rss.c, raptor/raptor_parse.c, raptor/raptor_namespace.c, raptor/n3_parser.y, raptor/n3_lexer.l: Lots of casts for str* function args, return values between unsigned char* as used for UTF8 and URI strings and char* used by str* functions. Some further casts for strings from XML. * raptor/raptor_www_test.c (write_bytes_fh): No return value. (main) Test code casts unsigned char* for URI strings Fix write_content_type and write_bytes_fh set handler methods. * raptor/raptor_utf8.c (raptor_unicode_char_to_utf8): unsigned char* arg. (raptor_utf8_is_nfc): unsigned int, cast for unsigned char* * raptor/raptor_sequence.c (raptor_sequence_ensure): Use void** not void*. C++ cares. (main): Test code casts to void* for args. * raptor/raptor_qname.c (raptor_qname_string_to_uri): cast for signed/unsigned int comparison. * raptor/raptor_locator.c (raptor_format_locator): Use raptor_uri_as_counted_string to save a strlen. * raptor/raptor_identifier.c: (raptor_identifier_print) fputs arg cast [function for RAPTOR_DEBUG only] * raptor/raptor_general.c (raptor_parsers_enumerate): Unsigned int. (raptor_parse_uri_write_bytes): unsigned char* cast. Declare raptor_xml_literal_datatype_uri_string. (raptor_print_statement_detailed): Replace several fprintf with fputs and fputc. (raptor_print_ntriples_string): Use unsigned long/size_t for counts. (raptor_statement_part_as_counted_string): unsigned char* Use raptor_xml_literal_datatype_uri_string. (raptor_statement_part_as_string): unsigned char* (raptor_print_statement_part_as_ntriples): unsigned char*. Replace several fprintf with fputs and fputc. Use raptor_xml_literal_datatype_uri_string (raptor_default_generate_id_handler): Casts for str* functions (raptor_check_ordinal): unsigned char* * raptor/ntriples_parse.c: (raptor_ntriples_generate_statement,raptor_ntriples_string_as_utf8_string, raptor_ntriples_parse_line): Updated to take/return unsigned char* args and internals. Update raptor_uri calls for similar changes. Use raptor_xml_literal_datatype_uri_string Lots of casts for str* functions char* arguments. * raptor/Makefile.am: Remove maintainer only n3 lex/yacc rules (flex/bison) Post process the bison output to remove unused label to make g++ happier. * raptor/raptor_internal.h: Added raptor_xml_literal_datatype_uri_string for the RDF datatype literal URI string, used several times. raptor_check_ordinal takes unsigned char* A couple of lengths, counts become unsigned int. raptor_unicode_char_to_utf8, raptor_format_sax2_element, raptor_xml_writer_cdata, raptor_xml_writer_comment, raptor_xml_writer_as_string changed to take/return unsigned char* for UTF8 strings. * raptor/raptor.h: raptor_new_uri_func, raptor_new_uri_from_local_name_func, raptor_new_uri_relative_to_base_func, raptor_uri_as_string_func, raptor_uri_as_counted_string_func URI factory methods changed to all take/return unsigned char* for URI strings raptor_statement_part_as_counted_string, raptor_statement_part_as_string, raptor_new_uri, raptor_new_uri_from_uri_local_name, raptor_new_uri_relative_to_base, raptor_uri_as_string, raptor_uri_as_counted_string URI methods changed to take/return unsigned char* for URI strings raptor_ntriples_string_as_utf8_string changed to return unsigned char* for UTF8 string raptor_uri_resolve_uri_reference, raptor_uri_filename_to_uri_string, raptor_uri_uri_string_to_filename, raptor_uri_uri_string_to_filename_fragment, raptor_uri_is_file_uri Changed to use unsigned char* for URI strings, char* for filenames 2003-12-01 Dave Beckett * raptor/raptor_set.c (raptor_set_stats_print): Debug printing tweak. 2003-11-28 Dave Beckett * raptor/raptor_internal.h: raptor_check_ordinal with now unsigned char* arg raptor_sax2 content_cdata now unsigned char* * raptor/raptor_general.c (raptor_check_ordinal): unsigned char *name * raptor/raptor_parse.c: Lots of char/unsigned char casting. * raptor/n3_common.h: Undo n3_syntax_error back to raptor_parser arg. * raptor/n3_parser.y: (n3_parser_error) aka yyerror; take a void arg. * raptor/n3_common.h: The n3_syntax_error aka yyerror function takes a void arg. * raptor/n3_parser.y: Casts for rdf_parser, strings. * raptor/n3_lexer.l: Define INPUT_FN as yyinput (C++) or input (otherwise) Add more casts for C++ near rdf_parser, yytext. (copy_token): More casts for malloc and string functions. (copy_string_token): More size_t, casts. * raptor/ntriples_parse.c (raptor_ntriples_term): Use a size_t; cast for C++. * raptor/ntriples_parse.c (raptor_ntriples_term_valid,raptor_ntriples_term): Change argument names from class to term_class to avoid C++ keyword. * raptor/raptor_getopt.h: Protect prototypes for C++ * raptor/raptor_stringbuffer.c: casts for RAPTOR_*ALLOC returns * raptor/n3_parser.y: oops, raptort -> raptor * raptor/n3_parser.y: another cast for RAPTOR_MALLOC return * raptor/n3_parser.y: casts for RAPTOR_CALLOC returns * raptor/configure.ac: Move adding pkg-config glib2.0 cppflags/libs till after the other libraries since that's more likely to be system wide and least effect libxml2, other libraries that might be elsewhere. Mostly affects OSX which is more sensitive to link order. * raptor/raptor_stringbuffer.c (main): declare at start of block * raptor/configure.ac: Check for libxml/SAX2.h - the new SAX2 API * raptor/raptor_libxml.c: Added a pile of libxml2_* macros to use the libxml2 SAX2 functions when they are present, otherwise the SAX1. Not using the SAX2 parts of the libxml2 API at present. * raptor/strcasecmp.c: Add debug message arg casts. * raptor/configure.ac: Include libxml/parser.h when checking for other libxml2 headers * raptor/ntriples_parse.c: Add some debug message arg casts. (raptor_ntriples_parse_chunk): At end of input, check that there is no remaining junk. * raptor/ntriples_parse.c (raptor_ntriples_parse_chunk): Fix line counting problems when \r\n crosses a buffer or when a line ends at the end of a buffer. last_char recorded in state. * raptor/raptor_stringbuffer.c (main): Free returned strings. * raptor/Makefile.am: Added raptor_stringbuffer.c raptor_stringbuffer_test code * raptor/raptor.h: Added raptor_stringbuffer. * raptor/raptor_stringbuffer.c: Stringbuffer class for growing strings * raptor/raptor_libxml.c (raptor_libxml_init): With libxml2 use raptor_xml_characters_handler for sax->characters. * raptor/raptor_parse.c (raptor_cdata_grammar): Added is_cdata arg. (raptor_xml_characters_handler): Added, calling raptor_cdata_grammar. (raptor_xml_cdata_handler): Updated to call raptor_cdata_grammar with is_cdata=1. (raptor_xml_parse_init): With expat use raptor_xml_characters_handler with XML_SetCharacterDataHandler. (raptor_cdata_grammar): Tidy error reporting; do not use raptor_xml_writer_as_string for a simple print. * raptor/raptor_internal.h: Added raptor_xml_characters_handler prototype. 2003-11-26 Dave Beckett * perl/Makefile.PL: List the .pm files explicitly since perl 5.8.1 broke scanning 2003-11-25 Dave Beckett * raptor/manifest.pl: Add withdrawn tests check 2003-11-23 Dave Beckett * raptor/tests/ntriplesplus/Makefile.am: Added more N-Triples Plus tests (1-7) and bad (0-3) * raptor/tests/ntriplesplus/test-07.out, raptor/tests/ntriplesplus/test-07.ntp, raptor/tests/ntriplesplus/test-06.out, raptor/tests/ntriplesplus/test-06.ntp, raptor/tests/ntriplesplus/test-05.out, raptor/tests/ntriplesplus/test-05.ntp, raptor/tests/ntriplesplus/test-04.out, raptor/tests/ntriplesplus/test-04.ntp, raptor/tests/ntriplesplus/test-03.out, raptor/tests/ntriplesplus/test-03.ntp, raptor/tests/ntriplesplus/test-02.out, raptor/tests/ntriplesplus/test-02.ntp, raptor/tests/ntriplesplus/test-01.out, raptor/tests/ntriplesplus/test-01.ntp: More N-Triples Plus tests * raptor/tests/ntriplesplus/bad-00.ntp, raptor/tests/ntriplesplus/bad-01.ntp, raptor/tests/ntriplesplus/bad-02.ntp, raptor/tests/ntriplesplus/bad-03.ntp: N-Triples Plus bad tests * raptor/n3_lexer.l: In prefix state, always return to initial on matching '.', then error out. (n3_syntax_error): Copy removed here. (main): Init enough more of parser/locator so that n3_syntax_error in main library can be used. 2003-11-21 Dave Beckett * raptor/rdfdump.c: extra newline in version * raptor/rdfdump.c: extra newline in help 2003-11-20 Dave Beckett * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_error_handler,librdf_parser_raptor_warning_handler): Do not pass on buffer directly since it is not a format string and might contain % such as when it is a URI. This causes libc to abort in the middle of vsnprintf with an assertion failure :/ 2003-11-19 Dave Beckett * demos/ntriples.pl: Style, HTML fixes. Counting wasn't right. * raptor/tests/Makefile.am: Added check-ntriples-plus to check N-Triples Plus with the N-Triples tests. * raptor/n3_parser.y, raptor/n3_lexer.l, raptor/n3_common.h: Added lineno to raptor_n3_parser context to track newlines for dos, unix, mac since flex doesn't do that by default with yylineno. * raptor/rdfdump.c: tidy help messages * raptor/ntriples_parse.c: Track newlines correctly for \r\n across chunks; move last_nl into ntriples parser context. (raptor_ntriples_parse_chunk,raptor_ntriples_parse_start): Use and init last_nl in ntriples parser context. 2003-11-16 Dave Beckett * raptor/raptor.h: Added raptor_ntriples_string_as_utf8_string * raptor/ntriples_parse.c (raptor_ntriples_term): Added allow_utf8 argument and new class RAPTOR_TERM_CLASS_FULL which uses all the passed in string. (raptor_ntriples_string_as_utf8_string): Added, using raptor_ntriples_term as above. (raptor_ntriples_parse_line): Use size_t len args. * utils/rdfproc.c: Replace a bunch of fprintf(..., "\n") with fputc * raptor/rdfdump.c: Use f/puts instead of print/fprintf when there are no %s * librdf/rdf_heuristics.c (main): Make test code silent unless LIBRDF_DEBUG > 1 Tidy code a little. * librdf/rdf_digest.c, librdf/rdf_hash.c: Replace a bunch of fprintf(..., "\n") with fputc * raptor/raptor_uri.c (raptor_default_new_uri_for_rdf_concept): Remove duplicate strlen(base_uri) 2003-11-15 Dave Beckett * raptor/n3_lexer.l: Document more ntriples plus Error out if @prefix's name doesn't match name * raptor/raptor_utf8.c (raptor_unicode_is_namestartchar): Two | changed to ||. Likely worked anyway 2003-11-11 Dave Beckett * raptor/libraptor.3: Noted raptor_set_feature with non_nfc_fatal * raptor/raptor.h: Added RAPTOR_FEATURE_NON_NFC_FATAL to pick between NFC errors or warnings. * raptor/raptor_general.c (raptor_set_feature): Added RAPTOR_FEATURE_NON_NFC_FATAL to pick between NFC errors or warnings. (raptor_set_parser_strict): Set feature_non_nfc_fatal default off. * raptor/raptor_internal.h: Added feature_non_nfc_fatal to pick between NFC errors or warnings. * raptor/raptor_parse.c: Put 'quotes' around element/attribute names in messages. Use feature_non_nfc_fatal to pick between NFC errors or warnings. * raptor/tests/Makefile.am: check-bad-nfc-rdf - use strict mode * raptor/rdfdump.c: Document -m/--mode arg 2003-11-10 Dave Beckett * raptor/configure.ac: Added tests/ntriplesplus * raptor/tests/ntriplesplus/Makefile.am: N-Triples plus tests * raptor/tests/ntriplesplus/test-00.ntp, raptor/tests/ntriplesplus/test-00.out: N-Triples Plus default namespace test * raptor/tests/Makefile.am: added ntriplesplus dir * raptor/raptor_qname.c (raptor_qname_string_to_uri): Keep original name around for error reporting. * raptor/rdfdump.c, raptor/n3_parser.y: parser now called ntriples-plus * raptor/n3_parser.y: parser called ntriplesplus * raptor/n3_parser.y (production directive): Fix declaring default namespace prefix 2003-11-09 Dave Beckett * raptor/tests/Makefile.am: added bad-20.rdf * raptor/tests/bad-20.rdf: check non-namespaced element does not crash parser * raptor/raptor_qname.c (raptor_new_qname,raptor_new_qname_from_namespace_local_name): Do not die if no URI for qname is available. It might be which is at least needed for some error reports or for embedded qnames. Caused unnecessary crashes when parsing failed. 2003-11-03 Dave Beckett * configure.ac: Added --with-mysql-config and automatic search for mysql_config program. Added STORAGE_OBJS * librdf/rdf_storage_mysql.c, librdf/rdf_storage_mysql.h: RDF Storage in MySQL DB * AUTHORS: Added Morten as MySQL store author * librdf/rdf_storage.h, librdf/rdf_storage.c: Added mysql store * librdf/Makefile.am: Added STORAGE_OBJS Added rdf_storage_mysql.c rdf_storage_mysql.h * librdf/librdf.h: Added LIBRDF_ERROR3 * raptor/raptor_xml.c (main): Make tests less chatty on success * raptor/raptor_uri.c (main): Make it less chatty on success * raptor/raptor_uri.c (raptor_uri_uri_string_to_filename_fragment): Allow file://a|/ and file://a:/ (main): For WIN32, check the above works. * librdf/rdf_parser_raptor.c: Add mapping of rdf:nodeID values to redland generated IDs. (librdf_parser_raptor_init): Create the userid->redlandID hash map. (librdf_parser_raptor_terminate): Added to delete the hash map. (librdf_parser_raptor_generate_id_handler): Do the mapping. * raptor/autogen.sh, autogen.sh: remove ltmain.sh libtool before libtoolize * python/redlandtest.py (class RedlandGetsCase): Add test for making a new anon (no arg) blank node * raptor/manifest.pl: Emit test-results.rdf in the style of http://www.w3.org/2003/08/owl-systems/test-results-out for machine processing of test runs * raptor/raptor_general.c (raptor_parse_uri_with_connection): Fail before parsing if raptor_www_fetch failed. * raptor/raptor_internal.h: Added raptor_www_error_varargs internal prototype. * raptor/raptor_www_libxml.c (raptor_www_libxml_http_error): This was just all wrong, printing to stderr and then exit(1). Change to use the proper raptor_www_error_varargs callback. * raptor/raptor_www.c (raptor_www_error_varargs): Added, with va_list signature. * raptor/raptor_general.c (raptor_parse_file): When uri is given and base_uri is NULL, copy the uri and free it later - fix to match the function documentation. 2003-10-31 Dave Beckett * raptor/raptor_general.c (raptor_parse_file): fclose only when fh is not NULL 2003-10-21 Dave Beckett * librdf/rdf_serializer_rdfxml.c (librdf_serializer_rdfxml_terminate): Free namespace before stack. * librdf/rdf_serializer_rdfxml.c: Use updated raptor_(new|free)_namespaces (librdf_serializer_rdfxml_init, librdf_serializer_rdfxml_terminate): Make the rdf namespace (librdf_serializer_rdfxml_serialize_model): declare rdf:RDF using raptor_new_qname_from_namespace_local_name * raptor/raptor_parse.c (raptor_xml_end_element_handler): For RAPTOR_DEBUG, declare element_name at start of function. 2003-10-20 Dave Beckett * raptor/raptor.h: raptor_namespace(s)_(new|free) renamed to raptor_(new|free)_namespace(s) Added raptor_new_qname_from_namespace_local_name * raptor/raptor_qname.c (raptor_new_qname_from_namespace_local_name): Added. * raptor/raptor_namespace.c: raptor_namespaces_(new|free) renamed to raptor_(new|free)_namespaces * raptor/raptor_namespace.c: raptor_namespace_(new|free) renamed to raptor_(new|free)_namespace * librdf/rdf_serializer_rdfxml.c: Added a raptor_namespace_stack to the context. (librdf_serializer_rdfxml_init): Updated with stack (librdf_serializer_rdfxml_terminate): Added, to free stack. (rdf_serializer_rdfxml_print_as_xml_attribute): Deleted. (librdf_serializer_print_statement_as_rdfxml): Do less work in finding max XML-name character for a property URI. Replace use of rdf_serializer_rdfxml_print_as_xml_attribute with calls to raptor_xml_escape_string. (librdf_serializer_rdfxml_serialize_model): Use namespace stack to declare rdf namespace - initial code. (librdf_serializer_rdfxml_register_factory): Add terminate call. * raptor/raptor_xml_writer.c: raptor_namespaces_free renamed to raptor_namespaces_clear * raptor/raptor_parse.c (raptor_xml_start_element_handler): Use raptor_new_sax2_element. raptor_namespaces_free renamed to raptor_namespaces_clear * raptor/raptor_internal.h: Added raptor_new_sax2_element * raptor/raptor_sax2.c (raptor_new_sax2_element): Added. * raptor/raptor.h: Added prototypes for raptor_namespaces_new, raptor_namespaces_clear * raptor/raptor_namespace.c (raptor_namespaces_new,raptor_namespaces_free): Added for constructor and destructor. raptor_namespaces_free renamed to raptor_namespaces_clear for emptying a statically allocated namespace stack. * raptor/n3_parser.y: raptor_namespaces_free renamed to raptor_namespaces_clear * librdf/rdf_serializer_rdfxml.c (librdf_serializer_rdfxml_raptor_error_handler): Added. (rdf_serializer_rdfxml_print_xml_attribute): Take world arg. Use raptor_xml_escape_string to do the escaping. (librdf_serializer_print_statement_as_rdfxml): pass world arg to calls to rdf_serializer_rdfxml_print_xml_attribute * librdf/rdf_utf8.h: Make librdf_unicode_char_to_utf8 match code 2003-10-16 Dave Beckett * raptor/n3_parser.y: Moved n3 lexer/parser stuff to n3_common.h Added uri field to union. URI_LITERAL and QNAME_LITERAL now are uri. PREFIX now expects an IDENTIFIER to follow. Remove all make qname/uri and free(copied token) sequences since the lexer does it. Added fake yy_init_globals to stop dumb warning. * raptor/n3_lexer.l: Make raptor_uris here from lexer tokens (qnames or URIs) For @prefix, recognise following token as an identifier specially rather than try to make it a URI. (n3_token_free): Free string or raptor_uri. (main): Lots of fixups to fake enough n3 parser structure to get it working fairly standalone. * raptor/Makefile.am: Added n3_common.h Fixup free of null inside flex-generated lexer. * raptor/n3_common.h: N3 parser/lexer shared internals * raptor/raptor_internal.h: Moved n3 lexer/parser stuff to n3_common.h * raptor/n3_parser.y (n3_qname_to_uri): Replace with call to raptor_qname_string_to_uri and added length parameter. * raptor/raptor_qname.c (raptor_new_qname): Replace raptor_namespace_local_name_to_uri with use of raptor_new_uri_from_uri_local_name. (raptor_qname_string_to_uri): Added, making only the URI equivalent to the qname and handling N3/RDQL-style special cases such as "prefix:", ":" and NULL. * raptor/raptor_internal.h, raptor/raptor.h: Moved raptor_qname, raptor_namespace, raptor_namespace_stack classes into public API. Added raptor_qname_string_to_uri * raptor/raptor_namespace.c (raptor_namespace_local_name_to_uri): Removed - only used once internally and was never public. 2003-10-09 Dave Beckett * raptor/n3_lexer.l (n3_token_free): Added, for cleanup in debugging. (main): Init and clear token/lval. * raptor/tests/Makefile.am: Added ex-53 * raptor/tests/ex-53.out, raptor/tests/ex-53.rdf: Check allowing optional rdf:RDF * raptor/rdfdump.c: --assume/-a feature_assume_is_rdf deleted; rdf:RDF is optional. * raptor/raptor_general.c, raptor/raptor_parse.c: feature_assume_is_rdf deleted; rdf:RDF is optional. * raptor/raptor_internal.h: feature_assume_is_rdf deleted 2003-10-08 Dave Beckett * librdf/rdf_node.c: Fix debug calls when LIBRDF_DEBUG > 1 2003-10-06 Dave Beckett * raptor/tests/wine.out, raptor/tests/wine.rdf: OWL Wine Ontology from http://www.w3.org/TR/owl-guide/wine.rdf * raptor/tests/Makefile.am: Added OWL Wine ontology from http://www.w3.org/TR/owl-guide/wine.rdf as wine.rdf wine.out 2003-09-30 Dave Beckett * raptor/n3_parser.y: Remove n3_parser_lex; re-#define yylex to call direct * raptor/n3_lexer.l (copy_string_token): Destroy malloced string on error return. * raptor/n3_parser.y (n3_parse): Don't delete buffer, pop buffer state; a successful lex does that. * raptor/raptor_internal.h: Remove n3_token_print * raptor/n3_parser.y: Use reentrant yacc parser. Store the lexer lval in the n3_parser context. Lots of #define trickery to get flex/bison to talk nicely. Make n3_parser_error take an rdf_parser arg (this isn't configurable by bison itself, so is likely fragile). Remove use of extern in lineno; get it from the lexer. Remove N3_Parser global; use rdf_parser local. (n3_parser_error): Update for having rdf_parser arg, update locator lineno from scanner. (n3_syntax_error, n3_qname_to_uri): Get lineno from scanner. (n3_parse): Remove fixmes, no need for protecting globals. (main): Update for reentrant parser; init locator from standalone args. * raptor/n3_lexer.l: Remove n3_lexer.c/.h prototypes no longer(?) needed with re-entrant lexer. Remove use of lineno; let lexer do it. Change lexer call to pass in lval from reentrant parser. (n3_token_print): Pass in lval. (main): Update for api changes. 2003-09-29 Dave Beckett * raptor/raptor_internal.h: Updates for reentrant lexer. * raptor/n3_parser.y: Use reentrant lexer API. Define YYLEX_PARAM to be scanner arg, from current grammar. (n3_parser_lex): Take scanner arg. (n3_syntax_error): Add rdf_parser arg. (n3_parse): Init and destroy reentrant lexer. (raptor_n3_parse_terminate): Tidy up any lexer stuff. (main): Check for file not found, report it. * raptor/n3_lexer.l: Switch to reentrant lexer. Pass rdf_parser into code, yyextra internally. (yywrap): Add scanner arg. (copy_string_token, n3_syntax_error): Add rdf_parser arg. (main): Use reentrant calls for lexer to set yyin, get_text. Use yylex_init/yylex_destroy. * raptor/Makefile.am: n3_lexer_test depends on raptor_utf8 * raptor/raptor_parse.c: Add EXPAT_UTF8_BOM_CRASH fix updates for sax2 changes. * raptor/configure.ac: Tweak for old flex version output * raptor/configure.ac: Try to check flex is new enough. 2003-09-25 Dave Beckett * configure.ac: 3store linking fixes. * librdf/rdf_storage_tstore.c: comment out unused context * configure.ac: Bumped raptor min to 1.1.0 Added --with-threestore. * librdf/rdf_storage.c (librdf_init_storage): Call librdf_init_storage_tstore if HAVE_TSTORE (librdf_storage_add_statements): Do add statements over a stream here if lower level just has add_statement method. * librdf/rdf_storage_tstore.h: RDF Storage using 3store * librdf/Makefile.am: Added rdf_storage_tstore.c rdf_storage_tstore.h * librdf/rdf_storage_tstore.c: RDF Storage using 3store 2003-09-22 Dave Beckett * librdf/rdf_init.h: Added internal librdf_error_varargs * librdf/rdf_init.c (librdf_error_varargs): Added, internal 2003-09-21 Dave Beckett * raptor/n3_parser.y: Minor C reformatting 2003-09-20 Dave Beckett * raptor/raptor.h: Added raptor_parsers_enumerate prototype * raptor/n3_lexer.l: minor reformatting * raptor/n3_lexer.l (copy_string_token): Make \r, \n and \t work * raptor/raptor_general.c (raptor_init): Ensure rdf/xml is default parser. (raptor_parsers_enumerate): Added, to enumerate parsers, returning their name & label. * raptor/examples/grapper.c: Use raptor_parsers_enumerate to get parser names, labels. * raptor/n3_lexer.l: flex archaeology for options * raptor/examples/Makefile.am: Don't build examples by default 2003-09-19 Dave Beckett * raptor/raptor_www.c, raptor/raptor_general.c: Revert to old API for raptor_uri_uri_string_to_filename * raptor/raptor.h, raptor/raptor_uri.c (raptor_uri_uri_string_to_filename): Restored to old API. (raptor_uri_uri_string_to_filename_fragment): Added with fragment arg. * librdf/rdf_hash_bdb.c: Use bdb->set_flags only when present * configure.ac: Check for BDB DB->set_flags 2003-09-17 Dave Beckett * raptor/n3_parser.y (n3_qname_to_uri): Handle NULL (":" in N3) returning the default namespace. It's not quite clear if this is legal. * raptor/n3_parser.y (raptor_n3_generate_statement): Do nothing if some part of the triple is NULL. * raptor/raptor_internal.h: n3_syntax_error now takes varargs * raptor/n3_parser.y (n3_syntax_error): Now takes varargs * raptor/n3_lexer.l: n3_syntax_error now takes varargs (copy_string_token): Added \u, \U. Fixed, \r, \n, \t * raptor/n3_parser.y: Wrap a debugging printf * raptor/n3_lexer.l: For blank literal "_:abc", don't include _: in the id passed to the parser. * raptor/n3_parser.y: Throughout replace raptor_new_uri with raptor_copy_uri when copying existing base URI. * raptor/n3_parser.y: Throughout: Handle NULL uri string meaning use the base URI * raptor/n3_lexer.l: Handle <> (returning NULL) as well as <> with content. (n3_token_print): Update to match. (n3_syntax_error): Simple standalone copy here. * raptor/n3_parser.y (n3_parser_error): Set lineno and call raptor_parser_simple_error to pass on the parsing error. (n3_syntax_error): Added. Set lineno and call raptor_parser_error to pass on a general syntax error. (n3_qname_to_uri): Init locator line before calling raptor_new_qname that may fail, calling raptor_parser_simple_error. * raptor/raptor_internal.h: Add n3_syntax_error * raptor/n3_lexer.l: Call n3_syntax_error on a syntax error * raptor/examples/grapper.c: Add n3 syntax * raptor/n3_parser.y (propertyList): Handle NULL verb, two cases. (raptor_n3_parse_start): No locator column, byte values just yet. * raptor/n3_parser.y (n3_qname_to_uri): Call raptor_new_qname with rdf_parser for errors 2003-09-15 Dave Beckett * raptor/n3_parser.y: Don't raptor_free_uri shared uris made from qnames * raptor/n3_parser.y (n3_parse): Tidy up flex buffers. (raptor_n3_parse_terminate): Destroy any flex state on exit. * raptor/n3_parser.y (n3_parse): delete buffer after parse. * raptor/n3_parser.y: Free uri strings returned from URI_LITERAL. * raptor/raptor_identifier.c (raptor_new_identifier): Note uri, literal_datatype are shared and not copied. * raptor/n3_parser.y: Free strings returned from QNAME_LITERAL. * raptor/raptor_sequence.c (raptor_new_sequence): Use RAPTOR_MALLOC. (raptor_free_sequence): Free the raptor_sequence. * raptor/raptor_identifier.c (raptor_new_identifier): Note id, literal, literal_language are shared and not copied. * raptor/n3_parser.y (statement): Free identifier used for subject (propertyList): Free identifier used for verb * raptor/n3_parser.y: Track when an identifier is copied using is_malloced (raptor_free_triple): Actually free the triple. * raptor/raptor_internal.h, raptor/n3_parser.y: raptor_triple now just has 3 items. * raptor/n3_parser.y (raptor_n3_parse_terminate): Free namespaces * raptor/n3_parser.y (n3_parse): Do not parser NULL or empty string. (raptor_n3_parse_chunk): Do not parser empty buffer. * raptor/rdfdump.c: (main) Don't free NULL uri * raptor/n3_parser.y: More debugging messages. Recover from errors, don't generate partial triples. (n3_qname_to_uri): Return NULL if raptor_new_qname does not give a URI (some error happened). * raptor/n3_lexer.l: Remove END token, should only use EOF Count lines right for \r\n|\r|\n Handle EOF in comments * raptor/n3_parser.y: Remove END token, should only use EOF Add more debugging statements. Throughtout, change raptor_new_uri to raptor_new_uri_relative_to_base. (statement): Handle empty propertyList ("[]"). (propertyList 1): Copy verb into objectList, then append propertyList items (if not empty "[]" again). (objectList): Add empty item for "[]", returning NULL. (resource): For [], handle NULL and generate statements here before returning the generated id. (n3_parser_print_statement): Added for test code (main): In test code, init URI module only, create fake static rdf_parser and n3_parser and initialise enough (base URI, and context) so that it works. * raptor/n3_parser.y: Add error recovery at '.' 2003-09-14 Dave Beckett * raptor/n3_parser.y: raptor_print_triple renamed to raptor_triple_print * raptor/n3_parser.y: Only define raptor_print_triple if debugging. * raptor/raptor_identifier.c, raptor/n3_parser.y: raptor_print_identifier renamed to raptor_identifier_print * raptor/n3_parser.y: Raptor N-Triples+/N3 parser * raptor/n3_lexer.l: Raptor N-Triples+/N3 lexer * raptor/raptor_identifier.c (raptor_identifier_print): Added for debugging * raptor/raptor_internal.h: When debugging, raptor_identifier_print * raptor/raptor_identifier.c (raptor_new_identifier): Add literal, literal_datatype, literal_language args and handle them. (raptor_init_identifier): Deleted, not used (enough). (raptor_copy_identifier, raptor_free_identifier): Updated for literal, literal language and literal datatype. * raptor/rdfdump.c: Use the syntax name (after validation) to intialise the parser rather than an ever-growing set of flags. * raptor/raptor_uri.c (raptor_default_new_uri): If the filename had a fragment, re-append it to the file:URI after updating it to be correct. (raptor_uri_uri_string_to_filename): Add fragment_p arg to return the URI fragment after a discovered filename in a file:URI. (assert_uri_to_filename): Update call to raptor_uri_uri_string_to_filename. * raptor/raptor_parse.c (raptor_xml_parser): Add namespaces. Elsewhere change rdf_parser->namespaces to rdf_xml_parser->namespaces. (raptor_xml_parse_start): Initialise the namespaces for rdf/xml. * raptor/raptor_sequence.c: Raptor sequence ADT * raptor/raptor_namespace.c (raptor_namespace_init): Add defaults arg to control which namespaces are added by default. 0=none, 1=xml, 2=... others (main): Update test code to give new arg. * raptor/raptor_general.c (raptor_init): Call raptor_init_parser_n3. (raptor_start_parser, raptor_free_parser): Remove namespace code from here; moves into specific parser context code. (raptor_parse_file): Update for raptor_uri_uri_string_to_filename extra arg. * raptor/raptor_xml_writer.c: (raptor_new_xml_writer) Update for raptor_namespaces_init defaults arg. * raptor/raptor_rss.c (raptor_rss_emit): Use raptor_new_identifier rather than raptor_init_identifier and make items dynamically allocated. * raptor/raptor_www.c: (raptor_www_file_fetch) Update for raptor_uri_uri_string_to_filename extra argument. * raptor/raptor.h: Add literal, literal_datatype, literal_language to raptor_identifier structure. Add above arguments to raptor_new_identifier. Remove raptor_init_identifier - not used. Add fragment_p argument to raptor_uri_uri_string_to_filename. * raptor/raptor_internal.h: Remove namespaces from raptor_parser; now in per-syntax contexts. Updated raptor_namespaces_init to take defaults arg. Added N3 class prototypes, for n3_token_print, raptor_init_parser_n3, n3_parser_lex. Added raptor_triple structure. Added sequence class prototypes. * raptor/Makefile.am: Add n3_lexer.c n3_lexer.h both generated from n3_lexer.l by flex; add maintainer-only rules to do that. Add n3_parser.tab.c n3_parser.tab.h generated from n3_parser.y by yacc; add maintainer-only rules to do that. Add raptor_sequence.c and test. * raptor/configure.ac: Add lex (flex required) and yacc 2003-09-12 Dave Beckett * Redland.i: Add prototypes for internal functions librdf_error, librdf_warning along with warning that these aren't in the API. 2003-09-11 Dave Beckett * python/RDF.py (Model): Added sync() calling librdf_model_sync * python/redlandtest.py (RedlandModelGeneral): Test model.sync() 2003-09-08 Dave Beckett * python/RDF.py: (Node:_get_literal_value) Use dt_uri=Uri(string=... not (uri_string=... * configure.ac: Bumped version to 0.9.15 * Snapshotted redland_0_9_14 for 0.9.14 release * librdf/redland.spec.in: Require raptor 1.0.0 * librdf/rdf_hash_bdb.c (librdf_hash_bdb_open): Restore previous call to db_create. Add an extra clause to do nothing inside big #ifdef chain if HAVE_DB_CREATE is present. * configure.ac: Min raptor version is now 1.0.0 * raptor/configure.ac: Bumped version to 1.1.0 * Snapshotted raptor_1_0_0 for 1.0.0 release * raptor/libraptor.3: new date * raptor/ntriples.h,raptor/Makefile.am: Removed old header ntriples.h * raptor/raptor_general.c, raptor/raptor.h, raptor/ntriples_parse.c: Removed deprecated functions as promised. Changes are described in the libraptor.3 man page. * raptor/configure.ac: Updated for Raptor 1.0.0 Shared library soname major now 1 * configure.ac: With only --with-bdb=PREFIX given, set the lib & include from that value. Use 'unknown' rather than none when some BDB bits given and no guessing. * raptor/win32_config.h: Added R_OK define for access() * raptor/tests/Makefile.am: test wording for failures * librdf/rdf_hash_bdb.c (librdf_hash_bdb_open): Probably restore early DB3.0 to working with db_create. 2003-09-05 Dave Beckett * raptor/tests/Makefile.am: Added bad-05.nt * raptor/tests/bad-05.nt: Bad Unicode character #x110000 * raptor/tests/test.out, raptor/tests/test.nt: fixes * raptor/tests/test.nt: Removed resource18-20 - illegal Unicode chars. Added \U0010FFFF * raptor/ntriples_parse.c (raptor_ntriples_term): Forbid Unicode characters outside #x0-#x10FFFF 2003-09-04 Dave Beckett * java/org/librdf/redland/World.java: Use librdf_version/copyright* * Redland.i: Use librdf_version* and both librdf_copyright strings * tcl/Makefile.am: clean more * raptor/libraptor.3: Updated for 1.0.0 Added raptor_parse_file_stream. Added new feature normalize_language. Added list of all static variables exported. * configure.ac: Remove a bunch of unused LIBRDF_VERSION_ AC_SUBST. Remove LIBRDF_VERSION_INFO - not used Define LIBRDF_VERSION_DECIMAL here and make it an AC_SUBST. * librdf/rdf_init.c: Use LIBRDF_VERSION_DECIMAL define. * raptor/configure.ac: Define RAPTOR_VERSION_DECIMAL here and make it an AC_SUBST. * raptor/raptor_general.c: Use RAPTOR_VERSION_DECIMAL define. * redland-config.in: Added --version-decimal. * redland-config.1, raptor/raptor-config.1: Document --version-decimal and --libtool-libs * raptor/raptor-config.in: Added --version-decimal. * raptor/rdfdump.c: Allow filename "-" to be used as standard input. When a filename is given, use raptor_parse_file. Adjust the error messages to mention file names when using raptor_parse_file * raptor/raptor.h: Added raptor_parse_file_stream * raptor/raptor_general.c (raptor_parse_file_stream): Added, allowing passing in of an existing FILE* stream (with optional filename) and parsing rather than raptor doing the fopen/fclose. (raptor_parse_file): A NULL uri argument now means stdin. * raptor/raptor_internal.h, raptor/raptor_parse.c: Remove rdf_parser->fh * utils/rdfproc.1: Update parse, serailize commands to note optional syntax names, list valid names and mention the default RDF/XML. * utils/rdfproc.c: Make syntax name option to parser commands, defauting to (default parser) rdf/xml Hide 'query' command further. Print short copyright in usage, help. Tidy help messages. Delete rotten parser features * librdf/rdf_parser_raptor.c (librdf_parser_raptor_constructor): Register "rdfxml" name and mime type, URL http://www.w3.org/TR/rdf-syntax-grammar. Keep raptor name around * raptor/rdfdump.c: Use raptor_short_copyright_string in usage/help messages * raptor/raptor_general.c, raptor/raptor.h: Added raptor_short_copyright_string * utils/rdfproc.c: Free options hash * librdf/redland.spec.in: Add rdfproc. Require raptor 0.9.12 min * utils/rdfproc.1: tweak * utils/Makefile.am: Added rdfproc.1 * utils/rdfproc.1: rdfproc manual page * utils/rdfproc.c: help * utils/rdfproc.c: Tidy usage message - use triples & graphs, explain source, target, arc. Add short copyright * librdf/rdf_init.c, librdf/librdf.h: Added librdf_short_copyright_string. Made long one have line breaks and more URIs * utils/rdfproc.c: statements now find Added optional CONTEXT to add/add-typed/remove, warning if not enabled. * utils/rdfproc.c: Use rdfproc_getopt.h * configure.ac: Enable public domain getopt in getopt.c & rdfproc_getopt.h for rdfproc if there is no getopt or getopt_long * utils/Makefile.am: Enable public domain getopt in getopt.c & rdfproc_getopt.h * utils/getopt.c, utils/rdfproc_getopt.h: public domain getopt for rdfproc * configure.ac: Look for getopt.h * librdf/rdf_hash.h: Added librdf_hash_put_strings * librdf/rdf_hash.c (librdf_hash_put_strings): Added helper to add strings to hash easier. * librdf/rdf_storage.c (librdf_new_storage_with_options): Added, taking a librdf_hash argument. Similar to librdf_new_model_with_options. * librdf/rdf_storage.h: Added librdf_new_storage_with_options * librdf/rdf_init.c: Renamed public statics to librdf_version* and librdf_copyright_string. Added librdf_version_decimal. * librdf/librdf.h: Added REDLAND_API Added REDLAND_DEPRECATED Added public statics librdf_version* and librdf_copyright_string. * utils/Makefile.am: Added rdfproc * utils/rdfproc.c: Redland RDF processor - converted from examples/example4.c 2003-09-03 Dave Beckett * Makefile.PL: Updated for 0.9.13 Uses configure.ac Pick the perl prefix to pass to configure. make clean needs a little help else it just returns 'exit 2'. install: Installs just the shared libraries for raptor and redland, then perl. Have a hand-crafted MANIFEST and MANIFEST.SKIP now. * raptor/raptor_general.c (raptor_set_feature): Add new feature normalize_language (raptor_set_parser_strict): Set default for feature normalize_language to true. * raptor/raptor.h, raptor/raptor_internal.h: Add new feature normalize_language * raptor/raptor_parse.c (raptor_xml_start_element_handler): Normalize language to lowercase. After http://www.w3.org/TR/rdf-concepts/#dfn-language-identifier Controlled by a new parser feature 'normalize_language'. * raptor/ntriples_parse.c (raptor_ntriples_parse_line): Normalize language to lowercase. After http://www.w3.org/TR/rdf-concepts/#dfn-language-identifier 2003-09-01 Dave Beckett * librdf/Makefile.am: In AM_LDFLAGS, use @LIBRDF_LIBS@ for -L/-l libraries and @LIBRDF_INTERNAL_LIBS@ for libtool things. Remove not-needed $(LIBS) from test binaries link lines. * examples/Makefile.am: In AM_LDFLAGS, use @LIBRDF_LIBS@ for -L/-l libraries and @LIBRDF_INTERNAL_LIBS@ for libtool things. * Makefile.am: raptor subdirectory is now not always built * configure.ac: TIdy some configure --with/--enable messages Added RAPTOR_CONFIG program (default raptor-config) Added --with-raptor=system or internal. By default will pick the best. Checks for minmum versions and warns if too old, but proceeds. raptor subdirectory is now not always built. * raptor/raptor-config.in: Oops, -lraptor with --libs * redland-config.in: Added --libtool-libs for compiling with librdf using libtool. * configure.ac: Added LIBRDF_LIBTOOLLIBS for compiling with librdf using libtool. * raptor/configure.ac: Added RAPTOR_LIBTOOL_LIBS for compiling with raptor using libtool. * raptor/raptor-config.in: Added exec_prefix to make --libs generate the right -L Added --libtool-libs for compiling with raptor using libtool. 2003-08-31 Dave Beckett * configure.ac, raptor/configure.ac: dmalloc enabled only if dmalloc.h is present * raptor/tests/Makefile.am: Removed warn-01 re-added accidently. * raptor/tests/warn-00.out, raptor/tests/warn-00.rdf: Added rdf:bagID warning check * raptor/tests/Makefile.am: Added scanning tests and ex-52.svg/out for inside SVG * raptor/tests/ex-52.out, raptor/tests/ex-52.svg: Check scanning for rdf/xml in SVG * raptor/raptor_general.c (raptor_set_parser_strict): Scanning and assuming are never default on, must be enabled * raptor/raptor_parse.c (raptor_xml_start_element_handler): Fix scanning for rdf:RDF. Do parent->child processing if the grammar has a state set up, in this case it is expecting a list of node elements. * raptor/rdfdump.c: Set strict before setting other features * raptor/rdfdump.c: Use strict_mode * raptor/tests/warn-00.out, raptor/tests/warn-00.rdf, raptor/tests/warn-01.out, raptor/tests/warn-01.rdf, raptor/tests/warn-03.rdf: These are now errors not wrarnings * raptor/raptor_parse.c (raptor_xml_start_element_handler): Non-namespaced elements are now an error. (raptor_process_property_attributes): Tidy non-namespaced element name. (raptor_start_element_grammar): Give errors if an attempt is made to proceed dealing with elements with no namespace for property or node elements - attributes are caught above. * raptor/tests/Makefile.am: Add bad-18.rdf, bad-19.rdf for non-namespaced elements * raptor/tests/bad-18.rdf, raptor/tests/bad-19.rdf: Test node/property elements without namespaces fail * raptor/raptor_internal.h: Add raptor_parser field 'magic' for libxml2 error/warning callback validation. and declare RAPTOR_LIBXML_MAGIC to set use there * raptor/raptor_general.c (raptor_new_parser): Set RAPTOR_LIBXML_MAGIC field in structure for libxml2 error/warning callback validation. * raptor/ntriples_parse.c (raptor_ntriples_term): Check that the string/URI term was terminated before the end of the string. * raptor/tests/Makefile.am: Added bad-04.nt * raptor/tests/bad-04.nt: Test for non-terminated URI * raptor/raptor_libxml.c (raptor_libxml_warning,raptor_libxml_error): Validate the ctx pointer returned since sometimes it is a ctx, sometimes ctx->userData. The latter is what is expected. * raptor/tests/Makefile.am: Oops, run bad ntriples tests in N-Triples mode * raptor/rapper.1: Added --version/-v * raptor/rdfdump.c: Tidied up option error handling, messages. Added --version/-v * librdf/rdf_storage.c: (librdf_storage_add_statement, librdf_storage_add_statements, librdf_storage_remove_statement, librdf_storage_context_add_statement, librdf_storage_context_remove_statement) For these optional methods that can change the store, return failure if the factory does not implement them. (librdf_storage_context_add_statements): Added either using the factory method or librdf_storage_context_add_statement if that is missing. (librdf_storage_context_remove_statements): Added either using the factory method or librdf_storage_context_remove_statement if that is missing. (librdf_storage_context_as_stream): Added, deprecating librdf_storage_context_serialise. * librdf/rdf_storage.h: Added new context_add_statements and context_remove_statements factory methods. Note that those are optional and so are all other context methods or methods that change the store (could be read only) Added prototypes for librdf_storage_context_add_statements, librdf_storage_context_remove_statements. Added prototype for librdf_storage_context_as_stream, deprecating librdf_storage_context_serialise. * librdf/rdf_model_storage.c: (librdf_model_storage_context_add_statements) Added, calling librdf_storage_context_add_statements (librdf_model_context_remove_statements) Added, calling librdf_storage_context_remove_statements * librdf/rdf_model.c: (librdf_model_context_add_statements) Use factory method if present otherwise use existing code and librdf_model_context_add_statement method. (librdf_model_context_remove_statements) Use factory method if present otherwise use existing code and librdf_model_context_remove_statement method. * librdf/rdf_model.h: model_factory - note sync is optional. Add context_add_statements and context_remove_statements, both optional that librdf_model will implement using the singular forms if they are missing. * librdf/rdf_node.c (librdf_node_equal): Remove unused var 2003-08-30 Dave Beckett * librdf/rdf_stream.c (librdf_stream_update_current_element): Do not do excessive work - only do a lower level check is_updated is false. (librdf_stream_next): Reset is_updated after an stream->next_method is performed. (librdf_stream_get_object): Do less work, just return librdf_stream_update_current_element, always the current element or NULL at the end. * librdf/rdf_iterator.c (librdf_iterator_update_current_element): Do not do excessive work - only do a lower level check is_updated is false. (librdf_iterator_next): Reset is_updated after an iterator->next_method is performed. (librdf_iterator_get_object): Do less work, just return librdf_iterator_update_current_element, always the current element or NULL at the end. * librdf/rdf_stream.h, librdf/rdf_iterator.h: Add is_updated flag * librdf/rdf_node.c (librdf_node_equals): Actually use interned nodes. * librdf/rdf_uri.c (librdf_uri_equals): Actually use interned URIs. * librdf/rdf_model.c (Main): In test code, use librdf_parser_parse_string_as_stream rather than write files, delete them. * librdf/rdf_node.c: Updates to share all librdf_node objects like for librdf_uri - usage counts and shared pointers. (librdf_init_node): Initialise the three hashes for resource, literal, blank nodes. (librdf_finish_node): Clean up the three hashes. (librdf_new_node_from_uri_string_or_uri): Internal helper function to do all resource node creation. Does the minimum of uri_string to/from uris objects conversion. If the resource node isn't in the resource hash (H_RESOURCE), add it otherwise just bump the usage count. (librdf_new_node_from_uri_string, librdf_new_node_from_uri, librdf_new_node_from_uri_local_name, librdf_new_node_from_normalised_uri_string): Use librdf_new_node_from_uri_string_or_uri. (librdf_new_node_from_typed_literal): If the librdf_node_encode-ed buffer of the literal node isn't in the literal hash (H_LITERAL), add it, otherwise just bump the usage count. (librdf_new_node_from_blank_identifier): If the identifier string isn't in the blank hash (H_BLANK), add it, otherwise just bump the usage count. (librdf_new_node_from_node): Now 1 line. (librdf_free_node): Decrement usage and then free and remove from the appropriate hashes if the usage was 0. (librdf_node_get_li_ordinal): Get the ordinal from the URI string since it isn't/wasn't ever stored. * librdf/rdf_node.h: librdf_node - add usage count. Remove ordinal union part, never used. Add key & size to literal part. * librdf/rdf_statement.c, librdf/rdf_query.c, librdf/rdf_concepts.c (main): Call librdf_init_node and librdf_finish_node in the test code. * librdf/rdf_init.h: Added node mutext (when threading) and node hashes to world structure. * librdf/rdf_init.c (librdf_world_open): Call librdf_init_uri. (librdf_world_set_uris_hash): Deleted (librdf_init_world): Don't use arg2. * librdf/rdf_uri.c (librdf_new_uri): Fail if uri_string is NULL. Tidy up cleanup and thread un-/locking. (librdf_new_uri_from_uri): Actually use the interning of URIs. (librdf_new_uri_from_uri_local_name): Fail if URI is NULL. Tidy up cleanup and thread un-/locking. (librdf_new_uri_normalised_to_base, librdf_new_uri_relative_to_base): Fail if URI is NULL. * raptor/configure.ac, configure.ac: Added --with-dmalloc option default auto for maintainer, no otherwise. 2003-08-29 Dave Beckett * perl/lib/RDF/Redland/Parser.pm: Use raptor in the example. Add a mime type example. * demos/demo.pl: s/statement/triple/ in html * demos/demo.pl: Update parser labels. Add owl namespace. Trim rdf content whitespace. Become read only if db is not writable to this user. * docs/Makefile.am: Added .pod.html rule 2003-08-28 Dave Beckett * docs/fix-python-xhtml: Remove remaining broken fragments, example urls * docs/fix-python-xhtml: Exclude __builtin__ class from links * Released RPMs version 0.9.13-3 (patch redland-0.9.13-perl2.patch) * librdf/redland.spec.in: (0.9.13-2, 0.9.13-3) patches added to fix broken perl UNIVERSAL::isa * perl/lib/RDF/Redland/URI.pm, perl/lib/RDF/Redland/Node.pm: Use URI::URL in the isa * Released RPMs version 0.9.13-2 (patch redland-0.9.13-perl1.patch) * perl/lib/RDF/Redland/URI.pm, perl/lib/RDF/Redland/Node.pm: Fix totally broken use of UNIVERSAL::isa * perl/lib/RDF/Redland/URI.pm (new): Fix arg promotion from URI objects. * perl/lib/RDF/Redland/URI.pm (new): Fix cloning. * configure.ac: Bumped version to 0.9.14 * Snapshotted redland_0_9_13 for 0.9.13 release * docs/redland.pod: Note out of dateness * docs/redland.pod, librdf/rdf_serializer_rdfxml.c, librdf/rdf_serializer_raptor.c, utils/db_upgrade.c, tcl/example.tcl, ruby/example.rb: Use librdf_model_as_stream * java/org/librdf/redland/Model.java (as_stream): Added - use Use librdf_model_as_stream or with a context node, use librdf_model_context_as_stream * python/RDF.py (Model.as_stream): Use librdf_model_context_as_stream * perl/lib/RDF/Redland/Model.pm: Fix uses of RDF::Redland::Node::_ensure($node) to use it as a redland node. (as_stream): Take optional context node, promote as necessary, using librdf_model_context_as_stream. Add documentation. * Redland.i: Added librdf_model_context_as_stream * librdf/rdf_model.c, librdf/rdf_model.h: Added librdf_model_context_as_stream, deprecating librdf_model_context_serialize as confusing with the librdf_serializer class and mixing US/UK spelling. * perl/serialize.pl, demos/demo.pl, perl/example.pl: Use as_stream * perl/lib/RDF/Redland/Model.pm (as_stream): Added, deprecating serialise and serialise. * librdf/rdf_model.c: Added librdf_model_as_stream, deprecating librdf_model_serialise as confusing with the librdf_serializer class. * librdf/rdf_model.h, Redland.i: Added librdf_model_as_stream * tcl/Makefile.am: TCL_INCLUDES * php/php.ini: load shared library from . * php/Makefile.am: Remove libtool again. Try "if OSX, else rest of world" approach. * configure.ac: TCL_INCLUDE now TCL_INCLUDES and blank if not found, otherwise -Idir * tcl/Makefile.am: Remove libtool again. Try "if OSX, else rest of world" approach. * configure.ac: default TCL_INCLUDE to /usr/include * ruby/Makefile.am: minor depends * ruby/Makefile.am: Remove libtool again. Try "if OSX, else rest of world" approach. Package now 'redland' to match ruby convention. * ruby/example.rb: Now redland * tcl/Makefile.am: Don't -I-I@TCL_INCLUDE@ * configure.ac: tcl version tweak -nonewline since OSX does silly things * tcl/Makefile.am: Removed README * tcl/README: Moved into ../docs/tcl.html * tcl/Makefile.am: Use @TCL_VERSION@ for the library name and -I@TCL_INCLUDE@ * configure.ac: --with-perl/python/java/tcl/php/ruby now either enable the language or enable and set the binary. Always try to find the version of the language before building the API automatically. Hunt for Tcl tcl.h and Java JDK JNI headers in various places. Report the languages available and language APIs built. * php/Makefile.am: comments. testing is optional, php program might not exist * php/Makefile.am: Very complex build and install using a libfake.la so I don't have to care about details of building shared object and dynamically loaded libraries. No OSX specific fixes here since I can't see what the convention is. * tcl/Makefile.am: Be verbose in pkgIndex.tcl * ruby/Makefile.am: docs * tcl/Makefile.am: No -module here 2003-08-27 Dave Beckett * tcl/Makefile.am: Very complex build and install using a libfake.la so I don't have to care about details of building shared object and dynamically loaded libraries (such as on OSX). The OSX specific naming is burnt in here since the dynamically loaded library must be called Redland.dylib * ruby/Makefile.am: Very complex build and install using a libfake.la so I don't have to care about details of building shared object and modules (such as on OSX). OSX specific naming have to be burnt in here since shared modules must be called Redland.bundle * ruby/Makefile.am, tcl/Makefile.am: Make build and installing work again, without libtool. * tcl/README: Update Tcl building info * tcl/test.tcl: Back to auto_path . * configure.ac: BDB check update again. Report discovered BDB version in summary * configure.ac: Use bdbc_ for temporary variables in BDB checking code. * perl/Makefile.PL: Revert to working version. No need for builddir/srcdir things. * perl/Makefile.am: Revert: Remove inplace editing of PERL_MAKEFILE * configure.ac: Another major BDB hunt and validate. This time check for db.h with version numbers. * perl/Makefile.PL: Set FULLEXT to RDF/Redland * perl/Makefile.am: Make sure PERL really uses the right FULLEXT, BASEEXT and BOOTSTRAP values * librdf/rdf_hash_bdb.c: Remove BDB_CLOSE/FD_2_ARGS ifdef sequence at start - now tested in configure. Rename to HAVE_BDB_CLOSE/FD_2_ARGS * configure.ac: bdb_dbname test was inverted * configure.ac: use "if test ...; then", not "if [ ... ]; then" * configure.ac: I give up. Put OSX fink hints here - look for /sw/bin. Add more Sleepycat/Berkeley DB checks, more guesswork and hunting for BDB headers in /usr/include/db* subdirectories. * perl/Makefile.am: Use CFLAGS, not MEM. * perl/Makefile.PL: Use CFLAGS, not MEM. Use redland-src-config --libs not --static-libs * librdf/rdf_hash_bdb.c (librdf_hash_bdb_open): More BDB #ifdef mess for db->open 6 or 7 arguments. * librdf/rdf_utf8.c, librdf/rdf_uri.c, librdf/rdf_stream.c, librdf/rdf_storage.c, librdf/rdf_statement.c, librdf/rdf_serializer.c, librdf/rdf_query.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_model.c, librdf/rdf_iterator.c, librdf/rdf_heuristics.c, librdf/rdf_hash.c, librdf/rdf_files.c, librdf/rdf_digest.c, librdf/rdf_concepts.c: When running a standalone test which has a STANDALONE #define set then do not compile the code from the module, but use the code in the linked librdf - all the tests link with this. This prevents complaints about dual symbols from the OSX linker, and crashes with statics that store the pointers to factories (models, storages, parsers). 2003-08-26 Dave Beckett * configure.ac: Added AC_HEADER_TIME and checks for time.h, sys/time.h for gettimeofday * librdf/rdf_parser_raptor.c (librdf_parser_raptor_generate_id_handler): Added to use librdf_world_get_genid to get a unique genid if the user does not provide one. (librdf_parser_raptor_parse_file_as_stream, librdf_parser_raptor_parse_as_stream_common, librdf_parser_raptor_parse_into_model_common): Use librdf_parser_raptor_generate_id_handler to generate IDs. * librdf/rdf_node.c (librdf_new_node_from_blank_identifier): If a NULL identifier is passed in, use librdf_world_get_genid to get a unique genid. * librdf/rdf_init.c: Added a slew of time related headers for gettimeofday (librdf_new_world): Get the startup time to init world genid_base. Set genid_counter to 1. (librdf_world_set_feature): Support LIBRDF_WORLD_FEATURE_GENID_BASE, LIBRDF_WORLD_FEATURE_GENID_COUNTER both integers. (librdf_world_get_genid): Added to return a new genid of the form "r"+base+"r"+(counter++) * librdf/rdf_init.h: World gains genid_base and genid_counter. New world features LIBRDF_WORLD_FEATURE_GENID_BASE, LIBRDF_WORLD_FEATURE_GENID_COUNTER New internal librdf_world_get_genid * docs/fix-python-xhtml: +email * docs/fix-python-xhtml: -email * docs/fix-python-xhtml: words * docs/fix-python-xhtml: New pydoc, new bad use of ID. Skip the huge #commented heading in the source. * examples/example2.c: Updated to a slightly more useful example - parsing from string content and adding/checking/removing a statement. * python/redlandtest.py (testIterateModel, testContains): Added. * librdf/rdf_storage.c: Revert, remove contexts check here. * librdf/rdf_storage_list.c (librdf_storage_list_contains_statement): Handle contains with contexts using librdf_storage_list_find_statements. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_contains_statement): Handle contains with contexts using librdf_storage_hashes_find_statements. * librdf/rdf_parser_raptor.c: removed unused variable * librdf/rdf_storage.c (librdf_storage_hashes_contains_statement): Revert fix. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_contains_statement): Move the fix for stores with contexts into librdf_storage_contains_statement * librdf/rdf_storage_list.c (librdf_storage_list_contains_statement): Build a librdf_storage_list_node to use to run librdf_list_contains. * librdf/rdf_storage.h: Added index_contexts flag to librdf_storage_factory_s. * python/RDF.py (Model.__iter__): Fix to return an iter * python/setup.py: Remove MEM, MEM_LIBS code - rely on CFLAGS and LDFLAGS being passed in. Move version code to top. * python/Makefile.am: Pass on CFLAGS and LDFLAGS to python setup.py * python/example.py: empty statement * python/RDF.py: words in copyright * python/test/test.py, python/example.py: Updated to use 0.9 api features * ruby/Makefile.am: test-ruby fix shared dir * ruby/Makefile.am: LIBRUBYARG works 1.6-1.8 * python/redlandtest.py: Update by Edd Dumbill to test the 0.9 RDF.py changes. * python/RDF.py: Major update to use Python 2.2+ idioms and features by Edd Dumbill. General remarks * Removed string exceptions and replaced with RedlandError ones * Where underlying Redland C objects were unexpectedly null, raise exceptions rather than returning None, "" or [] as appropriate. * Raise exceptions if Redland C constructors fail in Python constructors. * Did quite a lot of documentation updating, where possible demonstrating preferred Pythonic usages. * Added more unit tests to test changed functionality. RDF.Node * Constructor now accepts Uri to make a resource/property node, or a string to make a string literal * Removed usage of node_type() in favour of is_resource(), is_blank() etc methods. * DEPRECATED get_blank_identifier() etc methods in favour of node.blank_identifier etc properties. Raise exception if properties inconsistent with the node type are requested. RDF.Statement * No need to name subject, predicate, object in constructor any more. Uris or string literals accepted in place of nodes in constructor argument. * __getattr__ method deleted, using new-style property() for subject, predicate, object RDF.Model * Deleted get_*_iterator methods * Renamed sources() to get_sources(), targets() to get_targets(), arcs() to get_predicates(). Retained old method names as aliases. * Added get_sources_context(), get_targets_context(), get_predicates_context() which return (node, context) tuples. * Amended get_source(), get_sources() etc methods so that Uri and string literals were acceptable as shortcut types for nodes. * Added find_statements_context() which returns (statement, context) tuples. * Renamed context_remove_statements() to remove_statements_with_context(). Retained old method name as an alias. * Added __delitem__ method so del[statement] and del[statement, context] work. * Added append() method so append(statement) and append(statement, context) work. Suggest that append() is used in preference to add_statement() for Python idiomatic usage. * DEPRECATED serialise() in favour of as_stream(). * Added as_stream_context() to serialise (statement, context) tuples. * Exception raised if len() is attempted on model with a non-countable storage. * DEPRECATED Model.add(), Model.add_typed_literal_statement() usages: now that constructing Statements is easier, it's incongruous to have these in the model. Additionally it saves reproducing various bits of error checking that properly belong in the Node() constructor. * Implemented __contains__() so "if statement in model" and "if (statement, context) in model" work as expected using the more efficient Redland C methods where possible. RDF.Stream * DEPRECATED Stream.context_iter(). Use in preference the _context variants of the appropriate Model methods. This leads to fewer lines of code. RDF.Uri * Amended constructor so strings or Uri instances can be passed as the first argument, without named parameters being required, and the right thing still happen. ---- I did some indenting and white space editing for consistency with the existing code. * librdf/rdf_list.c (librdf_list_iterator_get_method): Oops * librdf/rdf_hash.c (librdf_hash_get_all_iterator_get_method): oops * java/Makefile.am: Use check-local again, since we don't actually make programs called test1 and test2. * Redland.i: Add prototypes for static, internal methods * python/Makefile.am: Pass in CFLAGS to python * librdf/rdf_hash.c (librdf_hash_get_all_iterator_get_method): Give an error for an unknown method and return NULL. * librdf/rdf_list.c (librdf_list_iterator_get_method): Check method is get_object and return an error if it isn't. * librdf/rdf_storage.c (librdf_storage_stream_to_node_iterator_get_method): Provide iterator get_context method as well as get_object, using the internal stream. * ruby/Makefile.am: Made an rubylib make definition * tcl/Makefile.am: Made an tcllib make definition * tcl/Makefile.am: Interrogate tclsh for versions, and then guess include paths and library name. * tcl/test.tcl, tcl/example.tcl: Back to redland * tcl/test.tcl, tcl/example.tcl: Tcl package now Redland * configure.ac: Look for tclsh for TCL * ruby/Makefile.am: More libtool flags * ruby/Makefile.am: Build shared objects again. * ruby/Makefile.am: Don't depend on build-ruby * librdf/rdf_storage_hashes.c (librdf_storage_hashes_contains_statement): Use librdf_storage_hashes_find_statements to make this work when contexts are being used. * librdf/rdf_node.c (librdf_node_equals): Doc fix * librdf/rdf_storage_list.c (librdf_storage_list_node_equals): When not using contexts, don't check the context nodes. * Redland.i (librdf_call_python_message, librdf_call_perl_message): Fix use of vsnprintf in perl and python message callbacks to properly copy va_list using va_copy. Same bug that happened in raptor. 2003-08-25 Dave Beckett * java/Makefile.am: Added test-java again * tcl/Makefile.am: Added test-tcl again * ruby/Makefile.am: Added test-ruby again * python/example.py: Modernise the python to 2.2+ * python/RDF.py: Throughout: Updated to use new Python classes (2.2+) Replace __getattr__/__setattr__ with property() method. * python/Makefile.am: check-local now also does unittest-python * raptor/configure.ac: Bumped version to 0.9.13 * raptor/raptor_parse.c (raptor_start_element_grammar): With rdf:datatype, do not lose the URI string pointer. For rdf:ID, do not allocate the URI twice. * raptor/raptor_parse.c (raptor_generate_statement): Do not set language when a datatype is given. * raptor/raptor_xml_writer.c (raptor_new_xml_writer): Initialise writer buffer to an empty string to start (i.e. just \0). (raptor_xml_writer_start_element): Now assume buffer is always present, remove empty buffer case. (raptor_xml_writer_end_element,raptor_xml_writer_cdata): Handle 0 length case, no strncpy. * raptor/tests/Makefile.am: Added ex-51. Fix daml+oil test. * raptor/tests/ex-51.out, raptor/tests/ex-51.rdf: Check empty XML literal works * raptor/tests/ex-41.out: No language for datatyped literals. * raptor/tests/daml-oil.rdf, raptor/tests/daml-oil.out, raptor/tests/Makefile.am: Updated to DAML+OIL schema 2001-03 as defined in http://www.daml.org/2001/03/daml+oil-index.html * raptor/tests/daml-oil.out, raptor/tests/daml-oil.rdf: Added 2000-11-30 http://www.cs.man.ac.uk/%7Ehorrocks/DAML-OIL/daml-oil.rdf * raptor/tests/owl-schema.rdf, raptor/tests/owl-schema.out: Updated OWL schema http://www.w3.org/2002/07/owl to match that given in OWL Reference 2003-08-18 CR at http://www.w3.org/TR/2003/CR-owl-ref-20030818/#appB * raptor/libraptor.3: Updated for 0.9.12 * python/RDF.py (Statement._get_subject): Missed accidently when updating to do more copies. * configure.ac: No languages by default. 2003-08-24 Dave Beckett * perl/Makefile.PL: Include -I builddir librdf dir to get rdf_config.h * Makefile.am: make languages after core libs * perl/Makefile.PL: More attempts at src/builddir fix. * perl/Makefile.am: Fix src/builddir for output of MakeMaker * tcl/Makefile.am: again * tcl/Makefile.am: oops, -c to compile * ruby/Makefile.am: This dir is now compiled and installed conditional on ruby being enabled with --with-ruby (off by default). Move -local targets into standard 'make' and 'make install' ones. Try to compile with the right Ruby shared library and install in the Ruby libs dir. * tcl/Makefile.am: Use @TCL@ * tcl/Makefile.am: This dir is now compiled and installed conditional on tcl being enabled with --with-tcl (off by default). Move -local targets into standard 'make' and 'make install' ones. Try to compile the Tcl shared library and install in the Tcl libs dir. Finding the tcl.h includes is impossible, so note that in the README. * tcl/README: Tcl building issues * php/Makefile.am: php installs now * configure.ac: In checking for progs, hunt for perl, python etc. rather than names. Added --with-perl/python/java/php/tcl/ruby with optional argument =PATH to set the script. This enables the particular language to be built. Present defaults are perl and python are enabled. Move --with-ecma-cli to be nearby and accept 'no' also. Moved --with-jdk to be nearby. The subdirectories called with standard 'make' and 'make install' now are based on languages. Report the languages configured in the build summary. * python/Makefile.am: This dir is now compiled and installed conditional on python being enabled with --with-python (by default). Move -local targets into standard 'make' and 'make install' ones and create a fake build and install to keep automake happy, since we are using python's Distutils to do the real work. * perl/Makefile.am: This dir is now compiled and installed conditional on perl being enabled with --with-perl (by default). Move -local targets into standard 'make' and 'make install' ones and create a fake build and install to keep automake happy, since we are using perl's MakeMaker to do the real work. * java/Makefile.am: This dir is now compiled and installed conditional on java being enabled with --with-java, so move -local targets into standard 'make' and 'make install' ones. Install both the shared library and jar. * java/Makefile.am: core_wrap.c without makefile variables * java/Makefile.am: EXTRA_LTLIBRARIES is broke - it won't build shared libraries. So fake it using lib_LTLIBRARIES and then override the installation for install-javalibLTLIBRARIES: to do nothing. * java/Makefile.am: Shared library now librdf-java and built using libtool. * java/org/librdf/redland/World.java, java/redland-fragment.java: Now rdf-java (aka librdf-java under unixen) * librdf/rdf_init.c: Now 2003 2003-08-23 Dave Beckett * java/org/librdf/redland/Node.java: (constructors) Update to always copy rather than deal with shared nodes. (isResource, isLiteral, isBlank): Added. * java/org/librdf/redland/Statement.java: (constructors, getSubject, getPredicate, getObject) Update node and statements to always copy rather than deal with shared. * java/org/librdf/redland/Stream.java: Returning copied statements is default. * java/org/librdf/redland/Iterator.java: Returning copied nodes is default. * configure.ac: For --with-jdk, hunt for the machine-dependent subdir * java/Makefile.am: Use JDK_INCLUDES * java/org/librdf/redland/Parser.java: (parse) Added methods parsing content ina string into a model or as a stream of statements. * java/org/librdf/redland/Model.java: sync has no return * configure.ac: Added --with-jdk to specify where Java lives * java/org/librdf/redland/Model.java, perl/lib/RDF/Redland/Model.pm (sync): Added calling librdf_model_sync * Redland.i: Added librdf_model_sync * librdf/rdf_model_storage.c (librdf_model_storage_sync): Added, invoking librdf_storage_sync * librdf/rdf_model.c (librdf_model_sync): Added, invoking it in the implementation via new factory method sync. * librdf/rdf_model.h: Added librdf_model_sync and factory method. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_sync): Added, implementing sync method. * librdf/rdf_storage.c: Added librdf_storage_sync * librdf/rdf_storage.h: Added librdf_storage_sync and factory method. * python/Makefile.am, perl/Makefile.am: clean more * perl/serialize.pl: Updated API tweaks * perl/lib/RDF/Redland/Node.pm (new_from_literal): Ensure is_wf_xml is an integer. * perl/lib/RDF/Redland/Model.pm (remote_statement): Allow NODE NODE NODE [CONTEXT] args * perl/lib/RDF/Redland/Statement.pm (new): Promote node arguments to redland nodes using RDF::Redland::Node::_ensure. * perl/lib/RDF/Redland/Node.pm (_ensure): Added, to promote other objects to redland nodes * perl/lib/RDF/Redland/Model.pm (add): Now call add_statements. (add_statements,remove_statement,add_statements,remove_statements, remove_context_statements): Promote node arguments to redland nodes using RDF::Redland::Node::_ensure. * perl/lib/RDF/Redland/Statement.pm (new_from_nodes): Fix call to constructor * perl/example.pl: Test add_statement(NODE, NODE, NODE) form - with same NODE * perl/lib/RDF/Redland/Model.pm (add_statement): Accept NODE NODE NODE [CONTEXT] as arguments too. 2003-08-22 Dave Beckett * Redland.i: typo * perl/lib/RDF/Redland/Parser.pm: (parse_string_as_stream, parse_string_into_model): Added for parsing strings. Note that the base_uri is required. * python/RDF.py: (Parser.parse_string_as_stream, Parser.parse_string_into_model): Note base_uri is required in docs, raise an error if it isn't there. * python/RDF.py: (Parser.parse_string_as_stream, Parser.parse_string_into_model): Added. * librdf/rdf_parser_raptor.c (librdf_parser_raptor_parse_as_stream_common, (librdf_parser_raptor_parse_uri_into_model_common): Ensure source_uri is set up correctly. Refuse to work without a base_uri. * python/test/test.py: Added test with parser.parse_string_as_stream * librdf/redland.spec.in: try to get perl install working again * Redland.i: Added librdf_parser_parse_string_as_stream, librdf_parser_parse_string_into_model * librdf/rdf_parser_raptor.c: Added new methods for implementing librdf_parser_parse_string_as_stream, librdf_parser_parse_string_into_model (librdf_parser_raptor_parse_as_stream_common): New, core work for both string and uri parsing into a stream. (librdf_parser_raptor_parse_uri_into_model_common): New, core work for both string and uri parsing into a model. * librdf/rdf_parser.h (librdf_parser_parse_string_as_stream, librdf_parser_parse_string_into_model): Added * librdf/rdf_parser.c (librdf_parser_parse_string_as_stream, librdf_parser_parse_string_into_model): Added 2003-08-21 Dave Beckett * raptor/Makefile.am: Remove -static from test links * raptor/raptor_uri.c (main): Test xmlbase and retrievable URI tranforms. * raptor/raptor_uri.c (raptor_uri_resolve_uri_reference): Handle #s relative to a uri-reference with a #fragment. * raptor/raptor_www.c: (raptor_www_fetch) Use raptor_new_uri_for_retrieval to ensure that the URI-reference fragments are removed, and the URI path exists. * raptor/raptor.h: Added raptor_new_uri_for_retrieval * raptor/raptor_uri.c (raptor_new_uri_for_retrieval): Added, strips fragments and ensures / path is present. * raptor/raptor_xml_writer.c (raptor_xml_writer_start_element, raptor_xml_writer_end_element): Use size_t for lengths. * raptor/raptor_xml_writer.c (raptor_xml_writer_start_element): Set content_element_seen in parent only if there is a parent. (raptor_xml_writer_end_element): Change current_element to parent only if there is a current element. * raptor/tests/Makefile.am: Pull out may-fail NFC checks into a separate set and don't exit 1 if they do fail. Failure is possible since it requires GNOME glib2 which isn't always available. * librdf/redland.spec.in: Fix perl CORE dir * librdf/redland.spec.in: Removed duplicate perl CORE shared objects * librdf/redland.spec.in: Added redland-db-upgrade.1 to devel 2003-08-20 Dave Beckett * perl/Makefile.PL: Use .. for redland-src-config and add check it is there. * python/setup.py: Use .. for redland-src-config and add an os.access check for it * redland-src-config.in: test ! -r * redland-src-config.in: Stop if cannot find raptor-src-config * python/setup.py: append define_macros only on match. * python/setup.py: Oh yes it is. * python/setup.py: redland-src-config is not in top_srcdir * python/redlandtest.py, python/setup.py, python/example.py: Set #! to /usr/bin/python * python/RDF.py: Update classes to always return copies of Nodes, Statements from streams, iterators such as model.find_statements. The user should now not need care about shared versus copying of returned values but just use them. * python/setup.py, python/Makefile.am: Pass MEM, MEM_LIBS to python compiling C * perl/lib/RDF/Redland/Statement.pm: (subject,predicate,object) Copy redland node for librdf set methods. * perl/lib/RDF/Redland/Node.pm: POD fixes * perl/example.pl: Minor updates to use newer API calls. * perl/lib/RDF/Redland/Statement.pm: (subject,predicate,object) Docs - note no copying neeeded. (predicate): Minor typo * perl/lib/RDF/Redland/RSS.pm (Model.DESTROY): Call super to tidy up (Node.new): Debugging (Node.DESTROY): Call super to tidy up (properties): Do less work, no need to copy. * perl/lib/RDF/Redland/Node.pm (new): Invoke clone properly. * perl/lib/RDF/Redland/URI.pm (new): Constructor now copies as well as building URIs. Takes string literals or URIs by sniffing for classes. (new_from_uri): Replaced by new (clone): Another way to copy a URI. Document these changes * perl/lib/RDF/Redland/Iterator.pm: Update for Node API change and no need to copy here (current, context): Do not copy returned node. * perl/lib/RDF/Redland/Stream.pm: Update for Statement API change and no need to copy here (current, context): Do not copy returned statement. * perl/lib/RDF/Redland/Model.pm: Update for Node, Statement API changes and no need to copy here (sources,targets,arcs): Don't copy statements to new lists. * perl/lib/RDF/Redland/Statement.pm (new): Constructor now copies as well as building statements. Takes string literals, URIs by sniffing for classes. (new_from_statement,new_from_nodes): Replaced by new. (clone): Another way to do new_from_statement (subject,predicate,object): Do less work, always return a copy. Document these changes * perl/lib/RDF/Redland/Node.pm (new): Constructor now builds resources, literals, URIs by sniffing for classes. (new_from_literal,new_from_typed_literal): Replaced with new_literal (new_xml_litearl): Added (new_from_node): Replaced with clone Document these changes * perl/rss-dump.pl: Comment out (working) code that lets perl do the URI retrieval, assume raptor has that. Slight updates for changed perl API. * librdf/rdf_node.c (main): Test: Revert accidently removed librdf_free_uri * perl/Makefile.am, perl/Makefile.PL: Pass on MEM to CFLAGS when building perl. * librdf/rdf_parser_raptor.c: Use LIBRDF_FREE for data returned from raptor. This is OK as long as raptor is in the redland sources. Otherwise it'll need to be SYSTEM_FREE. * librdf/rdf_hash_bdb.c: Use SYSTEM_FREE for data allocated by BDB via malloc() * librdf/rdf_init.c: Use SYSTEM_MALLOC/FREE for mutexes. (librdf_system_malloc, librdf_system_free): Added for dmalloc debugging. * librdf/librdf.h: Added SYSTEM_MALLOC and SYSTEM_FREE for routines that return genuine malloc() and free()ed memory - outside Redland typically. * raptor/raptor_general.c (raptor_check_ordinal): parentheses just for gcc 2003-08-19 Dave Beckett * python/setup.py: license now license apparently * utils/redland-db-upgrade.1: fix db names * utils/Makefile.am: Added redland-db-upgrade.1 * utils/redland-db-upgrade.1: Manpage for redland-db-upgrade * librdf/rdf_node.c: Make nodes immutable - remove all node class set methods. (librdf_new_node_from_literal): Now just calls librdf_new_node_from_typed_literal. (librdf_new_node_from_typed_literal): librdf_new_node_set_typed_literal_value inlined here. (librdf_new_node_from_blank_identifier): librdf_set_blank_identifier inlined here. (librdf_new_node_from_node): Call the appropriate node constructors rather than malloc a new node and use the set methods. (librdf_node_set_uri, librdf_node_set_type, librdf_node_set_typed_literal_value, librdf_node_set_blank_identifier): Deleted and inlined where used. (librdf_node_set_li_ordinal,librdf_node_set_literal_value): Deleted, never used in this module. (librdf_node_decode): Call the appropriate node constructors rather than malloc a new node and use the set methods. (main): Remove node set methods from test code. * librdf/rdf_node.h: Make nodes immutable - removed all public set methods into rdf_node.c * java/org/librdf/redland/Node.java: Make nodes immutable - remove set methods setURI, setType, setLiteralValue. * perl/lib/RDF/Redland/Node.pm: Make nodes immutable. Remove set parts of methods uri, blank_identifier and type. Remove method set_literal_value. * python/RDF.py (Class Node): Make nodes immutable - remove set methods. * Redland.i: Make nodes immutable - remove node class set methods. * Redland.i: comment out calling python exceptions for now 2003-08-17 Dave Beckett * configure.ac: Remove MEM=-DLIBRDF_MEMORY_DEBUG if no dmalloc present. * librdf/rdf_uri.c, librdf/rdf_stream.c, librdf/rdf_storage.c, librdf/rdf_statement.c, librdf/rdf_serializer.c, librdf/rdf_query.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_model.c, librdf/rdf_iterator.c, librdf/rdf_heuristics.c, librdf/rdf_hash.c, librdf/rdf_files.c, librdf/rdf_digest.c, librdf/rdf_concepts.c (main): In test code, remove calls to librdf_memory_report for old internal memory debugging code. * librdf/librdf.h: Remove LIBRDF_MEMORY_DEBUG and internal memory loss debugging code. External tools such as dmalloc work a lot better. * librdf/Makefile.am: Removed rdf_memory.c * librdf/rdf_memory.c: Memory debugging code superceeded by better external tools such as dmalloc * librdf/rdf_hash_bdb.c, configure.ac: Added BDB 4.0 and 4.1 open interface support - 6 or 7 arguments. * raptor/raptor_xml_writer.c: (raptor_xml_writer_end_element) Reset the current_element pointer on finishing. Makes any succeeding cdata do the right thing. * librdf/redland.spec.in: Updates for new perl module names * raptor/rdfdump.c: Inside redland, don't call raptor_init/finish, it's done by redland's world. 2003-08-13 Dave Beckett * raptor/raptor_rss.c (raptor_rss_parse_chunk): Stop working aftera a user abort of the parser. * raptor/raptor_general.c (raptor_check_ordinal): c is not const * raptor/rdfdump.c, raptor/raptor_xml_writer.c, raptor/raptor_xml.c, raptor/raptor_www_libwww.c, raptor/raptor_utf8.c, raptor/raptor_uri.c, raptor/raptor_set.c, raptor/raptor_sax2.c, raptor/raptor_qname.c, raptor/raptor_parse.c, raptor/raptor_namespace.c, raptor/raptor_locator.c, raptor/raptor_libxml.c, raptor/raptor_identifier.c, raptor/raptor_general.c, raptor/ntriples_parse.c: Move dmalloc includes into raptor_internal.h and use everywhere. * raptor/raptor_internal.h: Add raptor dmalloc includes here to ensure all raptor code uses it or not consistently. * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_error_handler, librdf_parser_raptor_warning_handler): Remove inadvisable use of raptor_parser as a variable name. (librdf_parser_raptor_parse_uri_into_model): Zap unused world. * librdf/rdf_hash.c (librdf_hash_from_array_of_strings): Fix return value. * examples/Makefile.am: Added redland_dbus * examples/redland_dbus.c: Initial import 2003-08-12 Dave Beckett * librdf/rdf_uri.c, librdf/rdf_stream.c, librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage.c, librdf/rdf_statement.c, librdf/rdf_serializer_rdfxml.c, librdf/rdf_serializer.c, librdf/rdf_query.c, librdf/rdf_parser_raptor.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_model.c, librdf/rdf_init.c, librdf/rdf_hash_memory.c, librdf/rdf_hash_bdb.c, librdf/rdf_hash.c, librdf/rdf_digest.c, librdf/rdf_concepts.c: Replaced most LIBRDF_FATAL1/2 calls with LIBRDF_ERROR1/2; both now take world arguments. The remaining fatal errors are either in redland startup when there is no sensible way to recover or in out of memory situations. The LIBRDF_ERROR1/2 calls now give the error and recover/fail the method if appropriate. The documentation on several methods were updated to note this. The error notification isn't always possible since some methods have way to return errors. A new method on the world class is needed to test for this state. * librdf/librdf.h: Added LIBRDF_ERROR1 and LIBRDF_ERROR2 that take world argument and call either librdf_error(world, ...) or #ifdef LIBRDF_DEBUG, abort() * librdf/rdf_parser_repat.c: Out of date, gone * librdf/rdf_stream.c, librdf/rdf_storage_list.c, librdf/rdf_storage.c, librdf/rdf_serializer_rdfxml.c, librdf/rdf_parser_repat.c, librdf/rdf_parser_raptor.c, librdf/rdf_node.c, librdf/rdf_hash_memory.c, librdf/rdf_hash_bdb.c, librdf/rdf_digest.c: Replace most abort() with calls to LIBRDF_FATAL2 which aborts but gives a message too. * librdf/rdf_init.c (librdf_world_get_feature, librdf_world_set_feature): Return failure rather than crash - not implemented or exposed in APIs yet. 2003-08-11 Dave Beckett * librdf/rdf_model.c (main): Add test that librdf_model_add_statement fails on a partial statement. * librdf/rdf_model.c (librdf_model_size): Added warning that it might not return an answer. (librdf_model_add_statement, librdf_model_add, librdf_model_remove_statement, librdf_model_contains_statement, librdf_model_context_add_statement, librdf_model_context_remove_statement): Added check that the statement used is complete, using new librdf_statement_is_complete * librdf/rdf_statement.h: Added librdf_statement_is_complete * librdf/rdf_statement.c (librdf_statement_is_complete): Added to check that a statement has all the subject, predicate, object fields. 2003-08-08 Dave Beckett * raptor/tests/Makefile.am: Added warn-03 * raptor/tests/warn-03.rdf: Handle deleting of default namespaces * raptor/raptor_parse.c (raptor_xml_start_element_handler): Handle when a name has a namespace but that namespace has no URI such as xmlns="". In that case, the element has non-namespaced parts too, so skip. * raptor/ntriples_parse.c (raptor_ntriples_parse_line): Casts so isspace calls get int args. * raptor/raptor_uri.c (raptor_uri_is_absolute): Cast so isalpha and isalnum get int args. * raptor/tests/Makefile.am: Addex ex-50 * raptor/tests/ex-50.out, raptor/tests/ex-50.rdf: Check parseType with unknown value * raptor/raptor_parse.c (raptor_start_element_grammar): Handle parseType="Literal" without duplicating code. * raptor/raptor_parse.c (raptor_start_element_grammar): Handle parseType="...." which isn't any of the other known types identically to parseType="Literal". * raptor/raptor_general.c (raptor_check_ordinal): Return <0 on failure such as no legal characters at all. * raptor/raptor_internal.h: Added raptor_check_ordinal. * raptor/ntriples_parse.c (raptor_ntriples_generate_statement): Make RAPTOR_IDENTIFIER_TYPE_ORDINAL predicates for property URI strings that match the rdf:_ pattern with n a decimal integer>0. * raptor/raptor_parse.c: Use raptor_check_ordinal for checking in rdf:_ * raptor/raptor_general.c (raptor_check_ordinal): Check the in rdf:_ * raptor/raptor_general.c (raptor_vsnprintf): Non-portable use of va_list fixed by copying the arguments with va_copy before passing to vsnprintf calls. The symptom was crashes on some architectures where this mattered, such as powerpc. 2003-08-07 Dave Beckett * librdf/rdf_parser_raptor.c: Track errors and warnings in parsing. (librdf_parser_raptor_error_handler(): Call raptor_parse_abort * librdf/rdf_statement.c (librdf_statement_decode_parts): Updated for new librdf_node_decode API * librdf/rdf_node.c (librdf_node_decode): Updated for new API - returns a new allocated node and sets the size pointer as a side effect. This removes the only use of librdf_new_node outside the node class. (main): Updated the test code to match. * librdf/rdf_node.h (librdf_node_decode): Updated for new API * raptor/raptor_general.c (raptor_parse_uri_with_connection): Return failure status. * librdf/rdf_node.c (librdf_new_node): No args means make a blank node. (librdf_new_node_from_blank_identifier): Docs * python/RDF.py (Model.serialise): Add optional contexts arg, to serialise contexts as stream of statements. (NS): New class to cache handy nodes from a namespace URI 2003-08-03 Dave Beckett * raptor/tests/Makefile.am: Added bad N-Triples tests bad-0[0-3].nt and checks * raptor/tests/bad-00.nt, raptor/tests/bad-01.nt, raptor/tests/bad-02.nt, raptor/tests/bad-03.nt: Bad N-Triples * raptor/ntriples_parse.c: raptor_ntriples_term_class Added for: (raptor_ntriples_term_valid): Checking validity of a ntriples term - this could be inlined. (raptor_ntriples_string) Renamed to: (raptor_ntriples_term) Use raptor_ntriples_term_valid. (raptor_ntriples_parse_line): Add more checks that whitespec exists between ntriples terms. Error to have typed literals with languages. * perl/Makefile.PL: Remove -Dbool=int - this can only cause trouble * perl/lib/RDF/Redland/Node.pm: Added methods is_resource, is_literal, is_blank using librdf_node_is_resource, librdf_node_is_literal, librdf_node_is_blank * python/RDF.py: Removed NODE_TYPE_LI (Node) is_resource, is_literal, is_blank now use librdf_node_is_resource, librdf_node_is_literal, librdf_node_is_blank * Redland.i, librdf/rdf_node.h, librdf/rdf_node.c: Added librdf_node_is_resource, librdf_node_is_literal, librdf_node_is_blank * librdf/rdf_node.h, librdf/rdf_node.c: Delete LIBRDF_NODE_TYPE_LI - never used. Reserve the allocated type 3. * raptor/tests/test.out, raptor/tests/test.nt: Updated to remove language from typed literals * raptor/raptor_general.c (raptor_print_statement_detailed): Fix datatype uri output not * raptor/raptor_general.c (raptor_parser_simple_error): Call raptor_parser_error_varargs, don't lose the arguments. 2003-07-30 Dave Beckett * configure.ac: ECMA CLR=>ECMI CLI since it's not just the runtime. ECMA CLI= ECMA Common Language Infrastructure. * configure.ac: No need for CSHARP_COMPILE, dotGNU compiler accepts same args as mcs. 2003-07-29 Dave Beckett * configure.ac: Also substitute CSHARP_COMPILE for csharp * configure.ac: Added --with-ecma-clr for mono or dotgnu versions of toolchain. Sets CLRRUN and CSHARPCC for use in csharp dir * Makefile.am: Added csharp dir * raptor/configure.ac: Bumped version to 0.9.12 * raptor/raptor_sax2.c: struct nsd: use size_t for length. * raptor/configure.ac: Ensure the libxml2 xmlReader API is new enough (2.5.0+) such as having xmlParserSeverities. 2003-07-28 Dave Beckett * raptor/raptor.h: Update raptor_generate_id_handler to take user_bnodeid arg. * raptor/raptor_rss.c: Update calls of raptor_generate_id with user_bnodeid (NULL for existing calls) * raptor/raptor_parse.c: Update calls of raptor_generate_id with user_bnodeid (NULL for existing calls) Use it to wrap the rdf:nodeID values for subject and object cases. * raptor/raptor_internal.h: raptor_generate_id updated to add user_bnodeid * raptor/raptor_general.c (raptor_set_generate_id_handler): Document final argument user_bnodeid from the rdf:nodeID attribute value. (raptor_default_generate_id_handler): Add user_bnodeid, return it if present. (raptor_generate_id): Add user_bnodeid and pass on. * raptor/raptor_internal.h: Added raptor_xml_writer_comment * raptor/raptor_namespace.c (raptor_namespace_copy): Don't copy uri and then lose it. * raptor/raptor_xml_writer.c: Added current_element for tracking empty/not empty elements. (raptor_xml_writer_comment): Added, just concatenating the content via raptor_xml_writer_cdata. * raptor/raptor_parse.c (raptor_xml_comment_handler): Call raptor_xml_writer_comment inside parseType="Literal" * raptor/raptor_xml_writer.c: raptor_xml_writer gains stack depth. (raptor_free_xml_writer): Clear any content_cdata before finishing. (raptor_xml_writer_start_element) Add depth to raptor_format_sax2_element calls. Increase it (raptor_xml_writer_start_element,raptor_xml_writer_end_element): Add depth to raptor_format_sax2_element calls. Decrease it and raptor_namespaces_end_for_depth each time. * raptor/raptor_namespace.c: Moved error_handler and error_data arguments around. (raptor_namespaces_start_namespace) Gets those as arguments (raptor_namespaces_start_namespace) Added, simpler version of _full (raptor_namespaces_start_namespace_full) Added, was the old interface but less error arguments. (raptor_namespaces_namespace_in_scope): Fix namespace URI comparison. (raptor_namespace_new) Looses error arguments. (raptor_namespace_copy) Added, copy to a new stack with a new depth. * raptor/raptor_sax2.c (raptor_format_sax2_element): Gain stack depth argument. Only use namespace declarations when there is a namespace stack present. copy namespaces to new stack when new ones are needed. * raptor/raptor_internal.h: Add error_handler and error_data to namespace_stack. raptor_namespaces_start_namespace gets those as arguments raptor_namespace_new looses them raptor_namespaces_start_namespace takes less args raptor_namespaces_start_namespace_full added raptor_namespace_copy added content_cdata_seen and content_element_seen back into sax2_element * raptor/raptor_parse.c: Moved content_cdata_seen and content_element_seen back into sax2_element. Update for new raptor_namespaces_start_namespace calling convention. * raptor/raptor_xml_writer.c: Debug * raptor/raptor_namespace.c (raptor_namespaces_format): Fix missing counting : when present * raptor/tests/ex-11.rdf, raptor/tests/ex-11.out: Updated to declare the html namespace as default, expect it in the N-Triples output. * raptor/raptor_namespace.c (raptor_namespaces_namespace_in_scope): Added, checking if a given namespace is declared in scope. (raptor_namespaces_format): Added, returning a string to declare the given namespace. * raptor/raptor_xml_writer.c: (raptor_xml_writer_start_element,raptor_xml_writer_end_element): Updated for raptor_format_sax2_element new arguments * raptor/raptor_sax2.c (raptor_format_sax2_element): Add raptor_namespace_stack argument. Create xmlns declarations for elements not declared in the current stack state, using raptor_namespaces_format to create the string. * raptor/raptor_internal.h: Added prototypes for raptor_namespaces_namespace_in_scope, raptor_namespaces_format raptor_format_sax2_element now takes a raptor_namespace_stack 2003-07-27 Dave Beckett * raptor/raptor_internal.h: raptor_xml_writer prototypes take unsigned char* * raptor/raptor_parse.c: Move the code building parseType="Literal" strings to raptor_xml_writer class. (raptor_cdata_grammar): Added, just for symmetry mostly, with most code taken from raptor_xml_cdata_handler. * raptor/raptor_xml_writer.c: Move the code building parseType="Literal" strings to raptor_xml_writer class. * raptor/Makefile.am: Added raptor_xml_writer.c * raptor/raptor_xml_writer.c: Initial version * raptor/raptor_parse.c: Split content_cdata fields between sax2_element & (RDF/XML specific) element. raptor_element: Add xml_writer field. Various calls changed to use the new raptor_simple_message_handler for error handling implemented as raptor_parser_simple_error here. (raptor_xml_parser_simple_error_handler): Added, matching the raptor_simple_message_handler API and calling raptor_parser_error. (raptor_start_element_grammar): When parseType="Literal" appears, create a new raptor_xml_writer. (raptor_end_element_grammar): When parseType="Literal" ends, delete the raptor_xml_writer. * raptor/raptor_sax2.c (raptor_format_sax2_element): Use raptor_simple_message_handler. * raptor/raptor_general.c (raptor_start_parse): Use raptor_parser_simple_error with raptor_namespaces_init. (raptor_parser_simple_error): Added, matching the raptor_simple_message_handler API but same as raptor_parser_error. * raptor/raptor_xml.c (raptor_xml_escape_string): Use raptor_simple_message_handler. * raptor/raptor_qname.c (raptor_new_qname): Use raptor_simple_message_handler. * raptor/raptor.h: raptor_sax2_element moved here, semi-public. Re-ordered URI functions earlier. Various methods changed to use (public) raptor_simple_message_handler for error handling. * raptor/raptor_internal.h: Delete raptor_internal_message_handler. Added prototype raptor_parser_simple_error, implementing raptor_simple_error_handler API. Various methods changed to use (public) raptor_simple_message_handler for error handling. raptor_sax2_element moved to semi-public raptor.h rdf/xml-specific cdata parts moved from raptor_sax2_element to raptor_element. Added raptor_xml_writer functions. * raptor/raptor_namespace.c: Use (public) raptor_simple_message_handler for error handling. 2003-07-24 Dave Beckett * raptor/raptor_parse.c (raptor_process_property_attributes): NFC error message tidy. (raptor_end_element_grammar): Fix NFC error reporting and recovery. Report NFC validation failures for XML Literals * raptor/tests/Makefile.am: Added bad-15 bad-17 for bad NFC checking * raptor/tests/bad-16.rdf, raptor/tests/bad-17.rdf, raptor/tests/bad-15.rdf: Bad NFC tests for property attribute, element, element ptl * raptor/configure.ac: Added check for g_utf8_normalize in glib 2.0 using pkgconfig. Defines HAVE_G_UTF8_NORMALIZE if present. * raptor/raptor_internal.h: Added raptor_utf8_is_nfc * raptor/raptor_parse.c (raptor_process_property_attributes): Check for valid NFC on property attribute values. (raptor_end_element_grammar): Check for valid NFC on plain literal property element values. * raptor/raptor_utf8.c (raptor_utf8_is_nfc): Added Normal Form C checking, using GNOME glib 2.0 g_utf8_normalize initially. * raptor/raptor_parse.c (raptor_start_element_grammar): Forbid property attributes and all rdf:* attributes (except rdf:ID) with rdf:parseType * raptor/raptor_general.c: (raptor_statement_part_as_counted_string, raptor_print_statement_part_as_ntriples): Do not emit language for datatyped literals. * raptor/raptor_parse.c (raptor_process_property_attributes): rdf:li is forbidden as a property attribute * raptor/raptor_parse.c: rdf_syntax_terms_info table: rdf:li is forbidden as a property attribute * raptor/libraptor.3: Updated raptor_set_feature for RAPTOR_FEATURE_ALLOW_BAGID and RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST * raptor/tests/owl-schema.out, raptor/tests/ex-39.out: Updated to remove the rdf:type rdf:List triples * raptor/raptor_general.c (raptor_set_feature, raptor_set_parser_strict): Added a new feature RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST (user argument) and feature_allow_rdf_type_rdf_List (internal) to generate the rdf:type rdf:List triple from rdf:parseType="Collection". The default is no after latest RDF/XML revisions. Not relevant for daml:Collection which get the daml:List always. * raptor/raptor.h: Added a new feature feature RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST to control rdf:type rdf:List triple generation from rdf:parseType="Collection" (default no) * raptor/raptor_internal.h: Added a new feature feature_allow_rdf_type_rdf_List to control rdf:type rdf:List triple generation from rdf:parseType="Collection" (default no) * raptor/raptor_parse.c (raptor_start_element_grammar): Remove rdf:type rdf:List triple generation from rdf:parseType="Collection" by default. Not for daml:Collection. Add a new feature feature_allow_rdf_type_rdf_List to control this. 2003-07-22 Dave Beckett * raptor/raptor_xml.c (raptor_valid_xml_ID, raptor_xml_escape_string): unsigned long for all unichars. * raptor/raptor_internal.h: Update raptor_utf8_to_unicode_char to use unsigned long output. * raptor/raptor_utf8.c (raptor_utf8_to_unicode_char): Take and use unsigned long for unichars. * raptor/raptor_rss.c: namespace->nspace since might be a C/C++ keyword sometime * raptor/raptor_www_curl.c (raptor_www_curl_header_callback): Turn void* into char* * raptor/raptor_set.c: Casts * raptor/rdfdump.c (rdfdump_error_handler): Cast data into raptor_parser* * raptor/raptor_www_curl.c: (raptor_www_curl_write_callback,raptor_www_curl_header_callback): Return unsigned int 0 on failure, cannot return -1 :) * raptor/raptor_www.c: Some casts near mallocs * raptor/tests/owl-schema.out: Updated to match 2003-03-18 version. * raptor/tests/owl-schema.rdf: Updated to 2003-03-18 version (just changed DOS line endings) * raptor/ntriples_parse.c (raptor_ntriples_parse_chunk): Handle just the end marker being given i.e. len=0 (and possibly s=NULL) * raptor/raptor_parse.c (raptor_xml_end_element_handler): When parsing has been aborted (rdf_parser->failed), clean up used memory rather than just return. element_name is not used except when debugging, so #ifdef it. 2003-07-21 Dave Beckett * raptor/raptor.h: Export global statics raptor_copyright_string, raptor_version_string, raptor_version_major, raptor_version_minor, raptor_version_release and raptor_version_decimal * raptor/raptor_general.c: Added statics raptor_copyright_string, raptor_version_string, raptor_version_major, raptor_version_minor, raptor_version_release and raptor_version_decimal * raptor/Makefile.am: Removed raptor_cc code since ISO may charge a commercial use fee for this list. * raptor/raptor_cc.gperf: ISO 3166-1 'The use of ISO 3166-1 in commercial products may be subject to a licence fee.' says the maintenance agency. Goodbye code. * raptor/raptor_parse.c: Free former rdf:about, rdf:resource attribute string values before they are zapped. * raptor/raptor_parse.c (raptor_xml_parse_terminate): Delete the sax2 object when cleaning up. * raptor/rdfdump.c: Free new uri_string when it's allocated for a filename * raptor/rdfdump.c: Tidied usage and help information. * raptor/rapper.1: Updated to match current rapper arguments. * raptor/Makefile.am: Added raptor_identifier.c * raptor/raptor_general.c, raptor/raptor_identifier.c: Moved raptor_identifer classes to raptor_identifier.c 2003-07-20 Dave Beckett * raptor/rdfdump.c: If first argument is a filename, make it into a file:/// uri. * raptor/raptor_uri.c (raptor_default_new_uri): Turn probably-bad file:filename 'URIs' into proper file:///... etc. ones. * raptor/raptor_parse.c: Make use of forbidden rdf-namespaced property attributes into errors, as they should be. (raptor_forbidden_propertyAttribute_name): Now used. Reword some error messages. * raptor/tests/Makefile.am (check-bad-rdf): Note when bad test succeeds instead of failing * raptor/tests/Makefile.am: Added bad-13, bad-14 * raptor/tests/bad-14.rdf: rdf:Description is not a legal property attribute * raptor/tests/bad-13.rdf: A property element cannot take rdf:about * raptor/raptor_uri.c (raptor_new_uri_for_xmlbase): Docs 2003-07-15 Dave Beckett * raptor/libraptor.3: formatting * raptor/libraptor.3: Added raptor_set_default_generate_id_parameters, raptor_set_generate_id_handler * raptor/raptor_general.c (raptor_set_default_generate_id_parameters): Fix it right this time. * raptor/raptor_general.c (raptor_set_default_generate_id_parameters): Fix base so the next generated ID uses the integer given, not integer+1 * raptor/raptor_general.c (raptor_free_parser): Free any user-set genid prefix. 2003-07-13 Dave Beckett * raptor/raptor.h: raptor_genid_type enum added - for RAPTOR_GENID_TYPE_BNODEID, BAGID Added prototypes for raptor_set_generate_id_handler, raptor_set_default_generate_id_parameters. * raptor/raptor_general.c (raptor_set_generate_id_handler): Added, to sent the generate ID handler implementation. (raptor_set_default_generate_id_parameters): Added, to sent the generate ID handler parameters for the default implementation ("gen"+integer). (raptor_default_generate_id_handler): Added, moved default code from raptor_generate_id (raptor_generate_id): Use handler if it exists, otherwise the default implementation. * raptor/raptor_internal.h: Added generate_id_handler data parts to raptor_parser internals. 2003-06-24 Dave Beckett * redland-config.in: Make --libs pick the right libdir - add exec_prefix variable declaration. * utils/Makefile.am, librdf/Makefile.am, examples/Makefile.am: Use @LIBS@ in LIBS to pick up any system-wide use. * configure.ac: Pick up any external CPPFLAGS, LDFLAGS, LIBS to start with. * raptor/tests/Makefile.am: use top_builddir not .. * raptor/Makefile.am: add libraptor.la to rapper dependencies 2003-06-23 Dave Beckett * python/RDF.py: Statements, Model: more docs, usage. * python/Makefile.am: Added redlandtest.py * python/redlandtest.py: Redland Python unit tests * python/RDF.py: v0.8 Updates from Matt Biddulph. (class Model) Now takes optional storage, if omitted, a memory storage model is created (class StreamWithContextIter, class IteratorWithContextIter, class IteratorIter, class StreamIter): Internal classes to create python iterators out of redland stream/iterators. (class Stream): New method context_iter that returns a python iterator returning (stream, context node) tuple on each iteration. (class HashStorage): Simple class to simplify creating hashed storage. (class MemoryStorage): Simple class to simplify creating in-memory storage. (class Parser): Name is now optional, defaults to raptor and RDF/XML. (class Parser): Methods parse_as_stream, parse_into_model will autoconvert uri arguments that are strings into redland URIs. * python/test/test.py: s/if not thing/if thing is None/ * raptor/rdfdump.c: Added -e/--ignore-errors otherwise rapper stops parsing after 1st error using raptor_parse_abort. 2003-06-14 Dave Beckett * raptor/raptor_rss.c (raptor_rss_insert_identifiers): Back to being legal C99. * raptor/libraptor.3: Fix changes for 0.9.11 * raptor/libraptor.3: Updated for stuff since 0.9.10 * raptor/raptor_rss.c (raptor_rss_insert_identifiers): Init identifier after item * raptor/rdfdump.c, raptor/configure.ac: Tweak RSS Tag Soup parser words 2003-06-10 Dave Beckett * raptor/raptor_parse.c (raptor_xml_start_element_handler): Emit an error for namespace declarations that are RDF namespace URI plus some chars. Emit a warning if a namespace is declared same as RDF one but 1 char short. * raptor/tests/Makefile.am: Added bad-12, warn-02 * raptor/tests/bad-12.rdf, raptor/tests/warn-02.out, raptor/tests/warn-02.rdf: Check for bad rdf namespace URI declarations and warn if last char of RDF namespace URI omitted 2003-06-09 Dave Beckett * librdf/rdf_uri.c (librdf_new_uri_from_filename): Removed unused vars. 2003-06-08 Dave Beckett * raptor/configure.ac: Fix the check for RSS parser requirements and report it more verbosely. * raptor/configure.ac: RSS parser only if libxml/reader.h present (for now). * raptor/configure.ac: libcurl reporting * raptor/raptor_parse.c (raptor_xml_parse_chunk_): Use sax2->first_read * raptor/raptor_parse.c (raptor_xml_parse_start,raptor_xml_parse_chunk_): Don't use first_read on newer libxml2. 2003-06-06 Dave Beckett * raptor/raptor_internal.h: raptor_sax2_s: Add first_read #if LIBXML_VERSION < 20425 * raptor/raptor_rss.c (raptor_rss_insert_identifiers): Fix GCC-ism, declare variable at start of block. * raptor/raptor_parse.c (raptor_xml_parse_init): Move declaration of expat xp to start of function. * raptor/examples/raptor_abort.c, raptor/examples/grapper.c, raptor/strcasecmp.c, raptor/rdfdump.c, raptor/raptor_xml.c, raptor/raptor_www_test.c, raptor/raptor_www_libxml.c, raptor/raptor_www_libwww.c, raptor/raptor_www_curl.c, raptor/raptor_www.c, raptor/raptor_win32.c, raptor/raptor_utf8.c, raptor/raptor_uri.c, raptor/raptor_set.c, raptor/raptor_sax2.c, raptor/raptor_rss.c, raptor/raptor_qname.c, raptor/raptor_parse.c, raptor/raptor_namespace.c, raptor/raptor_locator.c, raptor/raptor_libxml.c, raptor/raptor_general.c, raptor/ntriples_parse.c, raptor/configure.ac: Merged patch from Jose Kahan to switch to use raptor_config.h (helps people compiling from source with multiple config.h) 2003-06-05 Dave Beckett * raptor/examples/grapper.c (fs_ok_button_callback): Use raptor_uri_filename_to_uri_string to make the file URI. (main): If the argument is a filename, make a URI string out of it via raptor_uri_filename_to_uri_string and use it instead of assuming it is a URI. 2003-06-04 Dave Beckett * Redland.i, librdf/rdf_uri.h: Added librdf_new_uri_from_filename * librdf/rdf_uri.c (librdf_new_uri_from_filename): Added using raptor_uri_filename_to_uri_string * autogen.sh: Report min SWIG version 2003-05-26 Dave Beckett * demos/rss-show.pl: words 2003-05-12 Dave Beckett * raptor/raptor_xml.c (raptor_xml_escape_string): Changed API - does not require a parser arg. * raptor/raptor_internal.h: Moved SAX2 parts and prototypes here. * raptor/raptor_general.c: Use RAPTOR_PARSER_RSS to wrap init of RSS parser * raptor/raptor.h: Changed prototype of raptor_xml_escape_string - does not require a parser arg. * raptor/raptor_parse.c: Split raptor_element/raptor_rdf_xml_parser into SAX2/RDF bits. Lots of function and structure renaming. * raptor/configure.ac: Define RAPTOR_PARSER_RSS only when libxml is around * raptor/raptor_sax2.c: SAX2 API * raptor/Makefile.am: Added raptor_sax2.c 2003-04-30 Dave Beckett * perl/lib/RDF/Redland/Model.pm: Same as before but with right package names (find_statements): Return copies of shared statements (sources,arcs,targets): Return copies of shared nodes * perl/lib/RDF/Redland/Model.pm (find_statements): Return copies of shared statemetns (sources,arcs,targets): Return copies of shared nodes 2003-04-29 Dave Beckett * librdf/rdf_statement.c (librdf_statement_to_string): Handle buffer size counting when parts are null * librdf/rdf_heuristics.c (librdf_heuristic_gen_name): Check loop doesn't go before start. * librdf/rdf_utf8.c (librdf_utf8_print): check length first before looking in what might be a byte beyond the length 2003-04-28 Dave Beckett * raptor/raptor_rss.c (raptor_rss_emit): Use raptor_free_identifier * raptor/raptor_rss.c (raptor_rss_emit): Properly init the raptor_identifier items 2003-04-27 Dave Beckett * raptor/raptor_rss.c, raptor/raptor_parse.c, raptor/ntriples_parse.c: Use raptor_parser_register_factory with label param. * raptor/raptor.h: Added raptor_get_name, raptor_get_label * raptor/raptor_general.c: Added parser label to factory (raptor_parser_register_factory): Add label param, copy it. (raptor_get_name): Added, return name of parser. (raptor_get_label): Added, return label of parser. * raptor/raptor_internal.h: Added parser label to factory * raptor/examples/grapper.c: Remove some g_printfs Remove use of display qnames - not impl. * raptor/raptor_general.c (raptor_statement_part_as_counted_string): Init len for literals with the literal len included * raptor/examples/grapper.c: Don't use triples_list for now. (grapper_model_set_syntax): Fix output. (grapper_model_statements_handler): Remove newlines from literals. * raptor/raptor_general.c (raptor_statement_part_as_counted_string): Init len for literals. 2003-04-25 Dave Beckett * raptor/raptor_set.c: fix doccumment 2003-04-23 Dave Beckett * raptor/examples/grapper.c: Replace N-Triples / RDF/XML with dropdown menu and add RSS tag soup. 2003-04-22 Dave Beckett * librdf/redland.spec.in: Updated for Redhat 9 and RPM 4 * python/RDF.py: Added blank node is_blank() method example (Node.__set_attr): Fix set_type (Node.get_blank_identiifer, Node.set_blank_identiifer): Added * python/RDF.py: some perlisms in the docs/comments * python/RDF.py: this one file is now also under BSD without advertising/MIT license 2003-04-19 Dave Beckett * raptor/rdfdump.c: Added -i/--input for rdfxml, ntriples, rss * raptor/raptor_internal.h: More RAPTOR_DEBUG macros * raptor/raptor_general.c: (raptor_init) Added rss parser via raptor_init_parser_rss when HAVE_LIBXML_XMLREADER_H * raptor/Makefile.am: Added raptor_rss.c * raptor/raptor_rss.c: Raptor RSS parser 2003-04-17 Dave Beckett * raptor/configure.ac: Bumped version to 0.9.11 * raptor/libraptor.3: Added raptor_set_parser_strict Added raptor_www_no_www_library_init_finish * raptor/raptor.spec.in: Require curl Added raptor-config, raptor.pc * raptor/tests/Makefile.am: Move rdf:bagID tests to list of tests with warnings for now (while testing in lax mode) 2003-04-15 Dave Beckett * docs/fix-pod-xhtml: and a newline * docs/fix-pod-xhtml: added xml decl * docs/fix-pod-xhtml: More fixing * docs/fix-pod-xhtml: New style POD to html cleanup * librdf/rdf_storage_hashes.c (librdf_storage_hashes_register): Allow NULL name * perl/lib/RDF/Redland/Storage.pm: add rest of storage options to docs * raptor/rdfdump.c (print_statements): Print the program name not "rdfdump" hardcoded. * librdf/rdf_node.h, librdf/rdf_node.c: Added librdf_node_get_literal_value_as_counted_string 2003-04-14 Dave Beckett * raptor/configure.ac: Check for libxml/xmlreader.h 2003-04-13 Dave Beckett * raptor/examples/grapper.c: Added about box, triples count. Free some allocated memory. Rest seems lost in gtk. * raptor/examples/Makefile.am: Add AM_CFLAGS, LIBS for debugging * raptor/raptor_parse.c (raptor_xml_start_element_handler): Don't copy an empty attributes array. * raptor/configure.ac: Added raptor.pc * raptor/Makefile.am: Added raptor.pc pkgconfig file installing to $(libdir)/pkgconfig * raptor/raptor.pc.in: pkgconfig for raptor 2003-04-12 Dave Beckett * librdf/Makefile.am: Added rdf_model_storage.h * librdf/rdf_model_storage.h: RDF Model Storage Interface definition 2003-04-10 Dave Beckett * librdf/rdf_model.c: Split model/storage into model/model factory/model storage factory just like hashes, storage classes. (librdf_init_model): Call librdf_init_model_storage (librdf_finish_model): Call librdf_delete_model_factories (librdf_delete_model_factories, librdf_model_register_factory, librdf_get_model_factory): Added, after rdf_storage.c similar names. (librdf_new_model_with_options): Use storage factory create method. (librdf_new_model_from_model): Use clone method. (librdf_free_model): Use destroy method. The remaining methods that depend on storage now use factory methods. Some methods have slight edits to use the model method not the storage one when it doesn't matter, or when no factory method is present, and it is emulated at the model level. * librdf/Makefile.am: Added rdf_model_storage.c * librdf/rdf_model.h: Added internal librdf_model_factory struct with factory methods Added librdf_model_register_factory, librdf_get_model_factory * librdf/librdf.h: added librdf_model_factory * librdf/rdf_model_storage.c: RDF model over a storage 2003-04-05 Dave Beckett * raptor/raptor.h: void arg * raptor/examples/raptor_abort.c: Zap curl cleanup. * raptor/rdfdump.c: Added -c flag to getopts - oops, missed in last release. Added -m/--mode flag to set strict/lax. Check the values and die with usage. Check the legal values of -o/--output and die with usage. Zap curl cleanup. * raptor/raptor_www.c (raptor_www_no_www_library_init_finish): To control global WWW library init/finish * raptor/raptor_parse.c: Make bagID optional - removed from language and gives errors (strict), allowed with warnings (lax). lax/strict controlled by feature_allow_bagID * raptor/raptor_internal.h: Added feature_allow_bagID * raptor/raptor_general.c: Several more docucomments for functions. (raptor_new_parser): Use raptor_set_parser_strict (raptor_set_feature): Added RAPTOR_FEATURE_ALLOW_BAGID (raptor_set_parser_strict): Added to set strict/lax mode flags. * raptor/raptor.h: Added RAPTOR_FEATURE_ALLOW_BAGID Added raptor_set_parser_strict Added raptor_www_no_www_library_init_finish 2003-04-03 Dave Beckett * raptor/tests/Makefile.am: Added warn-01 * raptor/tests/warn-01.out, raptor/tests/warn-01.rdf: Check warning on non-prefixed property elements * raptor/raptor_parse.c, raptor/tests/Makefile.am (raptor_xml_start_element_handler): Error recovery - try to hide that a bad element was found from a parent element, it thinks the element is empty. See tests/warn-00.rdf * raptor/tests/warn-00.out, raptor/tests/warn-00.rdf: Check warnings 2003-04-02 Dave Beckett * Makefile.am, raptor/configure.ac, raptor/Makefile.am, configure.ac: debian dir elsewhere 2003-04-01 Dave Beckett * librdf/rdf_parser_raptor.c (librdf_parser_raptor_new_statement_handler): (re)add storing in a model direct. (librdf_parser_raptor_parse_uri_as_stream_write_bytes_handler): Added to support librdf_parser_raptor_parse_uri_as_stream via raptor_www (librdf_parser_raptor_parse_uri_as_stream): Added. Calls librdf_parser_raptor_parse_file_as_stream if that's possible. (librdf_parser_raptor_parse_uri_into_model): Added, doing all of librdf_parser_raptor_parse_file_into_model. (librdf_parser_raptor_constructor): Register new functionality. * raptor/raptor_uri.c (raptor_uri_uri_string_to_filename): Use raptor_strcasecmp (raptor_uri_is_file_uri): Use raptor_strncasecmp * librdf/rdf_parser_libwww.c: No libwww parser 2003-03-31 Dave Beckett * raptor/fix-groff-xhtml: more cols * raptor/fix-groff-xhtml: More fixes * raptor/Makefile.am: Added libraptor.html, fix-groff-xhtml * raptor/fix-groff-xhtml: Fix groff output HTML * raptor/libraptor.3: deleted repeated URI METHODS * raptor/libraptor.3: Updated for 0.9.6->present 2003-03-30 Dave Beckett * raptor/examples/grapper.c: Use N-triples output style. Pass in URL command line argument * raptor/Makefile.am: Added raptor_xml.c * raptor/raptor_parse.c (raptor_xml_start_element_handler): do XML attribute value normalization for libxml2. Cannot be done properly since the type of the attribute is lost. expat gets it right. (raptor_xml_parse_init): Cast for expat XML_SetExternalEntityRefHandler * raptor/raptor_xml.c: Updated for C14N text/attribute node encoding rules. Don't de-UTF8 at the same time. * raptor/tests/ex-49.out: > in attribute appears raw * raptor/raptor_general.c: (main) Moved raptor_validate_xml_ID, raptor_xml_escape_string test code to raptor_xml.c * raptor/raptor_xml.c: Raptor XML routines * raptor/raptor_general.c: Moved raptor_validate_xml_ID, raptor_xml_escape_string to raptor_xml.c * raptor/tests/Makefile.am: Added ex-49 * raptor/tests/ex-49.out, raptor/tests/ex-49.rdf: Checking escaping in parseType Literal values with XML attributes * raptor/raptor_parse.c (raptor_format_element): Pass in parser for UTF-8 error handling. Use raptor_xml_escape_string for attribute values but only malloc/free if lengths changed. (raptor_xml_end_element_handler): Update to new raptor_xml_escape_string API and only malloc/free it if lengths changed. * raptor/raptor_parse.c (raptor_xml_cdata_handler): Use updated raptor_xml_escape_string API * raptor/raptor.h: Added raptor_statement_part_as_counted_string, raptor_statement_part_as_string Changed raptor_xml_escape_string API * raptor/raptor_general.c (raptor_statement_part_as_counted_string, raptor_statement_part_as_string): Added, making N-triples style output from parts of raptor_statement. (raptor_xml_escape_string): Change API to take an existing buffer/calculate length (main): Update for raptor_xml_escape_string. * raptor/examples/Makefile.am: Also clean grapper binary 2003-03-29 Dave Beckett * raptor/examples/grapper.c: Added N-Triples parsing * raptor/examples/Makefile.am: Don't build grapper usually * raptor/examples/grapper.c: Raptor GTK GUI example code * python/RDF.py, librdf/rdf_parser_raptor.c, librdf/rdf_parser.h, librdf/rdf_parser.c, librdf/Makefile.am, docs/redland.pod, docs/api.sgml.in, docs/Makefile.am, demos/parser-tests.pl, demos/demo.pl, configure.ac: Removed repat * librdf/rdf_uri.c (librdf_free_uri): Move world defn inside ifdef * raptor/examples/Makefile.am: Added grapper.c * raptor/examples/Makefile.am: more deps * raptor/raptor_internal.h: Added raptor_print_statement_part_as_ntriples prototype * raptor/raptor_general.c: raptor_print_ntriples_string moved to raptor_general.c (raptor_print_statement_part_as_ntriples): Added, internal. (raptor_print_statement_as_ntriples): Now uses above. * Makefile.am: Removed repat * raptor/ntriples_parse.c: raptor_print_ntriples_string moved to raptor_general.c * librdf/Makefile.am: die recursive make 2003-03-28 Dave Beckett * raptor/examples/Makefile.am: another deps attempt * raptor/examples/Makefile.am: typo * raptor/examples/Makefile.am: Use LDADD and hunt for @REDLAND_LIBS@ Added $(top_builddir)/../librdf/librdf.la * raptor/configure.ac: Hunt for librdf.la in abs dir * raptor/rapper.1: added -c/--count * raptor/examples/Makefile.am: Fixes to make cross-dir building work. * raptor/configure.ac, raptor/Makefile.am: Added examples dir * raptor/raptor_general.c (raptor_parse_uri_with_connection): Added. (raptor_parse_abort): Added. * raptor/raptor.h: Added raptor_parse_uri_with_connection. Added raptor_parse_abort. * raptor/examples/raptor_abort.c, raptor/examples/Makefile.am: examples * raptor/rdfdump.c: Call curl_global_cleanup if using curl to free it's resources. * raptor/raptor_www.c (raptor_www_init,raptor_www_finish): Don't init/cleanup curl, we can't guarantee doing this at most once if a handle is passed in. * raptor/raptor_www_curl.c (raptor_www_curl_free): Tidy * raptor/raptor_www_curl.c (raptor_www_curl_init,raptor_www_curl_free): Use/mark field curl_init_here to note when to cleanup a handle - don't destroy one that was provided. * raptor/raptor_internal.h: for curl, record when curl_easy_init was done in raptor * raptor/raptor_general.c (raptor_init): Call raptor_www_init (raptor_finsh): Call raptor_www_finish (raptor_parse_uri): Delete www object on failure. * raptor/configure.ac: Bumped version to 0.9.10 * librdf/rdf_model.c: unused var * librdf/rdf_stream.c, librdf/rdf_statement.c, librdf/rdf_serializer.c, librdf/rdf_query.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_iterator.c, librdf/rdf_hash.c, librdf/rdf_concepts.c: Changes to test code after initial locking for threads support. (main) Testcode - use librdf_world_init_mutex * librdf/rdf_uri.c: Initial locking for threads from Seth Ladd (librdf_new_uri): Lock/unlock world for new URI. (librdf_free_uri): Lock/unlock world for destroying URI. (main) Testcode - use librdf_world_init_mutex * librdf/rdf_init.h: Initial locking for threads from Seth Ladd Added mutex to world. Added prototype for internal librdf_world_init_mutex * librdf/rdf_init.c: Initial locking for threads from Seth Ladd (librdf_free_world): Delete mutex on shutdown. (librdf_world_init_mutex): Added (internal) to be used by tests rather than initing all of redland. (librdf_world_open): Create mutex on startup. * configure.ac: Initial locking for threads from Seth Ladd Added --with-threads for POSIX threads 2003-03-27 Dave Beckett * demos/demo.pl: utf-8 output * librdf/rdf_storage_hashes.c (librdf_storage_hashes_grow_buffer): Fix return code sense. (librdf_storage_hashes_add_remove_statement): Use calculate length for key/value len, not buffer sizes. (librdf_storage_hashes_context_add_statement): Return failure if contexts aren't enabled and this is called. * librdf/rdf_model.c: (main) Test code - check get_sources, get_targets, get_arcs * python/RDF.py (Stream.context): Use self.stream 2003-03-26 Dave Beckett * raptor/raptor_set.c: Only use raptor_set_stats_print with RAPTOR_DEBUG * raptor/raptor_general.c: Some comment tidying. (raptor_start_parse): Docucomment. Copy the uri into the parser structure (base_uri, locator uri), don't just keep the pointer. (raptor_free_parser): Free the base URI in the structure, if present. * raptor/raptor_parse.c (raptor_xml_parse_start): Remove uri arg. Fail if no base URI is given - stored in the parser object * raptor/ntriples_parse.c (raptor_ntriples_parse_start): Remove uri arg. * raptor/raptor_internal.h: raptor_parser_factory start method: Remove (base) uri arg, it's in the object data. * raptor/raptor_www.c: Use RAPTOR_FREE,MALLOC,CALLOC (raptor_www_free): Free the www object. Doh. * raptor/libraptor.3: raptor_parse_chunk: Takes unsigned char buffer. * raptor/libraptor.3: raptor_start_parse: Note NULL base URI ok for ntriples * raptor/libraptor.3: Typo: raptor_start_parse not raptor_parse_start * raptor/raptor_general.c (raptor_xml_escape_string): Make it work with 10ffff again * raptor/raptor_parse.c (raptor_xml_cdata_handler): Cast around raptor_xml_escape_string * raptor/raptor_general.c (raptor_xml_escape_string): Null terminate new string * raptor/raptor_www_libxml.c, raptor/raptor_www.c: Use RAPTOR_WWW_BUFFER_SIZE for I/O buffers * raptor/raptor_internal.h: Define RAPTOR_WWW_BUFFER_SIZE for I/O buffers * raptor/rdfdump.c: Declare raptor_stats_print when RAPTOR_DEBUG * raptor/raptor_general.c: (raptor_stats_print) C99 * librdf/rdf_model.c (librdf_model_add_typed_literal_statement): Don't free object here, librdf_model_add does it as part of freeing the statement. 2003-03-25 Dave Beckett * demos/rss-show.pl, demos/parser-tests.pl, demos/ntriples.pl, demos/demo.pl: Updated to 0.9.12 API 2003-03-24 Dave Beckett * raptor/rdfdump.c: Call raptor_stats_print with RAPTOR_DEBUG * raptor/raptor_set.c: Record set hits/misses with RAPTOR_DEBUG (raptor_set_stats_print): Defined with RAPTOR_DEBUG * raptor/raptor_internal.h: Move raptor_xml_parser typedef here (still internal). raptor_xml_parser_stats_print, raptor_set_stats_print: Defined with RAPTOR_DEBUG * raptor/raptor_parse.c (raptor_xml_parser_stats_print): Defined with RAPTOR_DEBUG * raptor/raptor_general.c (raptor_stats_print): Defined with RAPTOR_DEBUG * raptor/raptor_parse.c (raptor_xml_cdata_handler): Use raptor_xml_escape_string when content type is an XML literal * raptor/raptor_general.c (raptor_xml_escape_string): Now takes and returns lengths Fix assumption of '\0' terminated strings. (main): Update for counted strings * raptor/raptor.h: raptor_xml_escape_string now takes and returns lengths * raptor/raptor.h: Added raptor_xml_escape_string * raptor/Makefile.am: Added raptor_general_test * raptor/raptor_general.c (raptor_xml_escape_string): Added, XML-escapes UTF-8 strings. (main): Added set of tests for raptor_xml_escape_string 2003-03-23 Dave Beckett * raptor/tests/ex-48.out, raptor/tests/ex-48.rdf: ex-48 parse type literal with entity encoding * raptor/tests/Makefile.am: Added ex-48 * raptor/raptor_www_libxml.c (raptor_www_libxml_fetch): Make this work again * raptor/raptor_parse.c (raptor_record_ID): Dealloc item after adding * librdf/rdf_parser_raptor.c: raptor_free now raptor_free_parser (librdf_raptor_uri_as_counted_string): Added Use it to register the raptor_uri * raptor/raptor_parse.c: typo * raptor/raptor_parse.c: Remove raptor_id_list implementation for ID checking to use raptor_set. (raptor_xml_parse_init): Init raptor_set for ids. (raptor_xml_parse_terminate): Use raptor_free_set. (raptor_record_ID): Use raptor_set_add to check for unique "ID base-URI" (raptor_free_ID_list): Gone * raptor/raptor_uri.c (raptor_default_uri_as_counted_string, (raptor_uri_as_counted_string): Added and used in default factory. * raptor/raptor.h: Added raptor_uri_as_counted_string. * raptor/raptor_internal.h: Added raptor_set and raptor_new_set constructor, raptor_free_set destructor and raptor_set_add only method * raptor/Makefile.am: Added raptor_set.c, raptor_set_test * raptor/raptor_set.c: Raptor sets for ID checking 2003-03-20 Dave Beckett * demos/rss-show.pl: sort feeds case insensitively * demos/rss-show.pl: Added Annotate module * librdf/rdf_storage_hashes.c: Add key/value buffers to hash context and share/grown them as needed to prevent a lot of unncessary malloc/frees. (librdf_storage_hashes_terminate): Delete shared key/value buffers. (librdf_storage_hashes_grow_buffer): Added to grow them when needed. (librdf_storage_hashes_add_remove_statement): Use librdf_storage_hashes_grow_buffer and shared key/value buffers. * librdf/rdf_hash_memory.c (librdf_hash_memory_expand_size): Revert bucket rehashing code to the older, simpler, slightly slower (2x work) since changed version failed. * librdf/rdf_hash_memory.c: Switched to same hash algorithm as perl, inlined it. (librdf_hash_memory_expand_size): When expanding, only move the nodes that need it, don't move everything. 2003-03-19 Dave Beckett * examples/example4.c: Free nodes on failure of get_source/target/arc * raptor/tests/Makefile.am: Added OWL namespace document / rdf schema owl-schema.rdf, owl-schema.out * raptor/raptor_www.c: No ghttp, init w3c libwww * librdf/rdf_statement.c (librdf_statement_to_string): Init statement_string_len to 0 * librdf/rdf_hash_memory.c (librdf_hash_memory_expand_size): Quick hack to make hash grow. Needs a proper fix. * librdf/rdf_statement.c (librdf_statement_to_string): Use librdf_node_to_counted_string to save on strlen calls. * librdf/rdf_node.c (librdf_node_to_string): Now uses librdf_node_to_counted_string. (librdf_node_to_counted_string): Added, returns already known length. Uses librdf_uri_to_counted_string to save on strlen calls. (librdf_node_encode): Use librdf_uri_as_counted_string to save on strlen calls. * librdf/rdf_node.h: Added librdf_node_to_counted_string * librdf/rdf_uri.c (librdf_uri_as_counted_string, librdf_uri_to_counted_string): Added returning the already stored/calculated length of the string. * librdf/rdf_uri.h: Added librdf_uri_as_counted_string, librdf_uri_to_counted_string * raptor/tests/owl-schema.out, raptor/tests/owl-schema.rdf: OWL namespace schema * raptor/raptor_www_libwww.c: add fatal does-not-work error * raptor/configure.ac, raptor/raptor_internal.h, raptor/raptor_www_ghttp.c: Delete libghttp 2003-03-18 Dave Beckett * raptor/raptor_www_libwww.c: Raptor WWW with W3C libwww * raptor/rdfdump.c: Added -c/--count option to just count triples, don't print anything. * raptor/raptor_www_test.c: Use raptor_www_init/finish * raptor/raptor_www_libxml.c, raptor/raptor_www_ghttp.c: Handle www->failed and aborting transfer. * raptor/raptor_www_curl.c: Handle www->failed and aborting transfer. (raptor_www_curl_init): Use passed-in connection if available. * raptor/raptor_www.c (raptor_www_init): Added, for once-only init. (raptor_www_finish): Added, for once-only tidy. (raptor_www_new): Now uses new constructor (raptor_www_new_with_connection): Added, allows re-use of existing www library connection - just curl at present. (raptor_www_get_connection): Added, returns current libwww library connection. (raptor_www_abort): Added to stop a www transaction. (raptor_www_file_fetch): Tidying of errors; handle abort. (raptor_www_fetch): Uses raptor_www_file_fetch for all files. * raptor/raptor_internal.h: Added W3C libwww prototypes. * raptor/raptor_parse.c: Throughout all SAX event handlers - if rdf_parser->failed set, return immediately, doing no work. * raptor/raptor_general.c (raptor_parse_uri_write_bytes): Use raptor_www_abort if parsing fails. (raptor_parse_uri): Return error status. Pass on is_end empty chunk. (raptor_parser_abort): Added, setting failed flag. (raptor_print_statement_detailed): Typo * raptor/raptor.h: Added raptor_www_abort * raptor/raptor.h: Add raptor_www_init, raptor_www_finish. Add raptor_www_new_with_connection Add raptor_www_get_connection * raptor/configure.ac: Added w3c libwww configuring 2003-03-16 Dave Beckett * raptor/rdfdump.c: Use raptor_parse_uri * raptor/raptor_general.c (raptor_parse_uri_write_bytes): Added, to support: (raptor_parse_uri): Added, using raptor_www to get and deal with all the data in one go. * raptor/raptor.h: raptor_parse_uri takes optional base_uri * raptor/raptor_www_test.c: Use URI from context. Take www arg on handlers Use raptor_uri * raptor/raptor_www_libxml.c, raptor/raptor_www_ghttp.c, raptor/raptor_www_curl.c: Use URI from context. Take www arg on handlers * raptor/raptor_www.c (raptor_www_set_userdata): Gone (raptor_www_free): Free request uri (raptor_www_set_write_bytes_handler, raptor_www_set_content_type_handler): Added (raptor_www_file_fetch): pass www to write_bytes (raptor_www_fetch): Don't pass URI on. * raptor/raptor_internal.h: Store raptor_uri of request Use new declared write_bytes, content_type handlers *fetch methods don't take URI string * raptor/raptor.h: Declare handlers for raptor www write bytes, content type raptor_www_fetch now takes a raptor_uri * raptor/raptor_parse.c: Fix broken-fix for broken-expat UTF8 BOM crash. tokens_count is on the rdf_xml_parser not rdf_parser * raptor/configure.ac: tweak * raptor/configure.ac: tidy libcurl version * raptor/raptor_internal.h, raptor/configure.ac: No more gnome-xml/libxml.h * raptor/configure.ac: Min libxml2 now 2.4.0 * raptor/configure.ac: Don't look for xml-config * raptor/raptor_general.c (raptor_parse_file): Tidy up if raptor_start_parse fails * raptor/raptor_general.c: Removed raptor_start_parse_file - merged into raptor_parse_file * raptor/raptor_www.c (raptor_www_file_fetch): Used for RAPTOR_WWW_NONE Report file open errors, correct file read eof handling. (raptor_www_fetch) Use only raptor_www_file_fetch for RAPTOR_WWW_NONE * raptor/raptor_general.c (raptor_start_parse_file): Improve file open error message * raptor/configure.ac: Added --with-www=none option and RAPTOR_WWW_NONE to indicate it 2003-03-15 Dave Beckett * raptor/raptor_www.c (raptor_www_error): Use RAPTOR_FREE * raptor/raptor_www_ghttp.c (raptor_www_ghttp_fetch): call raptor_www_error * raptor/raptor_www_test.c: Call raptor_uri_init * raptor/raptor_www_curl.c (raptor_www_curl_fetch): call raptor_www_error * raptor/raptor_internal.h: Use raptor_message_handler again * raptor/raptor.h: Use raptor_message_handler again in raptor_www_set_error_handler, raptor_www_error * raptor/raptor_www.c (raptor_www_free): Tidy locator URI (raptor_www_set_error_handler, raptor_www_error): Use raptor_message_handler again. (raptor_www_error): Use raptor_locator in output, error handler. (raptor_www_fetch): Store the URI string of request in the locator * raptor/raptor.h: Declare raptor_www_message_handler (no locator) * raptor/raptor_general.c: raptor_vsnprintf now internally visible. * raptor/raptor_internal.h: Use different error handler, no parser context. raptor_vsnprintf now internally visible. Added raptor_www_error prototype * raptor/raptor_www.c: Only enable raptor_www_file_fetch with libxml, libghttp (raptor_www_set_error_handler): Use different error handler, no parser context. * raptor/configure.ac, raptor/Makefile.am: Added raptor WWW enabling, configuring * raptor/raptor_internal.h: Added raptor WWW retrieval internal includes, structs, prototypes * raptor/raptor.h: Added raptor WWW retrieval prototypes * raptor/raptor_www.c, raptor/raptor_www_curl.c, raptor/raptor_www_ghttp.c, raptor/raptor_www_libxml.c, raptor/raptor_www_test.c: Raptor WWW retrieval 2003-03-13 Dave Beckett * librdf/rdf_parser_raptor.c (librdf_parser_raptor_parse_file_as_stream): Save copies of source and base URI - don't assume they will be around for the life of a parse. (librdf_parser_raptor_serialise_finished): Free the copied uris. * examples/example4.c: document parse-stream * python/RDF.py (Node.__init__): Add world arg to librdf_new_node_from_blank_identifier 2003-03-09 Dave Beckett * Makefile.am: added demos dir * demos/rss-show.pl, demos/ntriples.pl: absolutize some doc urls * configure.ac, Makefile.am: added demos dir * demos/rss-show.pl, demos/parser-tests.pl, demos/ntriples.pl, demos/demo.pl: point to source code * demos/rss-show.pl, demos/parser-tests.pl, demos/ntriples.pl, demos/demo.pl: add source code * demos/Makefile.am, demos/demo.pl, demos/ntriples.pl, demos/parser-tests.pl, demos/rss-show.pl: Redland CGI demos 2003-03-06 Dave Beckett * perl/serialize.pl (format_element_content,format_attribute): Added to escape &, <, > things etc. 2003-03-05 Dave Beckett * perl/serialize.pl: Whitespace tidying. (emit_literal_element): Added, for doing 1-line literals Fix datatypes. Emit multiple rdf:type properties too. * python/RDF.py: (Node.get_literal_value) Correct datatype URI method call to only operate if there is a datatype URI. (Stream._del_): Work when there is no redland Stream. (Parse.parse_as_stream): Return None if parsing fails, not an empty Stream. * perl/lib/RDF/Redland/Node.pm (literal_datatype): Added, return the URI of the literal datatype or undef if not one. * perl/lib/RDF/Redland/Parser.pm (parse_as_stream): Return undef if parsing fails, don't return a stream * perl/lib/RDF/Redland/Stream.pm (DESTROY): Handle wrapping an empty stream - might happen when a search fails straight away. * librdf/rdf_parser_raptor.c (librdf_parser_raptor_new_statement_handler): Handle XMLLiteral and datatyped literal URIs - pass them on as appropriate statements. * perl/serialize.pl (predicate_split): Fix (emit_empty_element) Pull out some more element building stuff - for now. main - declare an OWL namespace just for testing * perl/serialize.pl: added emit_start_element, emit_end_element now rdf:RDF declares its namespaces * perl/serialize.pl: Make blank node subject and objects work. 2003-03-04 Dave Beckett * raptor/raptor.h: Export raptor_free_parser with RAPTOR_API * raptor/win32_config.h: add trailing #endif * raptor/win32_config.h: s/WIN32_LEAD_AND_MEAN/WIN32_LEAN_AND_MEAN/ * raptor/raptor_parse.c (raptor_xml_comment_handler): Added - nop at present. (raptor_xml_parse_init): For expat, use raptor_xml_comment_handler * raptor/raptor_libxml.c: (raptor_libxml_init) Use raptor_xml_comment_handler * raptor/raptor_internal.h: Add raptor_xml_comment_handler prototype * raptor/configure.ac: Try to make maintainer mode flags match redland's defaults. * Makefile.am: expat sources not included * configure.ac: expat sources not included building against expat / libxml sources no longer supported. * librdf/rdf_model.c (librdf_model_add_typed_literal_statement): Document - nodes become owned by the model. * python/RDF.py: Bogus quotes * java/org/librdf/redland/Model.java: (add) (nodes, typed nodes versions) Copy redland nodes before adding. * perl/t/test2.t: Added test of Model method add_typed_literal_statement Added test of Serializer method serialize_model_to_file * python/test/test.py: Added test of model.add_typed_literal_statement * python/RDF.py (Model.add_typed_literal_statement): Copy redland nodes before adding. 2003-03-03 Dave Beckett * perl/Makefile.am: make clean targets run when perl isn't enabled. * perl/Makefile.PL: Grab version from redland-src-config * perl/Makefile.am: Use $(srcdir)/Makefile.PL * python/Makefile.am: Use $(srcdir)/setup.py * java/Makefile.am: clean-java - don't leap down subdirs to clean stuff too early - confuses autoconf. * configure.ac: More AC_CONFIG_FILES tidying * raptor/configure.ac, raptor/Makefile.am: Fix cflags/cppflags when in redland * librdf/rdf_serializer_raptor.c (librdf_serializer_print_statement_as_ntriple): No need for fprintf. * librdf/rdf_serializer_raptor.c: No need for ntriples.h (librdf_serializer_print_statement_as_ntriple): Handle datatyped literals. * perl/lib/RDF/Redland/Node.pm (new_from_typed_literal): Added, creating a datatyped literal. * perl/lib/RDF/Redland/Model.pm (add, add_typed_literal_statement): Copy the nodes before passing on - more natural for perl. * librdf/Makefile.am: s/AML_CFLAGS/AM_CFLAGS/ Give rdf_uri_test the raptor includes * librdf/rdf_node.c (librdf_node_decode): Correct datatype URI/lang decoded in wrong order. (main): Add de/encode of datatyped node. * librdf/rdf_node.c (librdf_node_encode): Copy datatype URI string not junk from the URI object. (main): Add use of librdf_new_node_from_typed_literal * examples/example4.c: Added add-typed command to use librdf_new_node_from_typed_literal * autogen.sh: Require autoconf 2.53+ * configure.ac: Require autoconf 2.53+ Update AC_OUTPUT to new form * Redland.i: Added librdf_new_node_from_typed_literal * redland-src-config.in: use abs_top_srcdir for all refs to raptor-src-config 2003-03-02 Dave Beckett * raptor/tests/ex-46.out, raptor/tests/ex-46.rdf: make rdf:li and rdf_2 property elements generate different triples 2003-02-27 Dave Beckett * raptor/tests/ex-46.out: fix * raptor/tests/Makefile.am: Added ex-47 * raptor/tests/ex-47.out, raptor/tests/ex-47.rdf: Exercise all rdfs vocab * raptor/tests/Makefile.am: Added ex-46 * raptor/tests/ex-46.out, raptor/tests/ex-46.rdf: Exercise all rdf vocab 2003-02-26 Dave Beckett * python/RDF.py (RDF.set_message_handler): Added. Make a class method (message_handler): Moved out of RDF.World class. (RDF.World): Use RDF.message_handler (RDF.Stream): Docs. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_node_iterator_create): Handle node being NULL, for example when dealing with a predicates index p2so. 2003-02-25 Dave Beckett * repat/Makefile.am: Make only librepat.la * Makefile.am: Add man pages to dist 2003-02-24 Dave Beckett * raptor/win32/raptor.plg, raptor/win32/Makefile.am: deleted raptor.plg * raptor/win32/raptor.dsp, raptor/win32/README: Updated win32 config - from contributed patches 2003-02-23 Dave Beckett * raptor/raptor_uri.c: Correct :'s turning into |'s in win32 file URIs 2003-02-20 Dave Beckett * autogen.sh: export autotools to configure * autogen.sh: Tidying * raptor/autogen.sh, autogen.sh: run libtoolize in each configure.ac dir * Makefile.am: acconfig.h not needed * utils/Makefile.am, repat/Makefile.am, librdf/Makefile.am, expat/xmltok/Makefile.am, expat/xmlparse/Makefile.am, examples/Makefile.am: Updates for automake 1.5-1.7 * autogen.sh: Update to use automake 1.6, autoconf 2.52 min * configure.ac: configure.ac replacing configure.in * acconfig.h, configure.in: Replace configure.in acconfig.h with configure.ac * raptor/win32_config.h: win32 has C99 compatible vsnprintf called _vsnprintf * raptor/configure.ac: Check for vsnprintf and check for C99 compatible return value. * raptor/raptor_general.c (raptor_vsnprintf): Added for handling compatibilty with vsnprintf that doesn't match C99. 2003-02-19 Dave Beckett * raptor/tests/Makefile.am: Use $(ECHO) which may be different from sh's echo * raptor/Makefile.am: Changing, moved raptor_getopt.h to rapper_SOURCES after automake manual recommendation. * raptor/Makefile.am: Put raptor_getopt.h in noinst_HEADERS * raptor/Makefile.am: No need for EXTRA_libraptor_la_SOURCES * raptor/Makefile.am: Use LTLIBOBJS for extra libraptor objs * raptor/raptor.h: again * raptor/raptor.h: don't do deprecated on broken OSX gcc * raptor/raptor_getopt.h, raptor/getopt.c: No need for prefix * raptor/getopt.c: Duh - use raptor getopt header * raptor/Makefile.am: Use RAPPER_EXTRA_OBJS to optionally add getopt to rapper only * raptor/configure.ac: Add getopt object to RAPPER_EXTRA_OBJS * raptor/rdfdump.c: Add raptor_getopt.h for local version * raptor/raptor_getopt.h: Define rest of getopt externs * raptor/getopt.c: More prefixes * raptor/raptor_getopt.h, raptor/getopt.c: Public domain getopt * raptor/configure.ac: Check for getopt and add getopt.o if it missing. * raptor/autogen.sh: try asking the progs for their version - slower, but right * raptor/autogen.sh: tidying * raptor/acconfig.h: acconfig.h obsoleted * raptor/Makefile.am: Use AM_CPPFLAGS * raptor/autogen.sh: Min versions are bumpled - 2.52 for autoconf, 1.6 for automake Now hunts for newest, shinyest autoconf and automake/aclocal and uses them whatever is available. 2003-02-18 Dave Beckett * raptor/configure.ac: autoconf 2.5x configure.ac * raptor/configure.in: Replaced with autoconf 2.5x configure.ac 2003-02-15 Dave Beckett * raptor/raptor.h: Move stuff around, consolidate deprecated bits * raptor/ntriples_parse.c, raptor/rdfdump.c: No need for ntriples.h * raptor/raptor.h: Moved all ntriples.h defines here. Defined RAPTOR_DEPRECATED (with gcc 3.1+) and used on old api calls. * raptor/ntriples.h: Moved all definitions to raptor.h - this file is now deprecated. * python/RDF.py: typo 2003-02-14 Dave Beckett * debian/changelog, debian/libredland0-dev.install: added redland-config.1 * debian/libredland0-dev.manpages: Added redland-config.1 * debian/Makefile.am: Added libredland0-dev.manpages * Makefile.am: added redland-config.1 * redland-config.1: redland-config manual page * redland-config.in, raptor/raptor-config.in: No exec-prefix * raptor/raptor-config.1: Manual page for raptor-config * raptor/Makefile.am: Added raptor-config.1 * debian/Makefile.am: missed a backslash * debian/redland1.files, debian/manpage.1.ex, debian/shlibs.local.ex: Not used * debian/rules.in, debian/copyright, debian/control, debian/changelog, debian/README.Debian, debian/Makefile.am: Updated for debian packaging 0.9.12 * debian/libredland0-dev.docs, debian/libredland0-dev.files, debian/libredland0-dev.install, debian/libredland0.files, debian/libredland0.install, debian/libredland0.manpages: Redland debian packaging * debian/doc-base.package, debian/docs, debian/dirs: Not used * raptor/rapper.1: EXAMPLE 2003-02-13 Dave Beckett * Redland.i: Added librdf_node_get_literal_value_datatype_uri * raptor/tests/Makefile.am: $name=>$$name * configure.in: Bumped version to 0.9.13 * Snapshotted redland_0_9_12 for 0.9.12 release * raptor/raptor.spec.in: release is 1 2003-02-12 Dave Beckett * librdf/redland.spec.in, Makefile.am: No RELEASE, TODO * raptor/Makefile.am: Restore LICENSE.txt * raptor/Makefile.am: No LICENSE.txt in dist * java/org/librdf/redland/Makefile.am: Add Hash.ajva to dist * librdf/redland.spec.in: Move man pages around. All headers now in devel. * librdf/redland.spec.in: Don't put raptor man files in this rpm * librdf/redland.spec.in: Require raptor 0.9.8 * raptor/raptor_uri.c (main): Use lstat, reading a selection of dirs to try harder to test relative file URIs. * raptor/configure.in: check for sys/stat.h (for raptor_uri_test main) * raptor/tests/Makefile.am: There is no portable test == operator * raptor/raptor_parse.c (raptor_xml_start_element_handler): Updated call to raptor_namespaces_start_namespace to use error_handler, error_data parameters * raptor/raptor_general.c (raptor_start_parse): Updated call to raptor_namespaces_init to use error_handler, error_data parameters * raptor/raptor_internal.h: Updated raptor_namespaces_init, raptor_namespaces_start_namespace, raptor_namespace_new with error_handler, error_data parameters * raptor/raptor_namespace.c: (raptor_namespaces_init, raptor_namespaces_start_namespace, raptor_namespace_new) Add error handler and data parameters and use to explain how xmlns:foo="" isn't allowed * utils/Makefile.am: Add update-api-0912.pl to dist 2003-02-11 Dave Beckett * raptor/raptor_parse.c: multiple objects of a property element (statement) is an error * raptor/tests/Makefile.am: Report warnings when they occur. Print the warning text * raptor/tests/bad-11.rdf: now xml * raptor/tests/Makefile.am: typo - restult * raptor/tests/bad-11.rdf: Check xmlns with no namespace name (URI) fails * raptor/tests/Makefile.am: Added bad-11 * raptor/raptor_libxml.c (raptor_libxml_update_document_locator): Handle empty parser context. * raptor/tests/Makefile.am: ex-46 now bad-10 * raptor/tests/bad-10.rdf, raptor/tests/ex-46.rdf, raptor/tests/ex-46.out: Now bad-10 * raptor/raptor_parse.c (raptor_xml_parse_chunk_): Make an empty rdf/xml bytestream an illegal doc (like expat) and return an error. * raptor/raptor_libxml.c (raptor_libxml_update_document_locator): Don't use loc if it is NULL such as errors before start of XML document. * raptor/raptor_libxml.c: Check for xmlSAXHandler externalSubset field, not present in old libxml v1. Whether raptor works after this is unlikely and untested. * raptor/configure.in: Add old libxml V1 warning and suggestion * raptor/acconfig.h: Added RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET * raptor/configure.in: Check for xmlSAXHandler externalSubset field 2003-02-10 Dave Beckett * raptor/raptor_locator.c (raptor_print_locator): Only print non-negative line numbers * raptor/raptor_parse.c (raptor_xml_parse_chunk_): For libxml, handle first chunk being empty, when the XML parser context, xc, is attempted to be initialiased * raptor/tests/Makefile.am: Added ex-46 (Empty file should give 0 triples) * raptor/tests/ex-46.out, raptor/tests/ex-46.rdf: Empty file should give 0 triples 2003-01-31 Dave Beckett * Makefile.am: utils now has buildable stuff * librdf/rdf_hash_bdb.c: Make BDB open failures return librdf_error even when debug set. * configure.in, Makefile.am: scripts now utils * utils/Makefile.am, utils/db_upgrade.c, utils/update-api-0912.pl: scripts now utils, added redland-db-upgrade util * librdf/redland.spec.in: Added redland-db-upgrade 2003-01-30 Dave Beckett * configure.in: don't destroy passed in LDFLAGS value 2003-01-29 Dave Beckett * tcl/Makefile.am: Fix so it doesn't compile over the input file. Bad $? / $< again * java/org/librdf/redland/Model.java: (add/remove) Added contexts version of methods (context_remove): Added, remove all statements with given context. * java/Makefile.am: $< wrong for build jars, add all files * python/RDF.py: (Model) Added contexts methods, as optional args to add/remove statements methods. New method: context_remove_statements * perl/lib/RDF/Redland/Model.pm (add_statement, add_statements, remove_statement): Add optional context arg. (remove_context_statements): Added. * configure.in: Make xml parser prefer libxml, to match what raptor does. Expat will be added if required/available anyway, such as for repat. If expat is needed for raptor, ensure it uses system expat first if available rather than always use source version. * php/php.ini: added safe_mode = Off, says Ron * autogen.sh: require swig 1.3.14 min * docs/api.sgml.in, docs/fix-python-xhtml, docs/fix-pod-xhtml: dates * configure.in, Makefile.am: Renamed aux dir to scripts * scripts/Makefile.am, scripts/update-api-0912.pl: Moved from aux dir 2003-01-27 Dave Beckett * tcl/Makefile.am, ruby/Makefile.am, raptor/Makefile.am, python/Makefile.am, perl/Makefile.am, java/Makefile.am, docs/Makefile.am, php/Makefile.am: Remove $? and replace with $< or full dependencies 2003-01-23 Dave Beckett * librdf/rdf_storage_hashes.c (librdf_storage_hashes_register): Return correct failure sense. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_terminate): Protect from empty arrays * librdf/rdf_storage_hashes.c (librdf_storage_hashes_register): Don't leak full_name memory when librdf_new_hash fails. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_init_common): On failure to create lower level hashes, don't free stuff here, librdf_storage_hashes_terminate will do it, eventually. 2003-01-21 Dave Beckett * raptor/ntriples_parse.c: Fix macro IS_ASCII_DIGIT which refused to allow '0'. 2003-01-13 Dave Beckett * raptor/rdfdump.1: rdfdump.1 renamed to rapper.1 * librdf/redland.spec.in: Updated for redland 0.9.12 (requires installed raptor to build) * raptor/raptor.spec.in, raptor/tests/Makefile.am, raptor/Makefile.am, raptor/INSTALL.html: rdfdump now rapper * raptor/rapper.1: rdfdump.1 renamed to rapper.1 2003-01-07 Dave Beckett * librdf/rdf_parser_sirpac.c: No longer needed 2003-01-03 Dave Beckett * examples/Makefile.am: tweak clean * librdf/rdf_model.c: (librdf_model_get_source,librdf_model_get_target,librdf_model_get_arc): Return a new copy of the shared node, restoring the declared API behaviour. * Makefile.am: Added RELEASE.html RELEASE * librdf/rdf_parser_repat.c (librdf_parser_repat_parse_file_into_model): Tidy up internal stream after add_statements no longer frees it. * librdf/rdf_parser_raptor.c (librdf_parser_raptor_parse_file_into_model): Tidy up internal stream after add_statements no longer frees it. 2003-01-02 Dave Beckett * examples/example4.c: Revert temporary context dbd-store ifdef * librdf/rdf_node.c (librdf_new_node_from_typed_literal): Docucomment fix 2003-01-01 Dave Beckett * docs/api.sgml.in: Added general query, serializer doc parts * aux/update-api-0912.pl: Add model add_statement changes checks * aux/update-api-0912.pl: Docs * aux/update-api-0912.pl: Try to catch stream/iterator api changes too redland-1.0.17/LICENSE.txt0000644000175000017500000000646712130720506011766 00000000000000 Redland librdf RDF API Library - License This package is Free Software available under any one of the specified licenses below. All the licenses below are alternatives and if you select one license, that one alone applies. 1. The GNU Lesser General Public License (LGPL) Version 2.1 or any newer version See [1]http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html or [2]COPYING.LIB for the full license text. __________________________________________________________________ Copyright (C) 2000-2012 [3]David Beckett Copyright (C) 2000-2005 [4]University of Bristol. All Rights Reserved. This package is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License Version 2.1 as published by the Free Software Foundation or any newer version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License Version 2.1 for more details. You should have received a copy of the GNU Lesser General Public License Version 2.1 along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA __________________________________________________________________ 2. GNU General Public License (GPL) V2 or any newer version Under Term 3 of the LGPL Version 2.1, you may choose to license the entire package under the GPL. If that option is chosen, then this package is licensed under the terms of the GPL Version 2 or alternatively, any newer version of the GPL. See [5]COPYING for the full GPL license text. 3. The Apache License V2.0 or any newer version See [6]http://www.apache.org/licenses/LICENSE-2.0 or [7]LICENSE-2.0.txt for the full ASL 2.0 license text. Copyright (C) 2000-2012 [8]David Beckett Copyright (C) 2000-2005 [9]University of Bristol. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: [10]http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. The [11]NOTICE file contains the notices that must be applied according to section 4(d) of the Apache License, Version 2.0. __________________________________________________________________ Copyright (C) 2000-2013 [12]Dave Beckett Copyright (C) 2000-2005 [13]University of Bristol References 1. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html 2. COPYING.LIB 3. http://www.dajobe.org/ 4. http://www.bristol.ac.uk/ 5. COPYING 6. http://www.apache.org/licenses/LICENSE-2.0 7. LICENSE-2.0.txt 8. http://www.dajobe.org/ 9. http://www.bristol.ac.uk/ 10. http://www.apache.org/licenses/LICENSE-2.0 11. NOTICE 12. http://www.dajobe.org/ 13. http://www.bristol.ac.uk/ redland-1.0.17/HACKING.md0000644000175000017500000002137311627263572011541 00000000000000Hacking Redland librdf ====================== 2011-08-23 [Dave Beckett](http://www.dajobe.org/) Commits ------- Should be: * Licensed with the same license as Redland librdf. * Patches in GNU `diff -u` unifed context format preferred. * Include tests if they add new features. Code Style ---------- Do not make large commits that only change code style unless you have previously had this agreed or it is in code under major refactoring where a diff is not a large concern. There is always `diff -b` when large code style (whitespace) changes are made. ### Indenting 2 spaces. No tabs. All code must be wrapped to 80 chars as far as is possible. Function definitions or calls should indent the parameters to the left `(`. Redland libraries use very long function names following the naming convention which can make linebreaking very hard. In this case, indent function parameters on new lines 4 spaces after the function name like this: var = function_name_with_very_long_name_that_is_hard_to_wrap_args( argument1_with_very_long_name_or_expression, argument2, ..) Use no space between a keyword followed by braces argument. For example, use `if(cond)` rather than `if (cond)` (ditto for while, do etc.) and `functionname(...)` rather than `functionname (...)` in both definition and calls of functions. There is nothing wrong with introducing a variable to break up a very long function call argument. ### Expressions Put spaces around operators in expressions, assignments, tests, conditions GOOD: * `a += 2 * x` * `if(a < 2)` BAD: * `a+=2*x` * `if(a<2)` When comparing to `0` or a `NULL` pointer, use the idiomatic form that has no comparison. GOOD: * `if(!ptr)` * `if(!index)` BAD: * `if(ptr == NULL)` * `if(index == 0)` * `if(0 == index)` When comparing a variable to a constant, the code has currently used `if(var == constant)` rather than the slightly safer, and easier to compile check, `if(constant == var)`. ### Blocks In general add {}s around blocks in if else chains when one of the blocks has more than 1 line of code. Try not to mix, but the final case if it is one line, can be braceless. if(var == 1) { ... multiple lines of code ... } else { ... multiple lines of code ... } or if(var == 1) ... one line of code else ... one line of code or if(var == 1) { ... multiple lines of code ... } else if(var == 2) { ... multiple lines of code and / or more if conditions ... } else ... one line of code ... ### Switches If using if else chains on an enumeration, don't do that, use a `switch()` which GCC can use to find missing cases when they get added. switch(enum_var) { case ENUM_1: ... code ... break; case ENUM_2: ... code ... break; case ENUM_DONT_CARE: default: ... code ... break; } There should ALWAYS be a `default:` case. ### Functions Declare functions in this format: returntype functionname(type1 param1, type2 param2, ...) { type3 var1; type4 var2; ... first line of code ... tidy: ... cleanup code... return value; } Notes: * Declare one variable per line * Declare all variables at the top of the function (K&R C style) * You may declare variables in inner `{}` blocks. The form `if(1) { ... var decls ...; more code }` may be used but a code rewrite is preferable. * If a label is used it *MUST* be used only for cleanup, and going forward in the code to the end of the function. * Multiple `return` are allowed but for obvious error or result returns. Do not twist the code to enable a single return. * `goto` may be used for resource cleanup and result return where control flow only goes forward. ### C Pre-Processor (CPP) Macros Always define macros for internal constants and name the macros with the library prefix followed by a descriptive name in ALL CAPS such as: #define LIBRDF_FOOBAR_BUFFER_SIZE 1234 When evaluating macro symbols that may be undefined, always check the symbol is defined first. Like this: #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 42 ... do complex debugging stuff ... #endif This is not needed for macros that are known to be defined, such as those checked by `configure` e.g. #if RAPTOR_VERSION_DECIMAL > 20100 ... do stuff that requires a raptor2 version 2.1.0 or newer ... #endif since the above would be checked implicitly by `configure` using `pkg-config(1)` to validate Raptor 2 is present before getting to the code that tries to evaluate the value from `raptor2.h`. The debug macros that are used for printing out values when debugging is enabled do not need protection by `#if` or `#ifdef` and should be used like this: LIBRDF_DEBUG1("Something wonderful happened\n"); LIBRDF_DEBUG2("Something %s happened\n", happening); ### Memory allocation Allocating a zeroed out block of memory or a set of objects (calloc) var = LIBRDF_CALLOC(type, count, size) Prefering when `count` = 1 this form: var = LIBRDF_CALLOC(type, 1, sizeof(*var)) Allocating a block of memory: var = LIBRDF_MALLOC(type, size) Freeing memory: LIBRDF_FREE(type, var) The reasoning here is to make allocs mostly fit into 1 line without too much boilerplate and duplication of types. The macro names vary by library such as `RAPTOR_CALLOC` and `RASQAL_CALLOC` for Raptor and Rasqal respectively. ### Documentation Public functions, types, enumerations and defines must have autodocs - the structured comment block before the definition. This is read by `gtk-doc(1)` to generate reference API documentation. Format: /** * functionname: * @param1: Description of first parameter * @param2: Description of second parameter (or NULL) * ... more params ... * * Short Description * * Long Description. * * Return value: return value */ returntype functionname(...) { ... body ... } The _Short Description_ have several commmon forms: * Constructor - creates a FOO object * Destructor - destroys a FOO object * Short description of regular function or method. * INTERNAL - short description The latter is used for autodocs for internal functions either as internal documentation or for APIs that may one day be public. The _(or NULL)_ phrase is used for pointer parameters that may be omitted. This is usually tested by the function as an assertion. In some functions there are more complex conditions on which optional parameters are allowed, these are described in the _Long Description_. The long description may also include a deprecation statement such as: * @Deprecated: Use new_function() with foo = BAR This must be indented to the left and will be used by the `gtk-doc(1)` document generator to provide a link to the replacement function and usage. Commit Messages --------------- The general standard for Redland libraries using GIT is a merge of the GIT standards format and GNU ChangeLog First line summaries what commit does - this goes into the GIT short log (function1, function2): what changed (function3): Added, deprecating function4() (function4): Deleted, replaced by function3() struct foo gains field ... struct bar loses field ... enum blah gains new value BLAH_2 which ... Use `name()` in the description for references to functions. Make sure to do (function1, function2) NOT (function1,function2) as it makes things easier to format later. Sometimes it's short enough (good) that it all can be done in the first line, pretty much only if it's a small change to a single function. If the change is trivial or a typo and (this is *IMPORTANT*) NOT a commit to code files, then the commit can start with '#'. This may get filtered out of commit log message notifications and ChangeLog. e.g. `#spelling` or `#ws` the latter is whitespace changes for some reason The changes will semi-automatically be added to the ChangeLog files following the GNU style, indented and word wrapped, and adding the list of files at the start. So the commit message above ends up looking something like: 2010-08-23 User Name * dir/file1.c, dir2/file2.c: First line summaries what commit does - this goes into the GIT short log (function1, function2): what changed (function3): Added, deprecating function4() (function4): Deleted, replaced by function3() struct foo gains field ... struct bar loses field ... enum blah gains new value BLAH_2 which ... redland-1.0.17/ChangeLog.20000644000175000017500000010350211171007723012044 000000000000002001-12-09 Dave Beckett * perl/Makefile.am, redland.spec.in, configure.in: Fix failure to build the Perl RPMs by passing Perl's installsitearch and man3dir configuration paths down to the SPEC file 2001-12-09 Dave Beckett * perl/Makefile.am, redland.spec.in, configure.in: Fix failure to build the Perl RPMs by passing Perl's installsitearch and man3dir configuration paths down to the SPEC file 2001-11-30 Dave Beckett * configure.in: Fixed bug: link -lexpat before other libs (inc libwww) 2001-11-26 Dave Beckett * docs/python.html: Added notes on running python example.py Updated other python links * python/Makefile.am: Added example.py to release * python/test/test.py: Update to new python interface style. * python/example.py: Update to new python interface style. Added parsing test Carefully delete objects in right order before world is destroyed * python/RDF.py: Changed to more Python-ic interface using **kw args - thanks to Mark Nottingham (class uri, constructor): Use new args properly. (class parser): Mime type takes an optional string not object. (class parser, method feature): update comment, still needs fixing to allow python URI objects 2001-10-29 Dave Beckett * rdf_storage.c (librdf_delete_storage_factories): Zero storages after freeing all. 2001-10-13 Dave Beckett * java/redland-fragment.java: Correct comment * expat/xmltok/Makefile.am, expat/xmlparse/Makefile.am: Updated to use libtool properly * NEWS.html: Added statement grouping 2001-09-25 Dave Beckett * Makefile.am: More updates for libtool Just use librdf.la (no librdf.a) Change all librdf_a to librdf_la Move example programs to automake style Fix test programs to work with libtool $(LINK) and -static librdf.la * configure.in: More updates for libtool: - remove SOBJS parts (not needed) - change from .o to .lo throughout * rdf_storage_hashes.c: Add statment grouping in 4th hash "groups". Bumped fixed number of hashes up one. (librdf_storage_hashes_group_add_statement, librdf_storage_hashes_group_remove_statement, librdf_storage_hashes_group_serialise, librdf_storage_hashes_group_serialise_end_of_stream, librdf_storage_hashes_group_serialise_next_statement, librdf_storage_hashes_group_serialise_finished): Added to implement groups in same style as for librdf_storage_list 2001-09-17 Dave Beckett * Makefile.am: Added ex1.rdf, ex2.rdf to dist - for tests * ex1.rdf, ex2.rdf: Example RDF/XML for tests * rdf_storage_list.c: Added statement groups support: (librdf_storage_list_open): Create memory hash for groups (librdf_storage_list_close): Remove memory hash for groups (librdf_storage_list_group_add_statement): Added (librdf_storage_list_group_remove_statement): Added (librdf_storage_list_group_serialise_end_of_stream): Added (librdf_storage_list_group_serialise_next_statement): Added (librdf_storage_list_group_serialise_finished): Added Added factory method registrations. * rdf_model.h: Added prototypes for librdf_model_add_statements_group and librdf_model_remove_statements_group * rdf_model.c (librdf_model_print): Moved most code to librdf_stream_print (librdf_model_add_statements_group): Added (librdf_model_remove_statements_group): Added Added tests for add/remove statements group * rdf_storage.h: Added factory methods and prototypes for librdf_storage_group_add_statement, librdf_storage_group_remove_statement, librdf_storage_group_serialise * rdf_storage.c (librdf_storage_has_arc_out): Use of wrong storage method. (librdf_storage_group_add_statement,librdf_storage_group_remove_statement,librdf_storage_group_serialise): Added, calling storage method * rdf_list.h: librdf_list_remove prototype amended to return data pointer * rdf_hash_memory.c (librdf_free_hash_memory_node): Always free node (librdf_hash_memory_delete_key_value): Free value as well as vnode * rdf_list.c (librdf_list_remove): Return data pointer of stored item. * rdf_parser_sirpac.c, rdf_parser_repat.c, rdf_parser_raptor.c, rdf_parser_libwww.c: Handle NULL base_uri as written in API spec. * rdf_stream.c (librdf_stream_print): Added more docu-comment Send result to fh, not always stdout 2001-09-16 Dave Beckett * rdf_stream.h: Added prototype for librdf_stream_print * rdf_stream.c (librdf_stream_print): Added * configure.in, Makefile.am: Added libtool versioning directed from configure.in 2001-09-14 Dave Beckett * repat/Makefile.am, expat/xmltok/Makefile.am, expat/xmlparse/Makefile.am, redland.spec.in, configure.in, Makefile.am: Build librdf as shared library as well as static one 2001-09-07 Dave Beckett * rdf_hash.h: Prototype for librdf_hash_values_count added Hash factory method values_count added * rdf_hash.c (librdf_hash_values_count): Added Use it in test code * rdf_hash_bdb.c (librdf_hash_bdb_values_count): Added, does not seem possible to implement with BDB btrees/hashes without a large performance penalty. * rdf_hash_gdbm.c (librdf_hash_gdbm_values_count): Added, does not seem possible to do in GBDM. * rdf_hash_memory.c (librdf_hash_memory_values_count): Added and implemented. * rdf_storage_hashes.c (librdf_storage_hashes_size): Call librdf_hash_values_count on one hash to count size. * rdf_storage.c (librdf_storage_size): Amended return value 2001-09-05 Dave Beckett * INSTALL.html: Added more details of where Redland builds. Updated BDB versions. Moved linking warning * configure.in: Added new java directory * FAQS.html: Updated - now have Java API. * docs/java.html: Updated to new class names. 2001-09-03 Dave Beckett * java/org/librdf/redland/World.java, java/org/librdf/redland/URI.java, java/org/librdf/redland/Stream.java, java/org/librdf/redland/Storage.java, java/org/librdf/redland/Statement.java, java/org/librdf/redland/Parser.java, java/org/librdf/redland/Node.java, java/org/librdf/redland/Model.java, java/org/librdf/redland/Iterator.java: Use finalize() with correct signature. * java/test2.java: Redland Java test code using classes * java/org/librdf/redland/Storage.java (Storage): Store new Redland object, don't loose it * java/org/librdf/redland/World.java, java/org/librdf/redland/URI.java, java/org/librdf/redland/Stream.java, java/org/librdf/redland/Storage.java, java/org/librdf/redland/Statement.java, java/org/librdf/redland/Parser.java, java/org/librdf/redland/Node.java, java/org/librdf/redland/Model.java, java/org/librdf/redland/Iterator.java, java/org/librdf/redland/Hash.java: Styled API with Java BiCapitalisation for classes, lowerThenUpper for methods Made Iterator and Stream implement java.lang.Iterator API. * java/test1.java, java/example.java: Updated for new java package, classes * java/Makefile.am: Added java files, class files Added classpath, use env to run java, javac Added test2.java and run it with test-java target. * java/test1.java, java/skeleton.java: Updates for Java package and class name changes * java/Makefile.am: Changed class path to org.librdf.redland and C interface class to core * java/org/librdf/redland/Makefile.am: Changed class names to Java style * java/org/librdf/Makefile.am: Makefile.am * java/org/librdf/redland/Model.java: Remove model_ from some method names 2001-08-28 Dave Beckett * NEWS.html: No space after

! * configure.in: Bump version to 0.9.11 * Snapshotted redland_0_9_10 for 0.9.10 release * configure.in: Tidy PROGS macros Added SWIG test and version test, in order to check if can build java. * perl/Makefile.am: Tidy perl macros * perl/lib/RDF/Model.pm (serialise): Use RDF::Stream constructor correctly 2001-08-22 Dave Beckett * README.html: Added java API pointers. * INSTALL.html: Added java API pointer. * docs/java.html: Updated for new Java Interface * java/test.java, java/Makefile.am: Updated for first version of SWIG Java interface * java/org/librdf/world.java, java/org/librdf/uri.java, java/org/librdf/stream.java, java/org/librdf/storage.java, java/org/librdf/statement.java, java/org/librdf/parser.java, java/org/librdf/node.java, java/org/librdf/model.java, java/org/librdf/iterator.java, java/org/librdf/hash.java, java/org/librdf/Makefile.am, java/org/Makefile.am, java/skeleton.java, java/redland-fragment.java, java/example.java: First version of SWIG Java interface * java/redland-java.c, java/NativeName.java: Not used * java/README: Notes not needed anymore * configure.in: Updated Berkeley/Sleepcat DB testing for V3, V2, V1 in order. Added java dirs * Makefile.am: Added java dir 2001-08-15 Dave Beckett * rdf_parser_raptor.c: Remove checks for obsolete XML_NAME types. Update to use identifier_type enum names Add some more error checking if types do not match. * rdf_concepts.h: Added prototype for librdf_get_concept_by_name * rdf_concepts.c (librdf_get_concept_by_name): Added 2001-08-14 Dave Beckett * python/test/test.py: Use memory storage not bdb - BDB may not be available or required. * perl/lib/RDF/RSS.pm: Use raptor as parser. (format_literal): Fix quoting. Allow description content through raw, including any HTML formattign. 2001-07-23 Dave Beckett * python/RDF.py: (RDF.parser constructor) Allow pass through of null mime_type (None in python) * perl/lib/RDF/Parser.pm: (RDF::Parser::new) Allow pass through of null mime_type (undef in perl) * docs/Makefile.am: Moved SGML docs to MAINTAINERCLEAN again * rdf_parser_raptor.c: Fixes after changes for daml:collection and ntriples support, with anonymous nodes that have non-URIs. (librdf_parser_raptor_make_node_from_anon): Added to support above. * INSTALL.html: Updated BDB notes - tested with 3.2.9 also 2001-07-17 Dave Beckett * rdf_parser.c: Add raptor to list of parser to test. Init URI module and dependent modules that are needed by parsers that use URIs for identification (raptor ntriples is only one so far) * configure.in: Updated for raptor ntriples parser * docs/api.sgml.in: Added world class - from rdf_init.c 2001-07-16 Dave Beckett * rdf_parser_raptor.c: Updated ntriples URI * rdf_parser_raptor.c: Added raptor ntriples parser called "ntriples" * debian/README.Debian: Added apt config that might work someday. * debian/scanpackages.override: guess again 2001-07-12 Dave Beckett * docs/Makefile.am: Raptor now rapier * debian/control: Updated Standards-Version to 3.5.5 * debian/README.Debian: Updated after more experience. * debian/Makefile.am: Debian package stuff * debian/doc-base.package: Install documents in /usr/share/doc/redland/html 2001-07-11 Dave Beckett * debian/scanpackages.override: override file for dpkg-scanpackages 2001-07-10 Dave Beckett * Makefile.am: tinkered with HTML to text rule * configure.in: Removed u16, u64, unsigned short, unsigned long long - not used * rdf_types.h: Removed u16, u64 - not used 2001-07-09 Dave Beckett * perl/lib/RDF/Statement.pm (new_from_nodes): Added documentation about copying nodes. * rdf_parser_raptor.c: Now called raptor 2001-07-04 Dave Beckett * java/UK/ac/bristol/ilrt/redland/Hash.java, java/UK/ac/bristol/ilrt/redland/Iterator.java, java/UK/ac/bristol/ilrt/redland/Model.java, java/UK/ac/bristol/ilrt/redland/Node.java, java/UK/ac/bristol/ilrt/redland/Parser.java, java/UK/ac/bristol/ilrt/redland/redland.java, java/UK/ac/bristol/ilrt/redland/Statement.java, java/UK/ac/bristol/ilrt/redland/Storage.java, java/UK/ac/bristol/ilrt/redland/Stream.java, java/UK/ac/bristol/ilrt/redland/URI.java, java/Makefile.am, java/NativeName.java, java/README, java/redland-java.c, java/test.java: Imported java test code 2001-07-03 Dave Beckett * rdf_statement.c, rdf_node.c: Make object comparisons fail if any pointer is NULL * NEWS.html: Local parser now Raptor 2001-07-02 Dave Beckett * rdf_parser.h, rdf_parser.c, configure.in, acconfig.h, Makefile.am: Rapier now raptor 2001-06-07 Dave Beckett * NEWS.html: Post release, added link to rapier changes * configure.in: Bump version to 0.9.10 * Snapshotted redland_0_9_9 for 0.9.9 release * NEWS.html: Updated for 0.9.9 release * debian/README.Debian: Updated after success! * debian/rules.in: Nasty horrible perl inline Makefile-editing finally makes debian package building work. 2001-06-06 Dave Beckett * debian/README.Debian: Updated with what might work someday... * configure.in, Makefile.am: Pick a local tar and set TAR variable * configure.in, Makefile.am: Changed rapier macro names to work better with automake/autoconf. 2001-06-04 Dave Beckett * configure.in: Yet more xml parser checking fixes. * acconfig.h: Added HAVE_XML_SetNamespaceDeclHandler 2001-06-01 Dave Beckett * configure.in, Makefile.am: More fixes to make rapier sources optional. * Makefile.am, configure.in: Add rapier sources to dist only when present * configure.in: Set have_rapier=0 by default * configure.in: Text compile and run of programs linked with -lexpat. Emit summary of things that are configured - xml, rdf parsers, digests, BDB 2001-05-30 Dave Beckett * README.html: Updated sources to include snapshots and web-cvs * redland.spec.in: Use make install-perl to install the perl modules * perl/example.pl: Close down storage explicitly to ensure data is flushed ok. 2001-05-16 Dave Beckett * Makefile.am: Added rpm/redland.spec to dist 2001-05-11 Dave Beckett * rdf_parser_sirpac.c: Quote URI field with quotes '%s' in format string for invoking SiRPAC java 2001-05-10 Dave Beckett * perl/lib/RDF/Storage.pm: Document more storage options. 2001-05-09 Dave Beckett * redland.spec.in: For perl rpm, use auto/Redland not auto/redland * redland.spec.in: Added missing RDF.pm to perl RPM * README.html: HTML 2001-05-08 Dave Beckett * perl/lib/RDF/Node.pm (type): Added an example. * perl/lib/RDF/Storage.pm: Docs: added more details and examples 2001-04-27 Dave Beckett * docs/java.html: Java interface 2001-04-26 Dave Beckett * README.html: Moved java stuff to java placeholder page. * docs/Makefile.am: Added java.html placeholder 2001-04-19 Dave Beckett * debian/rules.in: More fixes from attempts to get this working on a pure debian system * perl/test.pl: Added testing of iterators and individual warnings, more coverage of usual code calls. * perl/lib/RDF/Model.pm (sources,arcs): Fix prototypes. * perl/lib/RDF/Iterator.pm (end): Call Redland::librdf_iterator_end not old function 2001-04-12 Dave Beckett * perl/test.pl: Use in memory hashes for testing, not everyone has a working BDB * perl/Makefile.PL: Get version numbers from ../configure.in using changed style. 2001-04-03 Dave Beckett * rdf_parser_sirpac.c (librdf_parser_sirpac_get_next_statement): Don't reuse 'p' and change value inside inner loop. 2001-03-29 Dave Beckett * rdf_uri.h, rdf_uri.c, rdf_stream.c, rdf_storage.c, rdf_statement.c, rdf_parser_sirpac.c, rdf_parser_repat.c, rdf_parser_rapier.c, rdf_parser_libwww.c, rdf_parser.c, rdf_node.h, rdf_node.c, rdf_model.c, rdf_list.c, rdf_iterator.c, rdf_init.c, rdf_hash_memory.c, rdf_hash_gdbm.c, rdf_hash_bdb.c, rdf_hash.c, rdf_digest_openssl.c, rdf_digest_md5.c, rdf_digest.c, rdf_concepts.c: Comment documentation updated with librdf_world arguments * debian/rules.in, debian/shlibs.local.ex, debian/control, debian/copyright, debian/dirs, debian/doc-base.package, debian/docs, debian/manpage.1.ex, debian/changelog, debian/README.Debian: Debian package support * Makefile.am: Added debian dir * configure.in: More XML parser config games - note which system library name found Substitute $expat_libs Added debian makefile, rules * perl/lib/RDF/RSS.pm: (as_xhtml) format_literal - Changed encoding to UTF-8 and don't quote >255 char entities. 2001-03-27 Dave Beckett * python/RDF.py, perl/lib/RDF/Model.pm, perl/lib/RDF/Iterator.pm: Updated Perl/Python interfaces for changed iterator interface, added deprecated warnings. * rdf_stream.c, rdf_storage_list.c, rdf_storage_hashes.c, rdf_storage.c, example4.c, example1.c, Redland.i, rdf_model.c, rdf_list.c, rdf_hash_memory.c, rdf_hash_gdbm.c, rdf_hash_bdb.c, rdf_hash.c: Changed iterator test-end from have_elements to is_end and inverted logic. Replaced iterator_have_elements with !iterator_end * rdf_iterator.h: Changed iterator test-end from have_elements to is_end and inverted logic. Renamed librdf_iterator_set_map to librdf_iterator_add_map Added librdf_iterator_map_remove_duplicate_nodes * rdf_iterator.c: Changed iterator test-end from have_elements to is_end and inverted logic. Added list of mapping functions for each iterator, not just one. (librdf_iterator_free_iterator_map): Added, helper function for mapping. (librdf_iterator_add_map): Renamed from librdf_iterator_set_map and now uses the list. (librdf_iterator_map_remove_duplicate_nodes): Dummy mapping function, not used yet. * configure.in: Set LIBS and LDFLAGS more carefully to set lib search path in LDFLAGS and -lLIb in LIBS Include stdio.h in tests where NULL is referenced. 2001-03-22 Dave Beckett * rdf_storage.c (librdf_storage_get_arcs_in,librdf_storage_get_arcs_out): Added - pass to factory or implement here using librdf_storage_node_stream_to_node_create. However this isn't good enough since it needs to filter out duplicates but this requires changes to iterator so new FIXME. (librdf_storage_has_arc_in,librdf_storage_has_arc_out): Added - pass to factory or implement here by getting an iterator of answers and checking it isn't empty. * rdf_storage.h: Added prototypes for arc in/out tests, get arc in/out methods * rdf_model.c (librdf_model_get_arcs_in,librdf_model_get_arcs_out): Added - pass to storage (librdf_model_has_arc_in,librdf_model_has_arc_out): Added - pass to storage * rdf_model.h: Added prototypes for arc in/out tests, get arc in/out methods * example4.c: Added check for librdf_model_has_arc_in and librdf_model_has_arc_out * example4.c: Added arcs-in, arcs-out commands 2001-03-21 Dave Beckett * rdf_utf8.c, rdf_uri.c, rdf_statement.c, rdf_node.c, rdf_heuristics.c, rdf_hash.h, rdf_hash.c, example4.c, example1.c: Added some missing casts found by compiling as C++ * librdf.h: Removed RDF_World reference - local to rdf_init.c * rdf_hash.c (librdf_hash_from_string): Fixed ancient bug in \-escaping. Added test code for it. 2001-03-20 Dave Beckett * perl/lib/RDF/RSS.pm (description): Take DC description first if there is one * perl/lib/RDF/RSS.pm: (as_xhtml) Handle undef arg in sub format_literal 2001-02-23 Dave Beckett * rdf_parser_rapier.c (librdf_parser_rapier_new_statement_handler): Ignore statements with bare XML non-namespaced elements (librdf_parser_rapier_parse_common): Turn on scanning (hunt for rdf:RDF) by default. 2001-02-21 Dave Beckett * rdf_parser_rapier.c: Handle receiving XML literal content * rdf_parser_sirpac.c: Fixed negative use of librdf_uri_equals * python/RDF.py: Provide Python interfaces to librdf_node_equals and librdf_uri_equals. * rdf_uri.c (librdf_uri_equals): Fix documentation * rdf_statement.c (librdf_statement_equals): Fix documentation * perl/lib/RDF/URI.pm, perl/lib/RDF/Node.pm: Provide Perl interfaces to librdf_node_equals and librdf_uri_equals. * Redland.i: Export librdf_node_equals and librdf_uri_equals. * rdf_storage_hashes.c, rdf_statement.h, rdf_statement.c, rdf_node.h, rdf_node.c: (librdf_node_init, librdf_statement_init) Added methods for initialisation of statically allocated nodes, statements. * perl/lib/RDF/Statement.pm (new): Add missing reference to world in constructor. 2001-02-20 Dave Beckett * rdf_storage.h, rdf_digest.h, librdf.h: Move some opaque struct defines back to librdf.h * tcl/test.tcl, tcl/example.tcl: Update tcl interface for librdf_world changes * tcl/Makefile.am: Clean generated pkgIndex.tcl * python/RDF.py: Update python interface for librdf_world changes * perl/lib/RDF/URI.pm, perl/lib/RDF/Storage.pm, perl/lib/RDF/Statement.pm, perl/lib/RDF/Parser.pm, perl/lib/RDF/Node.pm, perl/lib/RDF/Model.pm, perl/lib/RDF.pm, perl/test.pl: Update perl interface for librdf_world changes * Redland.i: Update scripting interface for librdf_world changes * example4.c, example3.c, example2.c, example1.c: Update examples for librdf_world changes * Many files: Use librdf_world class for all main constructors (not copy constructors). 2001-02-19 Dave Beckett * docs/README.html: Added link to WWW10 paper pre-print. 2001-02-18 Dave Beckett * Many files: New class librdf_world handling Redland environment * rdf_parser_sirpac.c (librdf_parser_sirpac_get_next_statement): Handle multi-line literals. 2001-02-13 Dave Beckett * perl/rss-dump.pl: Updated out-of-date RSS 1.0 URIs * perl/Makefile.am: Add rss-dump.pl RSS 1.0 example to distribution 2001-02-11 Dave Beckett * perl/lib/RDF/RSS.pm (as_xhtml): Quote time keyword in associate array arg. * perl/Makefile.PL: Strip -L.. -lrdf when line has no end space 2001-02-09 Dave Beckett * docs/tcl.html: Other tools section updated with more corrections and details for XOTcl and related. * docs/tcl.html: Other tools section rewritten to attribute work correctly. 2001-02-07 Dave Beckett * tcl/example.tcl: Remove old meaningless comment * tcl/Makefile.am: clean-local: remove junk * rdf_node.h: Declare librdf_node_get_type_as_string only when debugging. * rdf_node.c (librdf_node_get_type_as_string): Compile only when debugging - meant to be internal. Remove docs from public view. * librdf.h: Use NEED_EXPAT_SOURCE to pick correct header when local expat source is compiled. * configure.in: Use NEED_EXPAT_SOURCE when local expat source is compiled in. * acconfig.h: Added NEED_EXPAT_SOURCE * INSTALL.html: Fix wrong -- options for SiRPACs * docs/README.html: Update Title, Copyright year * FAQS.html: Updated GPL license combinations - even more complex now. * FAQS.html: Added: Redland name #2 Added: Java interface note * docs/tcl.html: Added warning about file: uris * docs/tcl.html: Tidy words. * docs/tcl.html: Added other Tcl APIs and apps section. 2001-02-05 Dave Beckett * README.html: Moved mailing list egroups->yahoo groups * configure.in: Bump version to 0.9.9 * Snapshotted redland_0_9_8 for 0.9.8 release 2001-02-04 Dave Beckett * Many files: Make new boilerplate point to LICENSE not INSTALL - Doh! * LICENSE.html: Specify particular versions of licenses. * Many files: Pruned license boilerplate * python/example.py: Python 2.0 example * redland.spec.in: Set release to SNAP by default Use --enable-release to turn on optimisations only when building RPMs * configure.in: Added --enable-release to NOT remove -O2 from cflags. * docs/README.html, INSTALL.html, README.html: Updates for Tcl interface * docs/tcl.html: Tcl Interface * docs/Makefile.am: Added tcl.html * tcl/test.tcl: Tidied code * tcl/example.tcl: Tcl interface example code * tcl/Makefile.am: Added example.tcl * configure.in: Added Tcl interface * Redland.i: Updates for Tcl interface * tcl/test.tcl, tcl/README, tcl/Makefile.am: Tcl API * python/test/test.py: Updated for changed model add_statment api 2001-01-29 Dave Beckett * perl/lib/RDF.pm (DESTROY): Add () to librdf_destroy_world call to make perl 5.6 happy. 2001-01-26 Dave Beckett * configure.in: Another xml parser check attempt. * configure.in: Need more Xtrick for tests * Makefile.am: Added dist-hook rule to allow symlinks to rapier sources and make dist building continue to work. 2001-01-25 Dave Beckett * rdf_parser_rapier.c: Remove some unused vars. Updated for changed Rapier API and real Redland URI objects. * perl/lib/RDF/RSS.pm (as_xhtml): Don't output : after item link/title if there is no description 2001-01-24 Dave Beckett * Makefile.am: s/rapier_parser.c/rapier_parse.c/ * docs/Makefile.am: Add rapier * rdf_parser_rapier.c: Make list of stored statements static and clean up properly. Handle ordinal predicates simply. * rdf_parser_rapier.c: Final tweaks to get it basically working. * rdf_parser_libwww.c (librdf_parser_libwww_parse_uri_into_model): Fix return code logic. * rdf_utf8.c, rdf_uri.c, rdf_stream.c, rdf_storage_list.c, rdf_storage_hashes.c, rdf_storage.c, rdf_statement.c, rdf_parser_sirpac.c, rdf_parser_repat.c, rdf_parser_libwww.c, rdf_node.c, rdf_model.c, rdf_memory.c, rdf_list.c, rdf_iterator.c, rdf_init.c, rdf_heuristics.c, rdf_hash_memory.c, rdf_hash_gdbm.c, rdf_hash_bdb.c, rdf_hash.c, rdf_files.c, rdf_digest_openssl.c, rdf_digest_md5.c, rdf_digest.c, rdf_concepts.c: Define LIBRDF_INTERNAL outside * rdf_parser.h, rdf_parser.c: Added Rapier * rdf_parser_rapier.c: Rapier RDF parser for Redland * Makefile.am: Add rapier * configure.in: Improve version calculations Find old and new expat headers Add rapier parser Defined LIBRDF_INTERNAL here * acconfig.h: Added Rapier define * rdf_parser_redland.c: Renamde rdf_parser_redland.c to rdf_parser_rapier.c 2001-01-23 Dave Beckett * rdf_concepts.h, rdf_concepts.c: Added rdf:li concept * perl/lib/RDF/RSS.pm: (as_xhtml) Handle dc:subject being a URI 2001-01-22 Dave Beckett * Makefile.am: Add redland.spec.in to dist 2001-01-19 Dave Beckett * perl/lib/RDF/Storage.pm: Removed use Redland Futile attempt to get proper destruction before perl global destruction phase. * perl/lib/RDF/Model.pm: Removed use Redland Improved code comments. Futile attempt to get proper destruction before perl global destruction phase. Removed several node copies no longer needed. * perl/lib/RDF.pm: Moved use Redland * perl/rss-dump.pl: Added configuration to show properties in proposed modules. * rdf_uri.h: Added librdf_new_uri_relative_to_base * rdf_uri.c (librdf_new_uri_relative_to_base): Added - start at attempt to create absolute URI from abs URI+relative URI. Added tests for above. 2001-01-18 Dave Beckett * perl/lib/RDF/Stream.pm: Removed use Redland (new): No need for free statements arg, they are never freed now. (DESTROY): Empty references asap. (next): Update to return a new statement always or undef * perl/lib/RDF/Parser.pm: Removed use Redland (parse_as_stream): Fix new RDF::Stream args * perl/lib/RDF/Statement.pm: Removed use Redland Tweak debugging message. * perl/lib/RDF/URI.pm: Removed use Redland * perl/lib/RDF/RSS.pm (as_xhtml): Fix search form output. Updated various methods to use get_targets/get_target etc. as needed. Remove most RDF::Node copying, no longer needed since above methods return new nodes each time. (RDF::RSS::Node new): Remove RDF::Node copy. * rdf_stream.c (librdf_stream_next): Changed - returns a new statement object each time. (librdf_stream_end): Return not empty when stream contains a stored item. * rdf_storage_hashes.c (librdf_storage_hashes_add_statements): Free statement delivered by stream after using it. * rdf_storage.c: (librdf_storage_find_statements) Improve doc comments * rdf_parser_libwww.c (librdf_parser_libwww_new_triple_handler): Updated to free statement if added to a model. (librdf_parser_libwww_serialise_finished): Free any statements stored on list before finishing. * rdf_model.c: (librdf_model_get_source,librdf_model_get_arc,librdf_model_get_target): Don't free node that is returned, let the application do that now. Amend test code to free statement added to the model. * rdf_concepts.c: Added test code * example4.c: Update code to free statement after add_statement call. * example3.c: Update code to free statement, previously became owned by model after add_statement. 2001-01-17 Dave Beckett * perl/lib/RDF/Node.pm: Zap 'use Redland' Tidy debug message. * perl/lib/RDF/Iterator.pm: Zap 'use Redland' Tidy comments. (DESTROY) Remove creator reference after tidy 2001-01-16 Dave Beckett * perl/rss-dump.pl: Emit literals as latin1, not UTF8 * perl/example.pl: Change wording; add_statement does not take ownership of adding statement * Makefile.am: Added rdf_concepts_test to TESTS * example4.c: Remove extra node declaration. * example4.c: Added test code for source, arc, target model methods 2001-01-08 Dave Beckett * perl/lib/RDF/RSS.pm: Fixed imageAlign doc * perl/lib/RDF/RSS.pm: Tidied as_xhtml documentation. * perl/lib/RDF/RSS.pm (as_xhtml): Moved to METHODS section. * perl/lib/RDF/RSS.pm (as_xhtml): Added. 2001-01-05 Dave Beckett * configure.in: Bump version to 0.9.8 * Snapshotted redland_0_9_7 for 0.9.7 release * redland.spec.in: Mising % typo Make sure default python is used even if other versions are present. * redland.spec.in: Added perl manual pages to docs in perl rpm * Makefile.am: Add rdf_utf8.h to installed includes * NEWS.html: Updated for 0.9.7 release 2001-01-04 Dave Beckett * Redland.i: Added librdf_node_get_literal_value_as_latin1 * rdf_node.h: Added prototype for librdf_node_get_literal_value_as_latin1 * rdf_node.c (librdf_node_get_literal_value_as_latin1): Added to return literal value converted from UTF-8 to ISO Latin-1 (may discard chars) using utf8 utility functions. Added test for above. * rdf_utf8.c (librdf_utf8_to_latin1): Fixed off-by-one in allocating memory, copying. * rdf_utf8.h: Include rdf_types here to define u32 if needed * perl/lib/RDF/URI.pm, perl/lib/RDF/Stream.pm, perl/lib/RDF/Storage.pm, perl/lib/RDF/Statement.pm, perl/lib/RDF/RSS.pm, perl/lib/RDF/Parser.pm, perl/lib/RDF/Node.pm, perl/lib/RDF/Iterator.pm: Added SYNOPSIS pod section. Made module be 'strict' - fix some things for that. * perl/lib/RDF/Model.pm: Added SYNOPSIS pod section. Made module be 'strict' - fix some things for that. Added warning about deprecated get_sources,get_arcs,get_targets * rdf_model.c: Added casts for librdf_node pointers retrived from iterators (for c++) * rdf_files.c: template => file_template (for c++) * configure.in: Make Repat compile with (old) expat in sources as well as old/new expat in system. Remove Repat portability hacks, having updated sources. * repat/rdftest.c, repat/rdfparse.h, repat/rdfdump.c: Portability fixes - includes, _MAX_PATH => PATH_MAX * Makefile.am: Added DIST_SUBDIRS so distribution contains even conditionally-included sub directories Fixed wrong -D defines in MEM debugging macros 2001-01-03 Dave Beckett * docs/perl.html: Added links to perl pod docs * docs/api.sgml.in: Added utf8 class * rdf_stream.h: Protect private method * rdf_iterator.c: Comment improvement * rdf_list.h (librdf_list_clear,librdf_list_foreach): Added prototypes * rdf_list.c (librdf_list_clear): Added to empty the list (librdf_list_foreach): Added to walk the list and apply function to each data node * rdf_storage_list.c (librdf_storage_list_add_statement): Don't dispose of passed in statement. * rdf_storage_hashes.c: Renamed some incredibly long identifiers to be just very long instead. * rdf_model.c (librdf_model_add_statement): No longer owns incoming statement - just too annoying to use in practice. (librdf_model_get_source,librdf_model_get_arc,librdf_model_get_target): Added, returning one arbitrary matching node for given pair of nodes * rdf_model.h: (librdf_model_get_source,librdf_model_get_arc,librdf_model_get_target): Added, returning one arbitrary matching node for given pair of nodes * Redland.i, python/RDF.py: Updated for changes to Model API * perl/lib/RDF/Stream.pm, perl/lib/RDF/Storage.pm, perl/lib/RDF/Statement.pm, perl/lib/RDF/Node.pm: Tidy debugging messages. * perl/lib/RDF/Model.pm: Tidy debugging messages. Remove reference to storage from iterator constructors * perl/lib/RDF.pm: Added RDF::World class (hidden) to do global destruction - librdf_destroy_world * perl/Makefile.am: Pass in MEM_LIBS * perl/Makefile.PL: Simplified use of linking libs; maybe. Pull in memory debugging libs * perl/lib/RDF.pm, perl/lib/RDF/URI.pm, perl/lib/RDF/Stream.pm, perl/lib/RDF/Storage.pm, perl/lib/RDF/Statement.pm, perl/lib/RDF/RSS.pm, perl/lib/RDF/Parser.pm, perl/lib/RDF/Node.pm, perl/lib/RDF/Model.pm, perl/lib/RDF/Iterator.pm: Added plain old documentation (POD) redland-1.0.17/NEWS0000644000175000017500000007165612257575730010665 00000000000000 Redland librdf RDF API Library - News 2013-12-28 Redland Version 1.0.17 Released Configuration and build improvements Fixed Issues: [1]0000529, [2]0000540, [3]0000541, [4]0000542 and [5]0000543 See the [6]1.0.17 Release Notes for the full details of the changes. 2012-12-29 Redland Version 1.0.16 Released librdf_model_contains_statement() and librdf_storage_contains_statement() now return 0 for invalid statements Postgres, MySQL and Hashes storage bug fixes. Multiple other API bug fixes Multiple build fixes to help building on Windows. (Daniel Richard G.) Requires [7]Raptor 2.0.7 or newer Fixed Issues: [8]0000443, [9]0000460, [10]0000497, [11]0000518 and [12]0000519 See the [13]1.0.16 Release Notes for the full details of the changes. 2011-12-03 Redland Version 1.0.15 Released Revert librdf_new_statement_from_statement() to original copy semantics Add functions for cross-library (DLL) memory management Added a few new small APIs. Fixed Issues: [14]0000461, [15]0000468, [16]0000475, [17]0000478, [18]0000483 and [19]0000485 See the [20]1.0.15 Release Notes for the full details of the changes. 2011-07-23 Redland Version 1.0.14 Released Rasqal minimum version is now 0.9.25. Fixed a few URI and node reference leaks after changes for Raptor V2 Added parser class methods to parse from I/O stream sources Added query class static method to get query language descriptions Removed unused and Raptor-duplicate internal code Code cleanup fixing unused variables and values via GCC 4.6, LLVM [21]clang and valgrind. Other minor fixes and improvements Fixed Issues: [22]#0000375, [23]#0000418, [24]#0000432 and [25]#0000447 See the [26]1.0.14 Release Notes for the full details of the changes. 2011-02-01 Redland Version 1.0.13 Released Raptor V1 support was removed; Raptor minimum version is now 2.0.0 Rasqal minimum version is now 0.9.22. Added description-style APIs for parser, serializer and query results formats Serializing to quad formats now works Replaced remaining few abort()s in code paths with error log and failure Several other minor API changes Fixed Issues: [27]#0000325, [28]#0000404 and [29]#0000419 See the [30]1.0.13 Release Notes for the full details of the changes. 2010-10-13 Redland Version 1.0.12 Released Enable librdf.h to be used as the top-level header in addition to redland.h Fix linking issues when building with GNU ld with DT_NEEDED disabled Fixed Issues: [31]#0000329, [32]#0000348 [33]#0000391, [34]#0000392 and [35]#0000393. See the [36]1.0.12 Release Notes for the full details of the changes. 2010-09-25 Redland Version 1.0.11 Released Virtuoso storage backend querying now fully works. Several new convenience APIs were added and others deprecated. Support building with Raptor V2 API if configured with --with-raptor2. Exports more functions to SWIG language bindings. Switched to GIT version control [37]hosted by GitHub. Many other bug fixes and improvements were made. Fixed Issues: [38]#0000124, [39]#0000284, [40]#0000321, [41]#0000322, [42]#0000334, [43]#0000338, [44]#0000341, [45]#0000344, [46]#0000350, [47]#0000363, [48]#0000366, [49]#0000371, [50]#0000380, [51]#0000382 and [52]#0000383 See the [53]1.0.11 Release Notes for the full details of the changes. 2009-12-16 Redland Version 1.0.10 Released Added a [54]Virtuoso storage by Patrick van Kleef Support [55]Rasqal 0.9.17 API Fix compiling against sqlite 3.6.17 or newer Fix modular storage dynamic loading linking problems. Several other bug fixes including addressing issues: [56]Issue #0000302, [57]Issue #0000304, [58]Issue #0000311, [59]Issue #0000315 and [60]Issue #0000317. See the [61]1.0.10 Release Notes for the full details of the changes. 2009-04-12 Redland Version 1.0.9 Released Made the storages (triple stores) API public and the implementations modular - can be compiled externally and dynamically loaded on demand. Removed Raptor and Rasqal from sources - now external build dependencies. Many other bug fixes including addressing issues: [62]#0000272, [63]#0000282 [64]#0000283, [65]#0000285 and [66]#0000286. See the [67]1.0.9 Release Notes for the full details of the changes. 2008-07-05 Redland Version 1.0.8 Released Updated to use [68]Rasqal 0.9.16 (from 0.9.15) Updated to use [69]Raptor 1.4.18 (from 1.4.16) Added a 'trees' indexed in-memory storage Improvements to low-memory and other failures of resource allocation API additions and changes to concepts, parser and serializer classes. Fixed Issue [70]0000256 NOTE: The next release of redland will NOT include raptor and rasqal in the tarball, they will be separate download dependencies. See the [71]1.0.8 Release Notes for the full details of the changes. 2007-12-24 Redland Version 1.0.7 Released Updated to use [72]Rasqal 0.9.15 (from 0.9.14) Updated to use [73]Raptor 1.4.16 (from 1.4.15) Added a optional modular storage Improvements to low-memory and other failures of resource allocation Added URI filtering to the parser class SQLite storage gains transactions and other fixes Many other bug fixes addressing Issues [74]0000187, [75]0000189, [76]0000203, [77]0000205, [78]0000209, [79]0000213, [80]0000215, [81]0000218, [82]0000229, [83]0000230, [84]0000234, [85]0000235 and [86]0000236 See the [87]1.0.7 Release Notes for the full details of the changes. 2007-05-05 Redland Version 1.0.6 Released Updated to use [88]Rasqal 0.9.14 (from 0.9.13) Updated to use [89]Raptor 1.4.15 (from 1.4.13) Added a new transactions API for graph changes, implemented for MySQL Added a new query results formatter class Many other bug fixes addressing Issues [90]#0000175, [91]#0000173, [92]#0000159, [93]#0000153, [94]#0000150 and [95]#0000038 See the [96]1.0.6 Release Notes for the full details of the changes. 2006-11-19 Redland Version 1.0.5 Released Updated to use [97]Rasqal 0.9.13 (from 0.9.12) Updated to use [98]Raptor 1.4.13 (from 1.4.9) Several API additions Parsing methods can take a NULL base URI when it is not needed Added serializer methods to serialize from a stream Many fixes and improvements to the SQLite storage Export some more functions to the SWIG binding Many minor improvements Many other bug fixes addressing Issues [99]#0000092, [100]#0000103, [101]#0000105, [102]#0000107, [103]#0000114, [104]#0000116, [105]#0000125, [106]#0000130, [107]#0000132, [108]#0000136 and [109]#0000139. See the [110]1.0.5 Release Notes for the full details of the changes. 2006-05-05 Redland Version 1.0.4 Released Updated to use [111]Rasqal 0.9.12 to update to SPARQL 2006-04-06 and JSON results Updated to use [112]Raptor 1.4.9 with many improvements Fixes for several crashes in parsing and serializing. See the [113]1.0.4 Release Notes for the full details of the changes. 2006-02-15 Redland Version 1.0.3 Released Updated to use [114]Rasqal 0.9.11 to update to SPARQL 2005-11-23 Updated to use [115]Raptor 1.4.8 with many improvements Added a new PostgreSQL storage contributed by Shi Wenzhong Created an enhanced API reference manual with gtk-doc Some other minor fixes and changes NOTE: Redland will be switching to use [116]Subversion for version control after the 1.0.3 release. See the [117]Redland Subversion site or the online [118]Redland installation notes for the latest information. See the [119]1.0.3 Release Notes for the full details of the changes. 2005-06-10 Redland Version 1.0.2 Released Fixed a crash when querying or searching with the API and getting no results Updated to use [120]Rasqal 0.9.10 to provide query results sorting such as SPARQL ORDER BY and some SPARQL syntax updates. ([121]release notes) Updated to use [122]Raptor 1.4.7 to to fix some crashes in the RSS tag soup parser and serializer. ([123]release notes) See the [124]1.0.2 Release Notes for the full details of the changes. 2005-05-29 Redland Version 1.0.1 Released Updated to use [125]Rasqal 0.9.9 to provide improved SPARQL query support for the revised syntax ([126]release notes) Updated to use [127]Raptor 1.4.6 to provide a new GRDDL parser as well as updated RSS enclosures support ([128]relase notes) MySQL store has changed key algorithm: NOTE: may require a store save and reload SQLite store now returns correct query results Digest and Hash classes are now public and available to bindings Empty iterators and streams now always return an object Win32 portability fixes and build configuration (John Barstow) Several other API additions were made. See the [129]1.0.1 Release Notes for the full details of the changes. 2005-02-06 Redland Version 1.0.0 Released This is a mature library so it is time for 1.0.0 Updated to use [130]Rasqal 0.9.6 for better query and SPARQL support Updated to use [131]Raptor 1.4.5 for new RDF/XML abbreviated serializer, improved RSS tag soup parser and RSS 1.0 serializer New experimental [132]SQLite storage See the [133]1.0.0 Release Notes for the full details of the changes. 2004-11-01 Redland Version 0.9.19 Released License changed from LGPL 2.1/MPL 1.1 to LGPL 2.1/Apache 2 Updated to use [134]Rasqal 0.9.4 to provide SPARQL support Updated to use [135]Raptor 1.4.2 to provide serializing of models to strings in RDF/XML or N-Triples Some small API additions and bug fixes. See the [136]0.9.19 Release Notes for the full details of the changes. 2004-08-03 Redland Version 0.9.18 Released (Revert statement usage counting from 0.9.17) This is Redland 1.0 release candidate 1 New [137]Query and [138]Query Results classes to support RDF querying with [139]RDQL using [140]Rasqal Moved the language APIS into the new [141]Redland Bindings package Added a new message logging API giving structured messages Updated MySQL storage ([142]Morten Frederiksen) Check that duplicate statements are not added to models Portability fixes for building natively on Win32 (Jose Kahan) Updated to [143]Rasqal 0.9.2 and [144]Raptor 1.3.2 Several other minor bugs and fixes. See the [145]0.9.17 Release Notes for the full details of the changes. 2004-02-24 Redland Version 0.9.16 Released A small but important bug fix to make the installed C headers work correctly again. See the [146]0.9.16 Release Notes for the full details of the changes. 2004-01-31 Redland Version 0.9.15 Released API CHANGE Several classes were modified to use unsigned char* for UTF-8 encoded URIs and Literals Update to synchronise with [147]Raptor version 1.2.0 (RDF/XML and N-Triples parser) - see [148]Raptor NEWS gaining the [149]Turtle Terse RDF Triple Language Added storage with MySQL written by [150]Morten Frederiksen Added storage with [151]AKT Triplestore Added file and URI-backed in-memory storage Added fixes to make Redland compile cleanly under C++ (tested with g++) Added assertion checks and reporting for function arguments Added method for finding statements in a context Added a method for listing the contexts in a graph Storage, model and serializer get/set feature methods now take and return nodes Improved rdfproc utility to handle multiple storage types, storage options, contexts and environment variables for configuration. Fix crash on reporting parser errors with % in the message Improved RDF/XML serializer to chose better output names Many other minor changes and fixes. See the [152]0.9.15 Release Notes for the full list of the changes. 2003-09-08 Redland Version 0.9.14 Released Update to synchronise with [153]Raptor version 1.0.0 (RDF/XML and N-Triples parser) - see [154]Raptor NEWS for the changes since 0.9.12. Added a new utility program rdfproc - a general RDF processor for Redland that allows command line use of the library. Made the Node class intern every node. Fixed the broken use of Perl UNIVERSAL::isa Other minor API changes See the [155]0.9.14 Release Notes for the full list of the changes. 2003-08-28 Redland Version 0.9.13 Released API CHANGE [156]Node The class was modifed to make objects immutable, removing the set methods and to add new node type convienence methods. API addition [157]Model Added a method to sync the model to the backing store. API addition [158]Parser Added methods to allow parsing from strings. API addition [159]Statement Added method to check for partial statements. API addition [160]Storage Added a method to sync the backing store. Better error recovery - most errors return if possible. Added initial simple threading support (patches by Seth Ladd) Greatly improved Python API using 2.2 features (Edd Dumbill and Matt Biddulph) Updated Perl, Python and Java APIs to always return new nodes and statements, removing the need to consider shared object issues. Updated serializing to RDF/XML to handle datatype literals Update to [161]Raptor version 0.9.12 (RDF/XML and N-Triples parser) - see [162]Raptor NEWS for changes since 0.9.8. Extensive portability and other bug fixes. See the [163]0.9.13 Release Notes for the full list of the changes. 2003-02-13 Redland Version 0.9.12 Released FORMAT CHANGE The persistent storage format was changed to support RDF typed literals and this will require an upgrade of any existing Berkeley/Sleepycat DB stores created by Redland 0.9.11 or earlier. A utility redland-db-upgrade is provided that creates an updated store from an existing one. API CHANGE [164]Iterator and [165]Stream classes. The next/get_next method is split into get_object always returning a shared object and next methods. get_context method added. (get_object is called current in higher level language APIs) API CHANGE [166]Model class. Method add_statement no longer takes ownership of the passed in statement. The caller now retains ownership. API CHANGE [167]Model class. Method add_statements no longer frees the passed in librdf_stream; the caller must free it now. API CHANGE [168]Node and [169]Model classes. Added RDF Datatyped Literals. Other literal is_wf_xml constructors and methods deprecated. API CHANGE All literals methods and constructors have no mention of the never-used or supported XML Space argument which is not part of an RDF literal. Added a script [170]utils/update-api-0912.pl to help automate the API changes as far as possible or warn about those that cannot be automatically updated. Added contexts - Statements added to [171]Model (when using a Storage that supports contexts) can take an optional [172]Node, returned by the new get_context method on [173]Iterator and [174]Stream classes. Many portability and compiling fixes (OSX, gcc 3.x, FreeBSD, non-gcc compiler) [175]Java API classes. Add finished() method replacing useless finalize(). Use Raptor message callbacks to get parser warnings and errors Build Java API working around the stupid things recent SWIG versions do. Make Redland work with BDB/Sleepycat DB v4 (as well as v2 and v3) [176]Python API gains [177]pydoc comments and HTML derived version [178]Perl and [179]Python APIs now receive Redland message callbacks Redland URI class now registers with Raptor rather than specially compile Raptor Added RDF/XML [180]Serializer class and made higher level language APIs to it Update to [181]Raptor version 0.9.8 (RDF/XML and N-Triples parser) - see [182]Raptor NEWS for detailed changes since 0.9.5 Added skeleton [183]Ruby and [184]PHP APIs Major source reorganisation. See also the [185]0.9.12 Release Notes 2002-06-08 Redland Version 0.9.11 Released Update to [186]Raptor version 0.9.5 (RDF/XML and N-Triples parser) Added [187]serialization to a syntax API; with [188]N-Triples as the first syntax Added start of [189]query language API Updated [190]Python interface to be more Pythonic, now requires python 2.1+ Added [191]Ruby API Redland will now work as a perl [192]CPAN module Updated [193]Perl interface - modules have been renamed. Fix programs with [194]update-perl-api.pl Updated [195]Java API Now uses libtool to build dynamic and static libraries Multiple startup/shutdowns of entire library now works. 2001-08-28 Redland Version 0.9.10 Released More work on debian packaging Added [196]Raptor [197]N-Triples parser Changes needed for _:name identifiers from N-Triples Added [198]Java API 2001-06-07 Redland Version 0.9.9 Released Added librdf_world class to manage Redland environment startup/shutdown - pervasive change throughout all other classes configure improvements to try to get expat variants detected and working more automatically Added Debian (.deb) package support SiRPAC parser wrapper now handles multi-line literals Changed stream and iterator interfaces and classes to be compatible, in preparation for unifying in one new filter class. NOTE: This requires changes to user-code - librdf_iterator_have_elements is now !librdf_iterator_is_end and librdf_iterator_set_map is now librdf_iterator_add_map Added perl and python interface warnings for above changes Preparation work for querying for arcs to/from a resource node, filtering Additional examples and explanations added to perl interface documentation Updated to [199]Raptor RDF/XML parser 0.9.1 - many bug fixes 2001-02-05 Redland Version 0.9.8 Released Added [200]Tcl interface Added [201]Raptor RDF parser, written by me (alpha quality) and made some changes to support it. More fixes to [202]Perl interface to fix crashes Added [203]Perl [204]RDF::RSS method as_xhtml for simple RSS 1.0 to (X)HTML formatting. 2001-01-05 Redland Version 0.9.7 Released Changed [205]Perl Model API - renamed get_* method names, added deprecated warnings for old names. Updated [206]Repat to 2000-12-24 version (plus some patches). Added [207]Perl Plain Old Documentation (POD). Fixed subtle [208]Perl interface object reference bugs. Changed [209]Model API - add_statement now does not own the added statement Added to [210]Model API - get_source, get_arc, get_target return one matching [211]librdf_node, not a list of them like get_sources etc. do via [212]librdf_iterator. Added [213]UTF-8 support for converting between UTF-8 and ISO Latin-1. 2000-11-06 Redland Version 0.9.6 Released Added python interface (2.0 and 1.5) More perl interface fixes Parser APIs updated to handle syntax specified by MIME type and/or URI and now have features allowing the setting/querying of parser options. 2000-10-20 Redland Version 0.9.5 Released Added [214]Repat RDF parser by Jason Diamond - jason at njektilo dot org More perl API fixes and improvements Internal changes preparing for proper reification support and use of rdf:, rdfs: concepts 2000-09-29 Redland Version 0.9.4 Released Implemented perl interface Created RPM construction support Started work on internal RDF parser 2000-08-30 Redland Version 0.9.3 Released Implemented fast get sources, targets, arcs for storage models using multiple hashes (Berkeley DB) Made Berkeley DB support work for V3, two variants of V2 Implemented removing statements for stored models Changed internal hash API arguments, which was nice. Added general RDF utility example code [215]example4.c that parses RDF/XML syntax, stores it and provides multiple query methods. Added simple 10-line RDF example code [216]example3.c SiRPAC Java parser call changed to not discard error output Use streaming part of SiRPAC Java parser Didn't do anything on [217]list :( but fixed several parts of code marked FIXME :-). 2000-08-21 Redland Version 0.9.2 Released [218]API HTML documentation added to release. configure now splits and generates sub-version numbers. 2000-08-18 Redland Version 0.9.1 Released configure warns user if no persistant storage (BDB) found configure warns user if no RDF parser configured Made BDB V1 fail if found by configure - does not work with Redland. Some improvements to installation document. 2000-08-17 Redland named Redland renamed from librdf, license changed to LGPL/MPL from LGPL/BSD. 2000-06-21 Redland first CVS commit Redland 'born' with first CVS commit: It compiles and builds as a GNU automake/conf suite with 'make distcheck' and 'make check' __________________________________________________________________ Copyright (C) 2000-2013 [219]Dave Beckett Copyright (C) 2000-2005 [220]University of Bristol References 1. http://bugs.librdf.org/mantis/view.php?id=529 2. http://bugs.librdf.org/mantis/view.php?id=540 3. http://bugs.librdf.org/mantis/view.php?id=541 4. http://bugs.librdf.org/mantis/view.php?id=542 5. http://bugs.librdf.org/mantis/view.php?id=543 6. RELEASE.html#rel1_0_17 7. http://librdf.org/raptor/ 8. http://bugs.librdf.org/mantis/view.php?id=443 9. http://bugs.librdf.org/mantis/view.php?id=460 10. http://bugs.librdf.org/mantis/view.php?id=497 11. http://bugs.librdf.org/mantis/view.php?id=518 12. http://bugs.librdf.org/mantis/view.php?id=519 13. RELEASE.html#rel1_0_16 14. http://bugs.librdf.org/mantis/view.php?id=461 15. http://bugs.librdf.org/mantis/view.php?id=468 16. http://bugs.librdf.org/mantis/view.php?id=475 17. http://bugs.librdf.org/mantis/view.php?id=478 18. http://bugs.librdf.org/mantis/view.php?id=483 19. http://bugs.librdf.org/mantis/view.php?id=485 20. RELEASE.html#rel1_0_15 21. http://clang-analyzer.llvm.org/ 22. http://bugs.librdf.org/mantis/view.php?id= 23. http://bugs.librdf.org/mantis/view.php?id= 24. http://bugs.librdf.org/mantis/view.php?id= 25. http://bugs.librdf.org/mantis/view.php?id= 26. RELEASE.html#rel1_0_14 27. http://bugs.librdf.org/mantis/view.php?id=325 28. http://bugs.librdf.org/mantis/view.php?id=404 29. http://bugs.librdf.org/mantis/view.php?id=419 30. RELEASE.html#rel1_0_13 31. http://bugs.librdf.org/mantis/view.php?id=329 32. http://bugs.librdf.org/mantis/view.php?id=348 33. http://bugs.librdf.org/mantis/view.php?id=391 34. http://bugs.librdf.org/mantis/view.php?id=392 35. http://bugs.librdf.org/mantis/view.php?id=393 36. RELEASE.html#rel1_0_12 37. http://github.com/dajobe/librdf 38. http://bugs.librdf.org/mantis/view.php?id=124 39. http://bugs.librdf.org/mantis/view.php?id=284 40. http://bugs.librdf.org/mantis/view.php?id=321 41. http://bugs.librdf.org/mantis/view.php?id=322 42. http://bugs.librdf.org/mantis/view.php?id=334 43. http://bugs.librdf.org/mantis/view.php?id=338 44. http://bugs.librdf.org/mantis/view.php?id=341 45. http://bugs.librdf.org/mantis/view.php?id=344 46. http://bugs.librdf.org/mantis/view.php?id=350 47. http://bugs.librdf.org/mantis/view.php?id=363 48. http://bugs.librdf.org/mantis/view.php?id=366 49. http://bugs.librdf.org/mantis/view.php?id=371 50. http://bugs.librdf.org/mantis/view.php?id=380 51. http://bugs.librdf.org/mantis/view.php?id=382 52. http://bugs.librdf.org/mantis/view.php?id=383 53. RELEASE.html#rel1_0_11 54. http://sourceforge.net/projects/virtuoso/ 55. http://librdf.org/rasqal/ 56. http://bugs.librdf.org/mantis/view.php?id=302 57. http://bugs.librdf.org/mantis/view.php?id=304 58. http://bugs.librdf.org/mantis/view.php?id=311 59. http://bugs.librdf.org/mantis/view.php?id=315 60. http://bugs.librdf.org/mantis/view.php?id=315 61. RELEASE.html#rel1_0_10 62. http://bugs.librdf.org/mantis/view.php?id=272 63. http://bugs.librdf.org/mantis/view.php?id=282 64. http://bugs.librdf.org/mantis/view.php?id=283 65. http://bugs.librdf.org/mantis/view.php?id=285 66. http://bugs.librdf.org/mantis/view.php?id=286 67. RELEASE.html#rel1_0_9 68. http://librdf.org/rasqal/ 69. http://librdf.org/raptor/ 70. http://bugs.librdf.org/mantis/view.php?id=0000256 71. RELEASE.html#rel1_0_8 72. http://librdf.org/rasqal/ 73. http://librdf.org/raptor/ 74. http://bugs.librdf.org/mantis/view.php?id=0000187 75. http://bugs.librdf.org/mantis/view.php?id=0000189 76. http://bugs.librdf.org/mantis/view.php?id=0000203 77. http://bugs.librdf.org/mantis/view.php?id=0000205 78. http://bugs.librdf.org/mantis/view.php?id=0000209 79. http://bugs.librdf.org/mantis/view.php?id=0000213 80. http://bugs.librdf.org/mantis/view.php?id=0000215 81. http://bugs.librdf.org/mantis/view.php?id=0000218 82. http://bugs.librdf.org/mantis/view.php?id=0000229 83. http://bugs.librdf.org/mantis/view.php?id=0000230 84. http://bugs.librdf.org/mantis/view.php?id=0000234 85. http://bugs.librdf.org/mantis/view.php?id=0000235 86. http://bugs.librdf.org/mantis/view.php?id=0000236 87. RELEASE.html#rel1_0_7 88. http://librdf.org/rasqal/ 89. http://librdf.org/raptor/ 90. http://bugs.librdf.org/mantis/view.php?id=159 91. http://bugs.librdf.org/mantis/view.php?id=159 92. http://bugs.librdf.org/mantis/view.php?id=159 93. http://bugs.librdf.org/mantis/view.php?id=153 94. http://bugs.librdf.org/mantis/view.php?id=150 95. http://bugs.librdf.org/mantis/view.php?id=38 96. RELEASE.html#rel1_0_6 97. http://librdf.org/rasqal/ 98. http://librdf.org/raptor/ 99. http://bugs.librdf.org/mantis/view.php?id=92 100. http://bugs.librdf.org/mantis/view.php?id=103 101. http://bugs.librdf.org/mantis/view.php?id=105 102. http://bugs.librdf.org/mantis/view.php?id=107 103. http://bugs.librdf.org/mantis/view.php?id=114 104. http://bugs.librdf.org/mantis/view.php?id=116 105. http://bugs.librdf.org/mantis/view.php?id=125 106. http://bugs.librdf.org/mantis/view.php?id=130 107. http://bugs.librdf.org/mantis/view.php?id=132 108. http://bugs.librdf.org/mantis/view.php?id=136 109. http://bugs.librdf.org/mantis/view.php?id=139 110. RELEASE.html#rel1_0_5 111. http://librdf.org/rasqal/ 112. http://librdf.org/raptor/ 113. RELEASE.html#rel1_0_4 114. http://librdf.org/rasqal/ 115. http://librdf.org/raptor/ 116. http://subversion.tigris.org/ 117. http://svn.librdf.org/ 118. http://librdf.org/INSTALL.html 119. RELEASE.html#rel1_0_3 120. http://librdf.org/rasqal/ 121. http://librdf.org/rasqal/RELEASE.html#rel0_9_10 122. http://librdf.org/raptor/ 123. http://librdf.org/raptor/RELEASE.html#rel1_4_7 124. RELEASE.html#rel1_0_2 125. http://librdf.org/rasqal/ 126. http://librdf.org/rasqal/RELEASE.html#rel0_9_9 127. http://librdf.org/raptor/ 128. http://librdf.org/raptor/RELEASE.html#rel1_4_6 129. RELEASE.html#rel1_0_1 130. http://librdf.org/rasqal/ 131. http://librdf.org/raptor/ 132. http://www.sqlite.org/ 133. RELEASE.html#rel1_0_0 134. http://librdf.org/rasqal/ 135. http://librdf.org/raptor/ 136. RELEASE.html#rel0_9_19 137. docs/api/query.html 138. docs/api/query_results.html 139. http://www.w3.org/Submission/2004/SUBM-RDQL-20040109/ 140. http://librdf.org/rasqal/ 141. http://librdf.org/bindings/ 142. http://purl.org/net/morten/ 143. http://librdf.org/rasqal/ 144. http://librdf.org/raptor/ 145. RELEASE.html#rel0_9_17 146. RELEASE.html#rel0_9_16 147. http://librdf.org/raptor/ 148. http://librdf.org/raptor/NEWS.html 149. http://www.dajobe.org/2004/01/turtle/ 150. http://purl.org/net/morten/ 151. http://triplestore.aktors.org/ 152. RELEASE.html#rel0_9_15 153. http://librdf.org/raptor/ 154. http://librdf.org/raptor/NEWS.html 155. RELEASE.html#rel0_9_14 156. docs/api/node.html 157. docs/api/model.html 158. docs/api/parser.html 159. docs/api/statement.html 160. docs/api/storage.html 161. http://librdf.org/raptor/ 162. http://librdf.org/raptor/NEWS.html 163. RELEASE.html#rel0_9_13 164. docs/api/iterator.html 165. docs/api/stream.html 166. docs/api/model.html 167. docs/api/model.html 168. docs/api/node.html 169. docs/api/model.html 170. utils/update-api-0912.pl 171. docs/api/model.html 172. docs/api/node.html 173. docs/api/iterator.html 174. docs/api/stream.html 175. docs/java.html 176. docs/python.html 177. docs/pydoc/RDF.html 178. docs/perl.html 179. docs/python.html 180. docs/api/serializer.html 181. http://librdf.org/raptor/ 182. http://librdf.org/raptor/NEWS.html 183. docs/ruby.html 184. docs/php.html 185. RELEASE.html#rel0_9_12 186. http://librdf.org/raptor/ 187. docs/api/serializer.html 188. http://www.w3.org/TR/rdf-testcases/#ntriples 189. docs/api/query.html 190. docs/python.html 191. docs/ruby.html 192. http://www.cpan.org/ 193. docs/perl.html 194. perl/update-perl-api.pl 195. docs/java.html 196. http://librdf.org/raptor/ 197. http://www.w3.org/TR/rdf-testcases/#ntriples 198. docs/java.html 199. http://librdf.org/raptor/ 200. docs/tcl.html 201. http://librdf.org/raptor/ 202. docs/perl.html 203. docs/perl.html 204. docs/pod/RDF/RSS.html 205. docs/pod/RDF/Model.html 206. http://injektilo.org/rdf/repat.html 207. docs/pod/RDF.html 208. docs/perl.html 209. docs/api/model.html 210. docs/api/model.html 211. docs/api/node.html 212. docs/api/iterator.html 213. docs/api/utf8.html 214. http://injektilo.org/rdf/repat.html 215. example4.c 216. example3.c 217. TODO.html 218. docs/api/index.html 219. http://www.dajobe.org/ 220. http://www.bristol.ac.uk/ redland-1.0.17/ChangeLog.100000644000175000017500000004762511516620413012140 000000000000002009-12-18 Dave Beckett * Add librdf.la to librdf_storage_virtuoso_la_LIBADD 2009-12-16 Dave Beckett * Snapshotted redland_1_0_10 for 1.0.10 release (SVN 15919) * src/rdf_cache.c: (main): Free cache inside test loop 2009-12-15 Lauri Aalto * src/rdf_cache.c: Fixed rdf_cache_test deadlock with WITH_THREADS. (librdf_free_cache_internal,librdf_cache_delete_internal): Pulled functionality from librdf_free_cache(), librdf_cache_delete() without mutex locking. (librdf_new_cache): Call librdf_free_cache_internal() when already holding a mutex lock. (librdf_cache_cleanup): Call librdf_cache_delete_internal(), mutex lock already held by librdf_cache_set_common(). * src/rdf_hash.c, src/rdf_init.c: (librdf_free_hash_datums): Do not assume hash_datums mutex is initialized. (main): Remove librdf_world_open() from minimum init-finish test case. Fixes issue http://bugs.librdf.org/mantis/view.php?id=317 2009-12-14 Dave Beckett * NEWS.html, RELEASE.html: 1.0.10 notes updated for issue 317 fix * src/rdf_init.c: (main): Call librdf_world_open(world) to make the test run when threads are enabled. Fixes Issue#0000317 http://bugs.librdf.org/mantis/view.php?id=317 * src/rdf_storage_trees.c: (librdf_storage_trees_node_compare): Check language and datatype URI when comparing literals. Fixes Issue#000311 http://bugs.librdf.org/mantis/view.php?id=311 with patch from Gregory Williams - Thanks! * src/rdf_storage_trees.c: (librdf_storage_trees_remove_statement_internal): Return 0 on success (always). Fixes Issue#000304 http://bugs.librdf.org/mantis/view.php?id=304 2009-12-13 Dave Beckett * redland-config.in: Now a wrapper around pkg-config redland * src/rdf_storage_postgresql.c: Casts for C++ * src/rdf_init.c: (librdf_basename): Casts for C++ * docs/tmpl/parser.sgml, docs/tmpl/serializer.sgml: Update docbook tmpls * build, build/shave-libtool.in, build/shave.in, build/shave.m4, configure.ac: Enable SHAVE support for maintainer; move aux files to build dir * docs/redland-sections.txt: Add librdf_parser_check_name and librdf_serializer_check_name * src/rdf_storage_virtuoso.c: remove public autodocs from scanning * configure.ac: Berkeley DB 4.8 * NEWS.html, RELEASE.html, configure.ac, src/win32_rdf_config.h: Bump version to 1.0.10 * src/rdf_storage_virtuoso.c: Applied patch from 'lenrek' to "fix seg fault on x86_64 machines" with virtuoso storage. * src/rdf_query_rasqal.c: Use #ifdef RASQAL_TRIPLES_SOURCE_MIN_VERSION and #ifdef RASQAL_TRIPLES_SOURCE_FACTORY_MIN_VERSION from rasqal.h instead of RASQAL_TRIPLE_SOURCES_HAVE_API_VERSION defined locally by redland configure. * configure.ac: No need to define RASQAL_TRIPLE_SOURCES_HAVE_API_VERSION, can use other macros from rasqal.h 2009-12-12 Dave Beckett * src/rdf_cache.c: (librdf_cache_set_common): Call memset with address of buffer, not address of pointer to buffer. * src/rdf_query_rasqal.c: Use RASQAL_TRIPLE_SOURCES_HAVE_API_VERSION to set API version fields when using rasqal 0.9.17+ * configure.ac: Define RASQAL_TRIPLE_SOURCES_HAVE_API_VERSION for rasqal 0.9.17+ * autogen.sh: add space 2009-11-29 Lauri Aalto * autogen.sh: Reduce autogen noise on systems where uname is not in /usr/bin 2009-11-17 Lauri Aalto * src/rdf_query_rasqal.c: (rasqal_literal_get_rdf_term_type): Cannot use enum (RASQAL_LITERAL_UDT) with preprocessor, use RASQAL_LITERAL_UDT_DEFINED instead. * src/rdf_query_rasqal.c: (rasqal_literal_get_rdf_term_type): Changed return type from int to rasqal_literal_type enum to prevent int-enum conversion warnings. 2009-11-16 Dave Beckett * src/rdf_query_rasqal.c: (rasqal_literal_get_rdf_term_type): Added when RASQAL_LITERAL_UDT is not defined - rasqal is 0.9.16 or older. (rasqal_literal_to_redland_node): Use above to replace ever-growing if condition that is fragile when new literal types are added. 2009-11-16 Lauri Aalto * src/rdf_query_rasqal.c: (rasqal_literal_to_redland_node): Support RASQAL_LITERAL_UDT user-defined datatype literals introduced in rasqal r15608. 2009-10-14 Dave Beckett * src/rdf_storage_postgresql.c: Replace deprecated PQescapeString with PQescapeStringConn that takes a PGconn connection handle and when encoding takes into consideration any connection properties such as character encodings in force. 2009-10-10 Dave Beckett * utils/rdfproc.c: CMD_PARSE: get the warning count from the warning_count_node, not the (just freed) error_count_node 2009-09-07 Dave Beckett * docs/redland-docs.xml: Make this newer legal docbook 2009-08-30 Dave Beckett * src/rdf_query_rasqal.c: ws/indenting 2009-08-26 Dave Beckett * utils: props 2009-08-25 Dave Beckett * src/Makefile.am, src/rdf_query_virtuoso.c, src/rdf_storage.c, src/rdf_storage_module.h, src/rdf_storage_virtuoso.c: Remove virtuoso vsparql query part for now - should use some rasqal parts that are not yet public * utils/redland-virtuoso-test.c: cut the source down so it compiles. body seems to have been repeated, possibly by multiple rebasing of original patches * src/Makefile.am: copyright years * utils/redland-virtuoso-test.c: Add redland-virtuoso-test.c * src/rdf_query_virtuoso.c, src/rdf_storage_virtuoso.c, src/rdf_storage_virtuoso_internal.h: Also add new Virtuoso storage files also from http://bugs.librdf.org/mantis/view.php?id=284 * configure.ac, docs/redland-chapter-storage-modules.xml, src/Makefile.am, src/rdf_query_internal.h, src/rdf_storage.c, src/rdf_storage_internal.h, src/rdf_storage_module.h, utils/Makefile.am: Applied raw Virtuoso storage patch from http://bugs.librdf.org/mantis/view.php?id=284 - does not compile at this commit due to use of rasqal internals that are no longer available to librdf. * autogen.sh: Update common autogen.sh * configure.ac: Add -W to CPPFLAGS not CFLAGS, so they are not used in link lines * src/Makefile.am: typo $ * configure.ac: Put modular build libltdl includes and libs into INTERNAL macros * redland-src-config.in: update for moved includes to src dir * utils/Makefile.am: Add rule for librdf.la * redland-src-config.in: make redland-src-config work for external raptor and rasqal again 2009-08-13 Lauri Aalto * src/Makefile.am, src/rdf_list.h: Install rdf_list.h header and export its functions so that they can be used e.g. in external storage modules. 2009-08-12 Dave Beckett * configure.ac, src/rdf_storage_sqlite.c, src/win32_rdf_config.h: Change define SQLITE_API to REDLAND_SQLITE_API to allow redland to compile with sqlite 3.6.17 or newer where the SQLITE_API macro is defined. Thanks to Samuli Suominen for the report and fix. 2009-07-17 Dave Beckett * COPYING: Update GPL2 to latest version (white space changes) used by rasqal, raptor 2009-06-06 Lauri Aalto * configure.ac: Default to environment LIBS, CPPFLAGS, LDFLAGS. Addresses issue at http://bugs.gentoo.org/show_bug.cgi?id=267405 2009-05-20 Dave Beckett * configure.ac: Remove libltdlc.la from LIBRDF_PKGCONFIG_PRIVATE_LIBS which ends up in pkgconfig Libs.private field 2009-05-01 Dave Beckett * src/rdf_storage_file.c: Add storage option 'format' for uri and file storages librdf_storage_file_instance gains format_name field. (librdf_storage_file_init): Validate the format values as legal parser name and for file-storage, serializer name too. Log a warning if the type given is wrong. (librdf_storage_file_terminate): Free format_name (librdf_storage_file_sync): Use format_name for serializer for file storage. * src/rdf_parser.c, src/rdf_serializer.c: (librdf_parser_check_name, librdf_serializer_check_name): fix strcmp. * src/rdf_parser.c: (librdf_parser_check_name): fix assert * src/rdf_serializer.c: (librdf_serializer_check_name): fix assert * src/rdf_serializer.c, src/rdf_serializer.h: (librdf_serializer_check_name): Added to check if a serializer name is known. * src/rdf_parser.c, src/rdf_parser.h: (librdf_parser_check_name): Added to check if a parser name is valid. 2009-04-28 Dave Robillard * src/Makefile.am: Make modular storage backends depend on librdf library to avoid unresolved symbol errors when librdf itself is dynamically loaded. * autogen.sh: Don't lie about configure arguments. 2009-04-14 Lauri Aalto * src/rdf_storage.c: (librdf_storage_register_factory): Clean up storage factory if version check fails. 2009-04-13 Dave Beckett * src/rdf_storage.c: (librdf_memstr): Removed, no longer used (ltdl_module_callback): More constrained tests for what is a legal storage module name especially with debugging, to prevent false warnings during 'make check'. * src/Makefile.am: Set storage module test dir to $(abs_builddir)/.libs * src/rdf_storage.c: (ltdl_module_callback): Only attempt to load .so files when debugging. This should aid false error messages when testing with 'make check' in the source tree * ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4, ChangeLog.6: Add old changelogs * src/rdf_storage_postgresql.c: (librdf_storage_postgresql_init): Use res2 in PQresultErrorField() call after setting it to the error code. 2009-04-12 Dave Beckett * Snapshotted redland_1_0_9 for 1.0.9 release (SVN 15143) * INSTALL.html: Document --enable-debug * configure.ac: Add --enable-debug to turn on LIBRDF_DEBUG without the need for maintainer mode. Removed unused STANDARD_CFLAGS subst. * src/Makefile.am: Removed unused STANDARD_CFLAGS * redland.pc.in: Add plugindir variable for the directory where modules go * Redland.i: Added librdf_parser_guess_name2() to SWIG API * AUTHORS: Added Dave Robillard and Lauri Aalto * INSTALL.html: Update to remove mention of raptor and rasqal building inside. * src/rdf_storage_sqlite.c: (librdf_storage_sqlite_literal_helper): Init language_e_len to prevent gcc warning about used when not initialised. * docs/tmpl/iterator.sgml, docs/tmpl/parser.sgml, docs/tmpl/stream.sgml: update sgml templates * src/rdf_cache.c: (librdf_cache_set_common): Initialise new_object to NULL and check before freeing. * src/rdf_storage_postgresql.c: (librdf_storage_postgresql_init): Init res to NULL * src/rdf_iterator.h, src/rdf_stream.h: autodocs * docs/redland-sections.txt, docs/tmpl/parser.sgml, docs/tmpl/storage.sgml: Update doc templates and sections * docs/Makefile.am: Final filter build rule fix to make it works with 'make distcheck'. This took hours of tricky make and VPATH debugging - info recorded in makefile comments. 2009-04-11 Dave Beckett * docs/Makefile.am: Adjust filter header rule to ensure it builds * docs/Makefile.am: Make $(top_srcdir)/src/filtered_rdf_log.h rule public * src/rdf_storage.c, src/rdf_storage.h: (librdf_storage_register_factory): Passes back an int status value. Now checks for the interface version in the supported range and fails if not. Added some more parameter validation. * configure.ac, src/rdf_storage_module.h: Move LIBRDF_STORAGE_INTERFACE_VERSION to a macro and define max an min storage interface versions LIBRDF_STORAGE_MIN_INTERFACE_VERSION and LIBRDF_STORAGE_MAX_INTERFACE_VERSION * src/rdf_parser.c, src/rdf_parser.h: (librdf_parser_guess_name2): Added with new librdf_world* world argument. (librdf_parser_guess_name): Restored, but deprecated and uses the above to do the work. Makes existing librdf API the same as 1.0.8 in the absence of raptor V2 released. * src/rdf_stream.h, src/rdf_stream_internal.h: Move librdf_stream_get_method_flags public * src/rdf_stream_internal.h: librdf_stream_get_method_flags added for flags arg of stream get_method: aliases of iterator get_method flags for the day that iterator and stream are merged. * src/rdf_iterator.h: librdf_iterator_get_method_flags added for flags arg of iterator get_method * docs/tmpl/log.sgml, docs/tmpl/parser.sgml, docs/tmpl/redland-unused.sgml, docs/tmpl/storage.sgml, docs/tmpl/unused.sgml: Update sgml templates 2009-04-10 Dave Beckett * src/rdf_storage_mysql.c: (librdf_storage_mysql_transaction_terminate): internal autodocs * docs/redland-sections.txt: Remove internal macros from unused section * src/rdf_cache.h: librdf_cache - autodoc * src/rdf_storage_module.h: librdf_storage_instance - autodocs * src/rdf_storage.c: (librdf_storage_set_instance, librdf_storage_get_instance): autodocs * docs/Makefile.am: Filter rdf_log.h before gtkdoc-scan gets there * src/rdf_parser.h: autodocs - format librdf_parser_set_uri_filter prototype so gtkdoc-scan can scan it * src/rdf_log.c: (librdf_log): autodocs - document .../Varargs * src/rdf_cache.c, src/rdf_storage.c: autodocs * docs/redland-sections.txt: More docs * docs/redland-sections.txt: update sections * src/rdf_raptor.c, src/rdf_raptor.h, src/rdf_raptor_internal.h: Convert to Unix LF 2009-04-07 Dave Beckett * examples/Makefile.am, utils/Makefile.am: Split linker libs and flags between LDADD and AM_LDFLAGS * examples/Makefile.am: Add rule to make librdf.la * docs/tmpl/log.sgml, docs/tmpl/parser.sgml, docs/tmpl/redland-unused.sgml: Update templates * docs/Makefile.am: Fix DOC_SOURCE_DIR * Makefile.am, configure.ac, docs/Makefile.am, examples/Makefile.am, librdf, redland-src-config.in, src, utils/Makefile.am: Renamed dir librdf/ to src/ 2009-03-31 Dave Beckett * autogen.sh: Use LTDL_INIT in configure.ac to trigger --ltdl * librdf/rdf_storage_postgresql.c: make postgresql storage autodocs internal * librdf/rdf_hash.c: librdf_hash_values_count autodocs * librdf/rdf_storage_hashes.c: autodocs for librdf_storage_hashes_close are internal * librdf/rdf_storage_module.h: autodocs for storage factory types * librdf/rdf_storage_file.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage_trees.c, librdf/rdf_storage_tstore.c: Fix autodocs for storage module registration functions to make them internal * configure.ac, NEWS.html, librdf/win32_rdf_config.h: Bump version to 1.0.9 * autogen.sh, configure.ac: libtool V2 only. Minimum 2.2.0 2009-03-30 Dave Beckett * docs/Makefile.am: (redland.3): Adjust sed to make NAME section of generated manual more debian lintian friendly * librdf/Makefile.am: Add rule to build ${top_build_prefix}libltdl/libltdlc.la and remove those to try to build raptor and rasqal locally. 2009-03-29 Dave Beckett * INSTALL.html, configure.ac, librdf/Makefile.am, librdf/rdf_digest_openssl.c: Removed openssl digest support - not used much and an extra large dependency. MD5 and SHA1 remain builtin. * librdf/rdf_hash.c: (librdf_free_hash_datum): Debug print at level 2 or more * librdf/rdf_storage_postgresql.c: Applied fixes from Issue#0000286 to fix "Numerous leaks, potential NULL pointer use, and dropped postgresql errors and buffer overruns in the postgresql storage module" Rebased from original patch around about SVN r14170 to current head, applied recent changes and fixed ISO C90 problems by moving declarations and assertions to start of blocks. Fixes Issue#0000286 http://bugs.librdf.org/mantis/view.php?id=286 * librdf/rdf_storage_postgresql.c: (librdf_storage_postgresql_get_contexts): Fix allocation of N bytes not N x size_t bytes using patch from bug: Fixes Issue#0000285 http://bugs.librdf.org/mantis/view.php?id=285 May also fix issue 102 according to bug. (librdf_storage_postgresql_free_gccontext_row): Removes unused function. Unused because the memory the function frees belongs to a PGresult struct and is freed when that struct is freed with the appropriate postgresql API. * librdf/rdf_statement.c: (librdf_statement_encode_parts): Fix a buffer overrun error that could occur with certain size buffers. A buffer size of 1 is sure to write past the end of the buffer. Patch from Lou Sakey 2008-07-31 to redland-dev * librdf/rdf_hash.c: Protect world->hash_datums_list with hash_datums_mutex when threading. Patch from Lou Sakey 2008-07-31 to redland-dev * librdf/rdf_init.c: (librdf_free_world): Destroy hash_datums_mutex and others in reverse order when threading. (librdf_world_init_mutex): Init hash_datums_mutex. Patch from Lou Sakey 2008-07-31 to redland-dev * librdf/rdf_init_internal.h: Add hash_datums_mutex for locking hash_datums class when with threads. Patch from Lou Sakey 2008-07-31 to redland-dev * librdf/rdf_log.h: librdf_log_level_func and librdf_log_func functions gain REDLAND_CALLBACK_STDCALL before function pointer to allow windows to adjust the calling convention for C# compatibility. Based on patch from Lou Sakey 2008-07-31 to redland-dev * librdf/librdf.h: Added REDLAND_CALLBACK_STDCALL macro to prefix selected callback function pointer definitions. Enabled for windows when USE_STDCALL_CALLBACKS is defined. * librdf/rdf_uri.c: (librdf_new_uri): Clear key and value to all zeros before use to make it easier to debug since not all fields of the structure were used. Patch from Lou Sakey 2008-07-31 to redland-dev * librdf/win32_rdf_config.h: win32: Add STDCALL_CALLBACKS Enable HAVE_PTHREADS Disable mysql storage Patch from Lou Sakey 2008-07-31 to redland-dev * configure.ac: hello Berkeley DB 4.7 * utils/Makefile.am: Add fix-groff-xhtml to dist * utils/Makefile.am, utils/fix-groff-xhtml (from /raptor/trunk/fix-groff-xhtml:15041): Copy in fix-groff-xhtml from raptor * configure.ac: libtool ltdl config that seems to work for V1 and V2 2009-03-29 Dave Robillard * configure.ac, redland-src-config.in: Remove vestigial --with-raptor=internal and --with-rasqal=internal configure options. 2009-03-29 Dave Beckett * Makefile.am: Add $(subdirs) to SUBDIRS if e.g. libltdl needs building * configure.ac: Use LT_INIT LTDL_INIT and LT_CONFIG_LTDL_DIR to initialize libtool and libltdl 2009-03-29 Dave Robillard * librdf/rdf_init_internal.h, librdf/rdf_query_rasqal.c, librdf/rdf_raptor.c, librdf/rdf_raptor.h: Compile against raptor 1.4.18. 2009-03-29 Dave Beckett * autogen.sh: Delete libltdl dir early and always so it'll never be used by autogen.sh and will always be re-generated by libtoolize when needed. * configure.ac: revert libltdl/Makefile * configure.ac: Generate libltdl/Makefile 2009-02-18 Lauri Aalto * librdf/rdf_storage_file.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage_trees.c, librdf/rdf_storage_tstore.c: Check for failures in storage instance allocation. 2009-01-13 Lauri Aalto * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_literal_helper): Fixed whitespace in sql expression. * librdf/rdf_storage_sqlite.c: Do not write to the sqlite database when just querying. (librdf_storage_sqlite_uri_helper, librdf_storage_sqlite_blank_helper, librdf_storage_sqlite_literal_helper, librdf_storage_sqlite_node_helper, librdf_storage_sqlite_statement_helper, librdf_storage_sqlite_statement_operator_helper): Take in an add_new parameter to control whether to create new uri/blank/literal ids. (librdf_storage_sqlite_add_statements, librdf_storage_sqlite_context_add_statement): add_new (librdf_storage_sqlite_contains_statement): No add_new. Removed FIXME note about the issue. (librdf_storage_sqlite_find_statements): No add_new. Allow negative node_ids in queries. (FIXME: should not exec queries that are known to return nothing) (librdf_storage_sqlite_context_remove_statement, librdf_storage_sqlite_context_remove_statements, librdf_storage_sqlite_context_serialise): No add_new. redland-1.0.17/configure.ac0000644000175000017500000011405112257575706012442 00000000000000dnl -*- Mode: autoconf -*- dnl dnl configure.ac - top level autoconf file for Redland librdf dnl (Process this file with autoconf to produce a configure script.) dnl dnl Copyright (C) 2000-2012 David Beckett http://www.dajobe.org/ dnl Copyright (C) 2000-2005 University of Bristol, UK http://www.bristol.ac.uk/ dnl dnl This package is Free Software and part of Redland http://librdf.org/ dnl dnl It is licensed under the following three licenses as alternatives: dnl 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version dnl 2. GNU General Public License (GPL) V2 or any newer version dnl 3. Apache License, V2.0 or any newer version dnl dnl You may not use this file except in compliance with at least one of dnl the above three licenses. dnl dnl See LICENSE.html or LICENSE.txt at the top of this package for the dnl complete terms and further detail along with the license texts for dnl the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. dnl dnl AC_INIT([Redland librdf RDF API Library],[1.0.17],[http://bugs.librdf.org/],[redland]) AC_PREREQ([2.62]) AC_CONFIG_SRCDIR(src/rdf_node.c) AC_REVISION($Revision$)dnl AC_CONFIG_HEADERS([src/rdf_config.h]) AC_CONFIG_AUX_DIR(build) AC_CONFIG_MACRO_DIR(build) AM_INIT_AUTOMAKE([1.11 check-news std-options -Wobsolete -Wportability -Wsyntax -Wunsupported -Wextra-portability]) AM_MAINTAINER_MODE AC_CANONICAL_HOST changequote(<<, >>)dnl version_major=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\1/'` version_minor=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\2/'` version_release=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\3/'` changequote([, ])dnl version_decimal=`expr $version_major \* 10000 + $version_minor \* 100 + $version_release` AC_DEFINE_UNQUOTED(LIBRDF_VERSION_MAJOR, $version_major, [Major version number]) AC_DEFINE_UNQUOTED(LIBRDF_VERSION_MINOR, $version_minor, [Minor version number]) AC_DEFINE_UNQUOTED(LIBRDF_VERSION_RELEASE, $version_release, [Release version number]) AC_DEFINE_UNQUOTED(LIBRDF_VERSION_DECIMAL, $version_decimal, [Release version as a decimal]) # for redland-config.in LIBRDF_VERSION_MAJOR=$version_major LIBRDF_VERSION_MINOR=$version_minor LIBRDF_VERSION_RELEASE=$version_release LIBRDF_VERSION_DECIMAL=$version_decimal AC_SUBST(LIBRDF_VERSION_MAJOR) AC_SUBST(LIBRDF_VERSION_MINOR) AC_SUBST(LIBRDF_VERSION_RELEASE) AC_SUBST(LIBRDF_VERSION_DECIMAL) # Libtool versioning # # CURRENT # The most recent interface number that this library implements. # # REVISION # The implementation number of the CURRENT interface. # # AGE # The difference between the newest and oldest interfaces that this # library implements. In other words, the library implements all the # interface numbers in the range from number `CURRENT - AGE' to # `CURRENT'. # # Rules: # 1. Start with version information of `0:0:0' for each libtool library. # # 2. Update the version information only immediately before a public # release of your software. More frequent updates are unnecessary, # and only guarantee that the current interface number gets larger # faster. # # 3. If the library source code has changed at all since the last # update, then increment REVISION (`C:R:A' becomes `C:r+1:A'). # # 4. If any interfaces have been added, removed, or changed since the # last update, increment CURRENT, and set REVISION to 0. # # 5. If any interfaces have been added since the last public release, # then increment AGE. # # 6. If any interfaces have been removed since the last public release, # then set AGE to 0. # # syntax: CURRENT[:REVISION[:AGE]] LIBRDF_LIBTOOL_VERSION=0:0:0 AC_SUBST(LIBRDF_LIBTOOL_VERSION) dnl Checks for programs. AM_SANITY_CHECK AM_PROG_AR AC_PROG_CC AM_PROG_CC_C_O AC_MSG_CHECKING(whether $CC is clang) CC_IS_CLANG=no if $CC 2>&1 | grep clang >/dev/null 2>&1; then CC_IS_CLANG=yes else : fi AC_MSG_RESULT($CC_IS_CLANG) AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET m4_undefine([AC_PROG_CXX]) m4_defun([AC_PROG_CXX],[]) m4_undefine([AC_PROG_F77]) m4_defun([AC_PROG_F77],[]) # Libtool and LTDL initialising LT_CONFIG_LTDL_DIR([libltdl]) LT_INIT([dlopen]) LTDL_INIT([convenience]) # Find a tar command for 'make dist' AC_CHECK_PROGS(TAR, gnutar gtar tar) AC_CHECK_PROGS(PERL, perl) # Gnome PKG_PROG_PKG_CONFIG AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AC_CHECK_PROGS(RECHO, echo) RECHO_C= RECHO_N= case `$RECHO -n x` in -n*) case `$RECHO 'xy\c'` in *c*) ;; xy) RECHO_C='\c' ;; esac;; *) RECHO_N='-n' ;; esac release_version=no AC_ARG_ENABLE(release, [ --enable-release Turn on optimizations (for maintainer). ], \ if test "$enableval" = "yes"; then \ release_version=yes fi;) modular=yes AC_ARG_ENABLE(modular, [ --disable-modular Build storage backends into librdf library. ], \ if test "$enableval" = "no"; then \ modular=no fi;) dnl compiler checks AC_DEFUN([REDLAND_CC_TRY_FLAG], [ AC_MSG_CHECKING([whether $CC supports $1]) redland_save_CFLAGS="$CFLAGS" if test $CC_IS_CLANG = yes; then # Make unknown warnings into errors for clang so the test below works CFLAGS="-Werror $CFLAGS" fi CFLAGS="$CFLAGS $1" AC_COMPILE_IFELSE([AC_LANG_SOURCE([ ])], [redland_cc_flag=yes], [redland_cc_flag=no]) CFLAGS="$redland_save_CFLAGS" if test "X$redland_cc_flag" = "Xyes"; then ifelse([$2], , :, [$2]) else ifelse([$3], , :, [$3]) fi AC_MSG_RESULT($redland_cc_flag) ]) # GCC warning options # http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html # # Too noisy: # -Wconversion: # -Wformat-nonliteral : variables for format strings # -Wno-system-headers : not debugging system # -Wunused-parameter : variables can be marked __attribute__('unused') # # Apple gcc specific (probably): -Wshorten-64-to-32 possible_warnings="\ -Wall \ -Wc++-compat \ -Wextra \ -Wunused \ \ -Waggregate-return \ -Wbad-function-cast \ -Wcast-align \ -Wdeclaration-after-statement \ -Wdisabled-optimization \ -Wdiv-by-zero \ -Wendif-labels \ -Werror-implicit-function-declaration \ -Wfloat-equal \ -Wformat-security \ -Wframe-larger-than=4096 \ -Winit-self \ -Winline \ -Wmissing-declarations \ -Wmissing-field-initializers \ -Wmissing-format-attribute \ -Wmissing-noreturn \ -Wmissing-prototypes \ -Wnested-externs \ -Wold-style-definition \ -Wpacked \ -Wpointer-arith \ -Wredundant-decls \ -Wshadow \ -Wsign-compare \ -Wsign-conversion \ -Wstrict-prototypes \ -Wswitch-enum \ -Wundef \ -Wunsafe-loop-optimizations \ -Wwrite-strings \ \ -Wshorten-64-to-32 \ -Wno-conversion \ -Wno-format-nonliteral \ -Wno-system-headers \ -Wno-unused-parameter \ " warning_cflags= if test "$USE_MAINTAINER_MODE" = yes; then AC_MSG_CHECKING(for supported $CC warning flags) AC_MSG_RESULT($warning_cflags) for warning in $possible_warnings; do REDLAND_CC_TRY_FLAG([$warning], [warning_cflags="$warning_cflags $warning"]) done AC_MSG_CHECKING($CC supports warning flags) AC_MSG_RESULT($warning_cflags) fi MAINTAINER_CPPFLAGS="$warning_cflags" # Externally linked libraries - appear in redland-config # -Dfoo -Idir LIBRDF_CPPFLAGS=$CPPFLAGS # -Ldir LIBRDF_LDFLAGS=$LDFLAGS # -llib LIBRDF_LIBS=$LIBS # Internally linked libraries - never given to users # -Dfoo -Idir LIBRDF_INTERNAL_CPPFLAGS= # -Ldir -llib LIBRDF_INTERNAL_LIBS= # Internal dependencies like libltdl when built locally LIBRDF_INTERNAL_DEPS= # Libraries linked externally also may be internal - presently just # raptor and rasqal but in future may include others # Currently only substituted into redland-src-config. # -Dfoo -Idir LIBRDF_EXTERNAL_CPPFLAGS= # -Ldir -llib LIBRDF_EXTERNAL_LIBS= # do these first because somehow they get messed up by bdb checks AC_CHECK_TYPES([byte]) AC_CHECK_TYPES([u32]) AC_CHECK_TYPES([u64]) AC_CHECK_SIZEOF(unsigned char, 1) AC_CHECK_SIZEOF(unsigned int, 4) AC_CHECK_SIZEOF(unsigned long, 4) AC_CHECK_SIZEOF(unsigned long long, 8) dnl Checks for libraries. dnl Oracle Berkeley DB AC_ARG_WITH(bdb, [ --with-bdb=DIR Oracle Berkeley DB install area (default=/usr)], bdb_prefix="$withval", bdb_prefix="none") AC_ARG_WITH(bdb_lib, [ --with-bdb-lib=DIR Oracle Berkeley DB lib directory (default=/usr/lib)], bdb_lib_dir="$withval", bdb_lib_dir="none") AC_ARG_WITH(bdb_include, [ --with-bdb-include=DIR Oracle Berkeley DB include directory (default=/usr/include)], bdb_include_dir="$withval", bdb_include_dir="none") AC_ARG_WITH(bdb_dbname, [ --with-bdb-dbname=NAME Oracle Berkeley DB library name (auto)], bdb_dbname="$withval", bdb_dbname="none") bdb_version=unknown bdb_available=Missing # debian multiarch multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null` if test "x$bdb_prefix" != "xno" ; then if test "x$bdb_prefix" = "xyes" ; then bdb_prefix="none" fi # Only prefix given - set lib and include if test "X$bdb_prefix" != "Xnone" -a "X$bdb_lib_dir" = "Xnone" -a "X$bdb_include_dir" = "Xnone" ; then bdb_lib_dir="$bdb_prefix/lib" bdb_include_dir="$bdb_prefix/include" fi # Nothing given - search if test "X$bdb_prefix" = "Xnone" -a "X$bdb_lib_dir" = "Xnone" -a "X$bdb_include_dir" = "Xnone" -a "X$bdb_dbname" = "Xnone" ; then bdb_prefix="/usr" bdb_lib_dir="/usr/lib" bdb_include_dir="/usr/include" extraprefix= # OSX fink area added if found and /sw/bin is in the PATH if test -d /sw/include -a -d /sw/lib ; then if echo $PATH |grep /sw/bin >/dev/null; then extraprefix=/sw fi fi # Sigh! And this still might not be good enough. for bdbc_version in 5.3 5.2 5.1 5.0 4.9 4.8 4.7 4.6 4.5 4.4 4.3 4.2 4.1 4.0 4 3.3 3.2 3.1 3 2; do bdbc_major=`echo $bdbc_version | sed -e 's/^\(.\).*$/\1/'`; bdbc_version2=`echo $bdbc_version | sed -e 's/^\(.\).\(.\)$/\1\2/'` for bdbc_prefix in $extraprefix /usr/local/BerkeleyDB.$bdbc_version /usr/local /opt/local /usr; do bdbc_libdir=$bdbc_prefix/lib for bdbc_incdir in $bdbc_prefix/include/db$bdbc_version $bdbc_prefix/include/db$bdbc_version2 $bdbc_prefix/include/db$bdbc_major $bdbc_prefix/include ; do if test -r $bdbc_incdir/db.h ; then header_bdbc_version=`sed -ne 's/^.*DB_VERSION_STRING.*Berkeley DB \(...\).*/\1/p' $bdbc_incdir/db.h` if test "X$header_bdbc_version" = "X$bdbc_version" ; then for bdbc_name in db-$bdbc_version db$bdbc_version db-$bdbc_version2 db$bdbc_version2; do bdbc_libdir_multiarch= if test "X$multiarch" != X; then bdbc_libdir_multiarch=$bdbc_libdir/$multiarch fi for bdbc_libdir2 in $bdbc_libdir_multiarch $bdbc_libdir $bdbc_libdir/db$bdbc_version $bdbc_libdir/db$bdbc_version2; do if test -r $bdbc_libdir2/lib$bdbc_name.a -o -r $bdbc_libdir2/lib$bdbc_name.so -o -r $bdbc_libdir2/lib$bdbc_name.dylib; then bdb_version=$bdbc_version bdb_prefix=$bdbc_prefix bdb_include_dir=$bdbc_incdir bdb_lib_dir=$bdbc_libdir2 bdb_dbname=$bdbc_name break 5 fi done done fi fi done done done fi AC_MSG_CHECKING([Oracle Berkeley DB (BDB) version]) AC_MSG_RESULT($bdb_version) AC_MSG_CHECKING(location of BDB libs) AC_MSG_RESULT($bdb_lib_dir) AC_MSG_CHECKING(location of BDB includes) AC_MSG_RESULT($bdb_include_dir) if test "$bdb_prefix" != no; then nLDFLAGS=$LDFLAGS nCPPFLAGS= if test "$bdb_lib_dir" != /usr/lib; then nLDFLAGS="-L$bdb_lib_dir"; fi if test "$bdb_dbname" = none; then # Yuck, yuck, yuck - can't they create a bdb-config program like GNOME? dnl need to change quotes to allow square brackets changequote(<<, >>)dnl bdb_dbname=`cd $bdb_lib_dir; ls -1 libdb[-0-9.]*.a libdb[-0-9.]*.{so,dylib}* 2>/dev/null | sed -e 's/^lib//' -e 's/\.a$//' -e 's/\.so.*$//' -e 's/\.dylib.*$//' | head -1` changequote([, ])dnl if test "X$bdb_dbname" = X; then AC_MSG_WARN(Cannot find the BDB library name from the files in $bdb_lib_dir) AC_MSG_WARN(Assuming it is 'db' and will link like -ldb) AC_MSG_WARN(Use --with-bdb-dbname=NAME if this is wrong) bdb_dbname=db fi fi AC_MSG_CHECKING(name of BDB library) AC_MSG_RESULT($bdb_dbname) if test "$bdb_include_dir" != /usr/include; then nCPPFLAGS="-I$bdb_include_dir"; fi LDFLAGS="$nLDFLAGS $LDFLAGS" CPPFLAGS="$nCPPFLAGS $CPPFLAGS" LIBS="-l$bdb_dbname $LIBS" AC_CHECK_HEADERS(db.h) have_libdb=no if test "$ac_cv_header_db_h" = yes ; then AC_MSG_CHECKING(for BDB V1 dbopen) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[dbopen(NULL, 0, 0, DB_BTREE, NULL);]])],[AC_DEFINE(HAVE_DBOPEN, 1, BDB has dbopen method) if test $have_libdb = no; then bdb_available="Version 1.x - not supported" have_libdb=no fi AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for BDB V2 db_open) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[db_open(NULL, DB_BTREE, 0, 0, NULL, NULL, NULL);]])],[AC_DEFINE(HAVE_DB_OPEN, 1, BDB has db_open method) have_libdb=yes AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for BDB V3/V4.x db_create) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[db_create(NULL, NULL, 0);]])],[AC_DEFINE(HAVE_DB_CREATE, 1, BDB has db_create method) have_libdb=yes AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) have_bdb_open_7_args=no AC_MSG_CHECKING(for BDB V4.1+ DB->open with 7 arguments) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[DB *bdb; bdb->open(bdb, NULL, NULL, NULL, DB_BTREE, 0, 0);]])],[AC_DEFINE(HAVE_BDB_OPEN_7_ARGS, 1, BDB has open method with 7 args) have_libdb=yes have_bdb_open_7_args=yes AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) if test "X$have_bdb_open_7_args" = Xno; then # Cannot have 6 args if 7 args worked AC_MSG_CHECKING(for BDB V4.0 DB->open with 6 arguments) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[DB *bdb; bdb->open(bdb, NULL, NULL, DB_BTREE, 0, 0);]])],[AC_DEFINE(HAVE_BDB_OPEN_6_ARGS, 1, BDB has open method with 6 args) have_libdb=yes AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) fi AC_MSG_CHECKING(for BDB DB->close with 2 arguments) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[DB *bdb; bdb->close(bdb, 0);]])],[AC_DEFINE(HAVE_BDB_CLOSE_2_ARGS, 1, BDB has close method with 2 args) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for BDB DB->fd with 2 arguments) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[DB *bdb; bdb->fd(bdb, 0);]])],[AC_DEFINE(HAVE_BDB_FD_2_ARGS, 1, BDB has fd method with 2 args) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for BDB DB->set_flags) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[DB *bdb; bdb->set_flags(bdb, 0);]])],[AC_DEFINE(HAVE_BDB_SET_FLAGS, 1, BDB has set_flags method) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) AC_MSG_CHECKING(whether DB_TXN defined in db.h) dnl In BDB, DB_TXN is a pointer to a structure never defined AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[DB_TXN* ptr=(DB_TXN*)NULL]])],[AC_DEFINE(HAVE_BDB_DB_TXN, 1, BDB defines DB_TXN) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) AC_MSG_CHECKING(whether DBC defined in db.h) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[size_t len=sizeof(DBC)]])],[AC_DEFINE(HAVE_BDB_CURSOR, 1, BDB defines DBC) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) AC_MSG_CHECKING(number of arguments to db_cursor) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[DB* db; db->cursor(db, NULL, NULL, 0);]])],[AC_DEFINE(HAVE_BDB_CURSOR_4_ARGS, 1, BDB cursor method has 4 arguments) AC_MSG_RESULT(4)],[AC_MSG_RESULT(3)]) fi if test "X$have_libdb" = Xyes; then bdb_available="Version $bdb_version (library $bdb_dbname in $bdb_lib_dir)" LIBRDF_LIBS="$LIBRDF_LIBS $nLDFLAGS -l$bdb_dbname" LIBRDF_CPPFLAGS="$LIBRDF_CPPFLAGS $nCPPFLAGS" fi fi fi CPPFLAGS="$LIBRDF_CPPFLAGS" LDFLAGS="$LIBRDF_LDFLAGS" LIBS="$LIBRDF_LIBS" dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(errno.h stdlib.h unistd.h string.h fcntl.h time.h sys/time.h sys/stat.h getopt.h stddef.h) AC_HEADER_TIME dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_BIGENDIAN dnl Checks for library functions. AC_CHECK_FUNCS(getopt getopt_long memcmp mkstemp mktemp tmpnam gettimeofday getenv) AM_CONDITIONAL(MEMCMP, test $ac_cv_func_memcmp = no) AM_CONDITIONAL(GETOPT, test $ac_cv_func_getopt = no -a $ac_cv_func_getopt_long = no) dnl Checks for URI resolvers CPPFLAGS="$LIBRDF_CPPFLAGS" LDFLAGS="$LIBRDF_LDFLAGS" LIBS="$LIBRDF_LIBS" dnl Checks for RDF parsers parser_modules=raptor rdf_parsers_available= # Check for rasqal before raptor so that we can see if rasqal was already # built with raptor2 and can then enforce raptor2 is required RASQAL_MIN_VERSION=0.9.25 RASQAL_MAX_VERSION=0.9.99 AC_SUBST(RASQAL_MIN_VERSION) AC_SUBST(RASQAL_MAX_VERSION) PKG_CHECK_MODULES([RASQAL],[rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION],[ RASQAL_VERSION=`$PKG_CONFIG rasqal --modversion 2>/dev/null` ],[ AC_MSG_ERROR(Rasqal is not installed or too old - see http://librdf.org/rasqal/ to get a version in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION) ]) LIBRDF_EXTERNAL_CPPFLAGS="$RASQAL_CFLAGS $LIBRDF_EXTERNAL_CPPFLAGS" LIBRDF_EXTERNAL_LIBS="$RASQAL_LIBS $LIBRDF_EXTERNAL_LIBS" rdf_query="rasqal(system $RASQAL_VERSION)" # Check for raptor RAPTOR_MIN_VERSION=2.0.7 PKG_CHECK_MODULES([RAPTOR2],[raptor2 >= $RAPTOR_MIN_VERSION],[ RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null` ],[ AC_MSG_ERROR(Raptor2 is not installed or too old - see http://librdf.org/raptor/ to get version $RAPTOR_MIN_VERSION or newer) ]) LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS $RAPTOR2_LIBS" LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS $RASQAL_LIBS" LIBRDF_EXTERNAL_CPPFLAGS="$RAPTOR2_CFLAGS $LIBRDF_EXTERNAL_CPPFLAGS" LIBRDF_EXTERNAL_LIBS="$LIBRDF_DIRECT_LIBS $LIBRDF_EXTERNAL_LIBS" rdf_parsers_available="$parser_available raptor(system $RAPTOR_VERSION)" AC_SUBST(RAPTOR_MIN_VERSION) dnl for redland.pc.in mostly HAVE_RAPTOR2_API=1 AC_SUBST(HAVE_RAPTOR2_API) dnl Checks for modules digest_modules="md5 sha1 ripemd160" AC_MSG_CHECKING(digests wanted) AC_ARG_ENABLE(digests, [ --enable-digests=LIST Use digests (default=md5 sha1 ripemd160)], digest_modules="$enableval") AC_MSG_RESULT($digest_modules) DIGEST_OBJS= DIGEST_SRCS= digest_modules_available= dnl hashes HASH_OBJS= HASH_SRCS= AC_MSG_CHECKING(for bdb hash support) if test "$have_libdb" = yes; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BDB_HASH, 1, [Have BDB hash support]) HASH_OBJS="$HASH_OBJS rdf_hash_bdb.lo" HASH_SRCS="$HASH_SRCS rdf_hash_bdb.c" else AC_MSG_RESULT(no) fi AC_SUBST(HASH_OBJS) AC_SUBST(HASH_SRCS) dnl Storages persistent_storages="/file/tstore/mysql/sqlite/" persistent_store=no all_storages="memory file hashes trees mysql sqlite tstore postgresql virtuoso" always_available_storages="memory file hashes trees" dnl default availabilities and enablements for storage in $all_storages; do eval $storage'_storage_available=no' eval $storage'_storage=no' done for storage in $always_available_storages; do eval $storage'_storage_available=yes' eval $storage'_storage=yes' done REDLAND_MODULE_PATH="" AC_ARG_WITH(module-path, [ --with-module-path=PATH Default search path for modules (default=/usr/local/lib/redland:${libdir}/redland], REDLAND_MODULE_PATH="$witheval") if test "x$REDLAND_MODULE_PATH" = "x"; then REDLAND_MODULE_PATH=$libdir"/redland" if test "x$prefix" != "xNONE"; then REDLAND_MODULE_PATH="/usr/local/lib/redland:"$REDLAND_MODULE_PATH fi fi AC_SUBST(REDLAND_MODULE_PATH) storages_available="memory file hashes(memory) trees" if test "x$have_libdb" = xyes; then storages_available="$storages_available hashes(bdb $bdb_version)" fi AC_ARG_WITH(threestore, [ --with-threestore(=CONFIG|yes|no) Location of 3store-config (default=auto)], tstore_config="$withval", tstore_config="") if test "X$tstore_config" != "Xno"; then if test "X$tstore_config" != "Xyes" ; then TSTORE_CONFIG=$tstore_config fi tstore_config=yes fi if test $tstore_config = yes -a "X$TSTORE_CONFIG" = "X" ; then AC_CHECK_PROGS(TSTORE_CONFIG, 3store-config) fi AC_MSG_CHECKING(for 3store library) if test "X$TSTORE_CONFIG" != X -a "X$PKG_CONFIG" != X ; then tstore_version=`$TSTORE_CONFIG --version` storages_available="$storages_available 3store($tstore_version)" tstore_storage_available=yes AC_MSG_RESULT(yes - version $tstore_version) else AC_MSG_RESULT(no) fi AC_ARG_WITH(mysql, [ --with-mysql(=CONFIG|yes|no) Location of MySQL 3/4 mysql_config (default=auto)], mysql_config="$withval", mysql_config="") if test "X$mysql_config" != "Xno"; then if test "X$mysql_config" != "Xyes" ; then MYSQL_CONFIG=$mysql_config fi mysql_config=yes fi if test $mysql_config = yes -a "X$MYSQL_CONFIG" = "X" ; then AC_CHECK_PROGS(MYSQL_CONFIG, mysql_config) fi libmysql_min_version=3.23.56 # Also tested on 4.0.14 mysql_cflags= mysql_libs= if test "X$MYSQL_CONFIG" != X; then dnl need to change quotes to allow square brackets changequote(<<, >>)dnl mysql_libs=`$MYSQL_CONFIG --libs | sed -e "s/'//g"` # Stop the MySQL config program adding -Os or -O options to CFLAGS mysql_cflags=`$MYSQL_CONFIG --cflags | sed -e "s/'//g" -e "s/[ \t]-O[A-Za-z0-9]*/ /" ` changequote([, ])dnl LIBS="$LIBRDF_LIBS $mysql_libs" CPPFLAGS="$LIBRDF_CPPFLAGS $mysql_cflags" AC_MSG_CHECKING(for mysql library) LIBMYSQL_VERSION=`$MYSQL_CONFIG --version` libmysql_version_dec=`echo $LIBMYSQL_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` libmysql_min_version_dec=`echo $libmysql_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` AC_MSG_RESULT(yes - version $LIBMYSQL_VERSION) if test $libmysql_version_dec -lt $libmysql_min_version_dec; then AC_MSG_WARN(Using libmysql $LIBMYSQL_VERSION is unsupported - $libmysql_min_version or newer recommended.) else storages_available="$storages_available mysql($LIBMYSQL_VERSION)" mysql_storage_available=yes fi AC_MSG_CHECKING(whether MYSQL_OPT_RECONNECT is declared) AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include int x=MYSQL_OPT_RECONNECT;])], AC_DEFINE(HAVE_MYSQL_OPT_RECONNECT, 1, [have MYSQL_OPT_RECONNECT declared]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) LIBS="$LIBRDF_LIBS" CPPFLAGS="$LIBRDF_CPPFLAGS" fi AC_ARG_WITH(sqlite, [ --with-sqlite(=yes|no) Enable SQLite store (default=auto)], with_sqlite="$withval", with_sqlite="auto") if test "X$with_sqlite" != Xno; then PKG_CHECK_MODULES([SQLITE],[sqlite3],[ SQLITE_VERSION=`$PKG_CONFIG sqlite3 --modversion` with_sqlite=yes ],[with_sqlite=no]) fi AC_MSG_CHECKING(using sqlite library) if test "X$with_sqlite" != Xno ; then storages_available="$storages_available sqlite($SQLITE_VERSION)" sqlite_storage_available=yes AC_MSG_RESULT(yes - version $SQLITE_VERSION) CPPFLAGS="$LIBRDF_CPPFLAGS $SQLITE_CFLAGS" AC_CHECK_HEADERS(sqlite3.h sqlite.h) CPPFLAGS="$LIBRDF_CPPFLAGS" else AC_MSG_RESULT(no) fi AC_ARG_WITH(postgresql, [ --with-postgresql(=CONFIG|yes|no) Location of pg_config (default=auto)], pg_config="$withval", postgresql_config="") if test "X$pg_config" != "Xno"; then if test "X$pg_config" != "Xyes" ; then PG_CONFIG=$pg_config fi pg_config=yes fi if test $pg_config = yes -a "X$PG_CONFIG" = "X" ; then AC_CHECK_PROGS(PG_CONFIG, pg_config) fi AC_MSG_CHECKING(for postgresql library) if test "X$PG_CONFIG" != X ; then postgresql_version=`$PG_CONFIG --version | sed -e 's/^.* //'` storages_available="$storages_available postgresql($postgresql_version)" postgresql_storage_available=yes AC_MSG_RESULT(yes - version $postgresql_version) CPPFLAGS="$LIBRDF_CPPFLAGS -I`$PG_CONFIG --includedir`" AC_CHECK_HEADERS(libpq-fe.h) CPPFLAGS="$LIBRDF_CPPFLAGS" LIBS="$LIBRDF_LIBS -L`$PG_CONFIG --libdir` -lpq" else AC_MSG_RESULT(no) fi ########################################################################## # # # OpenLink Virtuoso storage support # # # ########################################################################## AC_ARG_WITH(virtuoso, [ --with-virtuoso(=yes|no) Enable Virtuoso RDF store (default=auto)], with_virtuoso="$withval", with_virtuoso="auto") ## ## Checkout ODBC situation ## # # Initialize variables # found_odbc=no ODBC_CFLAGS= ODBC_LIBS= # # Check for iODBC support # if test "$found_odbc" = "no" then AC_ARG_WITH(iodbc, [dnl AS_HELP_STRING([--with-iodbc(=DIR)],[Select iODBC support]) AS_HELP_STRING([],[DIR is the iODBC base install directory]) AS_HELP_STRING([],[(default=/usr/local)]) ] , [ if test "$withval" = "yes" then withval=/usr/local fi PATH_IODBC="$withval/bin:$PATH" AC_PATH_PROG(IODBC_CONFIG, iodbc-config, no, [$PATH_IODBC]) AC_MSG_CHECKING([for iODBC support]) if test -f "$withval/lib/libiodbc.dylib" then found_odbc=iODBC # Mac OS X ODBC_CFLAGS="-I$withval/include" ODBC_LIBS="-L$withval/lib -liodbc" AC_MSG_RESULT(yes) elif test -x "$IODBC_CONFIG" then found_odbc=iODBC ODBC_CFLAGS=`$IODBC_CONFIG --cflags` ODBC_LIBS=`$IODBC_CONFIG --libs` AC_MSG_RESULT(yes) elif test -f "$withval/lib/libiodbc.a" then found_odbc=iODBC ODBC_CFLAGS="-I$withval/include" ODBC_LIBS="-L$withval/lib -liodbc" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ]) fi # # Check for UnixODBC support # if test "$found_odbc" = "no" then AC_ARG_WITH(unixodbc, [dnl AS_HELP_STRING([--with-unixodbc(=DIR)],[Select UnixODBC support]) AS_HELP_STRING([],[DIR is the UnixODBC base install directory]) AS_HELP_STRING([],[(default=/usr/local)]) ], [ if test "$withval" = "yes" then withval=/usr/local fi AC_MSG_CHECKING([for UnixODBC support]) if test -f "$withval/lib/libodbc.a" then found_odbc=unixODBC ODBC_CFLAGS="-I$withval/include" ODBC_LIBS="-L$withval/lib -lodbc" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ]) fi # # Check for DataDirect support # if test "$found_odbc" = "no" then AC_ARG_WITH(datadirect, [dnl AS_HELP_STRING([--with-datadirect(=DIR)],[Select DataDirect support]) AS_HELP_STRING([],[DIR is the DataDirect base install directory]) AS_HELP_STRING([],[(default=/usr/local)]) ], [ if test "$withval" = "yes" then withval=/usr/local fi AC_MSG_CHECKING([for DataDirect support]) if test -f "$withval/lib/libodbc.a" then found_odbc=DataDirect ODBC_CFLAGS="-I$withval/include" ODBC_LIBS="-L$withval/lib -lodbc" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ]) fi # # Check for custom ODBC support # if test "$found_odbc" = "no" then AC_ARG_WITH(odbc-include, [dnl AS_HELP_STRING([--with-odbc-inc=DIR],[Specify custom ODBC include directory]) AS_HELP_STRING([],[(default=/usr/local/include)]) ], [ if test "$withval" = "yes" then withval=/usr/local/include fi AC_MSG_CHECKING([for sql.h]) if test -f "$withval/sql.h" then ODBC_CFLAGS="-I$withval" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ]) AC_ARG_WITH(odbc-lib, [dnl AS_HELP_STRING([--with-odbc-lib=DIR],[Specify custom ODBC lib directory]) AS_HELP_STRING([],[(default=/usr/local/lib)])dnl ], [ if test "$withval" = "yes" then withval=/usr/local/lib fi ac_save_LDFLAGS=$LDFLAGS test -n "$withval" && LDFLAGS="$LDFLAGS -L$withval" AC_CHECK_LIB(iodbc, SQLConnect, [ ODBC_LIBS="-L$withval -liodbc"; found_odbc=iODBC ], [ AC_CHECK_LIB(odbc, SQLConnect, [ ODBC_LIBS="-L$withval -lodbc"; found_odbc=ODBC ]) ]) LDFLAGS=$ac_save_LDFLAGS ]) fi # # Maybe the libraries are in some default directory # if test "$found_odbc" = "no" then AC_PATH_PROG(IODBC_CONFIG, iodbc-config, no) AC_MSG_CHECKING([for iODBC support]) if test -x "$IODBC_CONFIG" then found_odbc=iODBC ODBC_CFLAGS=`$IODBC_CONFIG --cflags` ODBC_LIBS=`$IODBC_CONFIG --libs` AC_MSG_RESULT(yes) fi fi # # Maybe the libraries are in some default directory # if test "$found_odbc" = "no" then AC_CHECK_LIB(iodbc, SQLConnect, [ ODBC_LIBS="-liodbc"; found_odbc=iODBC ], [ AC_CHECK_LIB(odbc, SQLConnect, [ ODBC_LIBS="-lodbc"; found_odbc=ODBC ]) ]) fi # # Expand our compile flags # AC_SUBST(ODBC_CFLAGS) AC_SUBST(ODBC_LIBS) # # Check if SQLLEN, SQLULEN, SQLBIGINT, SQLUBIGINT are defined # save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS" AC_CHECK_TYPE(SQLLEN, , AC_DEFINE(SQLLEN, SQLINTEGER, [define to SQLINTEGER if not defined in the ODBC headers]) AC_DEFINE(SQLULEN, SQLUINTEGER, [define to SQLUINTEGER if not defined in the ODBC headers]), [ #include #include #include ]) if test "x$with_virtuoso" != "xno" then AC_MSG_CHECKING([virtuoso storage dependencies]) if test "$found_odbc" = "no" then AC_MSG_RESULT(no) AC_MSG_WARN([Disabled virtuoso storage:]) AC_MSG_WARN([ could not find ODBC header files and/or libraries]) virtuoso_storage_available=no else AC_MSG_RESULT(yes) storages_available="$storages_available virtuoso" virtuoso_storage_available=yes fi fi CPPFLAGS="$save_CPPFLAGS" ########################################################################## # # # OpenLink Virtuoso storage support ***END*** # # # ########################################################################## # This is needed because autoheader can't work out which computed # symbols must be pulled from acconfig.h into config.h.in if test "x" = "y"; then AC_DEFINE(STORAGE_FILE, 1, [Building file storage]) AC_DEFINE(STORAGE_HASHES, 1, [Building hashes storage]) AC_DEFINE(STORAGE_TREES, 1, [Building trees storage]) AC_DEFINE(STORAGE_MEMORY, 1, [Building memory storage]) AC_DEFINE(STORAGE_MYSQL, 1, [Building MySQL storage]) AC_DEFINE(STORAGE_SQLITE, 1, [Building SQLite storage]) AC_DEFINE(STORAGE_TSTORE, 1, [Building 3store storage]) AC_DEFINE(STORAGE_POSTGRESQL, 1, [Building PostgreSQL storage]) AC_DEFINE(STORAGE_VIRTUOSO, 1, [Building Virtuoso storage]) fi AC_MSG_CHECKING(storages required) AC_ARG_ENABLE(storages, [ --enable-storages=LIST Use storages (default=all)], storages="$enableval") if test "X$storages" = Xall -o "X$storages" = X; then storages="$all_storages" AC_MSG_RESULT(all) else AC_MSG_RESULT($storages) fi dnl absolutely ensuring memory is enabled if echo $storages | grep memory >/dev/null; then : else storages="memory $storages" fi for storage in $storages; do if eval test \$$storage'_storage_available' = yes; then eval $storage'_storage=yes' NAME=`echo $storage | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` n=STORAGE_${NAME} AC_DEFINE_UNQUOTED($n) storages_enabled="$storages_enabled $storage" if echo $persistent_storages | grep "/$storage/" >/dev/null; then persistent_store=yes fi fi done AM_CONDITIONAL(STORAGE_FILE, test $file_storage = yes) AM_CONDITIONAL(STORAGE_HASHES, test $hashes_storage = yes) AM_CONDITIONAL(STORAGE_TREES, test $trees_storage = yes) AM_CONDITIONAL(STORAGE_MEMORY, test $memory_storage = yes) AM_CONDITIONAL(STORAGE_MYSQL, test $mysql_storage = yes) AM_CONDITIONAL(STORAGE_SQLITE, test $sqlite_storage = yes) AM_CONDITIONAL(STORAGE_TSTORE, test $tstore_storage = yes) AM_CONDITIONAL(STORAGE_POSTGRESQL, test $postgresql_storage = yes) AM_CONDITIONAL(STORAGE_VIRTUOSO, test $virtuoso_storage = yes) if test $mysql_storage = yes; then MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags | sed -e "s/'//g" -e "s/-O[A-Za-z0-9]*//" ` MYSQL_LIBS="$LIBRDF_LIBS $mysql_libs" fi if test $tstore_storage = yes; then TSTORE_CPPFLAGS="`$TSTORE_CONFIG --cflags` `$PKG_CONFIG glib --cflags`" TSTORE_LIBS="`$TSTORE_CONFIG --libs` `$PKG_CONFIG glib --libs`" fi if test $postgresql_storage = yes; then POSTGRESQL_CPPFLAGS="-I`$PG_CONFIG --includedir`" POSTGRESQL_LIBS="-L`$PG_CONFIG --libdir` -lpq" fi if test $virtuoso_storage = yes; then VIRTUOSO_CPPFLAGS="$ODBC_CFLAGS" VIRTUOSO_LIBS="$ODBC_LIBS" fi if test "$persistent_store" = no; then AC_MSG_WARN(No persistant storage is available or enabled) fi AC_SUBST(MYSQL_CPPFLAGS) AC_SUBST(MYSQL_LIBS) AC_SUBST(SQLITE_CFLAGS) AC_SUBST(SQLITE_LIBS) AC_SUBST(TSTORE_CPPFLAGS) AC_SUBST(TSTORE_LIBS) AC_SUBST(POSTGRESQL_CPPFLAGS) AC_SUBST(POSTGRESQL_LIBS) AC_SUBST(VIRTUOSO_CPPFLAGS) AC_SUBST(VIRTUOSO_LIBS) if test "$modular" = yes; then LIBRDF_INTERNAL_CPPFLAGS="$LIBRDF_INTERNAL_CPPFLAGS $INCLTDL" LIBRDF_INTERNAL_LIBS="$LIBRDF_INTERNAL_LIBS $LIBLTDL" LIBRDF_INTERNAL_DEPS="$LIBRDF_INTERNAL_DEPS $LTDLDEPS" AC_DEFINE(MODULAR_LIBRDF, 1, [Build storage backends as modules]) else LIBRDF_CPPFLAGS="$LIBRDF_CPPFLAGS $MYSQL_CPPFLAGS $SQLITE_CFLAGS $TSTORE_CPPFLAGS $POSTGRESQL_CPPFLAGS $VIRTUOSO_CPPFLAGS" LIBRDF_LIBS="$LIBRDF_LIBS $MYSQL_LIBS $SQLITE_LIBS $TSTORE_LIBS $POSTGRESQL_LIBS $VIRTUOSO_LIBS" fi AM_CONDITIONAL(MODULAR_LIBRDF, test $modular = yes) CPPFLAGS="$LIBRDF_CPPFLAGS" LDFLAGS="$LIBRDF_LDFLAGS" LIBS="$LIBRDF_LIBS" dnl Check for use of threads AC_ARG_WITH(threads, [ --with-threads With POSIX thread support (default=no)], with_threads="$withval", with_threads="no") AC_CHECK_HEADERS(pthread.h) AC_MSG_CHECKING(if POSIX threads should be used) if test $with_threads = "yes" ; then if test "$ac_cv_header_pthread_h" = yes ; then AC_DEFINE(WITH_THREADS, 1, [Use POSIX threads]) LIBRDF_LIBS="$LIBRDF_LIBS -lpthread" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi else AC_MSG_RESULT(no) fi LIBS=$LIBRDF_LIBS # Maybe add some local digest modules for module in $digest_modules; do module_u=`echo $module | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` AC_MSG_CHECKING(for local $module digest module) base=rdf_digest_$module if test -r $srcdir/src/$base.c; then AC_MSG_RESULT(yes) n=HAVE_LOCAL_${module_u}_DIGEST AC_DEFINE_UNQUOTED($n) DIGEST_OBJS="$DIGEST_OBJS $base.lo" DIGEST_SRCS="$DIGEST_SRCS $base.c" digest_modules_available="$digest_modules_available $module" else AC_MSG_RESULT(no) fi done AC_SUBST(DIGEST_OBJS) AC_SUBST(DIGEST_SRCS) # This is needed because autoheader can't work out which computed # symbols must be pulled from acconfig.h into config.h.in if test "x" = "y"; then AC_DEFINE(HAVE_LOCAL_MD5_DIGEST, 1, [Have local MD5 digest]) AC_DEFINE(HAVE_LOCAL_SHA1_DIGEST, 1, [Have local SHA1 digest]) AC_DEFINE(HAVE_LOCAL_RIPEMD160_DIGEST, 1, [Have local RIPEMD160 digest]) fi #LIBRDF_EXTERNAL_CPPFLAGS="$LIBRDF_EXTERNAL_CPPFLAGS $LIBRDF_CPPFLAGS" LIBRDF_EXTERNAL_LIBS="$LIBRDF_EXTERNAL_LIBS $LIBRDF_LIBS" # Everything except things with .pc files (raptor and rasqal) # 3store uses it but is optional and thus tricky to specify this way LIBRDF_PKGCONFIG_PRIVATE_LIBS=`echo $LIBRDF_LIBS | sed -e 's, ..top_build_prefix.libltdl/libltdlc.la, ,'` # Make final changes to cflags CFLAGS="-DLIBRDF_INTERNAL=1 $CFLAGS" assert=yes AC_ARG_ENABLE(assertions, [ --enable-assertions Perform run time assertion checks (default yes). ], assert=$enableval) if test "$assert" = "yes"; then AC_DEFINE(LIBRDF_ASSERT, 1, [Run time assertion checks.]) fi assert_messages=yes AC_ARG_ENABLE(assert-messages, [ --enable-assert-messages Print run time assertion check failure messages (default yes). ], assert_messages=$enableval) if test "$assert_messages" = "yes"; then AC_DEFINE(LIBRDF_ASSERT_MESSAGES, 1, [Print run time assertion check failure messages.]) fi debug_messages=no AC_ARG_ENABLE(debug, [ --enable-debug Enable debug messages (default no). ], debug_messages=$enableval) if test "$debug_messages" = "yes"; then LIBRDF_CPPFLAGS="-g -DLIBRDF_DEBUG=1 $LIBRDF_CPPFLAGS" fi if test "$USE_MAINTAINER_MODE" = yes; then CPPFLAGS="$MAINTAINER_CPPFLAGS $CPPFLAGS" fi if test "$USE_MAINTAINER_MODE" = yes -a $release_version = no; then dnl need to change quotes to allow square brackets changequote(<<, >>)dnl CFLAGS=`echo $CFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` CXXFLAGS=`echo $CXXFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` LIBRDF_CPPFLAGS=`echo $LIBRDF_CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` LIBRDF_EXTERNAL_CPPFLAGS=`echo $LIBRDF_EXTERNAL_CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` LIBRDF_INTERNAL_CPPFLAGS=`echo $LIBRDF_INTERNAL_CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` changequote([, ])dnl fi LIBS="$LIBS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" LIBRDF_LIBTOOLLIBS=librdf.la AC_SUBST(LIBRDF_EXTERNAL_CPPFLAGS) AC_SUBST(LIBRDF_EXTERNAL_LIBS) AC_SUBST(LIBRDF_DIRECT_LIBS) AC_SUBST(LIBRDF_INTERNAL_CPPFLAGS) AC_SUBST(LIBRDF_INTERNAL_LIBS) AC_SUBST(LIBRDF_INTERNAL_DEPS) AC_SUBST(LIBRDF_CPPFLAGS) AC_SUBST(LIBRDF_LDFLAGS) AC_SUBST(LIBRDF_LIBTOOLLIBS) AC_SUBST(LIBRDF_PKGCONFIG_PRIVATE_LIBS) AC_SUBST(MEM) AC_SUBST(MEM_LIBS) AC_SUBST(RECHO) AC_SUBST(RECHO_N) AC_SUBST(RECHO_C) abs_top_srcdir=`cd $srcdir; pwd` AC_SUBST(abs_top_srcdir) abs_top_builddir=`pwd` AC_SUBST(abs_top_builddir) dnl automake 1.11 AM_SILENT_RULES([no]) AC_CONFIG_FILES([Makefile redland.rdf docs/Makefile docs/version.xml examples/Makefile scripts/Makefile src/Makefile src/librdf.h src/redland.spec src/win32_rdf_config.h src/win32/Makefile utils/Makefile demos/Makefile data/Makefile redland.pc]) AC_CONFIG_FILES([redland-config], [chmod +x redland-config]) AC_CONFIG_FILES([redland-src-config], [chmod +x redland-src-config]) dnl Check for gtk-doc and docbook GTK_DOC_CHECK([1.3]) AC_OUTPUT AC_MSG_RESULT([ Redland build summary: ]) if test "$modular" = yes; then AC_MSG_RESULT([ Using modular storage backends in $REDLAND_MODULE_PATH]) else AC_MSG_RESULT([ Using monolithic storage backends]) fi AC_MSG_RESULT([ Oracle Berkeley DB (BDB) : $bdb_available Triple stores available : $storages_available Triple stores enabled :$storages_enabled RDF parsers :$rdf_parsers_available RDF query : $rdf_query Content digests :$digest_modules_available ]) redland-1.0.17/acinclude.m40000644000175000017500000000001210674751745012334 00000000000000dnl empty redland-1.0.17/HACKING.html0000644000175000017500000002617412071146137012100 00000000000000 Redland RDF Application Framework - Hacking Redland librdf

Hacking Redland librdf

2011-08-23

Dave Beckett

Commits

Should be:

  • Licensed with the same license as Redland librdf.
  • Patches in GNU diff -u unifed context format preferred.
  • Include tests if they add new features.

Code Style

Do not make large commits that only change code style unless you have previously had this agreed or it is in code under major refactoring where a diff is not a large concern. There is always diff -b when large code style (whitespace) changes are made.

Indenting

2 spaces. No tabs.

All code must be wrapped to 80 chars as far as is possible. Function definitions or calls should indent the parameters to the left (.

Redland libraries use very long function names following the naming convention which can make linebreaking very hard. In this case, indent function parameters on new lines 4 spaces after the function name like this:


  var = function_name_with_very_long_name_that_is_hard_to_wrap_args(
            argument1_with_very_long_name_or_expression,
            argument2,
            ..)
  

Use no space between a keyword followed by braces argument. For example, use if(cond) rather than if (cond) (ditto for while, do etc.) and functionname(...) rather than functionname (...) in both definition and calls of functions.

There is nothing wrong with introducing a variable to break up a very long function call argument.

Expressions

Put spaces around operators in expressions, assignments, tests, conditions

GOOD:

  • a += 2 * x
  • if(a < 2)

BAD:

  • a+=2*x
  • if(a<2)

When comparing to 0 or a NULL pointer, use the idiomatic form that has no comparison.

GOOD:

  • if(!ptr)
  • if(!index)

BAD:

  • if(ptr == NULL)
  • if(index == 0)
  • if(0 == index)

When comparing a variable to a constant, the code has currently used if(var == constant) rather than the slightly safer, and easier to compile check, if(constant == var).

Blocks

In general add {}s around blocks in if else chains when one of the blocks has more than 1 line of code. Try not to mix, but the final case if it is one line, can be braceless.


  if(var == 1) {
    ... multiple lines of code ...
  } else {
    ... multiple lines of code ...
  }
  

or


  if(var == 1)
    ... one line of code
  else
    ... one line of code
  

or


  if(var == 1) {
    ... multiple lines of code ...
  } else if(var == 2) {
    ... multiple lines of code and / or more if conditions ...
  } else
    ... one line of code ...
  

Switches

If using if else chains on an enumeration, don't do that, use a switch() which GCC can use to find missing cases when they get added.


  switch(enum_var) {
    case ENUM_1:
      ... code ...
      break;
  
    case ENUM_2:
      ... code ...
      break;
  
    case ENUM_DONT_CARE:
    default:
      ... code ...
      break;
  }
  

There should ALWAYS be a default: case.

Functions

Declare functions in this format:


  returntype
  functionname(type1 param1, type2 param2, ...)
  {
    type3 var1;
    type4 var2;
  
    ... first line of code ...
  
    tidy:
      ... cleanup code...
  
    return value;
   }
  

Notes:

  • Declare one variable per line
  • Declare all variables at the top of the function (K&R C style)
  • You may declare variables in inner {} blocks. The form if(1) { ... var decls ...; more code } may be used but a code rewrite is preferable.
  • If a label is used it MUST be used only for cleanup, and going forward in the code to the end of the function.
  • Multiple return are allowed but for obvious error or result returns. Do not twist the code to enable a single return.
  • goto may be used for resource cleanup and result return where control flow only goes forward.

C Pre-Processor (CPP) Macros

Always define macros for internal constants and name the macros with the library prefix followed by a descriptive name in ALL CAPS such as:


  #define LIBRDF_FOOBAR_BUFFER_SIZE 1234
  

When evaluating macro symbols that may be undefined, always check the symbol is defined first. Like this:


  #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 42
     ... do complex debugging stuff ...
  #endif
  

This is not needed for macros that are known to be defined, such as those checked by configure e.g.


  #if RAPTOR_VERSION_DECIMAL > 20100
     ... do stuff that requires a raptor2 version 2.1.0 or newer ...
  #endif
  

since the above would be checked implicitly by configure using pkg-config(1) to validate Raptor 2 is present before getting to the code that tries to evaluate the value from raptor2.h.

The debug macros that are used for printing out values when debugging is enabled do not need protection by #if or #ifdef and should be used like this:


  LIBRDF_DEBUG1("Something wonderful happened\n");
  
  LIBRDF_DEBUG2("Something %s happened\n", happening);
  

Memory allocation

Allocating a zeroed out block of memory or a set of objects (calloc)


  var = LIBRDF_CALLOC(type, count, size)
  

Prefering when count = 1 this form:


  var = LIBRDF_CALLOC(type, 1, sizeof(*var))
  

Allocating a block of memory:


  var = LIBRDF_MALLOC(type, size)
  

Freeing memory:


  LIBRDF_FREE(type, var)
  

The reasoning here is to make allocs mostly fit into 1 line without too much boilerplate and duplication of types.

The macro names vary by library such as RAPTOR_CALLOC and RASQAL_CALLOC for Raptor and Rasqal respectively.

Documentation

Public functions, types, enumerations and defines must have autodocs - the structured comment block before the definition. This is read by gtk-doc(1) to generate reference API documentation.

Format:


  /**
   * functionname:
   * @param1: Description of first parameter
   * @param2: Description of second parameter (or NULL)
   * ... more params ...
   *
   * Short Description
   *
   * Long Description.
   *
   * Return value: return value
   */
   returntype
   functionname(...)
   {
     ... body ...
   }
  

The Short Description have several commmon forms:

  • Constructor - creates a FOO object
  • Destructor - destroys a FOO object
  • Short description of regular function or method.
  • INTERNAL - short description

The latter is used for autodocs for internal functions either as internal documentation or for APIs that may one day be public.

The (or NULL) phrase is used for pointer parameters that may be omitted. This is usually tested by the function as an assertion. In some functions there are more complex conditions on which optional parameters are allowed, these are described in the Long Description.

The long description may also include a deprecation statement such as:


  * @Deprecated: Use new_function() with foo = BAR
  

This must be indented to the left and will be used by the gtk-doc(1) document generator to provide a link to the replacement function and usage.

Commit Messages

The general standard for Redland libraries using GIT is a merge of the GIT standards format and GNU ChangeLog


  First line summaries what commit does - this goes into the GIT short log
  
  (function1, function2): what changed
  
  (function3): Added, deprecating function4()
  
  (function4): Deleted, replaced by function3()
  
  struct foo gains field ...
  
  struct bar loses field ...
  
  enum blah gains new value BLAH_2 which ...
  

Use name() in the description for references to functions. Make sure to do (function1, function2) NOT (function1,function2) as it makes things easier to format later.

Sometimes it's short enough (good) that it all can be done in the first line, pretty much only if it's a small change to a single function.

If the change is trivial or a typo and (this is IMPORTANT) NOT a commit to code files, then the commit can start with '#'. This may get filtered out of commit log message notifications and ChangeLog.

e.g. #spelling or #ws the latter is whitespace changes for some reason

The changes will semi-automatically be added to the ChangeLog files following the GNU style, indented and word wrapped, and adding the list of files at the start. So the commit message above ends up looking something like:


  2010-08-23  User Name <user@example.org>
  
          * dir/file1.c, dir2/file2.c: First line summaries what commit
            does - this goes into the GIT short log
  
            (function1, function2): what changed
  
            (function3): Added, deprecating function4()
  
            (function4): Deleted, replaced by function3()
  
            struct foo gains field ...
  
            struct bar loses field ...
  
            enum blah gains new value BLAH_2 which ...
  

Copyright (C) 2013 Dave Beckett

redland-1.0.17/docs/0000755000175000017500000000000012257576340011155 500000000000000redland-1.0.17/docs/redland-chapter-objects.xml0000644000175000017500000000622311773210070016271 00000000000000 Objects in C Redland uses objects and is written in C, which has no built in support for object construction, destruction, copying etc. This library thus uses conventions for the names of the routines providing the constructor, destructor and copy constructor functionality for a class as well as conventions for the general methods. A class FOO is defined as a C typedef librdf_foo, and its a public interface defined in rdf_foo.h along with any public or private types, enumerations or constants. The private definitions are not exposed to library users, only internally when the library is built. The implementation of the class is defined in file rdf_foo.c and may include private (static) functions either for internal implementations or to satisfy part of a factory API. Each class may have a class initialiser / termination pair of functions which must be called before any object in the class is created, and after the last object has been freed. These are defined with signatures like: void init_librdf_foo (...) void terminate_librdf_foo (void) The arguments to the initialisation vary since there are sometimes some class wide options that can be set at initialisation time. The object constructor(s) are defined with signatures like: librdf_foo* librdf_new_foo(void) which takes no parameters. Additional constructors can be defined with parameters, and are named in a similar way with an extra part appropriate for the name for example: librdf_foo* librdf_new_foo_with_options(char *options) A copy constructor may be defined which will have the signature: librdf_foo* librdf_new_foo_from_foo(librdf_foo* old_foo) A destructor must be defined and has the signature: void librdf_free_foo(librdf_foo* foo) Methods of the class have names starting with librdf_foo_ and examples could be: /* accessor functions to object part 'thing' */ int librdf_foo_set_thing(librdf_foo* foo, char *thing) char *librdf_foo_get_thing(librdf_foo* foo) It is often convenient to get a string representation of an object for further processing, debugging or serialisation. There are two conventions for methods that provide this functionality - the first is when a pointer is returned to a shared copy of the string and in that case the method ends _as_string. The second is when a pointer is returned to a newly allocated string in which case the method ends _to_string. redland-1.0.17/docs/version.xml0000644000175000017500000000000712257576330013300 000000000000001.0.17 redland-1.0.17/docs/html/0000755000175000017500000000000012257576340012121 500000000000000redland-1.0.17/docs/html/redland-storage-module-virtuoso.html0000644000175000017500000001330512257576340021157 00000000000000 Store 'virtuoso'

Store 'virtuoso'

The Virtuoso Redland RDF Provider is an implementation of the Storage API, Model and Query interfaces of the Redland framework for RDF. This provider enables the execution of queries via the Redland Rasqal query engine or via Virtuoso query engine directly against the Virtuoso OpenSource Quad Store.

The Virtuoso Redland RDF Provider uses ODBC as the data access mechanism for communicating the Virtuoso Quad Store and requires the Virtuoso ODBC Driver be installed on the Redland client and a suitable ODBC DSN be configured for connecting to the target Virtuoso Quad Store instance.

The provider has been tested against the Redland 1.0.8 version currently available for download. Virtuoso is capable of efficiently handle large amounts of data and has been tested with upto 1B triples.

There are several options required with the virtuoso storage in order to connect to the database. These are:

  • dsn for the ODBC datasource name

  • user for the database server user name

  • password for the database server password

  • database for the database name (not the storage name)

  • host for the database server hostname

  • charset for the database charset to use

NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this.

The storage name parameter given to the storage constructor librdf_new_storage is used inside the virtuoso store to allow multiple stores inside one Virtuoso database instance as parameterised with the above options.

This store always provides contexts; the boolean storage option contexts is not checked.

Examples:

  /* A new Virtuoso store */
  storage=librdf_new_storage(world, "virtuoso", "db1",
      "dsn='Local Virtuoso',user='demo',password='demo'");

  /* A different, existing Virtuoso store in the same database as above */
  storage=librdf_new_storage(world, "virtuoso", "db2",
      "dsn='Local Virtuoso',user='demo',password='demo'");

  /* An existing Virtuoso store on a different database server */
  storage=librdf_new_storage(world, "virtuoso", "http://red3",
      "dsn='Remote Virtuoso',user='demo',password='demo'");

  /* Opening with an options hash */
  options=librdf_new_hash(world, NULL);
  librdf_hash_from_string(options, 
      "dsn='Local Virtuoso',user='demo'");
  librdf_hash_put_strings(options, "password", user_password);
  storage=librdf_new_storage_with_options(world, "virtuoso", "http://red3", options);

In PHP:

  # An existing store
  $storage=librdf_new_storage($world, 'virtuoso', 'db4', 
      "dsn='Local Virtuoso',user='demo',password='demo'");

Summary:

  • Persistent

  • Suitable for extremely large models, 1B+ triples

  • Indexed and optimized

  • Possibility of free text searching

  • Contexts always provided

redland-1.0.17/docs/html/reference-manual.html0000644000175000017500000002067112257576340016146 00000000000000 Part II. Reference Manual

Part II. Reference Manual

This part contains the Redland Reference Manual which comprehensively describes every class and function of the API.

The previous part contains the Redland Tutorial explaining how to use the API parts.

For the latest information, see the Redland Home Page

Table of Contents

Objects in C
World — Initialisation and termination of library
General — Static variables and memory handling.
Concepts — Pre-defined URIS and Nodes in the RDF namespaces.
Digests — Content digests.
Files — File utility functions.
Hashes — Key:Value hashes or dictionaries.
Heuristics — Utility heuristic functions.
Iterator — Iterate a sequence of objects across some other object.
List — Simple list class.
Logging — Message and error logging.
RDF Graph (librdf_model) — RDF graph (set of triples) API.
RDF term (librdf_node) — RDF triple component
Parsers — RDF parsers from syntax to triples.
Querying — RDF query languages and execution.
Query results — RDF query results.
Serializers — RDF serializers from triples to syntax.
RDF Triple (librdf_statement) — RDF Triple.
Triple stores — RDF Triple stores
Storage Modules
Introduction
Store 'hashes'
Store 'memory'
Store 'file'
Store 'mysql'
Store 'postgresql'
Store 'sqlite'
Store 'tstore'
Store 'uri'
Store 'virtuoso'
Stream of triples (#librdf_statement). — Sequence of RDF Triples.
Unicode — Unicode utility functions.
URI — URI class
API Changes
Introduction
Changes between Redland librdf 1.0.12 and 1.0.13
New functions, types and enums
Changed functions and types
Changes between Redland librdf 1.0.13 and 1.0.14
New functions, types and enums
Changes between Redland librdf 1.0.14 and 1.0.15
New functions, types and enums
Changes between Redland librdf 1.0.15 and 1.0.16
New functions, types and enums
Changes between Redland librdf 1.0.16 and 1.0.16
New functions, types and enums
redland-1.0.17/docs/html/redland-storage-module-postgresql.html0000644000175000017500000001376012257576340021475 00000000000000 Store 'postgresql'

Store 'postgresql'

This module is based on the MySQL store and is compiled in when PostgreSQL is available. This store provides storage using the PostgreSQL open source database including contexts. This store was added in Redland 1.0.3.

There are several options required with the postgresql storage in order to connect to the database. These are:

  • host for the database server hostname

  • port for the database server port (defaults to the Postgresql port 3306 if not given)

  • database for the Postgresql database name (not the storage name)

  • user for the database server user name

  • password for the database server password

  • database for the Postgresql database name (not the storage name)

NOTE: Before Redland 1.0.5, the parameter dbname had to be used instead of database for the Postgresql database name.

NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this.

The storage name parameter given to the storage constructor librdf_new_storage is used inside the postgresql store to allow multiple stores inside one PostgreSQL database instance as parameterised with the above optiosn.

If boolean option new is given, any existing PostgreSQL database named by the storage option database, say db will be dropped and the appropriate new tables created. The PostgreSQL database db must already exist, such as made with the PostgreSQL create database db command and the appropriate privileges set so that the user and password work.

This store always provides contexts; the boolean storage option contexts is not checked.

Examples:

  /* A new PostgreSQL store */
  storage=librdf_new_storage(world, "postgresql", "db1",
      "new='yes',host='localhost',database='red',user='foo','password='bar'");

  /* A different, existing PostgreSQL store db2 in the same database as above */
  storage=librdf_new_storage(world, "postgresql", "db2",
      "host='localhost',database='red',user='foo','password='bar'");

  /* An existing PostgreSQL store on a different database server */
  storage=librdf_new_storage(world, "postgresql", "db3",
      "host='db.example.org',database='abc',user='baz','password='blah'");

  /* Opening with an options hash */
  options=librdf_new_hash(world, NULL);
  librdf_hash_from_string(options, 
      "host='db.example.org',database='abc',user='baz'");
  librdf_hash_put_strings(options, "password", user_password);
  storage=librdf_new_storage_with_options(world, "postgresql", "db4", options);

In PHP:

  # An existing store
  $storage=librdf_new_storage($world, 'postgresql', 'db4', 
      "host='127.0.0.1',database='xyz',user='foo',password='blah'");

Summary:

  • Persistent

  • Suitable for very large models

  • Indexed but not optimized

  • Smaller disk usage than BDB

  • Contexts always provided

redland-1.0.17/docs/html/redland-storage-module-mysql.html0000644000175000017500000001357612257576340020444 00000000000000 Store 'mysql'

Store 'mysql'

This module is compiled in when MySQL 3 or 4 is available. This store provides storage using the MySQL open source database including contexts. It was added in Redland 0.9.15. It has however been tested with several million triples and deployed.

There are several options required with the mysql storage in order to connect to the database. These are:

  • host for the database server hostname

  • port for the database server port (defaults to the MySQL port 3306 if not given)

  • database for the MySQL database name (not the storage name)

  • user for the database server user name

  • password for the database server password

NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this.

The storage name parameter given to the storage constructor librdf_new_storage is used inside the mysql store to allow multiple stores inside one MySQL database instance as parameterised with the above options.

If boolean option new is given, any existing MySQL database named by the storage option database, say db will be dropped and the appropriate new tables created. The MySQL database db must already exist, such as made with the MySQL create database db command and the appropriate privileges set so that the user and password work.

If boolean option reconnect is given, MySQL reconnection will be enabled so that if the database connection is dropped, MySQL will attempt to reconnect.

This store always provides contexts; the boolean storage option contexts is not checked.

Examples:

  /* A new MySQL store */
  storage=librdf_new_storage(world, "mysql", "db1",
      "new='yes',host='localhost',database='red',user='foo','password='bar'");

  /* A different, existing MySQL store db2 in the same database as above */
  storage=librdf_new_storage(world, "mysql", "db2",
      "host='localhost',database='red',user='foo','password='bar'");

  /* An existing MySQL store on a different database server */
  storage=librdf_new_storage(world, "mysql", "db3",
      "host='db.example.org',database='abc',user='baz','password='blah'");

  /* Opening with an options hash */
  options=librdf_new_hash(world, NULL);
  librdf_hash_from_string(options, 
      "host='db.example.org',database='abc',user='baz'");
  librdf_hash_put_strings(options, "password", user_password);
  storage=librdf_new_storage_with_options(world, "mysql", "db4", options);

In PHP:

  # An existing store
  $storage=librdf_new_storage($world, 'mysql', 'db4', 
      "host='127.0.0.1',database='xyz',user='foo',password='blah'");

Summary:

  • Persistent

  • Suitable for very large models

  • Indexed but not optimized

  • Smaller disk usage than BDB

  • Possibility of free text searching

  • Contexts always provided

redland-1.0.17/docs/html/redland-serializer.html0000644000175000017500000020310412257576340016507 00000000000000 Serializers

Serializers

Serializers — RDF serializers from triples to syntax.

Synopsis

typedef             librdf_serializer;
typedef             librdf_serializer_factory;
const raptor_syntax_description * librdf_serializer_get_description
                                                        (librdf_world *world,
                                                         unsigned int counter);
int                 librdf_serializer_enumerate         (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const char **label);
void                librdf_serializer_register_factory  (librdf_world *world,
                                                         const char *name,
                                                         const char *label,
                                                         const char *mime_type,
                                                         const unsigned char *uri_string,
                                                         void (*factory) (librdf_serializer_factory*));
librdf_serializer * librdf_new_serializer               (librdf_world *world,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *type_uri);
librdf_serializer * librdf_new_serializer_from_factory  (librdf_world *world,
                                                         librdf_serializer_factory *factory);
void                librdf_free_serializer              (librdf_serializer *serializer);
int                 librdf_serializer_check_name        (librdf_world *world,
                                                         const char *name);
int                 librdf_serializer_serialize_model   (librdf_serializer *serializer,
                                                         FILE *handle,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);
int                 librdf_serializer_serialize_model_to_file_handle
                                                        (librdf_serializer *serializer,
                                                         FILE *handle,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);
int                 librdf_serializer_serialize_model_to_file
                                                        (librdf_serializer *serializer,
                                                         const char *name,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);
unsigned char *     librdf_serializer_serialize_model_to_string
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);
unsigned char *     librdf_serializer_serialize_model_to_counted_string
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model,
                                                         size_t *length_p);
int                 librdf_serializer_serialize_model_to_iostream
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model,
                                                         raptor_iostream *iostr);
unsigned char *     librdf_serializer_serialize_stream_to_counted_string
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_stream *stream,
                                                         size_t *length_p);
int                 librdf_serializer_serialize_stream_to_file
                                                        (librdf_serializer *serializer,
                                                         const char *name,
                                                         librdf_uri *base_uri,
                                                         librdf_stream *stream);
int                 librdf_serializer_serialize_stream_to_file_handle
                                                        (librdf_serializer *serializer,
                                                         FILE *handle,
                                                         librdf_uri *base_uri,
                                                         librdf_stream *stream);
int                 librdf_serializer_serialize_stream_to_iostream
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_stream *stream,
                                                         raptor_iostream *iostr);
unsigned char *     librdf_serializer_serialize_stream_to_string
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_stream *stream);
void                librdf_serializer_set_error         (librdf_serializer *serializer,
                                                         void *user_data,
                                                         void (*error_fn) (void *user_data, const char *msg, ...));
void                librdf_serializer_set_warning       (librdf_serializer *serializer,
                                                         void *user_data,
                                                         void (*warning_fn) (void *user_data, const char *msg, ...));
librdf_node *       librdf_serializer_get_feature       (librdf_serializer *serializer,
                                                         librdf_uri *feature);
int                 librdf_serializer_set_feature       (librdf_serializer *serializer,
                                                         librdf_uri *feature,
                                                         librdf_node *value);
int                 librdf_serializer_set_namespace     (librdf_serializer *serializer,
                                                         librdf_uri *uri,
                                                         const char *prefix);

Description

Provides class to create serializers to turn RDF graphs into syntax in either files or strings. Serializer features can be set, which are passed down to Raptor and errors and warnings that are returned can be retrieved by callbacks.

Details

librdf_serializer

typedef struct librdf_serializer_s librdf_serializer;

Redland serializer class.


librdf_serializer_factory

typedef struct librdf_serializer_factory_s librdf_serializer_factory;

Redland serializer factory class.


librdf_serializer_get_description ()

const raptor_syntax_description * librdf_serializer_get_description
                                                        (librdf_world *world,
                                                         unsigned int counter);

Get serializer descriptive syntax information

world :

world object

counter :

index into the list of serializers

Returns :

description or NULL if counter is out of range

librdf_serializer_enumerate ()

int                 librdf_serializer_enumerate         (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const char **label);

Get information on serializers.

Deprecated: use librdf_serializer_get_description() to return more information in a static structure.

world :

redland world object

counter :

index into the list of serializers

name :

pointer to store the name of the serializer (or NULL)

label :

pointer to store syntax readable label (or NULL)

Returns :

non 0 on failure of if counter is out of range

librdf_serializer_register_factory ()

void                librdf_serializer_register_factory  (librdf_world *world,
                                                         const char *name,
                                                         const char *label,
                                                         const char *mime_type,
                                                         const unsigned char *uri_string,
                                                         void (*factory) (librdf_serializer_factory*));

Register a serializer factory .

world :

redland world object

name :

the name of the serializer

label :

the label of the serializer (optional)

mime_type :

MIME type of the syntax (optional)

uri_string :

URI of the syntax (optional)

factory :

function to be called to register the factor parameters

librdf_new_serializer ()

librdf_serializer * librdf_new_serializer               (librdf_world *world,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *type_uri);

Constructor - create a new librdf_serializer object.

world :

redland world object

name :

the serializer factory name (or NULL or empty string if don't care)

mime_type :

the MIME type of the syntax (NULL if not used)

type_uri :

URI of syntax (NULL if not used)

Returns :

new librdf_serializer object or NULL

librdf_new_serializer_from_factory ()

librdf_serializer * librdf_new_serializer_from_factory  (librdf_world *world,
                                                         librdf_serializer_factory *factory);

Constructor - create a new librdf_serializer object.

world :

redland world object

factory :

the serializer factory to use to create this serializer

Returns :

new librdf_serializer object or NULL

librdf_free_serializer ()

void                librdf_free_serializer              (librdf_serializer *serializer);

Destructor - destroys a librdf_serializer object.

serializer :

the serializer

librdf_serializer_check_name ()

int                 librdf_serializer_check_name        (librdf_world *world,
                                                         const char *name);

Check if a serializer name is known

world :

redland world object

name :

name of serializer

Returns :

non 0 if name is a known serializer

librdf_serializer_serialize_model ()

int                 librdf_serializer_serialize_model   (librdf_serializer *serializer,
                                                         FILE *handle,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);

Deprecated: Use librdf_serializer_serialize_model_to_file_handle()

Write a serialized librdf_model to a FILE*.

serializer :

the serializer

handle :

file handle to serialize to

base_uri :

the base URI to use (or NULL)

model :

the librdf_model model to use

Returns :

non 0 on failure

librdf_serializer_serialize_model_to_file_handle ()

int                 librdf_serializer_serialize_model_to_file_handle
                                                        (librdf_serializer *serializer,
                                                         FILE *handle,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);

Write a serialized librdf_model to a FILE*.

serializer :

the serializer

handle :

file handle to serialize to

base_uri :

the base URI to use (or NULL)

model :

the librdf_model model to use

Returns :

non 0 on failure

librdf_serializer_serialize_model_to_file ()

int                 librdf_serializer_serialize_model_to_file
                                                        (librdf_serializer *serializer,
                                                         const char *name,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);

Write a serialized librdf_model to a file.

serializer :

the serializer

name :

filename to serialize to

base_uri :

the base URI to use (or NULL)

model :

the librdf_model model to use

Returns :

non 0 on failure

librdf_serializer_serialize_model_to_string ()

unsigned char *     librdf_serializer_serialize_model_to_string
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);

Write a serialized librdf_model to a string. The returned string must be freed by the caller using librdf_free_memory().

serializer :

the serializer

base_uri :

the base URI to use (or NULL)

model :

the librdf_model model to use

Returns :

NULL on failure

librdf_serializer_serialize_model_to_counted_string ()

unsigned char *     librdf_serializer_serialize_model_to_counted_string
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model,
                                                         size_t *length_p);

Write a serialized librdf_model to a counted string. The returned string must be freed by the caller using librdf_free_memory().

serializer :

the serializer

base_uri :

the base URI to use (or NULL)

model :

the librdf_model model to use

length_p :

pointer to store length or NULL

Returns :

non 0 on failure

librdf_serializer_serialize_model_to_iostream ()

int                 librdf_serializer_serialize_model_to_iostream
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model,
                                                         raptor_iostream *iostr);

Write a serialized librdf_model to a raptor_iostream. This function takes ownership of the iostream and frees it.

serializer :

the serializer

base_uri :

the base URI to use (or NULL)

model :

the librdf_model model to use

iostr :

the raptor_iostream to write to

Returns :

non-0 on failure

librdf_serializer_serialize_stream_to_counted_string ()

unsigned char *     librdf_serializer_serialize_stream_to_counted_string
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_stream *stream,
                                                         size_t *length_p);

Write a librdf_stream to a counted string. Caller should free the string with librdf_free_memory().

serializer :

the serializer

base_uri :

the base URI to use (or NULL)

stream :

the librdf_stream stream to use

length_p :

pointer to store length or NULL

Returns :

stream as string or NULL on failure

librdf_serializer_serialize_stream_to_file ()

int                 librdf_serializer_serialize_stream_to_file
                                                        (librdf_serializer *serializer,
                                                         const char *name,
                                                         librdf_uri *base_uri,
                                                         librdf_stream *stream);

Write a librdf_stream to a file.

serializer :

the serializer

name :

filename to serialize to

base_uri :

the base URI to use (or NULL)

stream :

the librdf_stream stream to use

Returns :

non 0 on failure

librdf_serializer_serialize_stream_to_file_handle ()

int                 librdf_serializer_serialize_stream_to_file_handle
                                                        (librdf_serializer *serializer,
                                                         FILE *handle,
                                                         librdf_uri *base_uri,
                                                         librdf_stream *stream);

Write a librdf_stream to a FILE*.

serializer :

the serializer

handle :

file handle to serialize to

base_uri :

the base URI to use (or NULL)

stream :

the librdf_stream model to use

Returns :

non 0 on failure

librdf_serializer_serialize_stream_to_iostream ()

int                 librdf_serializer_serialize_stream_to_iostream
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_stream *stream,
                                                         raptor_iostream *iostr);

Write a librdf_stream to a raptor_iostream. This function takes ownership of the iostream and frees it.

serializer :

the serializer

base_uri :

the base URI to use (or NULL)

stream :

the librdf_stream stream to use

iostr :

the raptor_iostream to write to

Returns :

non-0 on failure

librdf_serializer_serialize_stream_to_string ()

unsigned char *     librdf_serializer_serialize_stream_to_string
                                                        (librdf_serializer *serializer,
                                                         librdf_uri *base_uri,
                                                         librdf_stream *stream);

Write a librdf_stream to a string.

serializer :

the serializer

base_uri :

the base URI to use (or NULL)

stream :

the librdf_stream stream to use

Returns :

NULL on failure

librdf_serializer_set_error ()

void                librdf_serializer_set_error         (librdf_serializer *serializer,
                                                         void *user_data,
                                                         void (*error_fn) (void *user_data, const char *msg, ...));

Deprecated: Does nothing

Set the serializer error handling function.

serializer :

the serializer

user_data :

user data to pass to function

error_fn :

pointer to the function

librdf_serializer_set_warning ()

void                librdf_serializer_set_warning       (librdf_serializer *serializer,
                                                         void *user_data,
                                                         void (*warning_fn) (void *user_data, const char *msg, ...));

Deprecated: Does nothing

Set the serializer warning handling function.

serializer :

the serializer

user_data :

user data to pass to function

warning_fn :

pointer to the function

librdf_serializer_get_feature ()

librdf_node *       librdf_serializer_get_feature       (librdf_serializer *serializer,
                                                         librdf_uri *feature);

Get the value of a serializer feature.

serializer :

serializer object

feature :

URI of feature

Returns :

the value of the feature or NULL if no such feature exists or the value is empty.

librdf_serializer_set_feature ()

int                 librdf_serializer_set_feature       (librdf_serializer *serializer,
                                                         librdf_uri *feature,
                                                         librdf_node *value);

Set the value of a serializer feature.

serializer :

serializer object

feature :

URI of feature

value :

value to set

Returns :

non 0 on failure (negative if no such feature)

librdf_serializer_set_namespace ()

int                 librdf_serializer_set_namespace     (librdf_serializer *serializer,
                                                         librdf_uri *uri,
                                                         const char *prefix);

Set a namespace URI/prefix mapping.

serializer :

serializer object

uri :

URI of namespace or NULL

prefix :

prefix to use or NULL

Returns :

non 0 on failure
redland-1.0.17/docs/html/redland-changes-1-0-14-to-1-0-15.html0000644000175000017500000000635412257576340017631 00000000000000 Changes between Redland librdf 1.0.14 and 1.0.15

Changes between Redland librdf 1.0.14 and 1.0.15

New functions, types and enums

Functions

redland-1.0.17/docs/html/redland-parser.html0000644000175000017500000022424012257576340015636 00000000000000 Parsers

Parsers

Parsers — RDF parsers from syntax to triples.

Synopsis

typedef             librdf_parser;
typedef             librdf_parser_factory;
int                 librdf_parser_check_name            (librdf_world *world,
                                                         const char *name);
const raptor_syntax_description * librdf_parser_get_description
                                                        (librdf_world *world,
                                                         unsigned int counter);
int                 librdf_parser_enumerate             (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const char **label);
const char *        librdf_parser_guess_name            (const char *mime_type,
                                                         const unsigned char *buffer,
                                                         const unsigned char *identifier);
const char *        librdf_parser_guess_name2           (librdf_world *world,
                                                         const char *mime_type,
                                                         const unsigned char *buffer,
                                                         const unsigned char *identifier);
void                librdf_parser_register_factory      (librdf_world *world,
                                                         const char *name,
                                                         const char *label,
                                                         const char *mime_type,
                                                         const unsigned char *uri_string,
                                                         void (*factory) (librdf_parser_factory*));
librdf_parser *     librdf_new_parser                   (librdf_world *world,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *type_uri);
librdf_parser *     librdf_new_parser_from_factory      (librdf_world *world,
                                                         librdf_parser_factory *factory);
void                librdf_free_parser                  (librdf_parser *parser);
librdf_stream *     librdf_parser_parse_as_stream       (librdf_parser *parser,
                                                         librdf_uri *uri,
                                                         librdf_uri *base_uri);
int                 librdf_parser_parse_into_model      (librdf_parser *parser,
                                                         librdf_uri *uri,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);
librdf_stream *     librdf_parser_parse_file_handle_as_stream
                                                        (librdf_parser *parser,
                                                         FILE *fh,
                                                         int close_fh,
                                                         librdf_uri *base_uri);
int                 librdf_parser_parse_file_handle_into_model
                                                        (librdf_parser *parser,
                                                         FILE *fh,
                                                         int close_fh,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);
librdf_stream *     librdf_parser_parse_string_as_stream
                                                        (librdf_parser *parser,
                                                         const unsigned char *string,
                                                         librdf_uri *base_uri);
int                 librdf_parser_parse_string_into_model
                                                        (librdf_parser *parser,
                                                         const unsigned char *string,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);
void                librdf_parser_set_error             (librdf_parser *parser,
                                                         void *user_data,
                                                         void (*error_fn) (void *user_data, const char *msg, ...));
void                librdf_parser_set_warning           (librdf_parser *parser,
                                                         void *user_data,
                                                         void (*warning_fn) (void *user_data, const char *msg, ...));
librdf_stream *     librdf_parser_parse_counted_string_as_stream
                                                        (librdf_parser *parser,
                                                         const unsigned char *string,
                                                         size_t length,
                                                         librdf_uri *base_uri);
int                 librdf_parser_parse_counted_string_into_model
                                                        (librdf_parser *parser,
                                                         const unsigned char *string,
                                                         size_t length,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);
librdf_stream *     librdf_parser_parse_iostream_as_stream
                                                        (librdf_parser *parser,
                                                         raptor_iostream *iostream,
                                                         librdf_uri *base_uri);
int                 librdf_parser_parse_iostream_into_model
                                                        (librdf_parser *parser,
                                                         raptor_iostream *iostream,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);
#define             LIBRDF_PARSER_FEATURE_ERROR_COUNT
#define             LIBRDF_PARSER_FEATURE_WARNING_COUNT
librdf_node *       librdf_parser_get_feature           (librdf_parser *parser,
                                                         librdf_uri *feature);
int                 librdf_parser_set_feature           (librdf_parser *parser,
                                                         librdf_uri *feature,
                                                         librdf_node *value);
char *              librdf_parser_get_accept_header     (librdf_parser *parser);
int                 librdf_parser_get_namespaces_seen_count
                                                        (librdf_parser *parser);
const char *        librdf_parser_get_namespaces_seen_prefix
                                                        (librdf_parser *parser,
                                                         int offset);
librdf_uri *        librdf_parser_get_namespaces_seen_uri
                                                        (librdf_parser *parser,
                                                         int offset);
librdf_uri_filter_func librdf_parser_get_uri_filter     (librdf_parser *parser,
                                                         void **user_data_p);
void                librdf_parser_set_uri_filter        (librdf_parser *parser,
                                                         librdf_uri_filter_func filter,
                                                         void *user_data);

Description

Provides classes to create parsers and parse syntaxes from URIs or a string into RDF graphs (librdf_model) or sequences of triples (librdf_stream). Parser features can be set, which are passed down to Raptor and errors and warnings that are returned can be retrieved by callbacks.

Details

librdf_parser

typedef struct librdf_parser_s librdf_parser;

Redland parser class.


librdf_parser_factory

typedef struct librdf_parser_factory_s librdf_parser_factory;

Redland parser factory class.


librdf_parser_check_name ()

int                 librdf_parser_check_name            (librdf_world *world,
                                                         const char *name);

Check if a parser name is known

world :

redland world object

name :

name of parser

Returns :

non 0 if name is a known parser

librdf_parser_get_description ()

const raptor_syntax_description * librdf_parser_get_description
                                                        (librdf_world *world,
                                                         unsigned int counter);

Get parser descriptive syntax information

world :

world object

counter :

index into the list of parsers

Returns :

description or NULL if counter is out of range

librdf_parser_enumerate ()

int                 librdf_parser_enumerate             (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const char **label);

Get information on parsers.

Deprecated: use librdf_parser_get_description() to return more information in a static structure.

world :

redland world object

counter :

index into the list of parsers

name :

pointer to store the name of the parser (or NULL)

label :

pointer to store syntax readable label (or NULL)

Returns :

non 0 on failure of if counter is out of range

librdf_parser_guess_name ()

const char *        librdf_parser_guess_name            (const char *mime_type,
                                                         const unsigned char *buffer,
                                                         const unsigned char *identifier);

Get a parser name for content with type or identifier

mime_type :

MIME type of syntax or NULL

buffer :

content buffer or NULL

identifier :

content identifier or NULL

Returns :

a parser name or NULL if nothing was guessable

librdf_parser_guess_name2 ()

const char *        librdf_parser_guess_name2           (librdf_world *world,
                                                         const char *mime_type,
                                                         const unsigned char *buffer,
                                                         const unsigned char *identifier);

Get a parser name for content with type or identifier

world :

librdf_world object

mime_type :

MIME type of syntax or NULL

buffer :

content buffer or NULL

identifier :

content identifier or NULL

Returns :

a parser name or NULL if nothing was guessable

librdf_parser_register_factory ()

void                librdf_parser_register_factory      (librdf_world *world,
                                                         const char *name,
                                                         const char *label,
                                                         const char *mime_type,
                                                         const unsigned char *uri_string,
                                                         void (*factory) (librdf_parser_factory*));

Register a parser factory .

world :

redland world object

name :

the name of the parser

label :

the label of the parser (optional)

mime_type :

MIME type of the syntax (optional)

uri_string :

URI of the syntax (optional)

factory :

function to be called to register the factor parameters

librdf_new_parser ()

librdf_parser *     librdf_new_parser                   (librdf_world *world,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *type_uri);

Constructor - create a new librdf_parser object.

If all fields are NULL, this means any parser supporting MIME Type "application/rdf+xml"

world :

redland world object

name :

the parser factory name (or NULL or empty string if don't care)

mime_type :

the MIME type of the syntax (NULL if not used)

type_uri :

URI of syntax (NULL if not used)

Returns :

new librdf_parser object or NULL

librdf_new_parser_from_factory ()

librdf_parser *     librdf_new_parser_from_factory      (librdf_world *world,
                                                         librdf_parser_factory *factory);

Constructor - create a new librdf_parser object.

world :

redland world object

factory :

the parser factory to use to create this parser

Returns :

new librdf_parser object or NULL

librdf_free_parser ()

void                librdf_free_parser                  (librdf_parser *parser);

Destructor - destroys a librdf_parser object.

parser :

the parser

librdf_parser_parse_as_stream ()

librdf_stream *     librdf_parser_parse_as_stream       (librdf_parser *parser,
                                                         librdf_uri *uri,
                                                         librdf_uri *base_uri);

Parse a URI to a librdf_stream of statements.

parser :

the parser

uri :

the URI to read

base_uri :

the base URI to use or NULL

Returns :

librdf_stream of statements or NULL

librdf_parser_parse_into_model ()

int                 librdf_parser_parse_into_model      (librdf_parser *parser,
                                                         librdf_uri *uri,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);

Parse a URI of content into an librdf_model.

parser :

the parser

uri :

the URI to read the content

base_uri :

the base URI to use or NULL

model :

the model to use

Returns :

non 0 on failure

librdf_parser_parse_file_handle_as_stream ()

librdf_stream *     librdf_parser_parse_file_handle_as_stream
                                                        (librdf_parser *parser,
                                                         FILE *fh,
                                                         int close_fh,
                                                         librdf_uri *base_uri);

Parse a FILE* handle of content to a librdf_stream of statements.

parser :

the parser

fh :

FILE* to read content source

close_fh :

non-0 to fclose() the file handle on finishing

base_uri :

the base URI to use (or NULL)

Returns :

librdf_stream of statements or NULL

librdf_parser_parse_file_handle_into_model ()

int                 librdf_parser_parse_file_handle_into_model
                                                        (librdf_parser *parser,
                                                         FILE *fh,
                                                         int close_fh,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);

Parse a FILE* handle of content into an librdf_model.

parser :

the parser

fh :

FILE* to read content source

close_fh :

non-0 to fclose() the file handle on finishing

base_uri :

the base URI to use (or NULL)

model :

the model to write to

Returns :

non 0 on failure

librdf_parser_parse_string_as_stream ()

librdf_stream *     librdf_parser_parse_string_as_stream
                                                        (librdf_parser *parser,
                                                         const unsigned char *string,
                                                         librdf_uri *base_uri);

Parse a string of content to a librdf_stream of statements.

parser :

the parser

string :

the string to parse

base_uri :

the base URI to use or NULL

Returns :

librdf_stream of statements or NULL

librdf_parser_parse_string_into_model ()

int                 librdf_parser_parse_string_into_model
                                                        (librdf_parser *parser,
                                                         const unsigned char *string,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);

Parse a string of content into an librdf_model.

parser :

the parser

string :

the content to parse

base_uri :

the base URI to use or NULL

model :

the model to use

Returns :

non 0 on failure

librdf_parser_set_error ()

void                librdf_parser_set_error             (librdf_parser *parser,
                                                         void *user_data,
                                                         void (*error_fn) (void *user_data, const char *msg, ...));

Deprecated: Does nothing

Set the parser error handling function.

parser :

the parser

user_data :

user data to pass to function

error_fn :

pointer to the function

librdf_parser_set_warning ()

void                librdf_parser_set_warning           (librdf_parser *parser,
                                                         void *user_data,
                                                         void (*warning_fn) (void *user_data, const char *msg, ...));

Deprecated: Does nothing.

Set the parser warning handling function.

parser :

the parser

user_data :

user data to pass to function

warning_fn :

pointer to the function

librdf_parser_parse_counted_string_as_stream ()

librdf_stream *     librdf_parser_parse_counted_string_as_stream
                                                        (librdf_parser *parser,
                                                         const unsigned char *string,
                                                         size_t length,
                                                         librdf_uri *base_uri);

Parse a counted string of content to a librdf_stream of statements.

parser :

the parser

string :

the string to parse

length :

length of the string content (must be >0)

base_uri :

the base URI to use or NULL

Returns :

librdf_stream of statements or NULL

librdf_parser_parse_counted_string_into_model ()

int                 librdf_parser_parse_counted_string_into_model
                                                        (librdf_parser *parser,
                                                         const unsigned char *string,
                                                         size_t length,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);

Parse a counted string of content into an librdf_model.

parser :

the parser

string :

the content to parse

length :

length of content (must be >0)

base_uri :

the base URI to use or NULL

model :

the model to use

Returns :

non 0 on failure

librdf_parser_parse_iostream_as_stream ()

librdf_stream *     librdf_parser_parse_iostream_as_stream
                                                        (librdf_parser *parser,
                                                         raptor_iostream *iostream,
                                                         librdf_uri *base_uri);

Parse an iostream of content to a librdf_stream of statements.

parser :

the parser

iostream :

the iostream to parse

base_uri :

the base URI to use or NULL

Returns :

librdf_stream of statements or NULL

librdf_parser_parse_iostream_into_model ()

int                 librdf_parser_parse_iostream_into_model
                                                        (librdf_parser *parser,
                                                         raptor_iostream *iostream,
                                                         librdf_uri *base_uri,
                                                         librdf_model *model);

Parse a iostream of content into an librdf_model.

parser :

the parser

iostream :

the content to parse

base_uri :

the base URI to use or NULL

model :

the model to use

Returns :

non 0 on failure

LIBRDF_PARSER_FEATURE_ERROR_COUNT

#define LIBRDF_PARSER_FEATURE_ERROR_COUNT "http://feature.librdf.org/parser-error-count"

Parser feature URI string for getting the error count of the last parse.


LIBRDF_PARSER_FEATURE_WARNING_COUNT

#define LIBRDF_PARSER_FEATURE_WARNING_COUNT "http://feature.librdf.org/parser-warning-count"

Parser feature URI string for getting the warning count of the last parse.


librdf_parser_get_feature ()

librdf_node *       librdf_parser_get_feature           (librdf_parser *parser,
                                                         librdf_uri *feature);

Get the value of a parser feature.

parser :

librdf_parser object

feature :

librdf_Uuri feature property

Returns :

new librdf_node feature value or NULL if no such feature exists or the value is empty.

librdf_parser_set_feature ()

int                 librdf_parser_set_feature           (librdf_parser *parser,
                                                         librdf_uri *feature,
                                                         librdf_node *value);

Set the value of a parser feature.

parser :

librdf_parser object

feature :

librdf_uri feature property

value :

librdf_node feature property value

Returns :

non 0 on failure (negative if no such feature)

librdf_parser_get_accept_header ()

char *              librdf_parser_get_accept_header     (librdf_parser *parser);

Get an HTTP Accept value for the parser.

The returned string must be freed by the caller using librdf_free_memory().

parser :

parser

Returns :

a new Accept: header string or NULL on failure

librdf_parser_get_namespaces_seen_count ()

int                 librdf_parser_get_namespaces_seen_count
                                                        (librdf_parser *parser);

Get the number of namespaces seen during parsing

parser :

librdf_parser object

Returns :

namespace count

librdf_parser_get_namespaces_seen_prefix ()

const char *        librdf_parser_get_namespaces_seen_prefix
                                                        (librdf_parser *parser,
                                                         int offset);

Get the prefix of namespaces seen during parsing

parser :

librdf_parser object

offset :

index into list of namespaces

Returns :

prefix or NULL if no such namespace prefix

librdf_parser_get_namespaces_seen_uri ()

librdf_uri *        librdf_parser_get_namespaces_seen_uri
                                                        (librdf_parser *parser,
                                                         int offset);

Get the uri of namespaces seen during parsing

parser :

librdf_parser object

offset :

index into list of namespaces

Returns :

uri or NULL if no such namespace uri

librdf_parser_get_uri_filter ()

librdf_uri_filter_func librdf_parser_get_uri_filter     (librdf_parser *parser,
                                                         void **user_data_p);

Get the current URI filter function for retrieval during parsing.

parser :

librdf_parser object

user_data_p :

Pointer to user data to return

Returns :

current URI filter function

librdf_parser_set_uri_filter ()

void                librdf_parser_set_uri_filter        (librdf_parser *parser,
                                                         librdf_uri_filter_func filter,
                                                         void *user_data);

Set URI filter function for retrieval during parsing.

parser :

librdf_parser object

filter :

URI filter function

user_data :

User data to pass to filter function
redland-1.0.17/docs/html/redland-heuristics.html0000644000175000017500000001653312257576340016530 00000000000000 Heuristics

Heuristics

Heuristics — Utility heuristic functions.

Synopsis

char *              librdf_heuristic_gen_name           (const char *name);
int                 librdf_heuristic_is_blank_node      (const char *node);
const char *        librdf_heuristic_get_blank_node     (const char *node);
int                 librdf_heuristic_object_is_literal  (const char *object);

Description

Various utility functions for performing heuristics such as generating a name, guessing if a string is a URI or RDF literal.

Details

librdf_heuristic_gen_name ()

char *              librdf_heuristic_gen_name           (const char *name);

Generate a new name from an existing name.

Adds an integer or increases the integer at the end of the name in order to generate a new one

name :

the name

Returns :

a new name or NULL on failure

librdf_heuristic_is_blank_node ()

int                 librdf_heuristic_is_blank_node      (const char *node);

Try to guess if an node string is a blank node identifier.

The guessing is done by assuming the object is a blank node if it matches ^_: like N-Triples, N3 and related.

node :

string object to guess type

Returns :

non 0 if node is probably a blank node identifier

librdf_heuristic_get_blank_node ()

const char *        librdf_heuristic_get_blank_node     (const char *node);

Get a blank node identifier from a node string.

Picks the blank node identifier out of a string. Looks for things like _:ABC

node :

string object to guess type

Returns :

the blank node identifer string or NULL if the node does not seem to be a blank node identifier

librdf_heuristic_object_is_literal ()

int                 librdf_heuristic_object_is_literal  (const char *object);

Try to guess if an object string is a literal or a resource.

The guessing is done by assuming the object is a URL if it matches ^[isalnum()]+:[^isblank()]+$

This will be fooled by literals of form 'thing:non-blank-thing' but is good enough.

object :

string object to guess type

Returns :

non 0 if object is probably a literal
redland-1.0.17/docs/html/redland-storage-module-tstore.html0000644000175000017500000000736712257576340020620 00000000000000 Store 'tstore'

Store 'tstore'

This module provides storage via the AKT Triplestore when available. It was added in Redland 0.9.15 and is alpha quality - not complete or tested significantly (although the AKT store itself is used in production). This store provides a basic triple API but no redland contexts. The underlying RDQL support and inference is not yet exposed in Redland but may be in future.

There are several options required with the tstore storage in order to connect to the tstore database (which uses MySQL). These are:

  • host for the database server hostname

  • port for the database server port

  • database for the database name (not the storage name)

  • user for the database server user name

  • password for the database server password

NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this.

Summary:

  • Persistent

  • Suitable for very large models

  • Indexed and optimized by the AKT project

  • No Redland contexts

  • Alpha quality

redland-1.0.17/docs/html/redland-uri.html0000644000175000017500000010675312257576340015151 00000000000000 URI

URI

URI — URI class

Synopsis

typedef             librdf_uri;
librdf_uri *        librdf_new_uri                      (librdf_world *world,
                                                         const unsigned char *uri_string);
librdf_uri *        librdf_new_uri2                     (librdf_world *world,
                                                         const unsigned char *uri_string,
                                                         size_t length);
librdf_uri *        librdf_new_uri_from_uri             (librdf_uri *old_uri);
librdf_uri *        librdf_new_uri_from_uri_local_name  (librdf_uri *old_uri,
                                                         const unsigned char *local_name);
void                librdf_free_uri                     (librdf_uri *uri);
unsigned char *     librdf_uri_as_string                (librdf_uri *uri);
unsigned char *     librdf_uri_as_counted_string        (librdf_uri *uri,
                                                         size_t *len_p);
void                librdf_uri_print                    (librdf_uri *uri,
                                                         FILE *fh);
unsigned char *     librdf_uri_to_string                (librdf_uri *uri);
unsigned char *     librdf_uri_to_counted_string        (librdf_uri *uri,
                                                         size_t *len_p);
int                 librdf_uri_equals                   (librdf_uri *first_uri,
                                                         librdf_uri *second_uri);
int                 librdf_uri_is_file_uri              (librdf_uri *uri);
const char *        librdf_uri_to_filename              (librdf_uri *uri);
librdf_uri *        librdf_new_uri_normalised_to_base   (const unsigned char *uri_string,
                                                         librdf_uri *source_uri,
                                                         librdf_uri *base_uri);
librdf_uri *        librdf_new_uri_relative_to_base     (librdf_uri *base_uri,
                                                         const unsigned char *uri_string);
librdf_uri *        librdf_new_uri_from_filename        (librdf_world *world,
                                                         const char *filename);
int                 librdf_uri_compare                  (librdf_uri *uri1,
                                                         librdf_uri *uri2);
int                 (*librdf_uri_filter_func)           (void *user_data,
                                                         librdf_uri *uri);

Description

A class for absolute URIs and relative URI computation utility functions. Only absolute URIs are provided, with no current access to internals of URIs such as URI scheme, path, authority. Relative URIs can be generated against some base or turned to and from local filenames.

Details

librdf_uri

typedef struct raptor_uri_s librdf_uri;

Redland URI class.


librdf_new_uri ()

librdf_uri *        librdf_new_uri                      (librdf_world *world,
                                                         const unsigned char *uri_string);

Constructor - create a new librdf_uri object from a URI string.

A new URI is constructed from a copy of the string. If the string is a NULL pointer or empty (0 length) then the result is NULL.

world :

redland world object

uri_string :

URI in string form

Returns :

a new librdf_uri object or NULL on failure

librdf_new_uri2 ()

librdf_uri *        librdf_new_uri2                     (librdf_world *world,
                                                         const unsigned char *uri_string,
                                                         size_t length);

Constructor - create a new librdf_uri object from a counted URI string.

A new URI is constructed from a copy of the string. If the string is a NULL pointer or 0 length or empty (first byte is 0) then the result is NULL.

world :

redland world object

uri_string :

URI in string form

length :

length of string

Returns :

a new librdf_uri object or NULL on failure

librdf_new_uri_from_uri ()

librdf_uri *        librdf_new_uri_from_uri             (librdf_uri *old_uri);

Copy constructor - create a new librdf_uri object from an existing librdf_uri object.

old_uri :

librdf_uri object

Returns :

a new librdf_uri object or NULL on failure

librdf_new_uri_from_uri_local_name ()

librdf_uri *        librdf_new_uri_from_uri_local_name  (librdf_uri *old_uri,
                                                         const unsigned char *local_name);

Copy constructor - create a new librdf_uri object from an existing librdf_uri object and a local name.

old_uri :

librdf_uri object

local_name :

local name to append to URI

Returns :

a new librdf_uri object or NULL on failure

librdf_free_uri ()

void                librdf_free_uri                     (librdf_uri *uri);

Destructor - destroy a librdf_uri object.

uri :

librdf_uri object

librdf_uri_as_string ()

unsigned char *     librdf_uri_as_string                (librdf_uri *uri);

Get a pointer to the string representation of the URI.

Returns a shared pointer to the URI string representation. Note: does not allocate a new string so the caller must not free it.

uri :

librdf_uri object

Returns :

string representation of URI

librdf_uri_as_counted_string ()

unsigned char *     librdf_uri_as_counted_string        (librdf_uri *uri,
                                                         size_t *len_p);

Get a pointer to the string representation of the URI with length.

Returns a shared pointer to the URI string representation. Note: does not allocate a new string so the caller must not free it.

uri :

librdf_uri object

len_p :

pointer to location to store length

Returns :

string representation of URI

librdf_uri_print ()

void                librdf_uri_print                    (librdf_uri *uri,
                                                         FILE *fh);

Print the URI to the given file handle.

uri :

librdf_uri object

fh :

file handle

librdf_uri_to_string ()

unsigned char *     librdf_uri_to_string                (librdf_uri *uri);

Format the URI as a string.

Note: this method allocates a new string since this is a _to_ method and the caller must free the resulting memory.

uri :

librdf_uri object

Returns :

string representation of the URI or NULL on failure

librdf_uri_to_counted_string ()

unsigned char *     librdf_uri_to_counted_string        (librdf_uri *uri,
                                                         size_t *len_p);

Format the URI as a counted string.

Note: this method allocates a new string since this is a _to_ method and the caller must free the resulting memory.

uri :

librdf_uri object

len_p :

pointer to location to store length

Returns :

string representation of the URI or NULL on failure

librdf_uri_equals ()

int                 librdf_uri_equals                   (librdf_uri *first_uri,
                                                         librdf_uri *second_uri);

Compare two librdf_uri objects for equality.

first_uri :

librdf_uri object 1

second_uri :

librdf_uri object 2

Returns :

non 0 if the objects are equal

librdf_uri_is_file_uri ()

int                 librdf_uri_is_file_uri              (librdf_uri *uri);

Test if a URI points to a filename.

uri :

librdf_uri object

Returns :

Non zero if the URI points to a file

librdf_uri_to_filename ()

const char *        librdf_uri_to_filename              (librdf_uri *uri);

Return pointer to filename of URI.

Returns a pointer to a newly allocated buffer that the caller must free. This will fail if the URI is not a file: URI. This can be checked with librdf_uri_is_file_uri

uri :

librdf_uri object

Returns :

pointer to filename or NULL on failure

librdf_new_uri_normalised_to_base ()

librdf_uri *        librdf_new_uri_normalised_to_base   (const unsigned char *uri_string,
                                                         librdf_uri *source_uri,
                                                         librdf_uri *base_uri);

Constructor - create a new librdf_uri object from a URI string stripped of the source URI, made relative to the base URI.

uri_string :

URI in string form

source_uri :

source URI to remove

base_uri :

base URI to add

Returns :

a new librdf_uri object or NULL on failure

librdf_new_uri_relative_to_base ()

librdf_uri *        librdf_new_uri_relative_to_base     (librdf_uri *base_uri,
                                                         const unsigned char *uri_string);

Constructor - create a new librdf_uri object from a URI string relative to a base URI.

An empty uri_string or NULL is equivalent to librdf_new_uri_from_uri(base_uri)

base_uri :

absolute base URI

uri_string :

relative URI string

Returns :

a new librdf_uri object or NULL on failure

librdf_new_uri_from_filename ()

librdf_uri *        librdf_new_uri_from_filename        (librdf_world *world,
                                                         const char *filename);

Constructor - create a new librdf_uri object from a filename.

world :

Redland librdf_world object

filename :

filename

Returns :

a new librdf_uri object or NULL on failure

librdf_uri_compare ()

int                 librdf_uri_compare                  (librdf_uri *uri1,
                                                         librdf_uri *uri2);

Compare two librdf_uri objects lexicographically.

A NULL URI is always less than (never equal to) a non-NULL URI.

uri1 :

librdf_uri object 1 or NULL

uri2 :

librdf_uri object 2 or NULL

Returns :

<0 if uri1 is less than uri2, 0 if equal, >0 if uri1 is greater than uri2

librdf_uri_filter_func ()

int                 (*librdf_uri_filter_func)           (void *user_data,
                                                         librdf_uri *uri);

Callback function for librdf_parser_set_uri_filter()

user_data :

user data

uri :

librdf_uri URI to check

Returns :

non-0 to filter the URI
redland-1.0.17/docs/html/redland-query.html0000644000175000017500000007430712257576340015516 00000000000000 Querying

Querying

Querying — RDF query languages and execution.

Synopsis

typedef             librdf_query;
typedef             librdf_query_factory;
void                librdf_query_register_factory       (librdf_world *world,
                                                         const char *name,
                                                         const unsigned char *uri_string,
                                                         void (*factory) (librdf_query_factory*));
const raptor_syntax_description * librdf_query_language_get_description
                                                        (librdf_world *world,
                                                         unsigned int counter);
int                 librdf_query_languages_enumerate    (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const unsigned char **uri_string);
librdf_query *      librdf_new_query                    (librdf_world *world,
                                                         const char *name,
                                                         librdf_uri *uri,
                                                         const unsigned char *query_string,
                                                         librdf_uri *base_uri);
librdf_query *      librdf_new_query_from_query         (librdf_query *old_query);
librdf_query *      librdf_new_query_from_factory       (librdf_world *world,
                                                         librdf_query_factory *factory,
                                                         const char *name,
                                                         librdf_uri *uri,
                                                         const unsigned char *query_string,
                                                         librdf_uri *base_uri);
void                librdf_free_query                   (librdf_query *query);
librdf_query_results * librdf_query_execute             (librdf_query *query,
                                                         librdf_model *model);
int                 librdf_query_get_limit              (librdf_query *query);
int                 librdf_query_set_limit              (librdf_query *query,
                                                         int limit);
int                 librdf_query_get_offset             (librdf_query *query);
int                 librdf_query_set_offset             (librdf_query *query,
                                                         int offset);

Description

Provides classes to create query objects and to execute them over an RDF graph (librdf_model) returning a librdf_query_results Query result limits and offsets can be set.

Details

librdf_query

typedef struct librdf_query_s librdf_query;

Redland query class.


librdf_query_factory

typedef struct librdf_query_factory_s librdf_query_factory;

Redland query factory class.


librdf_query_register_factory ()

void                librdf_query_register_factory       (librdf_world *world,
                                                         const char *name,
                                                         const unsigned char *uri_string,
                                                         void (*factory) (librdf_query_factory*));

Register a query factory.

world :

redland world object

name :

the query language name

uri_string :

the query language URI string (or NULL if none)

factory :

pointer to function to call to register the factory

librdf_query_language_get_description ()

const raptor_syntax_description * librdf_query_language_get_description
                                                        (librdf_world *world,
                                                         unsigned int counter);

Get a query language syntax description.

world :

librdf_world

counter :

index into the list of query language syntaxes

Returns :

description or NULL if counter is out of range

librdf_query_languages_enumerate ()

int                 librdf_query_languages_enumerate    (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const unsigned char **uri_string);

Get information on query language syntaxes.

All returned strings are shared and must be copied if needed to be used dynamically.

deprecated: use librdf_query_language_get_description() to return more information in a static structure.

world :

librdf_world

counter :

index into the list of query language syntaxes

name :

pointer to store the name of the query language syntax (or NULL)

uri_string :

pointer to store query language syntax URI string (or NULL)

Returns :

non 0 on failure of if counter is out of range

librdf_new_query ()

librdf_query *      librdf_new_query                    (librdf_world *world,
                                                         const char *name,
                                                         librdf_uri *uri,
                                                         const unsigned char *query_string,
                                                         librdf_uri *base_uri);

Constructor - create a new librdf_query object.

world :

redland world object

name :

the name identifying the query language

uri :

the URI identifying the query language (or NULL)

query_string :

the query string

base_uri :

the base URI of the query string (or NULL)

Returns :

a new librdf_query object or NULL on failure

librdf_new_query_from_query ()

librdf_query *      librdf_new_query_from_query         (librdf_query *old_query);

Copy constructor - create a new librdf_query object from an existing one

Should create a new query in the same context as the existing one as appropriate.

old_query :

the existing query librdf_query to use

Returns :

a new librdf_query object or NULL on failure

librdf_new_query_from_factory ()

librdf_query *      librdf_new_query_from_factory       (librdf_world *world,
                                                         librdf_query_factory *factory,
                                                         const char *name,
                                                         librdf_uri *uri,
                                                         const unsigned char *query_string,
                                                         librdf_uri *base_uri);

Constructor - create a new librdf_query object.

world :

redland world object

factory :

the factory to use to construct the query

name :

query language name

uri :

query language URI (or NULL)

query_string :

the query string

base_uri :

base URI of the query string (or NULL)

Returns :

a new librdf_query object or NULL on failure

librdf_free_query ()

void                librdf_free_query                   (librdf_query *query);

Destructor - destroy a librdf_query object.

query :

librdf_query object

librdf_query_execute ()

librdf_query_results * librdf_query_execute             (librdf_query *query,
                                                         librdf_model *model);

Run the query on a model.

Runs the query against the (previously registered) model and returns a librdf_query_results for the result objects.

query :

librdf_query object

model :

model to operate query on

Returns :

librdf_query_results or NULL on failure

librdf_query_get_limit ()

int                 librdf_query_get_limit              (librdf_query *query);

Get the query-specified limit on results.

This is the limit given in the query on the number of results allowed.

query :

librdf_query query object

Returns :

integer >=0 if a limit is given, otherwise <0

librdf_query_set_limit ()

int                 librdf_query_set_limit              (librdf_query *query,
                                                         int limit);

Set the query-specified limit on results.

This is the limit given in the query on the number of results allowed.

query :

librdf_query query object

limit :

the limit on results, >=0 to set a limit, <0 to have no limit

Returns :

non-0 on failure

librdf_query_get_offset ()

int                 librdf_query_get_offset             (librdf_query *query);

Get the query-specified offset on results.

This is the offset given in the query on the number of results allowed.

query :

librdf_query query object

Returns :

integer >=0 if a offset is given, otherwise <0

librdf_query_set_offset ()

int                 librdf_query_set_offset             (librdf_query *query,
                                                         int offset);

Set the query-specified offset on results.

This is the offset given in the query on the number of results allowed.

query :

librdf_query query object

offset :

offset for results, >=0 to set an offset, <0 to have no offset

Returns :

non-0 on failure
redland-1.0.17/docs/html/redland-hash.html0000644000175000017500000010143012257576340015260 00000000000000 Hashes

Hashes

Hashes — Key:Value hashes or dictionaries.

Synopsis

typedef             librdf_hash;
typedef             librdf_hash_cursor;
librdf_hash *       librdf_new_hash                     (librdf_world *world,
                                                         const char *name);
librdf_hash *       librdf_new_hash_from_string         (librdf_world *world,
                                                         const char *name,
                                                         const char *string);
librdf_hash *       librdf_new_hash_from_array_of_strings
                                                        (librdf_world *world,
                                                         const char *name,
                                                         const char **array);
librdf_hash *       librdf_new_hash_from_hash           (librdf_hash *old_hash);
void                librdf_free_hash                    (librdf_hash *hash);
char *              librdf_hash_get                     (librdf_hash *hash,
                                                         const char *key);
int                 librdf_hash_get_as_boolean          (librdf_hash *hash,
                                                         const char *key);
long                librdf_hash_get_as_long             (librdf_hash *hash,
                                                         const char *key);
char *              librdf_hash_get_del                 (librdf_hash *hash,
                                                         const char *key);
int                 librdf_hash_put_strings             (librdf_hash *hash,
                                                         const char *key,
                                                         const char *value);
void                librdf_hash_print                   (librdf_hash *hash,
                                                         FILE *fh);
void                librdf_hash_print_keys              (librdf_hash *hash,
                                                         FILE *fh);
void                librdf_hash_print_values            (librdf_hash *hash,
                                                         const char *key_string,
                                                         FILE *fh);
unsigned char *     librdf_hash_interpret_template      (const unsigned char *template_string,
                                                         librdf_hash *dictionary,
                                                         const unsigned char *prefix,
                                                         const unsigned char *suffix);
int                 librdf_hash_from_string             (librdf_hash *hash,
                                                         const char *string);
char *              librdf_hash_to_string               (librdf_hash *hash,
                                                         const char *filter[]);

Description

Interface to implementations of key:value hashes either in memory, on disk and with persistence. Keys may have multiple and duplicate values.

Details

librdf_hash

typedef struct librdf_hash_s librdf_hash;

Redland hash class.


librdf_hash_cursor

typedef struct librdf_hash_cursor_s librdf_hash_cursor;

Redland hash cursor class.


librdf_new_hash ()

librdf_hash *       librdf_new_hash                     (librdf_world *world,
                                                         const char *name);

Constructor - create a new librdf_hash object.

world :

redland world object

name :

factory name

Returns :

a new librdf_hash object or NULL on failure

librdf_new_hash_from_string ()

librdf_hash *       librdf_new_hash_from_string         (librdf_world *world,
                                                         const char *name,
                                                         const char *string);

Constructor - create a new librdf_hash object from a string.

See librdf_hash_from_string for the string format.

world :

redland world object

name :

hash name

string :

hash encoded as a string

Returns :

a new librdf_hash object or NULL on failure

librdf_new_hash_from_array_of_strings ()

librdf_hash *       librdf_new_hash_from_array_of_strings
                                                        (librdf_world *world,
                                                         const char *name,
                                                         const char **array);

Constructor - create a new librdf_hash object from an array of strings.

world :

redland world object

name :

hash name

array :

address of the start of the array of char* pointers

Returns :

a new librdf_hash object or NULL on failure

librdf_new_hash_from_hash ()

librdf_hash *       librdf_new_hash_from_hash           (librdf_hash *old_hash);

Copy Constructor - create a new librdf_hash object from an existing one.

old_hash :

the hash to use to construct the hash

Returns :

a new librdf_hash object or NULL on failure

librdf_free_hash ()

void                librdf_free_hash                    (librdf_hash *hash);

Destructor - destroy a librdf_hash object.

hash :

hash object

librdf_hash_get ()

char *              librdf_hash_get                     (librdf_hash *hash,
                                                         const char *key);

Retrieve one value from hash for a given key as string.

The value returned is from newly allocated memory which the caller must free.

hash :

hash object

key :

pointer to key

Returns :

the value or NULL on failure

librdf_hash_get_as_boolean ()

int                 librdf_hash_get_as_boolean          (librdf_hash *hash,
                                                         const char *key);

Lookup a hash key and decode value as a boolean.

False values: "no", "false" True values: "yes", "true"

hash :

librdf_hash object

key :

key string to look up

Returns :

>0 (for true), 0 (for false) or <0 (for key not found or not known boolean value)

librdf_hash_get_as_long ()

long                librdf_hash_get_as_long             (librdf_hash *hash,
                                                         const char *key);

Lookup a hash key and decode value as a long.

hash :

librdf_hash object

key :

key string to look up

Returns :

>0 (for success), <0 (for key not found or not known boolean value)

librdf_hash_get_del ()

char *              librdf_hash_get_del                 (librdf_hash *hash,
                                                         const char *key);

Retrieve one value from hash for a given key as string and remove all values with that key.

The value returned is from newly allocated memory which the caller must free.

hash :

hash object

key :

pointer to key

Returns :

the value or NULL on failure

librdf_hash_put_strings ()

int                 librdf_hash_put_strings             (librdf_hash *hash,
                                                         const char *key,
                                                         const char *value);

Insert key/value pairs into the hash as strings.

The key and values are copied into the hash, no sharing i s done.

hash :

hash object

key :

key

value :

value

Returns :

non 0 on failure

librdf_hash_print ()

void                librdf_hash_print                   (librdf_hash *hash,
                                                         FILE *fh);

Pretty print the hash to a file descriptor.

hash :

the hash

fh :

file handle

librdf_hash_print_keys ()

void                librdf_hash_print_keys              (librdf_hash *hash,
                                                         FILE *fh);

Pretty print the keys to a file descriptor.

hash :

the hash

fh :

file handle

librdf_hash_print_values ()

void                librdf_hash_print_values            (librdf_hash *hash,
                                                         const char *key_string,
                                                         FILE *fh);

Pretty print the values of one key to a file descriptor.

hash :

the hash

key_string :

the key as a string

fh :

file handle

librdf_hash_interpret_template ()

unsigned char *     librdf_hash_interpret_template      (const unsigned char *template_string,
                                                         librdf_hash *dictionary,
                                                         const unsigned char *prefix,
                                                         const unsigned char *suffix);

Interpret keys in a template string to their value in a dictionary.

Can be used to do variable substitution for a string where the syntax that marks the variable is defined by the prefix and suffix strings, and the variables are stored in the dictionary hash table.

template_string :

template string to interprate

dictionary :

dictionary of key/values to substitute

prefix :

prefix to mark a key in the template

suffix :

suffix to mark a key in the template

Returns :

Newly allocated string, or NULL on failure

librdf_hash_from_string ()

int                 librdf_hash_from_string             (librdf_hash *hash,
                                                         const char *string);

Initialise a hash from a string.

The string format is something like: key1='value1',key2='value2', key3='\'quoted value\''

The 's are required and whitespace can appear around the = and ,s

hash :

hash object

string :

hash encoded as a string

Returns :

non 0 on failure

librdf_hash_to_string ()

char *              librdf_hash_to_string               (librdf_hash *hash,
                                                         const char *filter[]);

Format the hash as a string, suitable for parsing by librdf_hash_from_string.

Note: this method allocates a new string since this is a _to_ method and the caller must call librdf_free_memory() to free the resulting memory.

hash :

librdf_hash object

filter :

NULL terminated list of keys to ignore

Returns :

string representation of the hash or NULL on failure
redland-1.0.17/docs/html/redland-query-results.html0000644000175000017500000026743512257576340017223 00000000000000 Query results

Query results

Query results — RDF query results.

Synopsis

typedef             librdf_query_results;
librdf_stream *     librdf_query_results_as_stream      (librdf_query_results *query_results);
int                 librdf_query_results_get_count      (librdf_query_results *query_results);
int                 librdf_query_results_next           (librdf_query_results *query_results);
int                 librdf_query_results_finished       (librdf_query_results *query_results);
int                 librdf_query_results_get_bindings   (librdf_query_results *query_results,
                                                         const char ***names,
                                                         librdf_node **values);
librdf_node *       librdf_query_results_get_binding_value
                                                        (librdf_query_results *query_results,
                                                         int offset);
const char *        librdf_query_results_get_binding_name
                                                        (librdf_query_results *query_results,
                                                         int offset);
librdf_node *       librdf_query_results_get_binding_value_by_name
                                                        (librdf_query_results *query_results,
                                                         const char *name);
int                 librdf_query_results_get_bindings_count
                                                        (librdf_query_results *query_results);
unsigned char *     librdf_query_results_to_counted_string
                                                        (librdf_query_results *query_results,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri,
                                                         size_t *length_p);
unsigned char *     librdf_query_results_to_counted_string2
                                                        (librdf_query_results *query_results,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri,
                                                         size_t *length_p);
unsigned char *     librdf_query_results_to_string      (librdf_query_results *query_results,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);
unsigned char *     librdf_query_results_to_string2     (librdf_query_results *query_results,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);
int                 librdf_query_results_to_file_handle (librdf_query_results *query_results,
                                                         FILE *handle,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);
int                 librdf_query_results_to_file_handle2
                                                        (librdf_query_results *query_results,
                                                         FILE *handle,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);
int                 librdf_query_results_to_file        (librdf_query_results *query_results,
                                                         const char *name,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);
int                 librdf_query_results_to_file2       (librdf_query_results *query_results,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);
void                librdf_free_query_results           (librdf_query_results *query_results);
int                 librdf_query_results_is_bindings    (librdf_query_results *query_results);
int                 librdf_query_results_is_boolean     (librdf_query_results *query_results);
int                 librdf_query_results_is_graph       (librdf_query_results *query_results);
int                 librdf_query_results_is_syntax      (librdf_query_results *query_results);
int                 librdf_query_results_get_boolean    (librdf_query_results *query_results);
librdf_query_results_formatter * librdf_new_query_results_formatter
                                                        (librdf_query_results *query_results,
                                                         const char *name,
                                                         librdf_uri *uri);
librdf_query_results_formatter * librdf_new_query_results_formatter_by_mime_type
                                                        (librdf_query_results *query_results,
                                                         const char *mime_type);
librdf_query_results_formatter * librdf_new_query_results_formatter2
                                                        (librdf_query_results *query_results,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *uri);
void                librdf_free_query_results_formatter (librdf_query_results_formatter *formatter);
int                 librdf_query_results_formats_check  (librdf_world *world,
                                                         const char *name,
                                                         librdf_uri *uri,
                                                         const char *mime_type);
const raptor_syntax_description * librdf_query_results_formats_get_description
                                                        (librdf_world *world,
                                                         unsigned int counter);
int                 librdf_query_results_formats_enumerate
                                                        (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const char **label,
                                                         const unsigned char **uri_string,
                                                         const char **mime_type);
typedef             librdf_query_results_formatter;
int                 librdf_query_results_formatter_write
                                                        (raptor_iostream *iostr,
                                                         librdf_query_results_formatter *formatter,
                                                         librdf_query_results *query_results,
                                                         librdf_uri *base_uri);

Description

The results of an librdf_query execution as a sequence of individual results, an RDF graph as a sequence of triples or a boolean. For variable binding results, the binding names and values can be read in multiple forms and the number of results returned as well as the current result moved to the next. For an RDF graph result, the stream of triples can be returned. For a boolean result, the value can be returned. All results can be turned into a string XML format based on the SPARQL XML results format which can also be written to a file.

Details

librdf_query_results

typedef struct librdf_query_results_s librdf_query_results;

Redland query results class.


librdf_query_results_as_stream ()

librdf_stream *     librdf_query_results_as_stream      (librdf_query_results *query_results);

Get a query result as an RDF graph in librdf_stream form

The return value is only meaningful if this is an RDF graph query result - see librdf_query_results_is_graph().

query_results :

librdf_query_results query_results

Returns :

a new librdf_stream result or NULL on error

librdf_query_results_get_count ()

int                 librdf_query_results_get_count      (librdf_query_results *query_results);

Get number of bindings so far.

query_results :

librdf_query_results query results

Returns :

number of bindings found so far

librdf_query_results_next ()

int                 librdf_query_results_next           (librdf_query_results *query_results);

Move to the next result.

query_results :

librdf_query_results query results

Returns :

non-0 if failed or results exhausted

librdf_query_results_finished ()

int                 librdf_query_results_finished       (librdf_query_results *query_results);

Find out if binding results are exhausted.

query_results :

librdf_query_results query results

Returns :

non-0 if results are finished or query failed

librdf_query_results_get_bindings ()

int                 librdf_query_results_get_bindings   (librdf_query_results *query_results,
                                                         const char ***names,
                                                         librdf_node **values);

Get all binding names, values for current result.

If names is not NULL, it is set to the address of a shared array of names of the bindings (an output parameter). These names are shared and must not be freed by the caller

If values is not NULL, it is used as an array to store pointers to the librdf_node* of the results. These nodes must be freed by the caller. The size of the array is determined by the number of names of bindings, returned by librdf_query_results_get_bindings_count dynamically or will be known in advanced if hard-coded into the query string.

Example

const char **names=NULL; librdf_node* values[10];

if(librdf_query_results_get_bindings(results, &names, values)) ...

query_results :

librdf_query_results query results

names :

pointer to an array of binding names (or NULL)

values :

pointer to an array of binding value librdf_node (or NULL)

Returns :

non-0 if the assignment failed

librdf_query_results_get_binding_value ()

librdf_node *       librdf_query_results_get_binding_value
                                                        (librdf_query_results *query_results,
                                                         int offset);

Get one binding value for the current result.

query_results :

librdf_query_results query results

offset :

offset of binding name into array of known names

Returns :

a new librdf_node binding value or NULL on failure

librdf_query_results_get_binding_name ()

const char *        librdf_query_results_get_binding_name
                                                        (librdf_query_results *query_results,
                                                         int offset);

Get binding name for the current result.

query_results :

librdf_query_results query results

offset :

offset of binding name into array of known names

Returns :

a pointer to a shared copy of the binding name or NULL on failure

librdf_query_results_get_binding_value_by_name ()

librdf_node *       librdf_query_results_get_binding_value_by_name
                                                        (librdf_query_results *query_results,
                                                         const char *name);

Get one binding value for a given name in the current result.

query_results :

librdf_query_results query results

name :

variable name

Returns :

a new librdf_node binding value or NULL on failure

librdf_query_results_get_bindings_count ()

int                 librdf_query_results_get_bindings_count
                                                        (librdf_query_results *query_results);

Get the number of bound variables in the result.

query_results :

librdf_query_results query results

Returns :

<0 if failed or results exhausted

librdf_query_results_to_counted_string ()

unsigned char *     librdf_query_results_to_counted_string
                                                        (librdf_query_results *query_results,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri,
                                                         size_t *length_p);

Turn a query results into a string.

The default query results format will be used if format_uri is NULL.

librdf_query_results_formats_enumerate() returns information on the known query results names, labels and URIs.

The base_uri may be used for as the base URI the generated syntax, depending on the format.

The returned string must be freed by the caller using librdf_free_memory().

deprecated: Use librdf_query_results_to_counted_string2() with extra name and mime-type args.

query_results :

librdf_query_results object

format_uri :

URI of syntax to format to (or NULL)

base_uri :

Base URI of output formatted syntax (or NULL)

length_p :

Pointer to where to store length of string (or NULL)

Returns :

new string value or NULL on failure

librdf_query_results_to_counted_string2 ()

unsigned char *     librdf_query_results_to_counted_string2
                                                        (librdf_query_results *query_results,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri,
                                                         size_t *length_p);

Turn a query results into a string.

A query results format can be named, have a mime type, or identified by a URI, all of which are optional. The default query results format will be used if name, mime_type and format_uri are all NULL.

librdf_query_results_formats_enumerate() returns information on the known query results names, labels and URIs.

The base_uri may be used for as the base URI the generated syntax, depending on the format.

The returned string must be freed by the caller using librdf_free_memory().

query_results :

librdf_query_results object

name :

name of syntax to format to

mime_type :

mime type of syntax to format to (or NULL)

format_uri :

URI of syntax to format to (or NULL)

base_uri :

Base URI of output formatted syntax (or NULL)

length_p :

Pointer to where to store length of string (or NULL)

Returns :

new string value or NULL on failure

librdf_query_results_to_string ()

unsigned char *     librdf_query_results_to_string      (librdf_query_results *query_results,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);

Turn a query results into a string.

A query results format can be named, have a mime type, or identified by a URI, all of which are optional. The default query results format will be used if format_uri is NULL.

librdf_query_results_formats_enumerate() returns information on the known query results names, labels and URIs.

The base_uri may be used for as the base URI the generated syntax, depending on the format.

The returned string must be freed by the caller using librdf_free_memory().

Deprecated: use librdf_query_results_to_string2() with extra name and mime_type args.

query_results :

librdf_query_results object

format_uri :

URI of syntax to format to

base_uri :

Base URI of output formatted syntax (or NULL)

Returns :

new string value or NULL on failure

librdf_query_results_to_string2 ()

unsigned char *     librdf_query_results_to_string2     (librdf_query_results *query_results,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);

Turn a query results into a string.

A query results format can be named, have a mime type, or identified by a URI, all of which are optional. The default query results format will be used if name, mime_type and format_uri are all NULL.

librdf_query_results_formats_enumerate() returns information on the known query results names, labels and URIs.

The base_uri may be used for as the base URI the generated syntax, depending on the format.

The returned string must be freed by the caller using librdf_free_memory().

query_results :

librdf_query_results object

name :

format name

mime_type :

format mime type (or NULL)

format_uri :

URI of syntax to format to (or NULL)

base_uri :

Base URI of output formatted syntax (or NULL)

Returns :

new string value or NULL on failure

librdf_query_results_to_file_handle ()

int                 librdf_query_results_to_file_handle (librdf_query_results *query_results,
                                                         FILE *handle,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);

Write a query results to a FILE*.

A query results format can be named, have a mime type, or identified by a URI, all of which are optional. The default query results format will be used if format_uri is NULL.

librdf_query_results_formats_enumerate() returns information on the known query results names, labels and URIs.

The base_uri may be used for as the base URI the generated syntax, depending on the format.

Deprecated: use librdf_query_results_to_file_handle() with extra name and mime_type args.

query_results :

librdf_query_results object

handle :

file handle to write to

format_uri :

URI of syntax to format to

base_uri :

Base URI of output formatted syntax (or NULL)

Returns :

non 0 on failure

librdf_query_results_to_file_handle2 ()

int                 librdf_query_results_to_file_handle2
                                                        (librdf_query_results *query_results,
                                                         FILE *handle,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);

Write a query results to a FILE*.

A query results format can be named, have a mime type, or identified by a URI, all of which are optional. The default query results format will be used if name, mime_type and format_uri are all NULL.

librdf_query_results_formats_enumerate() returns information on the known query results names, labels and URIs.

The base_uri may be used for as the base URI the generated syntax, depending on the format.

query_results :

librdf_query_results object

handle :

file handle to write to

name :

result format name (or NULL)

mime_type :

result mime type (or NULL)

format_uri :

URI of syntax to format to (or NULL)

base_uri :

Base URI of output formatted syntax

Returns :

non 0 on failure

librdf_query_results_to_file ()

int                 librdf_query_results_to_file        (librdf_query_results *query_results,
                                                         const char *name,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);

Write a query results to a file.

A query results format can be named, have a mime type, or identified by a URI, all of which are optional. The default query results format will be used if format_uri is NULL.

librdf_query_results_formats_enumerate() returns information on the known query results names, labels and URIs.

The base_uri may be used for as the base URI the generated syntax, depending on the format.

Deprecated: use librdf_query_results_to_file2() with extra mime_type arg.

query_results :

librdf_query_results object

name :

filename to write to

format_uri :

URI of syntax to format to

base_uri :

Base URI of output formatted syntax (or NULL)

Returns :

non 0 on failure

librdf_query_results_to_file2 ()

int                 librdf_query_results_to_file2       (librdf_query_results *query_results,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *format_uri,
                                                         librdf_uri *base_uri);

Write a query results to a file.

A query results format can be named, have a mime type, or identified by a URI, all of which are optional. The default query results format will be used if name, mime_type and format_uri are all NULL.

librdf_query_results_formats_enumerate() returns information on the known query results names, labels and URIs.

The base_uri may be used for as the base URI the generated syntax, depending on the format.

query_results :

librdf_query_results object

name :

filename to write to

mime_type :

mime type (or NULL)

format_uri :

URI of syntax to format to (or NULL)

base_uri :

Base URI of output formatted syntax (or NULL)

Returns :

non 0 on failure

librdf_free_query_results ()

void                librdf_free_query_results           (librdf_query_results *query_results);

Destructor - destroy a librdf_query_results object.

query_results :

librdf_query_results object

librdf_query_results_is_bindings ()

int                 librdf_query_results_is_bindings    (librdf_query_results *query_results);

Test if librdf_query_results is variable bindings format.

query_results :

librdf_query_results object

Returns :

non-0 if true

librdf_query_results_is_boolean ()

int                 librdf_query_results_is_boolean     (librdf_query_results *query_results);

Test if librdf_query_results is boolean format.

If this function returns true, the result can be retrieved by librdf_query_results_get_boolean().

query_results :

librdf_query_results object

Returns :

non-0 if true

librdf_query_results_is_graph ()

int                 librdf_query_results_is_graph       (librdf_query_results *query_results);

Test if librdf_query_results is RDF graph format.

query_results :

librdf_query_results object

Returns :

non-0 if true

librdf_query_results_is_syntax ()

int                 librdf_query_results_is_syntax      (librdf_query_results *query_results);

Test if librdf_query_results is a syntax.

If this function returns true, the ONLY result available from this query is a syntax that can be serialized using one of the query_result_formatter class methods or with librdf_query_results_to_counted_string(), librdf_query_results_to_string(), librdf_query_results_to_file_handle() or librdf_query_results_to_file()

query_results :

librdf_query_results object

Returns :

non-0 if true

librdf_query_results_get_boolean ()

int                 librdf_query_results_get_boolean    (librdf_query_results *query_results);

Get boolean query result.

The return value is only meaningful if this is a boolean query result - see librdf_query_results_is_boolean()

query_results :

librdf_query_results query_results

Returns :

boolean query result - >0 is true, 0 is false, <0 on error or finished

librdf_new_query_results_formatter ()

librdf_query_results_formatter * librdf_new_query_results_formatter
                                                        (librdf_query_results *query_results,
                                                         const char *name,
                                                         librdf_uri *uri);

Constructor - create a new librdf_query_results_formatter object by identified format.

A query results format can be named or identified by a URI, both of which are optional. The default query results format will be used if name and uri are both NULL.

librdf_query_results_formats_enumerate() returns information on the known query results names, labels and URIs.

Deprecated: for librdf_new_query_results_formatter2() with the name, mime_type and format_uri args.

query_results :

librdf_query_results query_results

name :

the query results format name (or NULL)

uri :

librdf_uri query results format uri (or NULL)

Returns :

a new librdf_query_results_formatter object or NULL on failure

librdf_new_query_results_formatter_by_mime_type ()

librdf_query_results_formatter * librdf_new_query_results_formatter_by_mime_type
                                                        (librdf_query_results *query_results,
                                                         const char *mime_type);

Constructor - create a new librdf_query_results_formatter object by mime type.

A query results format generates a syntax with a mime type which may be requested with this constructor.

Note that there may be several formatters that generate the same MIME Type (such as SPARQL XML results format drafts) and in thot case the librdf_new_query_results_formatter() constructor allows selecting of a specific one by name or URI.

Deprecated: for librdf_new_query_results_formatter2() with the name, mime_type and format_uri args.

query_results :

librdf_query_results query_results

mime_type :

mime type name

Returns :

a new librdf_query_results_formatter object or NULL on failure

librdf_new_query_results_formatter2 ()

librdf_query_results_formatter * librdf_new_query_results_formatter2
                                                        (librdf_query_results *query_results,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *uri);

Constructor - create a new librdf_query_results_formatter object by identified format.

A query results format can be named, have a mime type, or identified by a URI, all of which are optional. The default query results format will be used if name, mime_type and uri are all NULL.

librdf_query_results_formats_enumerate() returns information on the known query results names, labels and URIs.

query_results :

librdf_query_results query_results

name :

the query results format name (or NULL)

mime_type :

the query results format mime type (or NULL)

uri :

librdf_uri query results format uri (or NULL)

Returns :

a new librdf_query_results_formatter object or NULL on failure

librdf_free_query_results_formatter ()

void                librdf_free_query_results_formatter (librdf_query_results_formatter *formatter);

Destructor - destroy a librdf_query_results_formatter object.

formatter :

librdf_query_results_formatter object

librdf_query_results_formats_check ()

int                 librdf_query_results_formats_check  (librdf_world *world,
                                                         const char *name,
                                                         librdf_uri *uri,
                                                         const char *mime_type);

Check if a query results formatter exists for the requested format.

world :

librdf_world

name :

the query results format name (or NULL)

uri :

librdf_uri query results format uri (or NULL)

mime_type :

mime type name

Returns :

non-0 if a formatter exists.

librdf_query_results_formats_get_description ()

const raptor_syntax_description * librdf_query_results_formats_get_description
                                                        (librdf_world *world,
                                                         unsigned int counter);

Get query result formats descriptive syntax information

world :

world object

counter :

index into the list of query results formats

Returns :

description or NULL if counter is out of range

librdf_query_results_formats_enumerate ()

int                 librdf_query_results_formats_enumerate
                                                        (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const char **label,
                                                         const unsigned char **uri_string,
                                                         const char **mime_type);

Get information on query result syntaxes.

All returned strings are shared and must be copied if needed to be used dynamically.

Deprecated: use librdf_query_results_formats_get_description() to return more information in a static structure.

world :

librdf_world

counter :

index into the list of query result syntaxes

name :

pointer to store the name of the query result syntax (or NULL)

label :

pointer to store query result syntax readable label (or NULL)

uri_string :

pointer to store query result syntax URI string (or NULL)

mime_type :

pointer to store query result syntax mime type string (or NULL)

Returns :

non 0 on failure of if counter is out of range

librdf_query_results_formatter

typedef struct librdf_query_results_formatter_s librdf_query_results_formatter;

Redland query results formatter class.


librdf_query_results_formatter_write ()

int                 librdf_query_results_formatter_write
                                                        (raptor_iostream *iostr,
                                                         librdf_query_results_formatter *formatter,
                                                         librdf_query_results *query_results,
                                                         librdf_uri *base_uri);

Write the query results using the given formatter to an iostream

Note that after calling this method, the query results will be empty and librdf_query_results_finished() will return true (non-0)

See librdf_query_results_formats_enumerate() to get the list of syntax URIs and their description.

iostr :

raptor_iostream to write the query to

formatter :

librdf_query_results_formatter object

query_results :

librdf_query_results query results format

base_uri :

librdf_uri base URI of the output format

Returns :

non-0 on failure
redland-1.0.17/docs/html/redland-changes-1-0-16-to-1-0-16.html0000644000175000017500000000463212257576340017631 00000000000000 Changes between Redland librdf 1.0.16 and 1.0.16

Changes between Redland librdf 1.0.16 and 1.0.16

New functions, types and enums

redland-1.0.17/docs/html/redland-storage-module-hashes.html0000644000175000017500000001117312257576340020541 00000000000000 Store 'hashes'

Store 'hashes'

This module is always present (cannot be removed) and provides indexed storage using Redland Triple stores(3) to store various combinations of subject, predicate and object for faster access. Context nodes are also stored in a hash when used. The hashes may be in-memory (always available) or persistent via Sleepycat/Berkeley DB (BDB) versions 2-4. It is the most mature and primary persistent store and suitable for large models, tested in the 2-3 million range..

The main option requiring setting is the hash-type which must be one of the supported Redland hashes. Hash type memory is always available and if BDB has been compiled in, bdb is also available. Option dir can be used to set the destination directory for the BDB files when used. Boolean option new can be set to force creation or truncation of a persistent hashed store. The storage name must be given for hash type bdb since it is used for a filename.

The module provides optional contexts support enabled when boolean storage option contexts is set. This can be used with any hash type.

Examples:

  /* A new BDB hashed persistent store in the current directory */
  storage=librdf_new_storage(world, "hashes", "db1",
                             "new='yes',hash-type='bdb',dir='.'");

  /* Hashed in-memory store */
  storage=librdf_new_storage(world, "hashes", NULL,
                             "hash-type='memory'");

  /* An existing BDB hashed persistent store in dir /somewhere */
  storage=librdf_new_storage(world, "hashes", "dv2", 
                             "hash-type='bdb',dir='/somewhere'");

  /* An existing BDB hashed store with contexts */
  storage=librdf_new_storage(world, "hashes", "db3", 
                             "hash-type='bdb',contexts='yes'");

In Python:

  from RDF import *
  ...
  # Create a new BDB store
  storage = HashStorage("db4", options="new='yes',hash-type='bdb'")

In Perl:

  use RDF::Redland;
  ...
  # Open an existing BDB store
  $storage=new RDF::Redland::Storage("hashes", "db5", 
                                     "hash-type='bdb',dir='.'");

Summary:

  • Persistent or in-memory

  • Suitable for larger models

  • Indexed

  • Large disk usage with BDB

  • Optional contexts (with option contexts set)

redland-1.0.17/docs/html/redland-storage-module-memory.html0000644000175000017500000000621312257576340020575 00000000000000 Store 'memory'

Store 'memory'

This module is always present (cannot be removed) and provides a simple and fast in-memory store with no persistence. It is the default store if no store name is given to the storage constructors.

The memory store is not suitable for large in-memory models since it does not do any indexing. For that, use the the section called “Store 'hashes'†with hash-type of memory.

The module provides optional contexts support enabled when boolean storage option contexts is set.

Examples:

  /* Explicitly named memory storage */
  storage=librdf_new_storage(world, "memory", NULL, NULL);

  /* Default storage type, which is memory */
  storage=librdf_new_storage(world, NULL, NULL, NULL);

  /* In-memory store with contexts */
  storage=librdf_new_storage(world, NULL, NULL, "contexts='yes'");

Summary:

  • In-memory

  • Fast

  • Suitable for small models

  • No indexing

  • No persistence

  • Optional contexts (with option contexts set)

redland-1.0.17/docs/html/redland-statement.html0000644000175000017500000020124712257576340016350 00000000000000 RDF Triple (librdf_statement)

RDF Triple (librdf_statement)

RDF Triple (librdf_statement) — RDF Triple.

Synopsis

typedef             librdf_statement;
enum                librdf_statement_part;
librdf_statement *  librdf_new_statement                (librdf_world *world);
librdf_statement *  librdf_new_statement_from_statement (librdf_statement *statement);
librdf_statement *  librdf_new_statement_from_statement2
                                                        (librdf_statement *statement);
librdf_statement *  librdf_new_statement_from_nodes     (librdf_world *world,
                                                         librdf_node *subject,
                                                         librdf_node *predicate,
                                                         librdf_node *object);
void                librdf_statement_init               (librdf_world *world,
                                                         librdf_statement *statement);
void                librdf_statement_clear              (librdf_statement *statement);
void                librdf_free_statement               (librdf_statement *statement);
librdf_node *       librdf_statement_get_subject        (librdf_statement *statement);
void                librdf_statement_set_subject        (librdf_statement *statement,
                                                         librdf_node *node);
librdf_node *       librdf_statement_get_predicate      (librdf_statement *statement);
void                librdf_statement_set_predicate      (librdf_statement *statement,
                                                         librdf_node *node);
librdf_node *       librdf_statement_get_object         (librdf_statement *statement);
void                librdf_statement_set_object         (librdf_statement *statement,
                                                         librdf_node *node);
int                 librdf_statement_is_complete        (librdf_statement *statement);
unsigned char *     librdf_statement_to_string          (librdf_statement *statement);
void                librdf_statement_print              (librdf_statement *statement,
                                                         FILE *fh);
int                 librdf_statement_equals             (librdf_statement *statement1,
                                                         librdf_statement *statement2);
int                 librdf_statement_match              (librdf_statement *statement,
                                                         librdf_statement *partial_statement);
size_t              librdf_statement_encode             (librdf_statement *statement,
                                                         unsigned char *buffer,
                                                         size_t length);
size_t              librdf_statement_encode2            (librdf_world *world,
                                                         librdf_statement *statement,
                                                         unsigned char *buffer,
                                                         size_t length);
size_t              librdf_statement_encode_parts       (librdf_statement *statement,
                                                         librdf_node *context_node,
                                                         unsigned char *buffer,
                                                         size_t length,
                                                         librdf_statement_part fields);
size_t              librdf_statement_encode_parts2      (librdf_world *world,
                                                         librdf_statement *statement,
                                                         librdf_node *context_node,
                                                         unsigned char *buffer,
                                                         size_t length,
                                                         librdf_statement_part fields);
size_t              librdf_statement_decode             (librdf_statement *statement,
                                                         unsigned char *buffer,
                                                         size_t length);
size_t              librdf_statement_decode2            (librdf_world *world,
                                                         librdf_statement *statement,
                                                         librdf_node **context_node,
                                                         unsigned char *buffer,
                                                         size_t length);
size_t              librdf_statement_decode_parts       (librdf_statement *statement,
                                                         librdf_node **context_node,
                                                         unsigned char *buffer,
                                                         size_t length);
int                 librdf_statement_write              (librdf_statement *statement,
                                                         raptor_iostream *iostr);

Description

An object representing an RDF Triple of three RDF terms (librdf_node). Triples can be created, accessed, destroyed and en/decoded into a binary form for use in storage.

Details

librdf_statement

typedef raptor_statement librdf_statement;

Redland statement class.


enum librdf_statement_part

typedef enum {
  LIBRDF_STATEMENT_SUBJECT   = 1 << 0,
  LIBRDF_STATEMENT_PREDICATE = 1 << 1,
  LIBRDF_STATEMENT_OBJECT    = 1 << 2,

  /* must be a combination of all of the above */
  LIBRDF_STATEMENT_ALL       = (LIBRDF_STATEMENT_SUBJECT|
                                LIBRDF_STATEMENT_PREDICATE|
                                LIBRDF_STATEMENT_OBJECT)
} librdf_statement_part;

Flags that are or-ed to indicate statement parts.

Used in fields arguments to methods such as the public librdf_statement_encode_parts() librdf_statement_decode_parts() librdf_new_stream_from_node_iterator().

LIBRDF_STATEMENT_SUBJECT

Subject of a statement.

LIBRDF_STATEMENT_PREDICATE

Predicate of a statement.

LIBRDF_STATEMENT_OBJECT

Object of a statement.

LIBRDF_STATEMENT_ALL

All parts of a statement.

librdf_new_statement ()

librdf_statement *  librdf_new_statement                (librdf_world *world);

Constructor - create a new empty librdf_statement.

world :

redland world object

Returns :

a new librdf_statement or NULL on failure

librdf_new_statement_from_statement ()

librdf_statement *  librdf_new_statement_from_statement (librdf_statement *statement);

Copy constructor - create a new librdf_statement from an existing librdf_statement. Creates a deep copy - changes to original statement nodes are not reflected in the copy.

statement :

librdf_statement to copy

Returns :

a new librdf_statement with copy or NULL on failure

librdf_new_statement_from_statement2 ()

librdf_statement *  librdf_new_statement_from_statement2
                                                        (librdf_statement *statement);

Copy constructor - create a new librdf_statement from an existing librdf_statement. Creates a shallow copy - changes to original statement nodes are reflected in the copy.

statement :

librdf_statement to copy

Returns :

a new librdf_statement with copy or NULL on failure

librdf_new_statement_from_nodes ()

librdf_statement *  librdf_new_statement_from_nodes     (librdf_world *world,
                                                         librdf_node *subject,
                                                         librdf_node *predicate,
                                                         librdf_node *object);

Constructor - create a new librdf_statement from existing librdf_node objects.

The node objects become owned by the new statement (or freed on error).

world :

redland world object

subject :

librdf_node

predicate :

librdf_node

object :

librdf_node

Returns :

a new librdf_statement with copy or NULL on failure

librdf_statement_init ()

void                librdf_statement_init               (librdf_world *world,
                                                         librdf_statement *statement);

Initialise a statically declared librdf_statement.

This MUST be called on a statically declared librdf_statement to initialise it properly. It is the responsibility of the user of the statically allocated librdf_statement to deal with deallocation of any statement parts (subject, predicate, object).

world :

redland world object

statement :

librdf_statement object

librdf_statement_clear ()

void                librdf_statement_clear              (librdf_statement *statement);

Empty a librdf_statement of nodes.

statement :

librdf_statement object

librdf_free_statement ()

void                librdf_free_statement               (librdf_statement *statement);

Destructor - destroy a librdf_statement.

statement :

librdf_statement object

librdf_statement_get_subject ()

librdf_node *       librdf_statement_get_subject        (librdf_statement *statement);

Get the statement subject.

This method returns a SHARED pointer to the subject which must be copied by the caller if needed.

statement :

librdf_statement object

Returns :

a pointer to the librdf_node of the statement subject -

librdf_statement_set_subject ()

void                librdf_statement_set_subject        (librdf_statement *statement,
                                                         librdf_node *node);

Set the statement subject.

The subject passed in becomes owned by the statement object and must not be used by the caller after this call.

statement :

librdf_statement object

node :

librdf_node of subject

librdf_statement_get_predicate ()

librdf_node *       librdf_statement_get_predicate      (librdf_statement *statement);

Get the statement predicate.

This method returns a SHARED pointer to the predicate which must be copied by the caller if needed.

statement :

librdf_statement object

Returns :

a pointer to the librdf_node of the statement predicate -

librdf_statement_set_predicate ()

void                librdf_statement_set_predicate      (librdf_statement *statement,
                                                         librdf_node *node);

Set the statement predicate.

The predicate passed in becomes owned by the statement object and must not be used by the caller after this call.

statement :

librdf_statement object

node :

librdf_node of predicate

librdf_statement_get_object ()

librdf_node *       librdf_statement_get_object         (librdf_statement *statement);

Get the statement object.

This method returns a SHARED pointer to the object which must be copied by the caller if needed.

statement :

librdf_statement object

Returns :

a pointer to the librdf_node of the statement object -

librdf_statement_set_object ()

void                librdf_statement_set_object         (librdf_statement *statement,
                                                         librdf_node *node);

Set the statement object.

The object passed in becomes owned by the statement object and must not be used by the caller after this call.

statement :

librdf_statement object

node :

librdf_node of object

librdf_statement_is_complete ()

int                 librdf_statement_is_complete        (librdf_statement *statement);

Check if statement is a complete and legal RDF triple.

Checks that all subject, predicate, object fields are present and they have the allowed node types.

statement :

librdf_statement object

Returns :

non 0 if the statement is complete and legal

librdf_statement_to_string ()

unsigned char *     librdf_statement_to_string          (librdf_statement *statement);

Format the librdf_statement as a string.

Formats the statement as a newly allocate string that must be freed by the caller.

Deprecated: Use librdf_statement_write() to write to raptor_iostream which can be made to write to a string. Use a librdf_serializer to write proper syntax formats.

statement :

the statement

Returns :

the string or NULL on failure.

librdf_statement_print ()

void                librdf_statement_print              (librdf_statement *statement,
                                                         FILE *fh);

Pretty print the statement to a file descriptor.

This method is for debugging and the format of the output should not be relied on.

statement :

the statement

fh :

file handle

librdf_statement_equals ()

int                 librdf_statement_equals             (librdf_statement *statement1,
                                                         librdf_statement *statement2);

Check if two statements are equal.

statement1 :

first librdf_statement

statement2 :

second librdf_statement

Returns :

non 0 if statements are equal

librdf_statement_match ()

int                 librdf_statement_match              (librdf_statement *statement,
                                                         librdf_statement *partial_statement);

Match a statement against a 'partial' statement.

A partial statement is where some parts of the statement - subject, predicate or object can be empty (NULL). Empty parts match against any value, parts with values must match exactly. Node matching is done via librdf_node_equals()

statement :

statement

partial_statement :

statement with possible empty parts

Returns :

non 0 on match

librdf_statement_encode ()

size_t              librdf_statement_encode             (librdf_statement *statement,
                                                         unsigned char *buffer,
                                                         size_t length);

Serialise a statement into a buffer.

Encodes the given statement in the buffer, which must be of sufficient size. If buffer is NULL, no work is done but the size of buffer required is returned.

Deprecated: Use librdf_statement_encode2()

statement :

the statement to serialise

buffer :

the buffer to use

length :

buffer size

Returns :

the number of bytes written or 0 on failure.

librdf_statement_encode2 ()

size_t              librdf_statement_encode2            (librdf_world *world,
                                                         librdf_statement *statement,
                                                         unsigned char *buffer,
                                                         size_t length);

Serialise a statement into a buffer.

Encodes the given statement in the buffer, which must be of sufficient size. If buffer is NULL, no work is done but the size of buffer required is returned.

world :

redland world

statement :

the statement to serialise

buffer :

the buffer to use

length :

buffer size

Returns :

the number of bytes written or 0 on failure.

librdf_statement_encode_parts ()

size_t              librdf_statement_encode_parts       (librdf_statement *statement,
                                                         librdf_node *context_node,
                                                         unsigned char *buffer,
                                                         size_t length,
                                                         librdf_statement_part fields);

Serialise parts of a statement into a buffer.

Encodes the given statement in the buffer, which must be of sufficient size. If buffer is NULL, no work is done but the size of buffer required is returned.

The fields values are or-ed combinations of: LIBRDF_STATEMENT_SUBJECT LIBRDF_STATEMENT_PREDICATE LIBRDF_STATEMENT_OBJECT or LIBRDF_STATEMENT_ALL for subject,prdicate,object fields

If context_node is given, it is encoded also

Deprecated: This will no longer be a public API

statement :

statement to serialise

context_node :

librdf_node context node (can be NULL)

buffer :

the buffer to use

length :

buffer size

fields :

fields to encode

Returns :

the number of bytes written or 0 on failure.

librdf_statement_encode_parts2 ()

size_t              librdf_statement_encode_parts2      (librdf_world *world,
                                                         librdf_statement *statement,
                                                         librdf_node *context_node,
                                                         unsigned char *buffer,
                                                         size_t length,
                                                         librdf_statement_part fields);

Serialise parts of a statement into a buffer.

Encodes the given statement in the buffer, which must be of sufficient size. If buffer is NULL, no work is done but the size of buffer required is returned.

The fields values are or-ed combinations of: LIBRDF_STATEMENT_SUBJECT LIBRDF_STATEMENT_PREDICATE LIBRDF_STATEMENT_OBJECT or LIBRDF_STATEMENT_ALL for subject,prdicate,object fields

If context_node is given, it is encoded also

world :

redland world object

statement :

statement to serialise

context_node :

librdf_node context node (can be NULL)

buffer :

the buffer to use

length :

buffer size

fields :

fields to encode

Returns :

the number of bytes written or 0 on failure.

librdf_statement_decode ()

size_t              librdf_statement_decode             (librdf_statement *statement,
                                                         unsigned char *buffer,
                                                         size_t length);

Decodes a statement from a buffer. (ALWAYS FAILS)

Used to decode the serialised statement as created by librdf_statement_encode() from the given buffer.

Deprecated: Replaced by librdf_statement_decode2() which works.

statement :

the statement to deserialise into

buffer :

the buffer to use

length :

buffer size

Returns :

0 signifying failure

librdf_statement_decode2 ()

size_t              librdf_statement_decode2            (librdf_world *world,
                                                         librdf_statement *statement,
                                                         librdf_node **context_node,
                                                         unsigned char *buffer,
                                                         size_t length);

Decodes a statement + context node from a buffer.

Decodes the serialised statement (as created by librdf_statement_encode() ) from the given buffer. If a context node is found and context_node is not NULL, a pointer to the new librdf_node is stored in *context_node.

world :

redland world

statement :

the statement to deserialise into

context_node :

pointer to librdf_node context_node to deserialise into

buffer :

the buffer to use

length :

buffer size

Returns :

number of bytes used or 0 on failure (bad encoding, allocation failure)

librdf_statement_decode_parts ()

size_t              librdf_statement_decode_parts       (librdf_statement *statement,
                                                         librdf_node **context_node,
                                                         unsigned char *buffer,
                                                         size_t length);

Decodes a statement + context node from a buffer. (ALWAYS FAILS)

Used to decode the serialised statement as created by librdf_statement_encode() from the given buffer.

Deprecated: Replaced by librdf_statement_decode2() which works.

statement :

the statement to deserialise into

context_node :

pointer to librdf_node context_node to deserialise into

buffer :

the buffer to use

length :

buffer size

Returns :

0 signifying failure

librdf_statement_write ()

int                 librdf_statement_write              (librdf_statement *statement,
                                                         raptor_iostream *iostr);

Write the statement to an iostream

This method is for debugging and the format of the output should not be relied on.

statement :

the statement

iostr :

raptor iostream to write to

Returns :

non-0 on failure
redland-1.0.17/docs/html/redland-log.html0000644000175000017500000004462212257576340015127 00000000000000 Logging

Logging

Logging — Message and error logging.

Synopsis

int                 (*librdf_log_level_func)            (void *user_data,
                                                         const char *message,
                                                         va_list arguments);
int                 (*librdf_log_func)                  (void *user_data,
                                                         librdf_log_message *message);
enum                librdf_log_level;
enum                librdf_log_facility;
int                 librdf_log_message_code             (librdf_log_message *message);
librdf_log_level    librdf_log_message_level            (librdf_log_message *message);
librdf_log_facility librdf_log_message_facility         (librdf_log_message *message);
const char *        librdf_log_message_message          (librdf_log_message *message);
raptor_locator *    librdf_log_message_locator          (librdf_log_message *message);

Description

Provides structured access to debug, information, warning and error messages from the libraries. Structured information is most often used from errors such as parsing where file or URI and line numbers can be returned via a raptor_locator object pointer found by librdf_log_message_locator() on the librdf_log_message.

Details

librdf_log_level_func ()

int                 (*librdf_log_level_func)            (void *user_data,
                                                         const char *message,
                                                         va_list arguments);

Handler for one log level, for the warning and error levels ONLY. Used by librdf_world_set_warning and librdf_world_set_error.

user_data :

User data pointer

message :

Log message.

arguments :

Message arguments.

Returns :

non-zero to indicate log message has been handled

librdf_log_func ()

int                 (*librdf_log_func)                  (void *user_data,
                                                         librdf_log_message *message);

Handler for all log levels.

user_data :

User data pointer

message :

Log message structure pointer.

Returns :

non-zero to indicate log message has been handled

enum librdf_log_level

typedef enum {
  LIBRDF_LOG_NONE = 0,
  LIBRDF_LOG_DEBUG,
  LIBRDF_LOG_INFO,
  LIBRDF_LOG_WARN,
  LIBRDF_LOG_ERROR,
  LIBRDF_LOG_FATAL,
  LIBRDF_LOG_LAST=LIBRDF_LOG_FATAL
} librdf_log_level;

Indicates the level of the log message.

LIBRDF_LOG_NONE

No level

LIBRDF_LOG_DEBUG

Debug.

LIBRDF_LOG_INFO

Information.

LIBRDF_LOG_WARN

Warning.

LIBRDF_LOG_ERROR

Recoverable error. Program can continue.

LIBRDF_LOG_FATAL

Fatal error. Program will abort if this is not caught.

LIBRDF_LOG_LAST

Internal, never returned.

enum librdf_log_facility

typedef enum {
  LIBRDF_FROM_NONE = 0,
  LIBRDF_FROM_CONCEPTS,
  LIBRDF_FROM_DIGEST,
  LIBRDF_FROM_FILES,
  LIBRDF_FROM_HASH,
  LIBRDF_FROM_INIT,
  LIBRDF_FROM_ITERATOR,
  LIBRDF_FROM_LIST,
  LIBRDF_FROM_MODEL,
  LIBRDF_FROM_NODE,
  LIBRDF_FROM_PARSER,
  LIBRDF_FROM_QUERY,
  LIBRDF_FROM_SERIALIZER,
  LIBRDF_FROM_STATEMENT,
  LIBRDF_FROM_STORAGE,
  LIBRDF_FROM_STREAM,
  LIBRDF_FROM_URI,
  LIBRDF_FROM_UTF8,
  LIBRDF_FROM_MEMORY,
  LIBRDF_FROM_RAPTOR,
  LIBRDF_FROM_LAST=LIBRDF_FROM_RAPTOR
} librdf_log_facility;

Indicates the part of the system that generated the log message.

LIBRDF_FROM_NONE

Associated with no part.

LIBRDF_FROM_CONCEPTS

Concepts

LIBRDF_FROM_DIGEST

Digest

LIBRDF_FROM_FILES

Files

LIBRDF_FROM_HASH

Hash

LIBRDF_FROM_INIT

Init

LIBRDF_FROM_ITERATOR

Iterator

LIBRDF_FROM_LIST

List

LIBRDF_FROM_MODEL

Model

LIBRDF_FROM_NODE

Node

LIBRDF_FROM_PARSER

Parser

LIBRDF_FROM_QUERY

Query

LIBRDF_FROM_SERIALIZER

Serializer

LIBRDF_FROM_STATEMENT

Statement

LIBRDF_FROM_STORAGE

Storage

LIBRDF_FROM_STREAM

Stream

LIBRDF_FROM_URI

URI

LIBRDF_FROM_UTF8

UTF8

LIBRDF_FROM_MEMORY

Memory

LIBRDF_FROM_RAPTOR

Raptor library (parser or serializer; Raptor 2.0.0+).

LIBRDF_FROM_LAST

Internal, never returned.

librdf_log_message_code ()

int                 librdf_log_message_code             (librdf_log_message *message);

Retrieve error code from log message.

message :

log message

Returns :

int error code

librdf_log_message_level ()

librdf_log_level    librdf_log_message_level            (librdf_log_message *message);

Retrieve severity of log message.

The log message severity level is defined in rdf_log.h as values of enum librdf_log_level

message :

log message

Returns :

severity level

librdf_log_message_facility ()

librdf_log_facility librdf_log_message_facility         (librdf_log_message *message);

Retrieve facility that generated the message.

The log message facility is defined in rdf_log.h as values of enum librdf_log_facility

message :

log message

Returns :

ID of Redland facility that generated the log message.

librdf_log_message_message ()

const char *        librdf_log_message_message          (librdf_log_message *message);

Retrieve text message from log entry.

The string returned is shared and must be copied by the caller if required to be retained.

message :

log message

Returns :

shared pointer to the log message string

librdf_log_message_locator ()

raptor_locator *    librdf_log_message_locator          (librdf_log_message *message);

Retrieve locator of log entry.

message :

log message

Returns :

pointer to an appropriate raptor_locator* or NULL if not available
redland-1.0.17/docs/html/redland.devhelp20000644000175000017500000021454112257576340015114 00000000000000 redland-1.0.17/docs/html/right.png0000644000175000017500000000073012257576340013664 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ2 I%Á=eIDATxœ­”!oÂ@†Ÿ.'**M0$ÄÁ$¿?1~¢vIeEuLlÉ&–Ô4‚ä Í¶B»Ý›œ¹|÷>ï—ûî …$ݶ©oc<”´ÑA©¤×€X’ò Digests

Digests

Digests — Content digests.

Synopsis

typedef             librdf_digest;
typedef             librdf_digest_factory;
librdf_digest *     librdf_new_digest                   (librdf_world *world,
                                                         const char *name);
void                librdf_free_digest                  (librdf_digest *digest);
void                librdf_digest_init                  (librdf_digest *digest);
void                librdf_digest_update                (librdf_digest *digest,
                                                         const unsigned char *buf,
                                                         size_t length);
void                librdf_digest_update_string         (librdf_digest *digest,
                                                         const unsigned char *string);
void                librdf_digest_final                 (librdf_digest *digest);
void *              librdf_digest_get_digest            (librdf_digest *digest);
size_t              librdf_digest_get_digest_length     (librdf_digest *digest);
char *              librdf_digest_to_string             (librdf_digest *digest);
void                librdf_digest_print                 (librdf_digest *digest,
                                                         FILE *fh);

Description

Create a message digest over a block of data. Includes implementations of MD5, RMD160 and SHA1.

Details

librdf_digest

typedef struct librdf_digest_s librdf_digest;

Redland content digest class.


librdf_digest_factory

typedef struct librdf_digest_factory_s librdf_digest_factory;

Redland digest factory class.


librdf_new_digest ()

librdf_digest *     librdf_new_digest                   (librdf_world *world,
                                                         const char *name);

Constructor - create a new librdf_digest object.

After construction, data should be added to the digest using librdf_digest_update or librdf_digest_update_string with librdf_digest_final to signify finishing. Then the digest value can be returned directly with librdf_digest_get_digest of librdf_digest_get_digest_length bytes or as a hex encoded string with librdf_digest_to_string. The digest can be re-initialised for new data with librdf_digest_init.

world :

redland world object

name :

the digest name to use to create this digest

Returns :

new librdf_digest object or NULL

librdf_free_digest ()

void                librdf_free_digest                  (librdf_digest *digest);

Destructor - destroy a librdf_digest object.

digest :

the digest

librdf_digest_init ()

void                librdf_digest_init                  (librdf_digest *digest);

(Re)initialise the librdf_digest object.

This is automatically called on construction but can be used to re-initialise the digest to the initial state for digesting new data.

digest :

the digest

librdf_digest_update ()

void                librdf_digest_update                (librdf_digest *digest,
                                                         const unsigned char *buf,
                                                         size_t length);

Add more data to the librdf_digest object.

digest :

the digest

buf :

the data buffer

length :

the length of the data

librdf_digest_update_string ()

void                librdf_digest_update_string         (librdf_digest *digest,
                                                         const unsigned char *string);

Add a string to the librdf_digest object.

digest :

the digest

string :

string to add

librdf_digest_final ()

void                librdf_digest_final                 (librdf_digest *digest);

Finish the digesting of data.

The digest can now be returned via librdf_digest_get_digest().

digest :

the digest

librdf_digest_get_digest ()

void *              librdf_digest_get_digest            (librdf_digest *digest);

Get the calculated digested value.

digest :

the digest

Returns :

pointer to the memory containing the digest. It will be librdf_digest_get_digest_length bytes in length.

librdf_digest_get_digest_length ()

size_t              librdf_digest_get_digest_length     (librdf_digest *digest);

Get length of the calculated digested.

digest :

the digest

Returns :

size of the digest in bytes

librdf_digest_to_string ()

char *              librdf_digest_to_string             (librdf_digest *digest);

Get a string representation of the digest object.

digest :

the digest

Returns :

a newly allocated string that represents the digest. This must be released by the caller using librdf_free_memory().

librdf_digest_print ()

void                librdf_digest_print                 (librdf_digest *digest,
                                                         FILE *fh);

Print the digest to a FILE handle.

digest :

the digest

fh :

file handle
redland-1.0.17/docs/html/home.png0000644000175000017500000000121612257576340013477 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ1õÚKvIDATxœÕ•±kqÅ?ßrC‡ßàpà ~C„np¼¡CAAJ .B-\'G‡]:Ü “‚ƒCÇ -(ˆ8´à Ô€!…fD°€…çÒ“klbRÛÁoyüxïûîËïwpðIJº<°of_®-@ÒððçRH•´ÏfÖŸtèÂü¤^¯×ÓÚÚš’$Q«ÕÒ|“ôpâ’¶€gív;X^^&Ïs¢(bww—Z­F£ÑÀ9Çææ&Þû3à¶™ Æ’^IRµZUE.0Z]]Uš¦ ÃPY–Mü8óHÒGIÚÙÙÑìììæeŸkqqñÒ€™!ó  $ÛÛÛ¬¯¯3Œn eýþ{-/seeeìÔÃŒãXóóóåO‡Í·$ý8==UÇS™—é½×ÑÑQòRR€¤'ã–9-sÚÛÛ+B^ éC·Û•sîŸÍËÂ+%À°<7³ŸWô˜¿ õâ:™2IEND®B`‚redland-1.0.17/docs/html/redland-node.html0000644000175000017500000023415612257576340015276 00000000000000 RDF term (librdf_node)

RDF term (librdf_node)

RDF term (librdf_node) — RDF triple component

Synopsis

void                librdf_free_node                    (librdf_node *node);
librdf_node *       librdf_new_node                     (librdf_world *world);
librdf_node *       librdf_new_node_from_blank_identifier
                                                        (librdf_world *world,
                                                         const unsigned char *identifier);
librdf_node *       librdf_new_node_from_counted_blank_identifier
                                                        (librdf_world *world,
                                                         const unsigned char *identifier,
                                                         size_t identifier_len);
librdf_node *       librdf_new_node_from_counted_uri_string
                                                        (librdf_world *world,
                                                         const unsigned char *uri_string,
                                                         size_t len);
librdf_node *       librdf_new_node_from_literal        (librdf_world *world,
                                                         const unsigned char *string,
                                                         const char *xml_language,
                                                         int is_wf_xml);
librdf_node *       librdf_new_node_from_node           (librdf_node *node);
librdf_node *       librdf_new_node_from_normalised_uri_string
                                                        (librdf_world *world,
                                                         const unsigned char *uri_string,
                                                         librdf_uri *source_uri,
                                                         librdf_uri *base_uri);
librdf_node *       librdf_new_node_from_typed_counted_literal
                                                        (librdf_world *world,
                                                         const unsigned char *value,
                                                         size_t value_len,
                                                         const char *xml_language,
                                                         size_t xml_language_len,
                                                         librdf_uri *datatype_uri);
librdf_node *       librdf_new_node_from_typed_literal  (librdf_world *world,
                                                         const unsigned char *value,
                                                         const char *xml_language,
                                                         librdf_uri *datatype_uri);
librdf_node *       librdf_new_node_from_uri            (librdf_world *world,
                                                         librdf_uri *uri);
librdf_node *       librdf_new_node_from_uri_local_name (librdf_world *world,
                                                         librdf_uri *uri,
                                                         const unsigned char *local_name);
librdf_node *       librdf_new_node_from_uri_string     (librdf_world *world,
                                                         const unsigned char *uri_string);
typedef             librdf_node;
librdf_node *       librdf_node_decode                  (librdf_world *world,
                                                         size_t *size_p,
                                                         unsigned char *buffer,
                                                         size_t length);
size_t              librdf_node_encode                  (librdf_node *node,
                                                         unsigned char *buffer,
                                                         size_t length);
int                 librdf_node_equals                  (librdf_node *first_node,
                                                         librdf_node *second_node);
unsigned char *     librdf_node_get_blank_identifier    (librdf_node *node);
unsigned char *     librdf_node_get_counted_blank_identifier
                                                        (librdf_node *node,
                                                         size_t *len_p);
int                 librdf_node_get_li_ordinal          (librdf_node *node);
unsigned char *     librdf_node_get_literal_value       (librdf_node *node);
unsigned char *     librdf_node_get_literal_value_as_counted_string
                                                        (librdf_node *node,
                                                         size_t *len_p);
char *              librdf_node_get_literal_value_as_latin1
                                                        (librdf_node *node);
librdf_uri *        librdf_node_get_literal_value_datatype_uri
                                                        (librdf_node *node);
int                 librdf_node_get_literal_value_is_wf_xml
                                                        (librdf_node *node);
char *              librdf_node_get_literal_value_language
                                                        (librdf_node *node);
librdf_node_type    librdf_node_get_type                (librdf_node *node);
librdf_uri *        librdf_node_get_uri                 (librdf_node *node);
int                 librdf_node_is_blank                (librdf_node *node);
int                 librdf_node_is_literal              (librdf_node *node);
int                 librdf_node_is_resource             (librdf_node *node);
librdf_iterator *   librdf_node_new_static_node_iterator
                                                        (librdf_world *world,
                                                         librdf_node **nodes,
                                                         int size);
void                librdf_node_print                   (librdf_node *node,
                                                         FILE *fh);
librdf_iterator *   librdf_node_static_iterator_create  (librdf_node **nodes,
                                                         int size);
unsigned char *     librdf_node_to_counted_string       (librdf_node *node,
                                                         size_t *len_p);
unsigned char *     librdf_node_to_string               (librdf_node *node);
enum                librdf_node_type;
int                 librdf_node_write                   (librdf_node *node,
                                                         raptor_iostream *iostr);

Description

The (subject, predicate, object) parts of an RDF triple.

Details

librdf_free_node ()

void                librdf_free_node                    (librdf_node *node);

Destructor - destroy an librdf_node object.

node :

librdf_node object

librdf_new_node ()

librdf_node *       librdf_new_node                     (librdf_world *world);

Constructor - create a new librdf_node object with a private identifier.

Calls librdf_new_node_from_blank_identifier(world, NULL) to construct a new redland blank node identifier and make a new librdf_node object for it.

world :

redland world object

Returns :

a new librdf_node object or NULL on failure

librdf_new_node_from_blank_identifier ()

librdf_node *       librdf_new_node_from_blank_identifier
                                                        (librdf_world *world,
                                                         const unsigned char *identifier);

Constructor - create a new blank node librdf_node object from a blank node identifier.

If no identifier string is given (NULL) this creates a new internal identifier and uses it.

world :

redland world object

identifier :

UTF-8 encoded blank node identifier or NULL

Returns :

new librdf_node object or NULL on failure

librdf_new_node_from_counted_blank_identifier ()

librdf_node *       librdf_new_node_from_counted_blank_identifier
                                                        (librdf_world *world,
                                                         const unsigned char *identifier,
                                                         size_t identifier_len);

Constructor - create a new blank node librdf_node object from a blank node counted length identifier.

If no identifier string is given (NULL) this creates a new internal identifier and uses it.

world :

redland world object

identifier :

UTF-8 encoded blank node identifier or NULL

identifier_len :

length of identifier

Returns :

new librdf_node object or NULL on failure

librdf_new_node_from_counted_uri_string ()

librdf_node *       librdf_new_node_from_counted_uri_string
                                                        (librdf_world *world,
                                                         const unsigned char *uri_string,
                                                         size_t len);

Constructor - create a new librdf_node object from a counted URI string.

world :

redland world object

uri_string :

string representing a URI

len :

length of string

Returns :

a new librdf_node object or NULL on failure

librdf_new_node_from_literal ()

librdf_node *       librdf_new_node_from_literal        (librdf_world *world,
                                                         const unsigned char *string,
                                                         const char *xml_language,
                                                         int is_wf_xml);

Constructor - create a new literal librdf_node object.

0.9.12: xml_space argument deleted

An xml_language cannot be used when is_wf_xml is non-0. If both are given, NULL is returned. If xml_language is the empty string, it is the equivalent to NULL.

world :

redland world object

string :

literal UTF-8 encoded string value

xml_language :

literal XML language (or NULL, empty string)

is_wf_xml :

non 0 if literal is XML

Returns :

new librdf_node object or NULL on failure

librdf_new_node_from_node ()

librdf_node *       librdf_new_node_from_node           (librdf_node *node);

Copy constructor - create a new librdf_node object from an existing librdf_node object.

node :

librdf_node object to copy

Returns :

a new librdf_node object or NULL on failure

librdf_new_node_from_normalised_uri_string ()

librdf_node *       librdf_new_node_from_normalised_uri_string
                                                        (librdf_world *world,
                                                         const unsigned char *uri_string,
                                                         librdf_uri *source_uri,
                                                         librdf_uri *base_uri);

Constructor - create a new librdf_node object from a UTF-8 encoded URI string normalised to a new base URI.

world :

redland world object

uri_string :

UTF-8 encoded string representing a URI

source_uri :

source URI

base_uri :

base URI

Returns :

a new librdf_node object or NULL on failure

librdf_new_node_from_typed_counted_literal ()

librdf_node *       librdf_new_node_from_typed_counted_literal
                                                        (librdf_world *world,
                                                         const unsigned char *value,
                                                         size_t value_len,
                                                         const char *xml_language,
                                                         size_t xml_language_len,
                                                         librdf_uri *datatype_uri);

Constructor - create a new typed literal librdf_node object.

Takes copies of the passed in value, datatype_uri and xml_language.

Only one of xml_language or datatype_uri may be given. If both are given, NULL is returned. If xml_language is the empty string, it is the equivalent to NULL.

world :

redland world object

value :

literal UTF-8 encoded string value

value_len :

literal string value length

xml_language :

literal XML language (or NULL, empty string)

xml_language_len :

literal XML language length (not used if xml_language is NULL)

datatype_uri :

URI of typed literal datatype or NULL

Returns :

new librdf_node object or NULL on failure

librdf_new_node_from_typed_literal ()

librdf_node *       librdf_new_node_from_typed_literal  (librdf_world *world,
                                                         const unsigned char *value,
                                                         const char *xml_language,
                                                         librdf_uri *datatype_uri);

Constructor - create a new typed literal librdf_node object.

Only one of xml_language or datatype_uri may be given. If both are given, NULL is returned. If xml_language is the empty string, it is the equivalent to NULL.

world :

redland world object

value :

literal UTF-8 encoded string value

xml_language :

literal XML language (or NULL, empty string)

datatype_uri :

URI of typed literal datatype or NULL

Returns :

new librdf_node object or NULL on failure

librdf_new_node_from_uri ()

librdf_node *       librdf_new_node_from_uri            (librdf_world *world,
                                                         librdf_uri *uri);

Constructor - create a new resource librdf_node object with a given URI.

world :

redland world object

uri :

librdf_uri object

Returns :

a new librdf_node object or NULL on failure

librdf_new_node_from_uri_local_name ()

librdf_node *       librdf_new_node_from_uri_local_name (librdf_world *world,
                                                         librdf_uri *uri,
                                                         const unsigned char *local_name);

Constructor - create a new resource librdf_node object with a given URI and local name.

world :

redland world object

uri :

librdf_uri object

local_name :

local name to append to URI

Returns :

a new librdf_node object or NULL on failure

librdf_new_node_from_uri_string ()

librdf_node *       librdf_new_node_from_uri_string     (librdf_world *world,
                                                         const unsigned char *uri_string);

Constructor - create a new librdf_node object from a URI string.

world :

redland world object

uri_string :

string representing a URI

Returns :

a new librdf_node object or NULL on failure

librdf_node

typedef raptor_term librdf_node;

Redland node class.


librdf_node_decode ()

librdf_node *       librdf_node_decode                  (librdf_world *world,
                                                         size_t *size_p,
                                                         unsigned char *buffer,
                                                         size_t length);

Deserialise a node from a buffer.

Decodes the serialised node (as created by librdf_node_encode() ) from the given buffer.

world :

librdf_world

size_p :

pointer to bytes used or NULL

buffer :

the buffer to use

length :

buffer size

Returns :

new node or NULL on failure (bad encoding, allocation failure)

librdf_node_encode ()

size_t              librdf_node_encode                  (librdf_node *node,
                                                         unsigned char *buffer,
                                                         size_t length);

Serialise a node into a buffer.

Encodes the given node in the buffer, which must be of sufficient size. If buffer is NULL, no work is done but the size of buffer required is returned.

If the node cannot be encoded due to restrictions of the encoding format, a redland error is generated

node :

the node to serialise

buffer :

the buffer to use

length :

buffer size

Returns :

the number of bytes written or 0 on failure.

librdf_node_equals ()

int                 librdf_node_equals                  (librdf_node *first_node,
                                                         librdf_node *second_node);

Compare two librdf_node objects for equality.

Note - for literal nodes, XML language, XML space and well-formness are presently ignored in the comparison.

first_node :

first librdf_node node

second_node :

second librdf_node node

Returns :

non 0 if nodes are equal. 0 if not-equal or failure

librdf_node_get_blank_identifier ()

unsigned char *     librdf_node_get_blank_identifier    (librdf_node *node);

Get the blank node identifier as a UTF-8 encoded string.

node :

the node object

Returns :

the UTF-8 encoded blank node identifier value or NULL on failure

librdf_node_get_counted_blank_identifier ()

unsigned char *     librdf_node_get_counted_blank_identifier
                                                        (librdf_node *node,
                                                         size_t *len_p);

Get the blank node identifier as a counted UTF-8 encoded string.

node :

the node object

len_p :

pointer to variable to store length (or NULL)

Returns :

the UTF-8 encoded blank node identifier value or NULL on failure

librdf_node_get_li_ordinal ()

int                 librdf_node_get_li_ordinal          (librdf_node *node);

Get the node li object ordinal value.

node :

the node object

Returns :

the li ordinal value or < 1 on failure

librdf_node_get_literal_value ()

unsigned char *     librdf_node_get_literal_value       (librdf_node *node);

Get the literal value of the node as a UTF-8 encoded string.

Returns a pointer to the UTF-8 encoded literal value held by the node, it must be copied if it is wanted to be used by the caller.

node :

the node object

Returns :

the UTF-8 encoded literal string or NULL if node is not a literal

librdf_node_get_literal_value_as_counted_string ()

unsigned char *     librdf_node_get_literal_value_as_counted_string
                                                        (librdf_node *node,
                                                         size_t *len_p);

Get the literal value of the node as a counted UTF-8 encoded string.

Returns a pointer to the UTF-8 encoded literal string value held by the node, it must be copied if it is wanted to be used by the caller.

node :

the node object

len_p :

pointer to location to store the string length (or NULL)

Returns :

the UTF-8 encoded literal string or NULL if node is not a literal

librdf_node_get_literal_value_as_latin1 ()

char *              librdf_node_get_literal_value_as_latin1
                                                        (librdf_node *node);

Get the string literal value of the node as ISO Latin-1.

Returns a newly allocated string containing the conversion of the node literal value held by the node into ISO Latin-1. Discards characters outside the U+0000 to U+00FF range (inclusive).

node :

the node object

Returns :

the Latin-1 literal string or NULL if node is not a literal

librdf_node_get_literal_value_datatype_uri ()

librdf_uri *        librdf_node_get_literal_value_datatype_uri
                                                        (librdf_node *node);

Get the typed literal datatype URI of the literal node.

node :

the node object

Returns :

shared URI of the datatyped literal or NULL if the node is not a literal, or has no datatype URI

librdf_node_get_literal_value_is_wf_xml ()

int                 librdf_node_get_literal_value_is_wf_xml
                                                        (librdf_node *node);

Get the XML well-formness property of the node.

node :

the node object

Returns :

0 if the XML literal is NOT well formed XML content, or the node is not a literal

librdf_node_get_literal_value_language ()

char *              librdf_node_get_literal_value_language
                                                        (librdf_node *node);

Get the XML language of the node.

Returns a pointer to the literal language value held by the node, it must be copied if it is wanted to be used by the caller. Language strings are ASCII, not UTF-8 encoded Unicode.

node :

the node object

Returns :

the XML language string or NULL if node is not a literal or there is no XML language defined.

librdf_node_get_type ()

librdf_node_type    librdf_node_get_type                (librdf_node *node);

Get the type of the node.

See also librdf_node_is_resource(), librdf_node_is_literal() and librdf_node_is_blank() for testing individual types.

node :

the node object

Returns :

the node type

librdf_node_get_uri ()

librdf_uri *        librdf_node_get_uri                 (librdf_node *node);

Get the URI for a node object.

Returns a pointer to the URI object held by the node, it must be copied if it is wanted to be used by the caller.

node :

the node object

Returns :

URI object or NULL if node has no URI.

librdf_node_is_blank ()

int                 librdf_node_is_blank                (librdf_node *node);

Check node is a blank nodeID.

node :

the node object

Returns :

non-zero if the node is a blank nodeID

librdf_node_is_literal ()

int                 librdf_node_is_literal              (librdf_node *node);

Check node is a literal.

node :

the node object

Returns :

non-zero if the node is a literal

librdf_node_is_resource ()

int                 librdf_node_is_resource             (librdf_node *node);

Check node is a resource.

node :

the node object

Returns :

non-zero if the node is a resource (URI)

librdf_node_new_static_node_iterator ()

librdf_iterator *   librdf_node_new_static_node_iterator
                                                        (librdf_world *world,
                                                         librdf_node **nodes,
                                                         int size);

Create an iterator over an array of nodes.

This creates an iterator for an existing static array of librdf_node objects. It is mostly intended for testing iterator code.

world :

world object

nodes :

static array of librdf_node objects

size :

size of array

Returns :

a librdf_iterator serialization of the nodes or NULL on failure

librdf_node_print ()

void                librdf_node_print                   (librdf_node *node,
                                                         FILE *fh);

Pretty print the node to a file descriptor.

This method is for debugging and the format of the output should not be relied on.

node :

the node

fh :

file handle

librdf_node_static_iterator_create ()

librdf_iterator *   librdf_node_static_iterator_create  (librdf_node **nodes,
                                                         int size);

Create an iterator over an array of nodes (ALWAYS FAILS)

This legacy method used to create an iterator for an existing static array of librdf_node objects. It was intended for testing iterator code.

deprecated: always returns NULL. Use librdf_node_new_static_node_iterator()

nodes :

static array of librdf_node objects

size :

size of array

Returns :

NULL

librdf_node_to_counted_string ()

unsigned char *     librdf_node_to_counted_string       (librdf_node *node,
                                                         size_t *len_p);

Format the node as a counted string in a debugging format.

Note a new string is allocated which must be freed by the caller.

Deprecated: Use librdf_node_write() to write to raptor_iostream which can be made to write to a string. Use a librdf_serializer to write proper syntax formats.

node :

the node object

len_p :

pointer to location to store length

Returns :

a string value representing the node or NULL on failure

librdf_node_to_string ()

unsigned char *     librdf_node_to_string               (librdf_node *node);

Format the node as a string in a debugging format.

Note a new string is allocated which must be freed by the caller.

Deprecated: Use librdf_node_write() to write to raptor_iostream which can be made to write to a string. Use a librdf_serializer to write proper syntax formats.

node :

the node object

Returns :

a string value representing the node or NULL on failure

enum librdf_node_type

typedef enum {
  LIBRDF_NODE_TYPE_UNKNOWN   = RAPTOR_TERM_TYPE_UNKNOWN,
  LIBRDF_NODE_TYPE_RESOURCE  = RAPTOR_TERM_TYPE_URI,
  LIBRDF_NODE_TYPE_LITERAL   = RAPTOR_TERM_TYPE_LITERAL,
  LIBRDF_NODE_TYPE_BLANK     = RAPTOR_TERM_TYPE_BLANK,
  LIBRDF_NODE_TYPE_LAST      = LIBRDF_NODE_TYPE_BLANK
} librdf_node_type;

Type of a redland node.

Better to check this with functions librdf_node_is_resource(), librdf_node_is_literal() or librdf_node_is_blank().

LIBRDF_NODE_TYPE_UNKNOWN

Internal

LIBRDF_NODE_TYPE_RESOURCE

rdf:Resource (& rdf:Property) - has a URI

LIBRDF_NODE_TYPE_LITERAL

rdf:Literal - has an XML string, language, XML space

LIBRDF_NODE_TYPE_BLANK

blank node has an identifier string.

LIBRDF_NODE_TYPE_LAST

Internal

librdf_node_write ()

int                 librdf_node_write                   (librdf_node *node,
                                                         raptor_iostream *iostr);

Write the node to an iostream in N-Triples format.

This method can be used to write a node in a relatively readable format. To write more compact formats use a serializer to pick a syntax and serialize triples to it.

node :

the node

iostr :

iostream to write to

Returns :

non-0 on failure
redland-1.0.17/docs/html/redland-storage-module-sqlite.html0000644000175000017500000000476612257576340020601 00000000000000 Store 'sqlite'

Store 'sqlite'

This module provides storage via the SQLite relational database when available and supports SQLite V2 and V3. It was added in Redland 1.0.0. This store provides triples and contexts.

The only option respected by this store is the new one to create a new store, destroying any existing store.

Summary:

  • Persistent

  • Suitable for small/medium models

  • Indexed but not optimized

  • Smaller disk usage than BDB

  • Contexts always provided

redland-1.0.17/docs/html/objects.html0000644000175000017500000001101012257576340014351 00000000000000 Objects in C

Objects in C

Redland uses objects and is written in C, which has no built in support for object construction, destruction, copying etc. This library thus uses conventions for the names of the routines providing the constructor, destructor and copy constructor functionality for a class as well as conventions for the general methods.

A class FOO is defined as a C typedef librdf_foo, and its a public interface defined in rdf_foo.h along with any public or private types, enumerations or constants. The private definitions are not exposed to library users, only internally when the library is built. The implementation of the class is defined in file rdf_foo.c and may include private (static) functions either for internal implementations or to satisfy part of a factory API.

Each class may have a class initialiser / termination pair of functions which must be called before any object in the class is created, and after the last object has been freed. These are defined with signatures like:

  void init_librdf_foo (...)
  void terminate_librdf_foo (void)

The arguments to the initialisation vary since there are sometimes some class wide options that can be set at initialisation time.

The object constructor(s) are defined with signatures like:

  librdf_foo* librdf_new_foo(void)

which takes no parameters. Additional constructors can be defined with parameters, and are named in a similar way with an extra part appropriate for the name for example:

  librdf_foo* librdf_new_foo_with_options(char *options)

A copy constructor may be defined which will have the signature:

  librdf_foo* librdf_new_foo_from_foo(librdf_foo* old_foo)

A destructor must be defined and has the signature:

  void librdf_free_foo(librdf_foo* foo)

Methods of the class have names starting with librdf_foo_ and examples could be:

  /* accessor functions to object part 'thing' */
  int librdf_foo_set_thing(librdf_foo* foo, char *thing)
  char *librdf_foo_get_thing(librdf_foo* foo)

It is often convenient to get a string representation of an object for further processing, debugging or serialisation. There are two conventions for methods that provide this functionality - the first is when a pointer is returned to a shared copy of the string and in that case the method ends _as_string. The second is when a pointer is returned to a newly allocated string in which case the method ends _to_string.

redland-1.0.17/docs/html/redland-changes-1-0-13-to-1-0-14.html0000644000175000017500000001105612257576340017622 00000000000000 Changes between Redland librdf 1.0.13 and 1.0.14

Changes between Redland librdf 1.0.13 and 1.0.14

New functions, types and enums

Functions

redland-1.0.17/docs/html/redland-world.html0000644000175000017500000011636612257576340015502 00000000000000 World

World

World — Initialisation and termination of library

Synopsis

typedef             librdf_world;
librdf_world *      librdf_new_world                    (void);
void                librdf_free_world                   (librdf_world *world);
void                librdf_world_open                   (librdf_world *world);
void                librdf_world_set_rasqal             (librdf_world *world,
                                                         rasqal_world *rasqal_world_ptr);
rasqal_world *      librdf_world_get_rasqal             (librdf_world *world);
raptor_world *      librdf_world_get_raptor             (librdf_world *world);
void                librdf_world_set_raptor             (librdf_world *world,
                                                         raptor_world *raptor_world_ptr);
void                librdf_world_init_mutex             (librdf_world *world);
void                librdf_world_set_error              (librdf_world *world,
                                                         void *user_data,
                                                         librdf_log_level_func error_handler);
void                librdf_world_set_warning            (librdf_world *world,
                                                         void *user_data,
                                                         librdf_log_level_func warning_handler);
void                librdf_world_set_logger             (librdf_world *world,
                                                         void *user_data,
                                                         librdf_log_func log_handler);
void                librdf_world_set_digest             (librdf_world *world,
                                                         const char *name);
void                (*librdf_raptor_init_handler)       (void *user_data,
                                                         raptor_world *raptor_world_ptr);
void                librdf_world_set_raptor_init_handler
                                                        (librdf_world *world,
                                                         void *user_data,
                                                         librdf_raptor_init_handler handler);
void                (*librdf_rasqal_init_handler)       (void *user_data,
                                                         rasqal_world *rasqal_world_ptr);
void                librdf_world_set_rasqal_init_handler
                                                        (librdf_world *world,
                                                         void *user_data,
                                                         librdf_rasqal_init_handler handler);
#define             LIBRDF_WORLD_FEATURE_GENID_BASE
#define             LIBRDF_WORLD_FEATURE_GENID_COUNTER
librdf_node *       librdf_world_get_feature            (librdf_world *world,
                                                         librdf_uri *feature);
int                 librdf_world_set_feature            (librdf_world *world,
                                                         librdf_uri *feature,
                                                         librdf_node *value);
void                librdf_init_world                   (char *digest_factory_name,
                                                         void *not_used2);
void                librdf_destroy_world                (void);

Description

The Redland librdf_world class handles startup and termination of the library and cleanup of all allocated resources.

Details

librdf_world

typedef struct librdf_world_s librdf_world;

Redland world class.


librdf_new_world ()

librdf_world *      librdf_new_world                    (void);

Create a new Redland execution environment.

Once this constructor is called to build a librdf_world object several functions may be called to set some parameters such as librdf_world_set_error(), librdf_world_set_warning(), librdf_world_set_logger(), librdf_world_set_digest(), librdf_world_set_feature().

The world object needs initializing using librdf_world_open() whether or not the above functions are called. It will be automatically called by all object constructors in Redland 1.0.6 or later, but for earlier versions it MUST be called before using any other part of Redland.

Returns :

a new librdf_world or NULL on failure

librdf_free_world ()

void                librdf_free_world                   (librdf_world *world);

Terminate the library and frees all allocated resources.

world :

redland world object

librdf_world_open ()

void                librdf_world_open                   (librdf_world *world);

Open a created redland world environment.

world :

redland world object

librdf_world_set_rasqal ()

void                librdf_world_set_rasqal             (librdf_world *world,
                                                         rasqal_world *rasqal_world_ptr);

Set the rasqal_world instance to be used with this librdf_world.

If no rasqal_world instance is set with this function, librdf_world_open() creates a new instance.

Ownership of the rasqal_world is not taken. If the rasqal library instance is set with this function, librdf_free_world() will not free it.

world :

librdf_world object

rasqal_world_ptr :

rasqal_world object

librdf_world_get_rasqal ()

rasqal_world *      librdf_world_get_rasqal             (librdf_world *world);

Get the rasqal_world instance used by this librdf_world.

world :

librdf_world object

Returns :

rasqal_world object or NULL on failure (e.g. not initialized)

librdf_world_get_raptor ()

raptor_world *      librdf_world_get_raptor             (librdf_world *world);

Get the raptor_world instance used by this librdf_world.

world :

librdf_world object

Returns :

raptor_world object or NULL on failure (e.g. not initialized)

librdf_world_set_raptor ()

void                librdf_world_set_raptor             (librdf_world *world,
                                                         raptor_world *raptor_world_ptr);

Set the raptor_world instance to be used with this librdf_world.

If no raptor_world instance is set with this function, librdf_world_open() creates a new instance.

Ownership of the raptor_world is not taken. If the raptor library instance is set with this function, librdf_free_world() will not free it.

world :

librdf_world object

raptor_world_ptr :

raptor_world object

librdf_world_init_mutex ()

void                librdf_world_init_mutex             (librdf_world *world);

INTERNAL - Create the world mutex.

world :

redland world object

librdf_world_set_error ()

void                librdf_world_set_error              (librdf_world *world,
                                                         void *user_data,
                                                         librdf_log_level_func error_handler);

Set the world error handling function.

The function will receive callbacks when the world fails. librdf_world_set_logger() provides richer access to all log messages and should be used in preference.

world :

redland world object

user_data :

user data to pass to function

error_handler :

pointer to the function

librdf_world_set_warning ()

void                librdf_world_set_warning            (librdf_world *world,
                                                         void *user_data,
                                                         librdf_log_level_func warning_handler);

Set the world warning handling function.

The function will receive callbacks when the world gives a warning. librdf_world_set_logger() provides richer access to all log messages and should be used in preference.

world :

redland world object

user_data :

user data to pass to function

warning_handler :

pointer to the function

librdf_world_set_logger ()

void                librdf_world_set_logger             (librdf_world *world,
                                                         void *user_data,
                                                         librdf_log_func log_handler);

Set the world log handling function.

The function will receive callbacks when redland generates a log message

world :

redland world object

user_data :

user data to pass to function

log_handler :

pointer to the function

librdf_world_set_digest ()

void                librdf_world_set_digest             (librdf_world *world,
                                                         const char *name);

Set the default content digest name.

Sets the digest factory for various modules that need to make digests of their objects.

world :

redland world object

name :

Digest factory name

librdf_raptor_init_handler ()

void                (*librdf_raptor_init_handler)       (void *user_data,
                                                         raptor_world *raptor_world_ptr);


librdf_world_set_raptor_init_handler ()

void                librdf_world_set_raptor_init_handler
                                                        (librdf_world *world,
                                                         void *user_data,
                                                         librdf_raptor_init_handler handler);

Set the raptor initialization handler to be called if a new raptor_world is constructed.

world :

librdf_world object

user_data :

user data

handler :

handler to call

librdf_rasqal_init_handler ()

void                (*librdf_rasqal_init_handler)       (void *user_data,
                                                         rasqal_world *rasqal_world_ptr);


librdf_world_set_rasqal_init_handler ()

void                librdf_world_set_rasqal_init_handler
                                                        (librdf_world *world,
                                                         void *user_data,
                                                         librdf_rasqal_init_handler handler);

Set the rasqal initialization handler to be called if a new rasqal_world is constructed.

world :

librdf_world object

user_data :

user data

handler :

handler to call

LIBRDF_WORLD_FEATURE_GENID_BASE

#define LIBRDF_WORLD_FEATURE_GENID_BASE "http://feature.librdf.org/genid-base"

World feature to set the generated ID base.

Must be set before the world is opened with librdf_world_open().


LIBRDF_WORLD_FEATURE_GENID_COUNTER

#define LIBRDF_WORLD_FEATURE_GENID_COUNTER "http://feature.librdf.org/genid-counter"

World feature to set the generated ID counter.

Must be set before the world is opened with librdf_world_open().


librdf_world_get_feature ()

librdf_node *       librdf_world_get_feature            (librdf_world *world,
                                                         librdf_uri *feature);

Get the value of a world feature.

world :

librdf_world object

feature :

librdf_uri feature property

Returns :

new librdf_node feature value or NULL if no such feature exists or the value is empty.

librdf_world_set_feature ()

int                 librdf_world_set_feature            (librdf_world *world,
                                                         librdf_uri *feature,
                                                         librdf_node *value);

Set the value of a world feature.

world :

librdf_world object

feature :

librdf_uri feature property

value :

librdf_node feature property value

Returns :

non 0 on failure (negative if no such feature)

librdf_init_world ()

void                librdf_init_world                   (char *digest_factory_name,
                                                         void *not_used2);

Initialise the library deprecated: Do not use.

Use librdf_new_world() and librdf_world_open() on librdf_world object

See librdf_world_set_digest() for documentation on arguments.

digest_factory_name :

Name of digest factory to use

not_used2 :

Not used

librdf_destroy_world ()

void                librdf_destroy_world                (void);

Terminate the library deprecated: Do not use.

Use librdf_free_world() on librdf_world object

Terminates and frees the resources.

redland-1.0.17/docs/html/redland-storage-module-file.html0000644000175000017500000000546712257576340020216 00000000000000 Store 'file'

Store 'file'

This module provides an in-memory model (internally, using a the section called “Store 'memory'â€) initialised from the RDF/XML content in a file. The file is given as the storage name and assumed to exist on opening. When a model or storage sync method is called or the model or store is closed, a new file is created, the old file renamed to a backup and the new file renamed to replace it. This store was added in Redland 0.9.15

There are no options for this store and contexts are not supported.

Example:

  /* File based store from thing.rdf file */
  storage=librdf_new_storage(world, "file", "thing.rdf", NULL);

Summary:

  • In-memory

  • Suitable for small models

  • Simple local storage to content in RDF/XML

  • Not indexed

  • No contexts

redland-1.0.17/docs/html/style.css0000644000175000017500000001210012257576340013705 00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } redland-1.0.17/docs/html/index.html0000644000175000017500000002271112257576340014041 00000000000000 Redland RDF Library Manual

Dave Beckett

Manual for Redland 1.0.17

This documentation is Free Software / Open Source - you can redistribute it and/or modify it under the same licenses as Redland. It is licensed under the following three licenses as alternatives:

  1. GNU Lesser General Public License (LGPL) V2.1 or any newer version

  2. GNU General Public License (GPL) V2 or any newer version

  3. Apache License, V2.0 or any newer version

You may not use this documentation except in compliance with at least one of the above three licenses. See the Redland site for the full license terms.


Redland Overview
Introduction
I. Tutorial
Tutorial Introduction
II. Reference Manual
Objects in C
World — Initialisation and termination of library
General — Static variables and memory handling.
Concepts — Pre-defined URIS and Nodes in the RDF namespaces.
Digests — Content digests.
Files — File utility functions.
Hashes — Key:Value hashes or dictionaries.
Heuristics — Utility heuristic functions.
Iterator — Iterate a sequence of objects across some other object.
List — Simple list class.
Logging — Message and error logging.
RDF Graph (librdf_model) — RDF graph (set of triples) API.
RDF term (librdf_node) — RDF triple component
Parsers — RDF parsers from syntax to triples.
Querying — RDF query languages and execution.
Query results — RDF query results.
Serializers — RDF serializers from triples to syntax.
RDF Triple (librdf_statement) — RDF Triple.
Triple stores — RDF Triple stores
Storage Modules
Introduction
Store 'hashes'
Store 'memory'
Store 'file'
Store 'mysql'
Store 'postgresql'
Store 'sqlite'
Store 'tstore'
Store 'uri'
Store 'virtuoso'
Stream of triples (#librdf_statement). — Sequence of RDF Triples.
Unicode — Unicode utility functions.
URI — URI class
API Changes
Introduction
Changes between Redland librdf 1.0.12 and 1.0.13
New functions, types and enums
Changed functions and types
Changes between Redland librdf 1.0.13 and 1.0.14
New functions, types and enums
Changes between Redland librdf 1.0.14 and 1.0.15
New functions, types and enums
Changes between Redland librdf 1.0.15 and 1.0.16
New functions, types and enums
Changes between Redland librdf 1.0.16 and 1.0.16
New functions, types and enums
Index
redland-1.0.17/docs/html/redland-storage.html0000644000175000017500000034627012257576340016016 00000000000000 Triple stores

Triple stores

Triple stores — RDF Triple stores

Synopsis

#define             LIBRDF_STORAGE_INTERFACE_VERSION
#define             LIBRDF_STORAGE_MAX_INTERFACE_VERSION
#define             LIBRDF_STORAGE_MIN_INTERFACE_VERSION
typedef             librdf_storage;
typedef             librdf_storage_factory;
int                 librdf_storage_register_factory     (librdf_world *world,
                                                         const char *name,
                                                         const char *label,
                                                         void (*factory) (librdf_storage_factory*));
int                 librdf_storage_enumerate            (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const char **label);
librdf_storage *    librdf_new_storage                  (librdf_world *world,
                                                         const char *storage_name,
                                                         const char *name,
                                                         const char *options_string);
librdf_storage *    librdf_new_storage_with_options     (librdf_world *world,
                                                         const char *storage_name,
                                                         const char *name,
                                                         librdf_hash *options);
librdf_storage *    librdf_new_storage_from_storage     (librdf_storage *old_storage);
librdf_storage *    librdf_new_storage_from_factory     (librdf_world *world,
                                                         librdf_storage_factory *factory,
                                                         const char *name,
                                                         librdf_hash *options);
void                librdf_free_storage                 (librdf_storage *storage);
int                 librdf_storage_open                 (librdf_storage *storage,
                                                         librdf_model *model);
int                 librdf_storage_close                (librdf_storage *storage);
int                 librdf_storage_size                 (librdf_storage *storage);
int                 librdf_storage_add_statement        (librdf_storage *storage,
                                                         librdf_statement *statement);
int                 librdf_storage_add_statements       (librdf_storage *storage,
                                                         librdf_stream *statement_stream);
int                 librdf_storage_remove_statement     (librdf_storage *storage,
                                                         librdf_statement *statement);
int                 librdf_storage_contains_statement   (librdf_storage *storage,
                                                         librdf_statement *statement);
librdf_stream *     librdf_storage_serialise            (librdf_storage *storage);
librdf_stream *     librdf_storage_find_statements      (librdf_storage *storage,
                                                         librdf_statement *statement);
librdf_stream *     librdf_storage_find_statements_with_options
                                                        (librdf_storage *storage,
                                                         librdf_statement *statement,
                                                         librdf_node *context_node,
                                                         librdf_hash *options);
librdf_iterator *   librdf_storage_get_sources          (librdf_storage *storage,
                                                         librdf_node *arc,
                                                         librdf_node *target);
librdf_iterator *   librdf_storage_get_arcs             (librdf_storage *storage,
                                                         librdf_node *source,
                                                         librdf_node *target);
librdf_iterator *   librdf_storage_get_targets          (librdf_storage *storage,
                                                         librdf_node *source,
                                                         librdf_node *arc);
librdf_iterator *   librdf_storage_get_arcs_in          (librdf_storage *storage,
                                                         librdf_node *node);
librdf_iterator *   librdf_storage_get_arcs_out         (librdf_storage *storage,
                                                         librdf_node *node);
int                 librdf_storage_has_arc_in           (librdf_storage *storage,
                                                         librdf_node *node,
                                                         librdf_node *property);
int                 librdf_storage_has_arc_out          (librdf_storage *storage,
                                                         librdf_node *node,
                                                         librdf_node *property);
int                 librdf_storage_context_add_statement
                                                        (librdf_storage *storage,
                                                         librdf_node *context,
                                                         librdf_statement *statement);
int                 librdf_storage_context_add_statements
                                                        (librdf_storage *storage,
                                                         librdf_node *context,
                                                         librdf_stream *stream);
int                 librdf_storage_context_remove_statement
                                                        (librdf_storage *storage,
                                                         librdf_node *context,
                                                         librdf_statement *statement);
int                 librdf_storage_context_remove_statements
                                                        (librdf_storage *storage,
                                                         librdf_node *context);
librdf_stream *     librdf_storage_context_as_stream    (librdf_storage *storage,
                                                         librdf_node *context);
librdf_stream *     librdf_storage_context_serialise    (librdf_storage *storage,
                                                         librdf_node *context);
int                 librdf_storage_supports_query       (librdf_storage *storage,
                                                         librdf_query *query);
librdf_query_results * librdf_storage_query_execute     (librdf_storage *storage,
                                                         librdf_query *query);
int                 librdf_storage_sync                 (librdf_storage *storage);
librdf_stream *     librdf_storage_find_statements_in_context
                                                        (librdf_storage *storage,
                                                         librdf_statement *statement,
                                                         librdf_node *context_node);
librdf_iterator *   librdf_storage_get_contexts         (librdf_storage *storage);
librdf_node *       librdf_storage_get_feature          (librdf_storage *storage,
                                                         librdf_uri *feature);
int                 librdf_storage_set_feature          (librdf_storage *storage,
                                                         librdf_uri *feature,
                                                         librdf_node *value);
int                 librdf_storage_transaction_commit   (librdf_storage *storage);
void *              librdf_storage_transaction_get_handle
                                                        (librdf_storage *storage);
int                 librdf_storage_transaction_rollback (librdf_storage *storage);
int                 librdf_storage_transaction_start    (librdf_storage *storage);
int                 librdf_storage_transaction_start_with_handle
                                                        (librdf_storage *storage,
                                                         void *handle);
void                librdf_storage_add_reference        (librdf_storage *storage);
void                librdf_storage_remove_reference     (librdf_storage *storage);
typedef             librdf_storage_instance;
librdf_storage_instance librdf_storage_get_instance     (librdf_storage *storage);
void                librdf_storage_set_instance         (librdf_storage *storage,
                                                         librdf_storage_instance instance);
librdf_world *      librdf_storage_get_world            (librdf_storage *storage);
void                (*librdf_storage_module_register_function)
                                                        (librdf_world *world);

Description

Provides classes to create triple stores to back the RDF graph interface (librdf_model). Most of the methods are for implementing the RDF model API and have the same name.

Details

LIBRDF_STORAGE_INTERFACE_VERSION

#define LIBRDF_STORAGE_INTERFACE_VERSION LIBRDF_STORAGE_MAX_INTERFACE_VERSION

Default librdf storage module interface version.


LIBRDF_STORAGE_MAX_INTERFACE_VERSION

#define LIBRDF_STORAGE_MAX_INTERFACE_VERSION 1

Newest supported librdf storage module interface version.


LIBRDF_STORAGE_MIN_INTERFACE_VERSION

#define LIBRDF_STORAGE_MIN_INTERFACE_VERSION 1

Oldest support librdf storage module interface version.


librdf_storage

typedef struct librdf_storage_s librdf_storage;

Redland storage class.


librdf_storage_factory

typedef struct librdf_storage_factory_s librdf_storage_factory;

A Storage Factory


librdf_storage_register_factory ()

int                 librdf_storage_register_factory     (librdf_world *world,
                                                         const char *name,
                                                         const char *label,
                                                         void (*factory) (librdf_storage_factory*));

Register a storage factory.

Registration will fail if any of the parameters or NULL, if the factory API version is out of the known range or if out of memory.

world :

redland world object

name :

the storage factory name

label :

the storage factory label

factory :

pointer to function to call to register the factory

Returns :

non-0 on failure

librdf_storage_enumerate ()

int                 librdf_storage_enumerate            (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const char **label);

Get information on storages.

world :

redland world object

counter :

index into the list of storages

name :

pointer to store the name of the storage (or NULL)

label :

pointer to store syntax readable label (or NULL)

Returns :

non 0 on failure of if counter is out of range

librdf_new_storage ()

librdf_storage *    librdf_new_storage                  (librdf_world *world,
                                                         const char *storage_name,
                                                         const char *name,
                                                         const char *options_string);

Constructor - create a new librdf_storage object.

The options are encoded as described in librdf_hash_from_string() and can be NULL if none are required.

world :

redland world object

storage_name :

the storage factory name

name :

an identifier for the storage

options_string :

options to initialise storage

Returns :

a new librdf_storage object or NULL on failure

librdf_new_storage_with_options ()

librdf_storage *    librdf_new_storage_with_options     (librdf_world *world,
                                                         const char *storage_name,
                                                         const char *name,
                                                         librdf_hash *options);

Constructor - create a new librdf_storage object.

The options can be NULL if none are required.

world :

redland world object

storage_name :

the storage factory name

name :

an identifier for the storage

options :

librdf_hash of options to use

Returns :

a new librdf_storage object or NULL on failure

librdf_new_storage_from_storage ()

librdf_storage *    librdf_new_storage_from_storage     (librdf_storage *old_storage);

Copy constructor - create a new librdf_storage object from an existing one

Should create a new storage in the same context as the existing one as appropriate for the storage. For example, in a RDBMS storage it would be a new database, or in on disk it would be a new set of files. This will mean automatically generating a new identifier for the storage, maybe based on the existing storage identifier.

old_storage :

the existing storage librdf_storage to use

Returns :

a new librdf_storage object or NULL on failure

librdf_new_storage_from_factory ()

librdf_storage *    librdf_new_storage_from_factory     (librdf_world *world,
                                                         librdf_storage_factory *factory,
                                                         const char *name,
                                                         librdf_hash *options);

Constructor - create a new librdf_storage object.

If the options are present, they become owned by the storage and should no longer be used.

world :

redland world object

factory :

the factory to use to construct the storage

name :

name to use for storage

options :

librdf_hash of options to initialise storage

Returns :

a new librdf_storage object or NULL on failure

librdf_free_storage ()

void                librdf_free_storage                 (librdf_storage *storage);

Destructor - destroy a librdf_storage object.

storage :

librdf_storage object

librdf_storage_open ()

int                 librdf_storage_open                 (librdf_storage *storage,
                                                         librdf_model *model);

Start a model / storage association.

This is ended with librdf_storage_close()

storage :

librdf_storage object

model :

model stored

Returns :

non 0 on failure

librdf_storage_close ()

int                 librdf_storage_close                (librdf_storage *storage);

End a model / storage association.

storage :

librdf_storage object

Returns :

non 0 on failure

librdf_storage_size ()

int                 librdf_storage_size                 (librdf_storage *storage);

Get the number of statements stored.

storage :

librdf_storage object

Returns :

The number of statements or < 0 if cannot be determined

librdf_storage_add_statement ()

int                 librdf_storage_add_statement        (librdf_storage *storage,
                                                         librdf_statement *statement);

Add a statement to a storage.

The passed-in statement is copied when added to the store, not shared with the store.

If the statement already exists in the store, it is not added unless Redland contexts are being used.

Enforces that the statement is legal for RDF - URI or blank subject, URI predicate and URI or blank or literal object (i.e. anything).

storage :

librdf_storage object

statement :

librdf_statement statement to add

Returns :

non 0 on failure, <0 on error, >0 if statement was illegal

librdf_storage_add_statements ()

int                 librdf_storage_add_statements       (librdf_storage *storage,
                                                         librdf_stream *statement_stream);

Add a stream of statements to the storage.

If any of the statements already exists in the store, they are not added unless Redland contexts are being used.

storage :

librdf_storage object

statement_stream :

librdf_stream of statements

Returns :

non 0 on failure

librdf_storage_remove_statement ()

int                 librdf_storage_remove_statement     (librdf_storage *storage,
                                                         librdf_statement *statement);

Remove a statement from the storage.

storage :

librdf_storage object

statement :

librdf_statement statement to remove

Returns :

non 0 on failure

librdf_storage_contains_statement ()

int                 librdf_storage_contains_statement   (librdf_storage *storage,
                                                         librdf_statement *statement);

Test if a given statement is present in the storage.

storage :

librdf_storage object

statement :

librdf_statement statement to check

Returns :

non 0 if the storage contains the statement (>0 if illegal statement)

librdf_storage_serialise ()

librdf_stream *     librdf_storage_serialise            (librdf_storage *storage);

Serialise the storage as a librdf_stream of statemetns.

storage :

librdf_storage object

Returns :

librdf_stream of statements or NULL on failure

librdf_storage_find_statements ()

librdf_stream *     librdf_storage_find_statements      (librdf_storage *storage,
                                                         librdf_statement *statement);

Search the storage for matching statements.

Searches the storage for a (partial) statement as described in librdf_statement_match() and returns a librdf_stream of matching librdf_statement objects.

storage :

librdf_storage object

statement :

librdf_statement partial statement to find

Returns :

librdf_stream of matching statements (may be empty) or NULL on failure

librdf_storage_find_statements_with_options ()

librdf_stream *     librdf_storage_find_statements_with_options
                                                        (librdf_storage *storage,
                                                         librdf_statement *statement,
                                                         librdf_node *context_node,
                                                         librdf_hash *options);

Search the storage for matching statements with match options.

Searches the storage for a (partial) statement as described in librdf_statement_match() and returns a librdf_stream of matching librdf_statement objects.

If options is given then the match is made according to the given options. If options is NULL, this is equivalent to librdf_storage_find_statements_in_context.

storage :

librdf_storage object

statement :

librdf_statement partial statement to find

context_node :

librdf_node context node or NULL.

options :

librdf_hash of matching options or NULL

Returns :

librdf_stream of matching statements (may be empty) or NULL on failure

librdf_storage_get_sources ()

librdf_iterator *   librdf_storage_get_sources          (librdf_storage *storage,
                                                         librdf_node *arc,
                                                         librdf_node *target);

Return the sources (subjects) of arc in an RDF graph given arc (predicate) and target (object).

Searches the storage for arcs matching the given arc and target and returns a list of the source librdf_node objects as an iterator

storage :

librdf_storage object

arc :

librdf_node arc

target :

librdf_node target

Returns :

librdf_iterator of librdf_node objects (may be empty) or NULL on failure

librdf_storage_get_arcs ()

librdf_iterator *   librdf_storage_get_arcs             (librdf_storage *storage,
                                                         librdf_node *source,
                                                         librdf_node *target);

Return the arcs (predicates) of an arc in an RDF graph given source (subject) and target (object).

Searches the storage for arcs matching the given source and target and returns a list of the arc librdf_node objects as an iterator

storage :

librdf_storage object

source :

librdf_node source

target :

librdf_node target

Returns :

librdf_iterator of librdf_node objects (may be empty) or NULL on failure

librdf_storage_get_targets ()

librdf_iterator *   librdf_storage_get_targets          (librdf_storage *storage,
                                                         librdf_node *source,
                                                         librdf_node *arc);

Return the targets (objects) of an arc in an RDF graph given source (subject) and arc (predicate).

Searches the storage for targets matching the given source and arc and returns a list of the source librdf_node objects as an iterator

storage :

librdf_storage object

source :

librdf_node source

arc :

librdf_node arc

Returns :

librdf_iterator of librdf_node objects (may be empty) or NULL on failure

librdf_storage_get_arcs_in ()

librdf_iterator *   librdf_storage_get_arcs_in          (librdf_storage *storage,
                                                         librdf_node *node);

Return the properties pointing to the given resource.

storage :

librdf_storage object

node :

librdf_node resource node

Returns :

librdf_iterator of librdf_node objects (may be empty) or NULL on failure

librdf_storage_get_arcs_out ()

librdf_iterator *   librdf_storage_get_arcs_out         (librdf_storage *storage,
                                                         librdf_node *node);

Return the properties pointing from the given resource.

storage :

librdf_storage object

node :

librdf_node resource node

Returns :

librdf_iterator of librdf_node objects (may be empty) or NULL on failure

librdf_storage_has_arc_in ()

int                 librdf_storage_has_arc_in           (librdf_storage *storage,
                                                         librdf_node *node,
                                                         librdf_node *property);

Check if a node has a given property pointing to it.

storage :

librdf_storage object

node :

librdf_node resource node

property :

librdf_node property node

Returns :

non 0 if arc property does point to the resource node

librdf_storage_has_arc_out ()

int                 librdf_storage_has_arc_out          (librdf_storage *storage,
                                                         librdf_node *node,
                                                         librdf_node *property);

Check if a node has a given property pointing from it.

storage :

librdf_storage object

node :

librdf_node resource node

property :

librdf_node property node

Returns :

non 0 if arc property does point from the resource node

librdf_storage_context_add_statement ()

int                 librdf_storage_context_add_statement
                                                        (librdf_storage *storage,
                                                         librdf_node *context,
                                                         librdf_statement *statement);

Add a statement to a storage in a context.

If context is NULL, this is equivalent to librdf_storage_add_statement

storage :

librdf_storage object

context :

librdf_node context node

statement :

librdf_statement statement to add

Returns :

non 0 on failure

librdf_storage_context_add_statements ()

int                 librdf_storage_context_add_statements
                                                        (librdf_storage *storage,
                                                         librdf_node *context,
                                                         librdf_stream *stream);

Add statements to a storage with a context.

If context is NULL, this is equivalent to librdf_storage_add_statements

storage :

librdf_storage object

context :

librdf_node context

stream :

librdf_stream stream object

Returns :

Non 0 on failure

librdf_storage_context_remove_statement ()

int                 librdf_storage_context_remove_statement
                                                        (librdf_storage *storage,
                                                         librdf_node *context,
                                                         librdf_statement *statement);

Remove a statement from a storage in a context.

If context is NULL, this is equivalent to librdf_storage_remove_statement

storage :

librdf_storage object

context :

librdf_node context node

statement :

librdf_statement statement to remove

Returns :

non 0 on failure

librdf_storage_context_remove_statements ()

int                 librdf_storage_context_remove_statements
                                                        (librdf_storage *storage,
                                                         librdf_node *context);

Remove statements from a storage with the given context.

storage :

librdf_storage object

context :

librdf_uri context

Returns :

Non 0 on failure

librdf_storage_context_as_stream ()

librdf_stream *     librdf_storage_context_as_stream    (librdf_storage *storage,
                                                         librdf_node *context);

List all statements in a storage context.

storage :

librdf_storage object

context :

librdf_node context node

Returns :

librdf_stream of statements or NULL on failure or context is empty

librdf_storage_context_serialise ()

librdf_stream *     librdf_storage_context_serialise    (librdf_storage *storage,
                                                         librdf_node *context);

List all statements in a storage context (DEPRECATED).

DEPRECATED to reduce confusion with the librdf_serializer class. Please use librdf_storage_context_as_stream.

storage :

librdf_storage object

context :

librdf_node context node

Returns :

librdf_stream of statements or NULL on failure or context is empty

librdf_storage_supports_query ()

int                 librdf_storage_supports_query       (librdf_storage *storage,
                                                         librdf_query *query);

Check if a storage system supports a query language.

storage :

librdf_storage object

query :

librdf_query query object

Returns :

non-0 if the query is supported.

librdf_storage_query_execute ()

librdf_query_results * librdf_storage_query_execute     (librdf_storage *storage,
                                                         librdf_query *query);

Run the given query against the storage.

Not implemented.

storage :

librdf_storage object

query :

librdf_query query object

Returns :

librdf_query_results or NULL on failure

librdf_storage_sync ()

int                 librdf_storage_sync                 (librdf_storage *storage);

Synchronise the storage to the storage implementation.

storage :

librdf_storage object

Returns :

non-0 on failure

librdf_storage_find_statements_in_context ()

librdf_stream *     librdf_storage_find_statements_in_context
                                                        (librdf_storage *storage,
                                                         librdf_statement *statement,
                                                         librdf_node *context_node);

Search the storage for matching statements in a given context.

Searches the storage for a (partial) statement as described in librdf_statement_match() in the given context and returns a librdf_stream of matching librdf_statement objects. If context is NULL, this is equivalent to librdf_storage_find_statements.

storage :

librdf_storage object

statement :

librdf_statement partial statement to find

context_node :

context librdf_node (or NULL)

Returns :

librdf_stream of matching statements (may be empty) or NULL on failure

librdf_storage_get_contexts ()

librdf_iterator *   librdf_storage_get_contexts         (librdf_storage *storage);

Return the list of contexts in the store.

Returns an iterator of librdf_node context nodes for each context in the store.

storage :

librdf_storage object

Returns :

librdf_iterator of context nodes or NULL on failure or if contexts are not supported

librdf_storage_get_feature ()

librdf_node *       librdf_storage_get_feature          (librdf_storage *storage,
                                                         librdf_uri *feature);

Get the value of a storage feature.

storage :

librdf_storage object

feature :

librdf_uri feature property

Returns :

new librdf_node feature value or NULL if no such feature exists or the value is empty.

librdf_storage_set_feature ()

int                 librdf_storage_set_feature          (librdf_storage *storage,
                                                         librdf_uri *feature,
                                                         librdf_node *value);

Set the value of a storage feature.

storage :

librdf_storage object

feature :

librdf_uri feature property

value :

librdf_node feature property value

Returns :

non 0 on failure (negative if no such feature)

librdf_storage_transaction_commit ()

int                 librdf_storage_transaction_commit   (librdf_storage *storage);

Commit a transaction.

storage :

the storage object

Returns :

non-0 on failure

librdf_storage_transaction_get_handle ()

void *              librdf_storage_transaction_get_handle
                                                        (librdf_storage *storage);

Get the current transaction handle.

storage :

the storage object

Returns :

non-0 on failure

librdf_storage_transaction_rollback ()

int                 librdf_storage_transaction_rollback (librdf_storage *storage);

Rollback a transaction.

storage :

the storage object

Returns :

non-0 on failure

librdf_storage_transaction_start ()

int                 librdf_storage_transaction_start    (librdf_storage *storage);

Start a transaction

storage :

the storage object

Returns :

non-0 on failure

librdf_storage_transaction_start_with_handle ()

int                 librdf_storage_transaction_start_with_handle
                                                        (librdf_storage *storage,
                                                         void *handle);

Start a transaction using an existing external transaction object.

storage :

the storage object

handle :

the transaction object

Returns :

non-0 on failure

librdf_storage_add_reference ()

void                librdf_storage_add_reference        (librdf_storage *storage);

Increment storage reference count by one.

This function is intended to be internal to librdf storage modules.

storage :

librdf_storage object

librdf_storage_remove_reference ()

void                librdf_storage_remove_reference     (librdf_storage *storage);

Decrement storage reference count by one and free the storage if reference count becomes zero.

This function is intended to be internal to librdf storage modules.

storage :

librdf_storage object

librdf_storage_instance

typedef void* librdf_storage_instance;

Opaque storage module instance handle.

For use with a storage module and the librdf_storage_get_instance() and librdf_storage_set_instance() functions. The instance handle should be set in the librdf_storage_factory init factory method.


librdf_storage_get_instance ()

librdf_storage_instance librdf_storage_get_instance     (librdf_storage *storage);

Get instance data for this storage

storage :

librdf_storage object

Returns :

opaque instance data for this storage

librdf_storage_set_instance ()

void                librdf_storage_set_instance         (librdf_storage *storage,
                                                         librdf_storage_instance instance);

Set the instance data for this storage.

This function is intended for use by the 'init' method of storage implementations to set instance data which can be retrived with librdf_storage_get_instance() and used in other methods of that storage.

The instance is completely opaque to librdf, including allocation and deallocation.

storage :

librdf_storage object

instance :

Opaque instance pointer

librdf_storage_get_world ()

librdf_world *      librdf_storage_get_world            (librdf_storage *storage);

Get the librdf_world object associated with this storage.

storage :

librdf_storage object

Returns :

world object for this storage

librdf_storage_module_register_function ()

void                (*librdf_storage_module_register_function)
                                                        (librdf_world *world);

Registration function for storage

A storage module must define and export a function named of this type with function name "librdf_storage_module_register_factory".

This function will be called by Redland and must call librdf_storage_register_factory() to register whatever storage backends are implemented in the module.

world :

world object
redland-1.0.17/docs/html/indexes.html0000644000175000017500000022677312257576340014407 00000000000000 Index

Index

L

librdf_alloc_memory, librdf_alloc_memory ()
librdf_calloc_memory, librdf_calloc_memory ()
librdf_copyright_string, librdf_copyright_string
librdf_destroy_world, librdf_destroy_world ()
librdf_digest, librdf_digest
librdf_digest_factory, librdf_digest_factory
librdf_digest_final, librdf_digest_final ()
librdf_digest_get_digest, librdf_digest_get_digest ()
librdf_digest_get_digest_length, librdf_digest_get_digest_length ()
librdf_digest_init, librdf_digest_init ()
librdf_digest_print, librdf_digest_print ()
librdf_digest_to_string, librdf_digest_to_string ()
librdf_digest_update, librdf_digest_update ()
librdf_digest_update_string, librdf_digest_update_string ()
librdf_files_temporary_file_name, librdf_files_temporary_file_name ()
librdf_free_digest, librdf_free_digest ()
librdf_free_hash, librdf_free_hash ()
librdf_free_iterator, librdf_free_iterator ()
librdf_free_list, librdf_free_list ()
librdf_free_memory, librdf_free_memory ()
librdf_free_model, librdf_free_model ()
librdf_free_node, librdf_free_node ()
librdf_free_parser, librdf_free_parser ()
librdf_free_query, librdf_free_query ()
librdf_free_query_results, librdf_free_query_results ()
librdf_free_query_results_formatter, librdf_free_query_results_formatter ()
librdf_free_serializer, librdf_free_serializer ()
librdf_free_statement, librdf_free_statement ()
librdf_free_storage, librdf_free_storage ()
librdf_free_stream, librdf_free_stream ()
librdf_free_uri, librdf_free_uri ()
librdf_free_world, librdf_free_world ()
librdf_get_concept_ms_namespace, librdf_get_concept_ms_namespace ()
librdf_get_concept_resource_by_index, librdf_get_concept_resource_by_index ()
librdf_get_concept_schema_namespace, librdf_get_concept_schema_namespace ()
librdf_get_concept_uri_by_index, librdf_get_concept_uri_by_index ()
librdf_hash, librdf_hash
librdf_hash_cursor, librdf_hash_cursor
librdf_hash_from_string, librdf_hash_from_string ()
librdf_hash_get, librdf_hash_get ()
librdf_hash_get_as_boolean, librdf_hash_get_as_boolean ()
librdf_hash_get_as_long, librdf_hash_get_as_long ()
librdf_hash_get_del, librdf_hash_get_del ()
librdf_hash_interpret_template, librdf_hash_interpret_template ()
librdf_hash_print, librdf_hash_print ()
librdf_hash_print_keys, librdf_hash_print_keys ()
librdf_hash_print_values, librdf_hash_print_values ()
librdf_hash_put_strings, librdf_hash_put_strings ()
librdf_hash_to_string, librdf_hash_to_string ()
librdf_heuristic_gen_name, librdf_heuristic_gen_name ()
librdf_heuristic_get_blank_node, librdf_heuristic_get_blank_node ()
librdf_heuristic_is_blank_node, librdf_heuristic_is_blank_node ()
librdf_heuristic_object_is_literal, librdf_heuristic_object_is_literal ()
librdf_home_url_string, librdf_home_url_string
librdf_init_world, librdf_init_world ()
librdf_iterator, librdf_iterator
librdf_iterator_add_map, librdf_iterator_add_map ()
librdf_iterator_end, librdf_iterator_end ()
librdf_iterator_get_context, librdf_iterator_get_context ()
librdf_iterator_get_key, librdf_iterator_get_key ()
librdf_iterator_get_method_flags, enum librdf_iterator_get_method_flags
librdf_iterator_get_object, librdf_iterator_get_object ()
librdf_iterator_get_value, librdf_iterator_get_value ()
librdf_iterator_have_elements, librdf_iterator_have_elements ()
librdf_iterator_map_free_context_handler, librdf_iterator_map_free_context_handler ()
librdf_iterator_map_handler, librdf_iterator_map_handler ()
librdf_iterator_next, librdf_iterator_next ()
librdf_latin1_to_utf8, librdf_latin1_to_utf8 ()
librdf_latin1_to_utf8_2, librdf_latin1_to_utf8_2 ()
librdf_license_string, librdf_license_string
librdf_list, librdf_list
librdf_list_add, librdf_list_add ()
librdf_list_clear, librdf_list_clear ()
librdf_list_contains, librdf_list_contains ()
librdf_list_foreach, librdf_list_foreach ()
librdf_list_get_iterator, librdf_list_get_iterator ()
librdf_list_pop, librdf_list_pop ()
librdf_list_remove, librdf_list_remove ()
librdf_list_set_equals, librdf_list_set_equals ()
librdf_list_shift, librdf_list_shift ()
librdf_list_size, librdf_list_size ()
librdf_list_unshift, librdf_list_unshift ()
librdf_log_facility, enum librdf_log_facility
librdf_log_func, librdf_log_func ()
librdf_log_level, enum librdf_log_level
librdf_log_level_func, librdf_log_level_func ()
librdf_log_message_code, librdf_log_message_code ()
librdf_log_message_facility, librdf_log_message_facility ()
librdf_log_message_level, librdf_log_message_level ()
librdf_log_message_locator, librdf_log_message_locator ()
librdf_log_message_message, librdf_log_message_message ()
librdf_model, librdf_model
librdf_model_add, librdf_model_add ()
librdf_model_add_statement, librdf_model_add_statement ()
librdf_model_add_statements, librdf_model_add_statements ()
librdf_model_add_string_literal_statement, librdf_model_add_string_literal_statement ()
librdf_model_add_submodel, librdf_model_add_submodel ()
librdf_model_add_typed_literal_statement, librdf_model_add_typed_literal_statement ()
librdf_model_as_stream, librdf_model_as_stream ()
librdf_model_contains_context, librdf_model_contains_context ()
librdf_model_contains_statement, librdf_model_contains_statement ()
librdf_model_context_add_statement, librdf_model_context_add_statement ()
librdf_model_context_add_statements, librdf_model_context_add_statements ()
librdf_model_context_as_stream, librdf_model_context_as_stream ()
librdf_model_context_remove_statement, librdf_model_context_remove_statement ()
librdf_model_context_remove_statements, librdf_model_context_remove_statements ()
librdf_model_context_serialize, librdf_model_context_serialize ()
librdf_model_enumerate, librdf_model_enumerate ()
librdf_model_factory, librdf_model_factory
LIBRDF_MODEL_FEATURE_CONTEXTS, LIBRDF_MODEL_FEATURE_CONTEXTS
LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL, LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL
librdf_model_find_statements, librdf_model_find_statements ()
librdf_model_find_statements_in_context, librdf_model_find_statements_in_context ()
librdf_model_find_statements_with_options, librdf_model_find_statements_with_options ()
librdf_model_get_arc, librdf_model_get_arc ()
librdf_model_get_arcs, librdf_model_get_arcs ()
librdf_model_get_arcs_in, librdf_model_get_arcs_in ()
librdf_model_get_arcs_out, librdf_model_get_arcs_out ()
librdf_model_get_contexts, librdf_model_get_contexts ()
librdf_model_get_feature, librdf_model_get_feature ()
librdf_model_get_source, librdf_model_get_source ()
librdf_model_get_sources, librdf_model_get_sources ()
librdf_model_get_storage, librdf_model_get_storage ()
librdf_model_get_target, librdf_model_get_target ()
librdf_model_get_targets, librdf_model_get_targets ()
librdf_model_has_arc_in, librdf_model_has_arc_in ()
librdf_model_has_arc_out, librdf_model_has_arc_out ()
librdf_model_load, librdf_model_load ()
librdf_model_print, librdf_model_print ()
librdf_model_query_execute, librdf_model_query_execute ()
librdf_model_remove_statement, librdf_model_remove_statement ()
librdf_model_remove_submodel, librdf_model_remove_submodel ()
librdf_model_serialise, librdf_model_serialise ()
librdf_model_set_feature, librdf_model_set_feature ()
librdf_model_size, librdf_model_size ()
librdf_model_supports_contexts, librdf_model_supports_contexts ()
librdf_model_sync, librdf_model_sync ()
librdf_model_to_counted_string, librdf_model_to_counted_string ()
librdf_model_to_string, librdf_model_to_string ()
librdf_model_transaction_commit, librdf_model_transaction_commit ()
librdf_model_transaction_get_handle, librdf_model_transaction_get_handle ()
librdf_model_transaction_rollback, librdf_model_transaction_rollback ()
librdf_model_transaction_start, librdf_model_transaction_start ()
librdf_model_transaction_start_with_handle, librdf_model_transaction_start_with_handle ()
librdf_model_write, librdf_model_write ()
LIBRDF_MS_aboutEach, LIBRDF_MS_aboutEach
LIBRDF_MS_aboutEachPrefix, LIBRDF_MS_aboutEachPrefix
LIBRDF_MS_aboutEachPrefix_URI, LIBRDF_MS_aboutEachPrefix_URI
LIBRDF_MS_aboutEach_URI, LIBRDF_MS_aboutEach_URI
LIBRDF_MS_Alt, LIBRDF_MS_Alt
LIBRDF_MS_Alt_URI, LIBRDF_MS_Alt_URI
LIBRDF_MS_Bag, LIBRDF_MS_Bag
LIBRDF_MS_Bag_URI, LIBRDF_MS_Bag_URI
LIBRDF_MS_Description, LIBRDF_MS_Description
LIBRDF_MS_Description_URI, LIBRDF_MS_Description_URI
LIBRDF_MS_li, LIBRDF_MS_li
LIBRDF_MS_li_URI, LIBRDF_MS_li_URI
LIBRDF_MS_object, LIBRDF_MS_object
LIBRDF_MS_object_URI, LIBRDF_MS_object_URI
LIBRDF_MS_predicate, LIBRDF_MS_predicate
LIBRDF_MS_predicate_URI, LIBRDF_MS_predicate_URI
LIBRDF_MS_Property, LIBRDF_MS_Property
LIBRDF_MS_Property_URI, LIBRDF_MS_Property_URI
LIBRDF_MS_RDF, LIBRDF_MS_RDF
LIBRDF_MS_RDF_URI, LIBRDF_MS_RDF_URI
LIBRDF_MS_Seq, LIBRDF_MS_Seq
LIBRDF_MS_Seq_URI, LIBRDF_MS_Seq_URI
LIBRDF_MS_Statement, LIBRDF_MS_Statement
LIBRDF_MS_Statement_URI, LIBRDF_MS_Statement_URI
LIBRDF_MS_subject, LIBRDF_MS_subject
LIBRDF_MS_subject_URI, LIBRDF_MS_subject_URI
LIBRDF_MS_type, LIBRDF_MS_type
LIBRDF_MS_type_URI, LIBRDF_MS_type_URI
LIBRDF_MS_value, LIBRDF_MS_value
LIBRDF_MS_value_URI, LIBRDF_MS_value_URI
librdf_new_digest, librdf_new_digest ()
librdf_new_empty_iterator, librdf_new_empty_iterator ()
librdf_new_empty_stream, librdf_new_empty_stream ()
librdf_new_hash, librdf_new_hash ()
librdf_new_hash_from_array_of_strings, librdf_new_hash_from_array_of_strings ()
librdf_new_hash_from_hash, librdf_new_hash_from_hash ()
librdf_new_hash_from_string, librdf_new_hash_from_string ()
librdf_new_iterator, librdf_new_iterator ()
librdf_new_list, librdf_new_list ()
librdf_new_model, librdf_new_model ()
librdf_new_model_from_model, librdf_new_model_from_model ()
librdf_new_model_with_options, librdf_new_model_with_options ()
librdf_new_node, librdf_new_node ()
librdf_new_node_from_blank_identifier, librdf_new_node_from_blank_identifier ()
librdf_new_node_from_counted_blank_identifier, librdf_new_node_from_counted_blank_identifier ()
librdf_new_node_from_counted_uri_string, librdf_new_node_from_counted_uri_string ()
librdf_new_node_from_literal, librdf_new_node_from_literal ()
librdf_new_node_from_node, librdf_new_node_from_node ()
librdf_new_node_from_normalised_uri_string, librdf_new_node_from_normalised_uri_string ()
librdf_new_node_from_typed_counted_literal, librdf_new_node_from_typed_counted_literal ()
librdf_new_node_from_typed_literal, librdf_new_node_from_typed_literal ()
librdf_new_node_from_uri, librdf_new_node_from_uri ()
librdf_new_node_from_uri_local_name, librdf_new_node_from_uri_local_name ()
librdf_new_node_from_uri_string, librdf_new_node_from_uri_string ()
librdf_new_parser, librdf_new_parser ()
librdf_new_parser_from_factory, librdf_new_parser_from_factory ()
librdf_new_query, librdf_new_query ()
librdf_new_query_from_factory, librdf_new_query_from_factory ()
librdf_new_query_from_query, librdf_new_query_from_query ()
librdf_new_query_results_formatter, librdf_new_query_results_formatter ()
librdf_new_query_results_formatter2, librdf_new_query_results_formatter2 ()
librdf_new_query_results_formatter_by_mime_type, librdf_new_query_results_formatter_by_mime_type ()
librdf_new_serializer, librdf_new_serializer ()
librdf_new_serializer_from_factory, librdf_new_serializer_from_factory ()
librdf_new_statement, librdf_new_statement ()
librdf_new_statement_from_nodes, librdf_new_statement_from_nodes ()
librdf_new_statement_from_statement, librdf_new_statement_from_statement ()
librdf_new_statement_from_statement2, librdf_new_statement_from_statement2 ()
librdf_new_storage, librdf_new_storage ()
librdf_new_storage_from_factory, librdf_new_storage_from_factory ()
librdf_new_storage_from_storage, librdf_new_storage_from_storage ()
librdf_new_storage_with_options, librdf_new_storage_with_options ()
librdf_new_stream, librdf_new_stream ()
librdf_new_stream_from_node_iterator, librdf_new_stream_from_node_iterator ()
librdf_new_uri, librdf_new_uri ()
librdf_new_uri2, librdf_new_uri2 ()
librdf_new_uri_from_filename, librdf_new_uri_from_filename ()
librdf_new_uri_from_uri, librdf_new_uri_from_uri ()
librdf_new_uri_from_uri_local_name, librdf_new_uri_from_uri_local_name ()
librdf_new_uri_normalised_to_base, librdf_new_uri_normalised_to_base ()
librdf_new_uri_relative_to_base, librdf_new_uri_relative_to_base ()
librdf_new_world, librdf_new_world ()
librdf_node, librdf_node
librdf_node_decode, librdf_node_decode ()
librdf_node_encode, librdf_node_encode ()
librdf_node_equals, librdf_node_equals ()
librdf_node_get_blank_identifier, librdf_node_get_blank_identifier ()
librdf_node_get_counted_blank_identifier, librdf_node_get_counted_blank_identifier ()
librdf_node_get_literal_value, librdf_node_get_literal_value ()
librdf_node_get_literal_value_as_counted_string, librdf_node_get_literal_value_as_counted_string ()
librdf_node_get_literal_value_as_latin1, librdf_node_get_literal_value_as_latin1 ()
librdf_node_get_literal_value_datatype_uri, librdf_node_get_literal_value_datatype_uri ()
librdf_node_get_literal_value_is_wf_xml, librdf_node_get_literal_value_is_wf_xml ()
librdf_node_get_literal_value_language, librdf_node_get_literal_value_language ()
librdf_node_get_li_ordinal, librdf_node_get_li_ordinal ()
librdf_node_get_type, librdf_node_get_type ()
librdf_node_get_uri, librdf_node_get_uri ()
librdf_node_is_blank, librdf_node_is_blank ()
librdf_node_is_literal, librdf_node_is_literal ()
librdf_node_is_resource, librdf_node_is_resource ()
librdf_node_new_static_node_iterator, librdf_node_new_static_node_iterator ()
librdf_node_print, librdf_node_print ()
librdf_node_static_iterator_create, librdf_node_static_iterator_create ()
librdf_node_to_counted_string, librdf_node_to_counted_string ()
librdf_node_to_string, librdf_node_to_string ()
librdf_node_type, enum librdf_node_type
librdf_node_write, librdf_node_write ()
librdf_parser, librdf_parser
librdf_parser_check_name, librdf_parser_check_name ()
librdf_parser_enumerate, librdf_parser_enumerate ()
librdf_parser_factory, librdf_parser_factory
LIBRDF_PARSER_FEATURE_ERROR_COUNT, LIBRDF_PARSER_FEATURE_ERROR_COUNT
LIBRDF_PARSER_FEATURE_WARNING_COUNT, LIBRDF_PARSER_FEATURE_WARNING_COUNT
librdf_parser_get_accept_header, librdf_parser_get_accept_header ()
librdf_parser_get_description, librdf_parser_get_description ()
librdf_parser_get_feature, librdf_parser_get_feature ()
librdf_parser_get_namespaces_seen_count, librdf_parser_get_namespaces_seen_count ()
librdf_parser_get_namespaces_seen_prefix, librdf_parser_get_namespaces_seen_prefix ()
librdf_parser_get_namespaces_seen_uri, librdf_parser_get_namespaces_seen_uri ()
librdf_parser_get_uri_filter, librdf_parser_get_uri_filter ()
librdf_parser_guess_name, librdf_parser_guess_name ()
librdf_parser_guess_name2, librdf_parser_guess_name2 ()
librdf_parser_parse_as_stream, librdf_parser_parse_as_stream ()
librdf_parser_parse_counted_string_as_stream, librdf_parser_parse_counted_string_as_stream ()
librdf_parser_parse_counted_string_into_model, librdf_parser_parse_counted_string_into_model ()
librdf_parser_parse_file_handle_as_stream, librdf_parser_parse_file_handle_as_stream ()
librdf_parser_parse_file_handle_into_model, librdf_parser_parse_file_handle_into_model ()
librdf_parser_parse_into_model, librdf_parser_parse_into_model ()
librdf_parser_parse_iostream_as_stream, librdf_parser_parse_iostream_as_stream ()
librdf_parser_parse_iostream_into_model, librdf_parser_parse_iostream_into_model ()
librdf_parser_parse_string_as_stream, librdf_parser_parse_string_as_stream ()
librdf_parser_parse_string_into_model, librdf_parser_parse_string_into_model ()
librdf_parser_register_factory, librdf_parser_register_factory ()
librdf_parser_set_error, librdf_parser_set_error ()
librdf_parser_set_feature, librdf_parser_set_feature ()
librdf_parser_set_uri_filter, librdf_parser_set_uri_filter ()
librdf_parser_set_warning, librdf_parser_set_warning ()
librdf_query, librdf_query
librdf_query_execute, librdf_query_execute ()
librdf_query_factory, librdf_query_factory
librdf_query_get_limit, librdf_query_get_limit ()
librdf_query_get_offset, librdf_query_get_offset ()
librdf_query_languages_enumerate, librdf_query_languages_enumerate ()
librdf_query_language_get_description, librdf_query_language_get_description ()
librdf_query_register_factory, librdf_query_register_factory ()
librdf_query_results, librdf_query_results
librdf_query_results_as_stream, librdf_query_results_as_stream ()
librdf_query_results_finished, librdf_query_results_finished ()
librdf_query_results_formats_check, librdf_query_results_formats_check ()
librdf_query_results_formats_enumerate, librdf_query_results_formats_enumerate ()
librdf_query_results_formats_get_description, librdf_query_results_formats_get_description ()
librdf_query_results_formatter, librdf_query_results_formatter
librdf_query_results_formatter_write, librdf_query_results_formatter_write ()
librdf_query_results_get_bindings, librdf_query_results_get_bindings ()
librdf_query_results_get_bindings_count, librdf_query_results_get_bindings_count ()
librdf_query_results_get_binding_name, librdf_query_results_get_binding_name ()
librdf_query_results_get_binding_value, librdf_query_results_get_binding_value ()
librdf_query_results_get_binding_value_by_name, librdf_query_results_get_binding_value_by_name ()
librdf_query_results_get_boolean, librdf_query_results_get_boolean ()
librdf_query_results_get_count, librdf_query_results_get_count ()
librdf_query_results_is_bindings, librdf_query_results_is_bindings ()
librdf_query_results_is_boolean, librdf_query_results_is_boolean ()
librdf_query_results_is_graph, librdf_query_results_is_graph ()
librdf_query_results_is_syntax, librdf_query_results_is_syntax ()
librdf_query_results_next, librdf_query_results_next ()
librdf_query_results_to_counted_string, librdf_query_results_to_counted_string ()
librdf_query_results_to_counted_string2, librdf_query_results_to_counted_string2 ()
librdf_query_results_to_file, librdf_query_results_to_file ()
librdf_query_results_to_file2, librdf_query_results_to_file2 ()
librdf_query_results_to_file_handle, librdf_query_results_to_file_handle ()
librdf_query_results_to_file_handle2, librdf_query_results_to_file_handle2 ()
librdf_query_results_to_string, librdf_query_results_to_string ()
librdf_query_results_to_string2, librdf_query_results_to_string2 ()
librdf_query_set_limit, librdf_query_set_limit ()
librdf_query_set_offset, librdf_query_set_offset ()
librdf_raptor_init_handler, librdf_raptor_init_handler ()
librdf_rasqal_init_handler, librdf_rasqal_init_handler ()
LIBRDF_RS_first, LIBRDF_RS_first
LIBRDF_RS_first_URI, LIBRDF_RS_first_URI
LIBRDF_RS_List, LIBRDF_RS_List
LIBRDF_RS_List_URI, LIBRDF_RS_List_URI
LIBRDF_RS_nil, LIBRDF_RS_nil
LIBRDF_RS_nil_URI, LIBRDF_RS_nil_URI
LIBRDF_RS_nodeID, LIBRDF_RS_nodeID
LIBRDF_RS_nodeID_URI, LIBRDF_RS_nodeID_URI
LIBRDF_RS_rest, LIBRDF_RS_rest
LIBRDF_RS_rest_URI, LIBRDF_RS_rest_URI
LIBRDF_RS_XMLLiteral, LIBRDF_RS_XMLLiteral
LIBRDF_RS_XMLLiteral_URI, LIBRDF_RS_XMLLiteral_URI
librdf_serializer, librdf_serializer
librdf_serializer_check_name, librdf_serializer_check_name ()
librdf_serializer_enumerate, librdf_serializer_enumerate ()
librdf_serializer_factory, librdf_serializer_factory
librdf_serializer_get_description, librdf_serializer_get_description ()
librdf_serializer_get_feature, librdf_serializer_get_feature ()
librdf_serializer_register_factory, librdf_serializer_register_factory ()
librdf_serializer_serialize_model, librdf_serializer_serialize_model ()
librdf_serializer_serialize_model_to_counted_string, librdf_serializer_serialize_model_to_counted_string ()
librdf_serializer_serialize_model_to_file, librdf_serializer_serialize_model_to_file ()
librdf_serializer_serialize_model_to_file_handle, librdf_serializer_serialize_model_to_file_handle ()
librdf_serializer_serialize_model_to_iostream, librdf_serializer_serialize_model_to_iostream ()
librdf_serializer_serialize_model_to_string, librdf_serializer_serialize_model_to_string ()
librdf_serializer_serialize_stream_to_counted_string, librdf_serializer_serialize_stream_to_counted_string ()
librdf_serializer_serialize_stream_to_file, librdf_serializer_serialize_stream_to_file ()
librdf_serializer_serialize_stream_to_file_handle, librdf_serializer_serialize_stream_to_file_handle ()
librdf_serializer_serialize_stream_to_iostream, librdf_serializer_serialize_stream_to_iostream ()
librdf_serializer_serialize_stream_to_string, librdf_serializer_serialize_stream_to_string ()
librdf_serializer_set_error, librdf_serializer_set_error ()
librdf_serializer_set_feature, librdf_serializer_set_feature ()
librdf_serializer_set_namespace, librdf_serializer_set_namespace ()
librdf_serializer_set_warning, librdf_serializer_set_warning ()
librdf_short_copyright_string, librdf_short_copyright_string
librdf_statement, librdf_statement
librdf_statement_clear, librdf_statement_clear ()
librdf_statement_decode, librdf_statement_decode ()
librdf_statement_decode2, librdf_statement_decode2 ()
librdf_statement_decode_parts, librdf_statement_decode_parts ()
librdf_statement_encode, librdf_statement_encode ()
librdf_statement_encode2, librdf_statement_encode2 ()
librdf_statement_encode_parts, librdf_statement_encode_parts ()
librdf_statement_encode_parts2, librdf_statement_encode_parts2 ()
librdf_statement_equals, librdf_statement_equals ()
librdf_statement_get_object, librdf_statement_get_object ()
librdf_statement_get_predicate, librdf_statement_get_predicate ()
librdf_statement_get_subject, librdf_statement_get_subject ()
librdf_statement_init, librdf_statement_init ()
librdf_statement_is_complete, librdf_statement_is_complete ()
librdf_statement_match, librdf_statement_match ()
librdf_statement_part, enum librdf_statement_part
librdf_statement_print, librdf_statement_print ()
librdf_statement_set_object, librdf_statement_set_object ()
librdf_statement_set_predicate, librdf_statement_set_predicate ()
librdf_statement_set_subject, librdf_statement_set_subject ()
librdf_statement_to_string, librdf_statement_to_string ()
librdf_statement_write, librdf_statement_write ()
librdf_storage, librdf_storage
librdf_storage_add_reference, librdf_storage_add_reference ()
librdf_storage_add_statement, librdf_storage_add_statement ()
librdf_storage_add_statements, librdf_storage_add_statements ()
librdf_storage_close, librdf_storage_close ()
librdf_storage_contains_statement, librdf_storage_contains_statement ()
librdf_storage_context_add_statement, librdf_storage_context_add_statement ()
librdf_storage_context_add_statements, librdf_storage_context_add_statements ()
librdf_storage_context_as_stream, librdf_storage_context_as_stream ()
librdf_storage_context_remove_statement, librdf_storage_context_remove_statement ()
librdf_storage_context_remove_statements, librdf_storage_context_remove_statements ()
librdf_storage_context_serialise, librdf_storage_context_serialise ()
librdf_storage_enumerate, librdf_storage_enumerate ()
librdf_storage_factory, librdf_storage_factory
librdf_storage_find_statements, librdf_storage_find_statements ()
librdf_storage_find_statements_in_context, librdf_storage_find_statements_in_context ()
librdf_storage_find_statements_with_options, librdf_storage_find_statements_with_options ()
librdf_storage_get_arcs, librdf_storage_get_arcs ()
librdf_storage_get_arcs_in, librdf_storage_get_arcs_in ()
librdf_storage_get_arcs_out, librdf_storage_get_arcs_out ()
librdf_storage_get_contexts, librdf_storage_get_contexts ()
librdf_storage_get_feature, librdf_storage_get_feature ()
librdf_storage_get_instance, librdf_storage_get_instance ()
librdf_storage_get_sources, librdf_storage_get_sources ()
librdf_storage_get_targets, librdf_storage_get_targets ()
librdf_storage_get_world, librdf_storage_get_world ()
librdf_storage_has_arc_in, librdf_storage_has_arc_in ()
librdf_storage_has_arc_out, librdf_storage_has_arc_out ()
librdf_storage_instance, librdf_storage_instance
LIBRDF_STORAGE_INTERFACE_VERSION, LIBRDF_STORAGE_INTERFACE_VERSION
LIBRDF_STORAGE_MAX_INTERFACE_VERSION, LIBRDF_STORAGE_MAX_INTERFACE_VERSION
LIBRDF_STORAGE_MIN_INTERFACE_VERSION, LIBRDF_STORAGE_MIN_INTERFACE_VERSION
librdf_storage_module_register_function, librdf_storage_module_register_function ()
librdf_storage_open, librdf_storage_open ()
librdf_storage_query_execute, librdf_storage_query_execute ()
librdf_storage_register_factory, librdf_storage_register_factory ()
librdf_storage_remove_reference, librdf_storage_remove_reference ()
librdf_storage_remove_statement, librdf_storage_remove_statement ()
librdf_storage_serialise, librdf_storage_serialise ()
librdf_storage_set_feature, librdf_storage_set_feature ()
librdf_storage_set_instance, librdf_storage_set_instance ()
librdf_storage_size, librdf_storage_size ()
librdf_storage_supports_query, librdf_storage_supports_query ()
librdf_storage_sync, librdf_storage_sync ()
librdf_storage_transaction_commit, librdf_storage_transaction_commit ()
librdf_storage_transaction_get_handle, librdf_storage_transaction_get_handle ()
librdf_storage_transaction_rollback, librdf_storage_transaction_rollback ()
librdf_storage_transaction_start, librdf_storage_transaction_start ()
librdf_storage_transaction_start_with_handle, librdf_storage_transaction_start_with_handle ()
librdf_stream, librdf_stream
librdf_stream_add_map, librdf_stream_add_map ()
librdf_stream_end, librdf_stream_end ()
librdf_stream_get_context, librdf_stream_get_context ()
librdf_stream_get_context2, librdf_stream_get_context2 ()
librdf_stream_get_method_flags, enum librdf_stream_get_method_flags
librdf_stream_get_object, librdf_stream_get_object ()
librdf_stream_map_free_context_handler, librdf_stream_map_free_context_handler ()
librdf_stream_map_handler, librdf_stream_map_handler ()
librdf_stream_next, librdf_stream_next ()
librdf_stream_print, librdf_stream_print ()
librdf_stream_write, librdf_stream_write ()
LIBRDF_S_Class, LIBRDF_S_Class
LIBRDF_S_Class_URI, LIBRDF_S_Class_URI
LIBRDF_S_comment, LIBRDF_S_comment
LIBRDF_S_comment_URI, LIBRDF_S_comment_URI
LIBRDF_S_ConstraintProperty, LIBRDF_S_ConstraintProperty
LIBRDF_S_ConstraintProperty_URI, LIBRDF_S_ConstraintProperty_URI
LIBRDF_S_ConstraintResource, LIBRDF_S_ConstraintResource
LIBRDF_S_ConstraintResource_URI, LIBRDF_S_ConstraintResource_URI
LIBRDF_S_Container, LIBRDF_S_Container
LIBRDF_S_ContainerMembershipProperty, LIBRDF_S_ContainerMembershipProperty
LIBRDF_S_ContainerMembershipProperty_URI, LIBRDF_S_ContainerMembershipProperty_URI
LIBRDF_S_Container_URI, LIBRDF_S_Container_URI
LIBRDF_S_domain, LIBRDF_S_domain
LIBRDF_S_domain_URI, LIBRDF_S_domain_URI
LIBRDF_S_isDefinedBy, LIBRDF_S_isDefinedBy
LIBRDF_S_isDefinedBy_URI, LIBRDF_S_isDefinedBy_URI
LIBRDF_S_label, LIBRDF_S_label
LIBRDF_S_label_URI, LIBRDF_S_label_URI
LIBRDF_S_Literal, LIBRDF_S_Literal
LIBRDF_S_Literal_URI, LIBRDF_S_Literal_URI
LIBRDF_S_range, LIBRDF_S_range
LIBRDF_S_range_URI, LIBRDF_S_range_URI
LIBRDF_S_Resource, LIBRDF_S_Resource
LIBRDF_S_Resource_URI, LIBRDF_S_Resource_URI
LIBRDF_S_seeAlso, LIBRDF_S_seeAlso
LIBRDF_S_seeAlso_URI, LIBRDF_S_seeAlso_URI
LIBRDF_S_subClassOf, LIBRDF_S_subClassOf
LIBRDF_S_subClassOf_URI, LIBRDF_S_subClassOf_URI
LIBRDF_S_subPropertyOf, LIBRDF_S_subPropertyOf
LIBRDF_S_subPropertyOf_URI, LIBRDF_S_subPropertyOf_URI
librdf_unichar, librdf_unichar
librdf_unicode_char_to_utf8, librdf_unicode_char_to_utf8 ()
librdf_uri, librdf_uri
librdf_uri_as_counted_string, librdf_uri_as_counted_string ()
librdf_uri_as_string, librdf_uri_as_string ()
librdf_uri_compare, librdf_uri_compare ()
librdf_uri_equals, librdf_uri_equals ()
librdf_uri_filter_func, librdf_uri_filter_func ()
librdf_uri_is_file_uri, librdf_uri_is_file_uri ()
librdf_uri_print, librdf_uri_print ()
LIBRDF_URI_RDF_MS, LIBRDF_URI_RDF_MS
LIBRDF_URI_RDF_SCHEMA, LIBRDF_URI_RDF_SCHEMA
librdf_uri_to_counted_string, librdf_uri_to_counted_string ()
librdf_uri_to_filename, librdf_uri_to_filename ()
librdf_uri_to_string, librdf_uri_to_string ()
librdf_utf8_print, librdf_utf8_print ()
librdf_utf8_to_latin1, librdf_utf8_to_latin1 ()
librdf_utf8_to_latin1_2, librdf_utf8_to_latin1_2 ()
librdf_utf8_to_unicode_char, librdf_utf8_to_unicode_char ()
LIBRDF_VERSION, LIBRDF_VERSION
librdf_version_decimal, librdf_version_decimal
LIBRDF_VERSION_MAJOR, LIBRDF_VERSION_MAJOR
librdf_version_major, librdf_version_major
LIBRDF_VERSION_MINOR, LIBRDF_VERSION_MINOR
librdf_version_minor, librdf_version_minor
LIBRDF_VERSION_RELEASE, LIBRDF_VERSION_RELEASE
librdf_version_release, librdf_version_release
LIBRDF_VERSION_STRING, LIBRDF_VERSION_STRING
librdf_version_string, librdf_version_string
librdf_world, librdf_world
LIBRDF_WORLD_FEATURE_GENID_BASE, LIBRDF_WORLD_FEATURE_GENID_BASE
LIBRDF_WORLD_FEATURE_GENID_COUNTER, LIBRDF_WORLD_FEATURE_GENID_COUNTER
librdf_world_get_feature, librdf_world_get_feature ()
librdf_world_get_raptor, librdf_world_get_raptor ()
librdf_world_get_rasqal, librdf_world_get_rasqal ()
librdf_world_init_mutex, librdf_world_init_mutex ()
librdf_world_open, librdf_world_open ()
librdf_world_set_digest, librdf_world_set_digest ()
librdf_world_set_error, librdf_world_set_error ()
librdf_world_set_feature, librdf_world_set_feature ()
librdf_world_set_logger, librdf_world_set_logger ()
librdf_world_set_raptor, librdf_world_set_raptor ()
librdf_world_set_raptor_init_handler, librdf_world_set_raptor_init_handler ()
librdf_world_set_rasqal, librdf_world_set_rasqal ()
librdf_world_set_rasqal_init_handler, librdf_world_set_rasqal_init_handler ()
librdf_world_set_warning, librdf_world_set_warning ()

R

REDLAND_DEPRECATED, REDLAND_DEPRECATED
redland-1.0.17/docs/html/redland-storage-modules.html0000644000175000017500000001062412257576340017453 00000000000000 Storage Modules

Storage Modules

Introduction

Redland includes several modules that implement the storage API and provide a variety of different features and functionality. This document gives the details of what each implementation module provides and the storage options used.

Storage modules:

redland-1.0.17/docs/html/redland-model.html0000644000175000017500000042057212257576340015450 00000000000000 RDF Graph (librdf_model)

RDF Graph (librdf_model)

RDF Graph (librdf_model) — RDF graph (set of triples) API.

Synopsis

typedef             librdf_model;
typedef             librdf_model_factory;
int                 librdf_model_enumerate              (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const char **label);
librdf_model *      librdf_new_model                    (librdf_world *world,
                                                         librdf_storage *storage,
                                                         const char *options_string);
librdf_model *      librdf_new_model_with_options       (librdf_world *world,
                                                         librdf_storage *storage,
                                                         librdf_hash *options);
librdf_model *      librdf_new_model_from_model         (librdf_model *model);
void                librdf_free_model                   (librdf_model *model);
int                 librdf_model_size                   (librdf_model *model);
int                 librdf_model_add                    (librdf_model *model,
                                                         librdf_node *subject,
                                                         librdf_node *predicate,
                                                         librdf_node *object);
int                 librdf_model_add_string_literal_statement
                                                        (librdf_model *model,
                                                         librdf_node *subject,
                                                         librdf_node *predicate,
                                                         const unsigned char *literal,
                                                         const char *xml_language,
                                                         int is_wf_xml);
int                 librdf_model_add_typed_literal_statement
                                                        (librdf_model *model,
                                                         librdf_node *subject,
                                                         librdf_node *predicate,
                                                         const unsigned char *literal,
                                                         const char *xml_language,
                                                         librdf_uri *datatype_uri);
int                 librdf_model_add_statement          (librdf_model *model,
                                                         librdf_statement *statement);
int                 librdf_model_add_statements         (librdf_model *model,
                                                         librdf_stream *statement_stream);
int                 librdf_model_remove_statement       (librdf_model *model,
                                                         librdf_statement *statement);
int                 librdf_model_contains_statement     (librdf_model *model,
                                                         librdf_statement *statement);
int                 librdf_model_has_arc_in             (librdf_model *model,
                                                         librdf_node *node,
                                                         librdf_node *property);
int                 librdf_model_has_arc_out            (librdf_model *model,
                                                         librdf_node *node,
                                                         librdf_node *property);
librdf_stream *     librdf_model_as_stream              (librdf_model *model);
librdf_stream *     librdf_model_serialise              (librdf_model *model);
librdf_stream *     librdf_model_find_statements        (librdf_model *model,
                                                         librdf_statement *statement);
#define             LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL
librdf_stream *     librdf_model_find_statements_with_options
                                                        (librdf_model *model,
                                                         librdf_statement *statement,
                                                         librdf_node *context_node,
                                                         librdf_hash *options);
librdf_iterator *   librdf_model_get_sources            (librdf_model *model,
                                                         librdf_node *arc,
                                                         librdf_node *target);
librdf_iterator *   librdf_model_get_arcs               (librdf_model *model,
                                                         librdf_node *source,
                                                         librdf_node *target);
librdf_iterator *   librdf_model_get_targets            (librdf_model *model,
                                                         librdf_node *source,
                                                         librdf_node *arc);
librdf_node *       librdf_model_get_source             (librdf_model *model,
                                                         librdf_node *arc,
                                                         librdf_node *target);
librdf_node *       librdf_model_get_arc                (librdf_model *model,
                                                         librdf_node *source,
                                                         librdf_node *target);
librdf_node *       librdf_model_get_target             (librdf_model *model,
                                                         librdf_node *source,
                                                         librdf_node *arc);
librdf_iterator *   librdf_model_get_arcs_in            (librdf_model *model,
                                                         librdf_node *node);
librdf_iterator *   librdf_model_get_arcs_out           (librdf_model *model,
                                                         librdf_node *node);
int                 librdf_model_add_submodel           (librdf_model *model,
                                                         librdf_model *sub_model);
int                 librdf_model_remove_submodel        (librdf_model *model,
                                                         librdf_model *sub_model);
void                librdf_model_print                  (librdf_model *model,
                                                         FILE *fh);
int                 librdf_model_context_add_statement  (librdf_model *model,
                                                         librdf_node *context,
                                                         librdf_statement *statement);
int                 librdf_model_context_add_statements (librdf_model *model,
                                                         librdf_node *context,
                                                         librdf_stream *stream);
int                 librdf_model_context_remove_statement
                                                        (librdf_model *model,
                                                         librdf_node *context,
                                                         librdf_statement *statement);
int                 librdf_model_context_remove_statements
                                                        (librdf_model *model,
                                                         librdf_node *context);
librdf_stream *     librdf_model_context_as_stream      (librdf_model *model,
                                                         librdf_node *context);
librdf_stream *     librdf_model_context_serialize      (librdf_model *model,
                                                         librdf_node *context);
int                 librdf_model_contains_context       (librdf_model *model,
                                                         librdf_node *context);
int                 librdf_model_supports_contexts      (librdf_model *model);
librdf_query_results * librdf_model_query_execute       (librdf_model *model,
                                                         librdf_query *query);
int                 librdf_model_sync                   (librdf_model *model);
librdf_storage *    librdf_model_get_storage            (librdf_model *model);
int                 librdf_model_load                   (librdf_model *model,
                                                         librdf_uri *uri,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *type_uri);
unsigned char *     librdf_model_to_counted_string      (librdf_model *model,
                                                         librdf_uri *uri,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *type_uri,
                                                         size_t *string_length_p);
unsigned char *     librdf_model_to_string              (librdf_model *model,
                                                         librdf_uri *uri,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *type_uri);
librdf_stream *     librdf_model_find_statements_in_context
                                                        (librdf_model *model,
                                                         librdf_statement *statement,
                                                         librdf_node *context_node);
librdf_iterator *   librdf_model_get_contexts           (librdf_model *model);
#define             LIBRDF_MODEL_FEATURE_CONTEXTS
librdf_node *       librdf_model_get_feature            (librdf_model *model,
                                                         librdf_uri *feature);
int                 librdf_model_set_feature            (librdf_model *model,
                                                         librdf_uri *feature,
                                                         librdf_node *value);
int                 librdf_model_transaction_commit     (librdf_model *model);
void *              librdf_model_transaction_get_handle (librdf_model *model);
int                 librdf_model_transaction_rollback   (librdf_model *model);
int                 librdf_model_transaction_start      (librdf_model *model);
int                 librdf_model_transaction_start_with_handle
                                                        (librdf_model *model,
                                                         void *handle);
int                 librdf_model_write                  (librdf_model *model,
                                                         raptor_iostream *iostr);

Description

The main user API class for Redland, providing access to the RDF graph and the triples in it (librdf_statement), storage, parsing, serializing and querying.

Details

librdf_model

typedef struct librdf_model_s librdf_model;

Redland model class.


librdf_model_factory

typedef struct librdf_model_factory_s librdf_model_factory;

Redland model factory class.


librdf_model_enumerate ()

int                 librdf_model_enumerate              (librdf_world *world,
                                                         const unsigned int counter,
                                                         const char **name,
                                                         const char **label);

Get information on models.

world :

redland world object

counter :

index into the list of models

name :

pointer to store the name of the model (or NULL)

label :

pointer to store syntax readable label (or NULL)

Returns :

non 0 on failure of if counter is out of range

librdf_new_model ()

librdf_model *      librdf_new_model                    (librdf_world *world,
                                                         librdf_storage *storage,
                                                         const char *options_string);

Constructor - create a new storage librdf_model object.

The options are encoded as described in librdf_hash_from_string() and can be NULL if none are required.

world :

redland world object

storage :

librdf_storage to use

options_string :

options to initialise model

Returns :

a new librdf_model object or NULL on failure

librdf_new_model_with_options ()

librdf_model *      librdf_new_model_with_options       (librdf_world *world,
                                                         librdf_storage *storage,
                                                         librdf_hash *options);

Constructor - Create a new librdf_model with storage.

Options are presently not used.

world :

redland world object

storage :

librdf_storage storage to use

options :

librdf_hash of options to use

Returns :

a new librdf_model object or NULL on failure

librdf_new_model_from_model ()

librdf_model *      librdf_new_model_from_model         (librdf_model *model);

Copy constructor - create a new librdf_model from an existing one.

Creates a new model as a copy of the existing model in the same storage context.

model :

the existing librdf_model

Returns :

a new librdf_model or NULL on failure

librdf_free_model ()

void                librdf_free_model                   (librdf_model *model);

Destructor - Destroy a librdf_model object.

model :

librdf_model model to destroy

librdf_model_size ()

int                 librdf_model_size                   (librdf_model *model);

Get the number of statements in the model.

WARNING: Not all underlying stores can return the size of the graph In which case the return value will be negative.

model :

librdf_model object

Returns :

the number of statements or <0 if not possible

librdf_model_add ()

int                 librdf_model_add                    (librdf_model *model,
                                                         librdf_node *subject,
                                                         librdf_node *predicate,
                                                         librdf_node *object);

Create and add a new statement about a resource to the model.

After this method, the librdf_node objects become owned by the model. All of subject, predicate and object must be non-NULL.

model :

model object

subject :

librdf_node of subject

predicate :

librdf_node of predicate

object :

librdf_node of object (literal or resource)

Returns :

non 0 on failure

librdf_model_add_string_literal_statement ()

int                 librdf_model_add_string_literal_statement
                                                        (librdf_model *model,
                                                         librdf_node *subject,
                                                         librdf_node *predicate,
                                                         const unsigned char *literal,
                                                         const char *xml_language,
                                                         int is_wf_xml);

Create and add a new statement about a literal to the model.

The language can be set to NULL if not used. All of subject, predicate and literal must be non-NULL.

0.9.12: xml_space argument deleted

model :

model object

subject :

librdf_node of subject

predicate :

librdf_node of predicate

literal :

string literal conten

xml_language :

language of literal

is_wf_xml :

literal is XML

Returns :

non 0 on failure

librdf_model_add_typed_literal_statement ()

int                 librdf_model_add_typed_literal_statement
                                                        (librdf_model *model,
                                                         librdf_node *subject,
                                                         librdf_node *predicate,
                                                         const unsigned char *literal,
                                                         const char *xml_language,
                                                         librdf_uri *datatype_uri);

Create and add a new statement about a typed literal to the model.

After this method, the librdf_node subject and predicate become owned by the model.

The language can be set to NULL if not used. All of subject, predicate and literal must be non-NULL.

model :

model object

subject :

librdf_node of subject

predicate :

librdf_node of predicate

literal :

string literal content

xml_language :

language of literal

datatype_uri :

datatype librdf_uri

Returns :

non 0 on failure

librdf_model_add_statement ()

int                 librdf_model_add_statement          (librdf_model *model,
                                                         librdf_statement *statement);

Add a statement to the model.

The passed-in statement is copied when added to the model, not shared with the model. It must be a complete statement - all of subject, predicate, object parts must be present.

Only statements that are legal RDF can be added: URI or blank subject, URI predicate and URI or blank or literal object (i.e. anything).

If the statement already exists in the model, it is not added. Duplicate statements can be added when used with Redland Contexts such as with librdf_model_context_add_statement

model :

model object

statement :

statement object

Returns :

non 0 on failure

librdf_model_add_statements ()

int                 librdf_model_add_statements         (librdf_model *model,
                                                         librdf_stream *statement_stream);

Add a stream of statements to the model.

If any of the statements are illegal RDF statements they will be skipped and not added. See librdf_model_add_statement for the detail.

If any of the statements already exists in the store, they are not added unless Redland contexts are being used. See also librdf_model_context_add_statements

model :

model object

statement_stream :

stream of statements to use

Returns :

non 0 on failure

librdf_model_remove_statement ()

int                 librdf_model_remove_statement       (librdf_model *model,
                                                         librdf_statement *statement);

Remove a known statement from the model.

It must be a complete statement - all of subject, predicate, object parts must be present and a legal RDF triple.

model :

the model object

statement :

the statement

Returns :

non 0 on failure

librdf_model_contains_statement ()

int                 librdf_model_contains_statement     (librdf_model *model,
                                                         librdf_statement *statement);

Check for a statement in the model.

It must be a complete statement - all of subject, predicate, object parts must be present and a legal RDF triple. Use librdf_model_find_statements to search for partial statement matches.

WARNING: librdf_model_contains_statement may not work correctly with stores using contexts. In this case, a search using librdf_model_find_statements for a non-empty list will return the correct result.

model :

the model object

statement :

the statement

Returns :

non 0 if the model contains the statement (>0 if the statement is illegal)

librdf_model_has_arc_in ()

int                 librdf_model_has_arc_in             (librdf_model *model,
                                                         librdf_node *node,
                                                         librdf_node *property);

Check if a node has a given property pointing to it.

model :

librdf_model object

node :

librdf_node resource node

property :

librdf_node property node

Returns :

non 0 if arc property does point to the resource node

librdf_model_has_arc_out ()

int                 librdf_model_has_arc_out            (librdf_model *model,
                                                         librdf_node *node,
                                                         librdf_node *property);

Check if a node has a given property pointing from it.

model :

librdf_model object

node :

librdf_node resource node

property :

librdf_node property node

Returns :

non 0 if arc property does point from the resource node

librdf_model_as_stream ()

librdf_stream *     librdf_model_as_stream              (librdf_model *model);

List the model contents as a stream of statements.

model :

the model object

Returns :

a librdf_stream or NULL on failure

librdf_model_serialise ()

librdf_stream *     librdf_model_serialise              (librdf_model *model);

Serialise the entire model as a stream (DEPRECATED).

DEPRECATED to reduce confusion with the librdf_serializer class. Please use librdf_model_as_stream.

model :

the model object

Returns :

a librdf_stream or NULL on failure

librdf_model_find_statements ()

librdf_stream *     librdf_model_find_statements        (librdf_model *model,
                                                         librdf_statement *statement);

Find matching statements in the model.

The partial statement is a statement where the subject, predicate and/or object can take the value NULL which indicates a match with any value in the model

model :

the model object

statement :

the partial statement to match

Returns :

a librdf_stream of statements (can be empty) or NULL on failure.

LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL

#define LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL "http://feature.librdf.org/model-find-match-substring-literal"

Model find statement option.

If set, the find statement uses substring matching.


librdf_model_find_statements_with_options ()

librdf_stream *     librdf_model_find_statements_with_options
                                                        (librdf_model *model,
                                                         librdf_statement *statement,
                                                         librdf_node *context_node,
                                                         librdf_hash *options);

Search the model for matching statements with match options.

Searches the model for a (partial) statement as described in librdf_statement_match() and returns a librdf_stream of matching librdf_statement objects.

If options is given then the match is made according to the given options. If options is NULL, this is equivalent to librdf_model_find_statements_in_context.

model :

librdf_model object

statement :

librdf_statement partial statement to find

context_node :

librdf_node context node or NULL.

options :

librdf_hash of matching options or NULL

Returns :

librdf_stream of matching statements (may be empty) or NULL on failure

librdf_model_get_sources ()

librdf_iterator *   librdf_model_get_sources            (librdf_model *model,
                                                         librdf_node *arc,
                                                         librdf_node *target);

Return the sources (subjects) of arc in an RDF graph given arc (predicate) and target (object).

Searches the model for arcs matching the given arc and target and returns a list of the source librdf_node objects as an iterator

model :

librdf_model object

arc :

librdf_node arc

target :

librdf_node target

Returns :

librdf_iterator of librdf_node objects (may be empty) or NULL on failure

librdf_model_get_arcs ()

librdf_iterator *   librdf_model_get_arcs               (librdf_model *model,
                                                         librdf_node *source,
                                                         librdf_node *target);

Return the arcs (predicates) of an arc in an RDF graph given source (subject) and target (object).

Searches the model for arcs matching the given source and target and returns a list of the arc librdf_node objects as an iterator

model :

librdf_model object

source :

librdf_node source

target :

librdf_node target

Returns :

librdf_iterator of librdf_node objects (may be empty) or NULL on failure

librdf_model_get_targets ()

librdf_iterator *   librdf_model_get_targets            (librdf_model *model,
                                                         librdf_node *source,
                                                         librdf_node *arc);

Return the targets (objects) of an arc in an RDF graph given source (subject) and arc (predicate).

Searches the model for targets matching the given source and arc and returns a list of the source librdf_node objects as an iterator

model :

librdf_model object

source :

librdf_node source

arc :

librdf_node arc

Returns :

librdf_iterator of librdf_node objects (may be empty) or NULL on failure

librdf_model_get_source ()

librdf_node *       librdf_model_get_source             (librdf_model *model,
                                                         librdf_node *arc,
                                                         librdf_node *target);

Return one source (subject) of arc in an RDF graph given arc (predicate) and target (object).

Searches the model for arcs matching the given arc and target and returns one librdf_node object

model :

librdf_model object

arc :

librdf_node arc

target :

librdf_node target

Returns :

a new librdf_node object or NULL on failure

librdf_model_get_arc ()

librdf_node *       librdf_model_get_arc                (librdf_model *model,
                                                         librdf_node *source,
                                                         librdf_node *target);

Return one arc (predicate) of an arc in an RDF graph given source (subject) and target (object).

Searches the model for arcs matching the given source and target and returns one librdf_node object

model :

librdf_model object

source :

librdf_node source

target :

librdf_node target

Returns :

a new librdf_node object or NULL on failure

librdf_model_get_target ()

librdf_node *       librdf_model_get_target             (librdf_model *model,
                                                         librdf_node *source,
                                                         librdf_node *arc);

Return one target (object) of an arc in an RDF graph given source (subject) and arc (predicate).

Searches the model for targets matching the given source and arc and returns one librdf_node object

model :

librdf_model object

source :

librdf_node source

arc :

librdf_node arc

Returns :

a new librdf_node object or NULL on failure

librdf_model_get_arcs_in ()

librdf_iterator *   librdf_model_get_arcs_in            (librdf_model *model,
                                                         librdf_node *node);

Return the properties pointing to the given resource.

model :

librdf_model object

node :

librdf_node resource node

Returns :

librdf_iterator of librdf_node objects (may be empty) or NULL on failure

librdf_model_get_arcs_out ()

librdf_iterator *   librdf_model_get_arcs_out           (librdf_model *model,
                                                         librdf_node *node);

Return the properties pointing from the given resource.

model :

librdf_model object

node :

librdf_node resource node

Returns :

librdf_iterator of librdf_node objects (may be empty) or NULL on failure

librdf_model_add_submodel ()

int                 librdf_model_add_submodel           (librdf_model *model,
                                                         librdf_model *sub_model);

Add a sub-model to the model.

FIXME: Not tested

model :

the model object

sub_model :

the sub model to add

Returns :

non 0 on failure

librdf_model_remove_submodel ()

int                 librdf_model_remove_submodel        (librdf_model *model,
                                                         librdf_model *sub_model);

Remove a sub-model from the model.

FIXME: Not tested

model :

the model object

sub_model :

the sub model to remove

Returns :

non 0 on failure

librdf_model_print ()

void                librdf_model_print                  (librdf_model *model,
                                                         FILE *fh);

Print the model.

This method is for debugging and the format of the output should not be relied on.

Deprecated: Use librdf_model_write() to write to raptor_iostream which can be made to write to a string. Use a librdf_serializer to write proper syntax formats.

model :

the model object

fh :

the FILE stream to print to

librdf_model_context_add_statement ()

int                 librdf_model_context_add_statement  (librdf_model *model,
                                                         librdf_node *context,
                                                         librdf_statement *statement);

Add a statement to a model with a context.

It must be a complete statement - all of subject, predicate, object parts must be present.

If context is NULL, this is equivalent to librdf_model_add_statement

model :

librdf_model object

context :

librdf_node context

statement :

librdf_statement statement object

Returns :

Non 0 on failure

librdf_model_context_add_statements ()

int                 librdf_model_context_add_statements (librdf_model *model,
                                                         librdf_node *context,
                                                         librdf_stream *stream);

Add statements to a model with a context.

If context is NULL, this is equivalent to librdf_model_add_statements

model :

librdf_model object

context :

librdf_node context

stream :

librdf_stream stream object

Returns :

Non 0 on failure

librdf_model_context_remove_statement ()

int                 librdf_model_context_remove_statement
                                                        (librdf_model *model,
                                                         librdf_node *context,
                                                         librdf_statement *statement);

Remove a statement from a model in a context.

It must be a complete statement - all of subject, predicate, object parts must be present.

If context is NULL, this is equivalent to librdf_model_remove_statement

model :

librdf_model object

context :

librdf_node context

statement :

librdf_statement statement

Returns :

Non 0 on failure

librdf_model_context_remove_statements ()

int                 librdf_model_context_remove_statements
                                                        (librdf_model *model,
                                                         librdf_node *context);

Remove statements from a model with the given context.

model :

librdf_model object

context :

librdf_node context

Returns :

Non 0 on failure

librdf_model_context_as_stream ()

librdf_stream *     librdf_model_context_as_stream      (librdf_model *model,
                                                         librdf_node *context);

List all statements in a model context.

model :

librdf_model object

context :

librdf_node context

Returns :

librdf_stream of statements or NULL on failure

librdf_model_context_serialize ()

librdf_stream *     librdf_model_context_serialize      (librdf_model *model,
                                                         librdf_node *context);

List all statements in a model context.

DEPRECATED to reduce confusion with the librdf_serializer class. Please use librdf_model_context_as_stream.

model :

librdf_model object

context :

librdf_node context

Returns :

librdf_stream of statements or NULL on failure

librdf_model_contains_context ()

int                 librdf_model_contains_context       (librdf_model *model,
                                                         librdf_node *context);

Check for a context in the model.

model :

the model object

context :

the contest

Returns :

non 0 if the model contains the context node

librdf_model_supports_contexts ()

int                 librdf_model_supports_contexts      (librdf_model *model);

Check if this model supports contexts

model :

the model object

Returns :

non-0 if contexts are supported

librdf_model_query_execute ()

librdf_query_results * librdf_model_query_execute       (librdf_model *model,
                                                         librdf_query *query);

Execute a query against the model.

Run the given query against the model and return a librdf_stream of matching librdf_statement objects

model :

librdf_model object

query :

librdf_query object

Returns :

librdf_query_results or NULL on failure

librdf_model_sync ()

int                 librdf_model_sync                   (librdf_model *model);

Synchronise the model to the model implementation.

model :

librdf_model object

Returns :

non-0 on failure

librdf_model_get_storage ()

librdf_storage *    librdf_model_get_storage            (librdf_model *model);

Return the storage of this model.

Note: this can only return one storage, so model implementations that have multiple librdf_storage internally may chose not to implement this.

model :

librdf_model object

Returns :

librdf_storage or NULL if this has no store

librdf_model_load ()

int                 librdf_model_load                   (librdf_model *model,
                                                         librdf_uri *uri,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *type_uri);

Load content from a URI into the model.

If the name field is NULL, the library will try to guess the parser to use from the uri, mime_type and type_uri fields. This is done via the raptor_guess_parser_name function.

model :

librdf_model object

uri :

the URI to read the content

name :

the name of the parser (or NULL)

mime_type :

the MIME type of the syntax (NULL if not used)

type_uri :

URI identifying the syntax (NULL if not used)

Returns :

non 0 on failure

librdf_model_to_counted_string ()

unsigned char *     librdf_model_to_counted_string      (librdf_model *model,
                                                         librdf_uri *uri,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *type_uri,
                                                         size_t *string_length_p);

Write serialized model to a string.

If the name field is NULL, the default serializer will be used.

Note: the returned string must be freed by the caller using librdf_free_memory().

model :

librdf_model object

uri :

base URI to use in serializing (or NULL if not used)

name :

the name of the serializer (or NULL for default)

mime_type :

the MIME type of the syntax (NULL if not used)

type_uri :

URI identifying the syntax (NULL if not used)

string_length_p :

pointer to location to store string length (or NULL)

Returns :

new string or NULL on failure

librdf_model_to_string ()

unsigned char *     librdf_model_to_string              (librdf_model *model,
                                                         librdf_uri *uri,
                                                         const char *name,
                                                         const char *mime_type,
                                                         librdf_uri *type_uri);

Write serialized model to a string.

If the name field is NULL, the default serializer will be used.

Note: the returned string must be freed by the caller.

model :

librdf_model object

uri :

base URI to use in serializing (or NULL if not used)

name :

the name of the serializer (or NULL for default)

mime_type :

the MIME type of the syntax (NULL if not used)

type_uri :

URI identifying the syntax (NULL if not used)

Returns :

new string or NULL on failure

librdf_model_find_statements_in_context ()

librdf_stream *     librdf_model_find_statements_in_context
                                                        (librdf_model *model,
                                                         librdf_statement *statement,
                                                         librdf_node *context_node);

Search the model for matching statements in a given context.

Searches the model for a (partial) statement as described in librdf_statement_match() in the given context and returns a librdf_stream of matching librdf_statement objects. If context is NULL, this is equivalent to librdf_model_find_statements.

model :

librdf_model object

statement :

librdf_statement partial statement to find

context_node :

context librdf_node (or NULL)

Returns :

librdf_stream of matching statements (may be empty) or NULL on failure

librdf_model_get_contexts ()

librdf_iterator *   librdf_model_get_contexts           (librdf_model *model);

Return the list of contexts in the graph.

Returns an iterator of librdf_node context nodes for each context in the graph.

model :

librdf_model object

Returns :

librdf_iterator of context nodes or NULL on failure or if contexts are not supported

LIBRDF_MODEL_FEATURE_CONTEXTS

#define LIBRDF_MODEL_FEATURE_CONTEXTS "http://feature.librdf.org/model-contexts"

Model feature contexts.

If set, the model has redland contexts.


librdf_model_get_feature ()

librdf_node *       librdf_model_get_feature            (librdf_model *model,
                                                         librdf_uri *feature);

Get the value of a graph feature .

model :

librdf_model object

feature :

librdf_uri feature property

Returns :

new librdf_node feature value or NULL if no such feature exists or the value is empty.

librdf_model_set_feature ()

int                 librdf_model_set_feature            (librdf_model *model,
                                                         librdf_uri *feature,
                                                         librdf_node *value);

Set the value of a graph feature.

model :

librdf_model object

feature :

librdf_uri feature property

value :

librdf_node feature property value

Returns :

non 0 on failure (negative if no such feature)

librdf_model_transaction_commit ()

int                 librdf_model_transaction_commit     (librdf_model *model);

Commit a transaction.

model :

the model object

Returns :

non-0 on failure

librdf_model_transaction_get_handle ()

void *              librdf_model_transaction_get_handle (librdf_model *model);

Get the current transaction handle.

model :

the model object

Returns :

non-0 on failure

librdf_model_transaction_rollback ()

int                 librdf_model_transaction_rollback   (librdf_model *model);

Rollback a transaction.

model :

the model object

Returns :

non-0 on failure

librdf_model_transaction_start ()

int                 librdf_model_transaction_start      (librdf_model *model);

Start a transaction

model :

the model object

Returns :

non-0 on failure

librdf_model_transaction_start_with_handle ()

int                 librdf_model_transaction_start_with_handle
                                                        (librdf_model *model,
                                                         void *handle);

Start a transaction using an existing external transaction object.

model :

the model object

handle :

the transaction object

Returns :

non-0 on failure

librdf_model_write ()

int                 librdf_model_write                  (librdf_model *model,
                                                         raptor_iostream *iostr);

Write a model to an iostream in a debug format.

This method is for debugging and the format of the output should not be relied on. In particular, when contexts are used the result may be 4 nodes.

model :

the model object

iostr :

the iostream to write to

Returns :

non-0 on failure
redland-1.0.17/docs/html/index.sgml0000644000175000017500000020040012257576340014030 00000000000000 redland-1.0.17/docs/html/redland-changes-1-0-12-to-1-0-13.html0000644000175000017500000001307712257576340017625 00000000000000 Changes between Redland librdf 1.0.12 and 1.0.13

Changes between Redland librdf 1.0.12 and 1.0.13

New functions, types and enums

Functions

Changed functions and types

1.0.12 type 1.0.13 type Notes
librdf_node librdf_node Now a typedef for raptor_term
librdf_statement librdf_statement Now a typedef for raptor_statement
librdf_uri librdf_uri Now a typedef for raptor_uri
redland-1.0.17/docs/html/redland-iterator.html0000644000175000017500000007352312257576340016201 00000000000000 Iterator

Iterator

Iterator — Iterate a sequence of objects across some other object.

Synopsis

typedef             librdf_iterator;
enum                librdf_iterator_get_method_flags;
void *              (*librdf_iterator_map_handler)      (librdf_iterator *iterator,
                                                         void *map_context,
                                                         void *item);
void                (*librdf_iterator_map_free_context_handler)
                                                        (void *map_context);
librdf_iterator *   librdf_new_iterator                 (librdf_world *world,
                                                         void *context,
                                                         int (*is_end_method) (void*),
                                                         int (*next_method) (void*),
                                                         void* (*get_method) (void*, int),
                                                         void (*finished_method) (void*));
void                librdf_free_iterator                (librdf_iterator *iterator);
int                 librdf_iterator_end                 (librdf_iterator *iterator);
int                 librdf_iterator_have_elements       (librdf_iterator *iterator);
int                 librdf_iterator_next                (librdf_iterator *iterator);
void *              librdf_iterator_get_object          (librdf_iterator *iterator);
void *              librdf_iterator_get_context         (librdf_iterator *iterator);
void *              librdf_iterator_get_key             (librdf_iterator *iterator);
void *              librdf_iterator_get_value           (librdf_iterator *iterator);
int                 librdf_iterator_add_map             (librdf_iterator *iterator,
                                                         librdf_iterator_map_handler map_function,
                                                         librdf_iterator_map_free_context_handler free_context,
                                                         void *map_context);
librdf_iterator *   librdf_new_empty_iterator           (librdf_world *world);

Description

Provides a way to operate across a sequence of objects that are generated one-by-one on demand. The returned objects can be of any type but the main public methods are on the librdf_model classs and return sequence of librdf_node objects such as librdf_model_get_sources().

Details

librdf_iterator

typedef struct librdf_iterator_s librdf_iterator;

Redland iterator class.


enum librdf_iterator_get_method_flags

typedef enum {
  LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT  = 0,
  LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT = 1,
  LIBRDF_ITERATOR_GET_METHOD_GET_KEY     = 2,
  LIBRDF_ITERATOR_GET_METHOD_GET_VALUE   = 3
} librdf_iterator_get_method_flags;

Flags for librdf_new_iterator() get_method function pointer.

LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT

get object from iterator - implementing librdf_iterator_get_context()

LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT

get context from iterator - implementing librdf_iterator_get_object()

LIBRDF_ITERATOR_GET_METHOD_GET_KEY

get iterator key object from iterator - implementing librdf_iterator_get_key()

LIBRDF_ITERATOR_GET_METHOD_GET_VALUE

get iterator value from iterator - implementing librdf_iterator_get_value()

librdf_iterator_map_handler ()

void *              (*librdf_iterator_map_handler)      (librdf_iterator *iterator,
                                                         void *map_context,
                                                         void *item);

Map function for a librdf_iterator map operation.

See librdf_iterator_add_map().

iterator :

Iterator that this map is operating over.

map_context :

Map data context pointer.

item :

Pointer to the current item in the iteration.

Returns :

item in keep the iteration or NULL to remove it

librdf_iterator_map_free_context_handler ()

void                (*librdf_iterator_map_free_context_handler)
                                                        (void *map_context);

Free handler function for a librdf_iterator map operation.

See librdf_iterator_add_map().

map_context :

Map data context pointer.

librdf_new_iterator ()

librdf_iterator *   librdf_new_iterator                 (librdf_world *world,
                                                         void *context,
                                                         int (*is_end_method) (void*),
                                                         int (*next_method) (void*),
                                                         void* (*get_method) (void*, int),
                                                         void (*finished_method) (void*));

Constructor - create a new librdf_iterator object. The iterator object takes ownership of context and frees it with finished_method. The finished method is not called if librdf_new_iterator fails and returns NULL.

world :

redland world object

context :

context to pass to the iterator functions

is_end_method :

function to call to see if the iteration has ended

next_method :

function to get the next element

get_method :

function to get the next element

finished_method :

function to destroy the iterator context (or NULL if not needed)

Returns :

a new librdf_iterator object or NULL on failure

librdf_free_iterator ()

void                librdf_free_iterator                (librdf_iterator *iterator);

Destructor - destroy a librdf_iterator object.

iterator :

the librdf_iterator object

librdf_iterator_end ()

int                 librdf_iterator_end                 (librdf_iterator *iterator);

Test if the iterator has finished.

iterator :

the librdf_iterator object

Returns :

non 0 if the iterator has finished

librdf_iterator_have_elements ()

int                 librdf_iterator_have_elements       (librdf_iterator *iterator);

Test if the iterator has finished.

DEPRECATED - use !librdf_iterator_end(iterator)

iterator :

the librdf_iterator object

Returns :

0 if the iterator has finished

librdf_iterator_next ()

int                 librdf_iterator_next                (librdf_iterator *iterator);

Move to the next iterator element.

iterator :

the librdf_iterator object

Returns :

non 0 if the iterator has finished

librdf_iterator_get_object ()

void *              librdf_iterator_get_object          (librdf_iterator *iterator);

Get the current object from the iterator.

This method returns a SHARED pointer to the current iterator object which should be copied by the caller to preserve it if the iterator is moved on librdf_iterator_next or if it should last after the iterator is closed.

iterator :

the librdf_iterator object

Returns :

The next element or NULL if the iterator has finished.

librdf_iterator_get_context ()

void *              librdf_iterator_get_context         (librdf_iterator *iterator);

Get the context of the current object on the iterator.

This method returns a SHARED pointer to the current context node object which should be copied by the caller to preserve it if the iterator is moved on librdf_iterator_next or if it should last after the iterator is closed.

iterator :

the librdf_iterator object

Returns :

The context (can be NULL) or NULL if the iterator has finished.

librdf_iterator_get_key ()

void *              librdf_iterator_get_key             (librdf_iterator *iterator);

Get the key of the current object on the iterator.

iterator :

the librdf_iterator object

Returns :

The context or NULL if the iterator has finished.

librdf_iterator_get_value ()

void *              librdf_iterator_get_value           (librdf_iterator *iterator);

Get the value of the current object on the iterator.

iterator :

the librdf_iterator object

Returns :

The context or NULL if the iterator has finished.

librdf_iterator_add_map ()

int                 librdf_iterator_add_map             (librdf_iterator *iterator,
                                                         librdf_iterator_map_handler map_function,
                                                         librdf_iterator_map_free_context_handler free_context,
                                                         void *map_context);

Add a librdf_iterator mapping function.

Adds an iterator mapping function which operates over the iterator to select which elements are returned; it will be applied as soon as this method is called.

Several mapping functions can be added and they are applied in the order given

The mapping function should return non 0 to allow the element to be returned.

iterator :

the iterator

map_function :

the function to operate

free_context :

the function to use to free the context (or NULL)

map_context :

the context to pass to the map function

Returns :

Non 0 on failure

librdf_new_empty_iterator ()

librdf_iterator *   librdf_new_empty_iterator           (librdf_world *world);

Constructor - create a new librdf_iterator with no content.

world :

redland world object

Returns :

a new librdf_iterator object or NULL on failure
redland-1.0.17/docs/html/redland-changes.html0000644000175000017500000000775012257576340015757 00000000000000 API Changes

API Changes

This chapter describes the API changes for Redland librdf.

Introduction

The following sections describe the changes in the API between versions including additions, deletions, renames (retaining the same number of parameters, types and return value type) and more complex changes to functions, types and enums.

redland-1.0.17/docs/html/redland-unicode.html0000644000175000017500000004657212257576340016002 00000000000000 Unicode

Unicode

Unicode — Unicode utility functions.

Synopsis

typedef             librdf_unichar;
int                 librdf_unicode_char_to_utf8         (librdf_unichar c,
                                                         unsigned char *output,
                                                         int length);
int                 librdf_utf8_to_unicode_char         (librdf_unichar *output,
                                                         const unsigned char *input,
                                                         int length);
unsigned char *     librdf_utf8_to_latin1               (const unsigned char *input,
                                                         int length,
                                                         int *output_length);
unsigned char *     librdf_utf8_to_latin1_2             (const unsigned char *input,
                                                         size_t length,
                                                         unsigned char discard,
                                                         size_t *output_length);
unsigned char *     librdf_latin1_to_utf8               (const unsigned char *input,
                                                         int length,
                                                         int *output_length);
unsigned char *     librdf_latin1_to_utf8_2             (const unsigned char *input,
                                                         size_t length,
                                                         size_t *output_length);
void                librdf_utf8_print                   (const unsigned char *input,
                                                         int length,
                                                         FILE *stream);

Description

Utility functions to convert between UTF-8, full Unicode and Latin-1. Redland uses UTF-8 for all string formats (except where noted) but these may need to be converted to other Unicode encodings or downgraded with loss to Latin-1.

Details

librdf_unichar

typedef raptor_unichar librdf_unichar;

Unicode codepoint.


librdf_unicode_char_to_utf8 ()

int                 librdf_unicode_char_to_utf8         (librdf_unichar c,
                                                         unsigned char *output,
                                                         int length);

Convert a Unicode character to UTF-8 encoding.

deprecated: Use raptor_unicode_utf8_string_put_char() noting that the length argument is a size_t.

If buffer is NULL, then will calculate the length rather than perform it. This can be used by the caller to allocate space and then re-call this function with the new buffer.

c :

Unicode character

output :

UTF-8 string buffer or NULL

length :

buffer size (will be truncated to size_t)

Returns :

bytes written to output buffer or <0 on failure

librdf_utf8_to_unicode_char ()

int                 librdf_utf8_to_unicode_char         (librdf_unichar *output,
                                                         const unsigned char *input,
                                                         int length);

Convert an UTF-8 encoded buffer to a Unicode character.

deprecated: Use raptor_unicode_utf8_string_get_char() noting that the arg order has changed to input, length (a size_t), output.

If output is NULL, then will calculate the number of bytes that will be used from the input buffer and not perform the conversion.

output :

Pointer to the Unicode character or NULL

input :

UTF-8 string buffer

length :

buffer size (will be truncated to size_t)

Returns :

bytes used from input buffer or <0 on failure

librdf_utf8_to_latin1 ()

unsigned char *     librdf_utf8_to_latin1               (const unsigned char *input,
                                                         int length,
                                                         int *output_length);

Convert a UTF-8 string to ISO Latin-1.

Converts the given UTF-8 string to the ISO Latin-1 subset of Unicode (characters 0x00-0xff), discarding any out of range characters.

deprecated for librdf_utf8_to_latin1_2() that takes and returns size_t sizes and allows replacing of out of range characters.

If output_length is not NULL, the returned string length will be stored there.

input :

UTF-8 string buffer

length :

buffer size (will be truncated to size_t)

output_length :

Pointer to variable to store resulting string length or NULL

Returns :

pointer to new ISO Latin-1 string or NULL on failure

librdf_utf8_to_latin1_2 ()

unsigned char *     librdf_utf8_to_latin1_2             (const unsigned char *input,
                                                         size_t length,
                                                         unsigned char discard,
                                                         size_t *output_length);

Convert a UTF-8 string to ISO Latin-1.

Converts the given UTF-8 string to the ISO Latin-1 subset of Unicode (characters 0x00-0xff). Out of range characters are replaced with discard unless it is NUL (\0).

If output_length is not NULL, the returned string length will be stored there.

input :

UTF-8 string buffer

length :

buffer size

discard :

character to use to replace out of range characters or NUL (\0) to discard

output_length :

Pointer to variable to store resulting string length or NULL

Returns :

pointer to new ISO Latin-1 string or NULL on failure

librdf_latin1_to_utf8 ()

unsigned char *     librdf_latin1_to_utf8               (const unsigned char *input,
                                                         int length,
                                                         int *output_length);

Convert an ISO Latin-1 encoded string to UTF-8.

Converts the given ISO Latin-1 string to an UTF-8 encoded string representing the same content. This is lossless.

deprecated for librdf_latin1_to_utf8_2() that takes and returns size_t sizes.

If output_length is not NULL, the returned string length will be stored there.

input :

ISO Latin-1 string buffer

length :

buffer size (will be truncated to size_t)

output_length :

Pointer to variable to store resulting string length or NULL

Returns :

pointer to new UTF-8 string or NULL on failure

librdf_latin1_to_utf8_2 ()

unsigned char *     librdf_latin1_to_utf8_2             (const unsigned char *input,
                                                         size_t length,
                                                         size_t *output_length);

Convert an ISO Latin-1 encoded string to UTF-8.

Converts the given ISO Latin-1 string to an UTF-8 encoded string representing the same content. This is lossless.

If output_length is not NULL, the returned string length will be stored there.

input :

ISO Latin-1 string buffer

length :

buffer size

output_length :

Pointer to variable to store resulting string length or NULL

Returns :

pointer to new UTF-8 string or NULL on failure

librdf_utf8_print ()

void                librdf_utf8_print                   (const unsigned char *input,
                                                         int length,
                                                         FILE *stream);

Print a UTF-8 string to a stream.

Pretty prints the UTF-8 string in a pseudo-C character format like \uhex digits when the characters fail the isprint() test.

input :

UTF-8 string buffer

length :

buffer size (will be truncated to size_t)

stream :

FILE* stream
redland-1.0.17/docs/html/redland-general.html0000644000175000017500000002757712257576340015775 00000000000000 General

General

General — Static variables and memory handling.

Synopsis

#define             LIBRDF_VERSION
#define             LIBRDF_VERSION_MAJOR
#define             LIBRDF_VERSION_MINOR
#define             LIBRDF_VERSION_RELEASE
#define             LIBRDF_VERSION_STRING
extern const unsigned int librdf_version_decimal;
extern const unsigned int librdf_version_major;
extern const unsigned int librdf_version_release;
extern const unsigned int librdf_version_minor;
extern const char * const librdf_version_string;
extern const char * const librdf_copyright_string;
extern const char * const librdf_short_copyright_string;
extern const char * const librdf_license_string;
extern const char * const librdf_home_url_string;
void *              librdf_alloc_memory                 (size_t size);
void *              librdf_calloc_memory                (size_t nmemb,
                                                         size_t size);
void                librdf_free_memory                  (void *ptr);
#define             REDLAND_DEPRECATED

Description

Static variables for version numbers and strings, copyright strings and home page. Functions for in-library memory allocation and deallocation.

Details

LIBRDF_VERSION

#define LIBRDF_VERSION 10017

Redland librdf library version number

Format: major * 10000 + minor * 100 + release


LIBRDF_VERSION_MAJOR

#define LIBRDF_VERSION_MAJOR 1

Redland librdf library major version


LIBRDF_VERSION_MINOR

#define LIBRDF_VERSION_MINOR 0

Redland librdf library minor version


LIBRDF_VERSION_RELEASE

#define LIBRDF_VERSION_RELEASE 17

Redland librdf library release


LIBRDF_VERSION_STRING

#define LIBRDF_VERSION_STRING "1.0.17"

Redland librdf library version string


librdf_version_decimal

extern const unsigned int librdf_version_decimal;

Redland librdf version as a decimal number.

Format: major * 10000 + minor * 100 + release


librdf_version_major

extern const unsigned int librdf_version_major;

Redland librdf major version number.


librdf_version_release

extern const unsigned int librdf_version_release;

Redland librdf release version number.


librdf_version_minor

extern const unsigned int librdf_version_minor;

Redland librdf minor version number.


librdf_version_string

extern const char * const librdf_version_string;

Redland librdf version as a string.


librdf_copyright_string

extern const char * const librdf_copyright_string;

Copyright string (multiple lines).


librdf_short_copyright_string

extern const char * const librdf_short_copyright_string;

Short copyright string (one line).


librdf_license_string

extern const char * const librdf_license_string;

Redland librdf license string.


librdf_home_url_string

extern const char * const librdf_home_url_string;

Redland librdf home page URL.


librdf_alloc_memory ()

void *              librdf_alloc_memory                 (size_t size);

Allocate memory inside the library similar to malloc().

Required for some runtimes where memory must be freed within the same shared object it was allocated in.

size :

alloc size

Returns :

pointer to memory or NULL on failure

librdf_calloc_memory ()

void *              librdf_calloc_memory                (size_t nmemb,
                                                         size_t size);

Allocate zeroed array of items inside the library similar to calloc().

Required for some runtimes where memory must be freed within the same shared object it was allocated in.

nmemb :

number of members

size :

size of member

Returns :

pointer to memory or NULL on failure

librdf_free_memory ()

void                librdf_free_memory                  (void *ptr);

Free memory allocated in the library.

Required for some runtimes where memory must be freed within the same shared object it was allocated in.

ptr :

pointer to free

REDLAND_DEPRECATED

#define REDLAND_DEPRECATED __attribute__((deprecated))

When defined before a function, indicates that the function has been deprecated and may be replaced in a future release. With some versions of gcc this may give a compilation warning.

redland-1.0.17/docs/html/redland-storage-module-uri.html0000644000175000017500000000534712257576340020073 00000000000000 Store 'uri'

Store 'uri'

This module provides an in-memory model (internally, using a the section called “Store 'memory'â€) initialised from the RDF/XML content in a URI. The URI is given as the storage name and on closing, the model is destroyed. This store was added in Redland 1.0.15. In future it may be extended to allow saving the store to the URI.

There are no options for this store and contexts are not supported.

Example:

  /* Read URI content into a store */
  storage=librdf_new_storage(world, "uri", 
     "http://example.org/content.rdf", NULL);

Summary:

  • In-memory

  • Suitable for small models

  • Easy access to web content in RDF/XML

  • Not indexed

  • No contexts

redland-1.0.17/docs/html/redland-list.html0000644000175000017500000005617212257576340015324 00000000000000 List

List

List — Simple list class.

Synopsis

typedef             librdf_list;
librdf_list *       librdf_new_list                     (librdf_world *world);
void                librdf_free_list                    (librdf_list *list);
void                librdf_list_clear                   (librdf_list *list);
int                 librdf_list_add                     (librdf_list *list,
                                                         void *data);
int                 librdf_list_unshift                 (librdf_list *list,
                                                         void *data);
void *              librdf_list_shift                   (librdf_list *list);
void *              librdf_list_pop                     (librdf_list *list);
void *              librdf_list_remove                  (librdf_list *list,
                                                         void *data);
int                 librdf_list_contains                (librdf_list *list,
                                                         void *data);
int                 librdf_list_size                    (librdf_list *list);
void                librdf_list_set_equals              (librdf_list *list,
                                                         int (*equals) (void* data1, void *data2));
librdf_iterator *   librdf_list_get_iterator            (librdf_list *list);
void                librdf_list_foreach                 (librdf_list *list,
                                                         void (*fn) (void *, void *),
                                                         void *user_data);

Description

A simple list class used internally.

Details

librdf_list

typedef struct librdf_list_s librdf_list;

Redland list class.


librdf_new_list ()

librdf_list *       librdf_new_list                     (librdf_world *world);

Constructor - create a new librdf_list.

world :

redland world object

Returns :

a new librdf_list or NULL on failure

librdf_free_list ()

void                librdf_free_list                    (librdf_list *list);

Destructor - destroy a librdf_list object.

list :

librdf_list object

librdf_list_clear ()

void                librdf_list_clear                   (librdf_list *list);

Empty an librdf_list.

list :

librdf_list object

librdf_list_add ()

int                 librdf_list_add                     (librdf_list *list,
                                                         void *data);

Add a data item to the end of a librdf_list.

Equivalent to the list 'push' notion, thus if librdf_list_pop() is called after this, it will return the value added here.

list :

librdf_list object

data :

the data value

Returns :

non 0 on failure

librdf_list_unshift ()

int                 librdf_list_unshift                 (librdf_list *list,
                                                         void *data);

Add a data item to the start of a librdf_list.

if librdf_list_shift() is called after this, it will return the value added here.

list :

librdf_list object

data :

the data value

Returns :

non 0 on failure

librdf_list_shift ()

void *              librdf_list_shift                   (librdf_list *list);

Remove and return the data at the start of the list.

list :

librdf_list object

Returns :

the data object or NULL if the list is empty

librdf_list_pop ()

void *              librdf_list_pop                     (librdf_list *list);

Remove and return the data at the end of the list.

list :

librdf_list object

Returns :

the data object or NULL if the list is empty

librdf_list_remove ()

void *              librdf_list_remove                  (librdf_list *list,
                                                         void *data);

Remove a data item from an librdf_list.

The search is done using the 'equals' function which may be set by librdf_list_set_equals() or by straight comparison of pointers if not set.

list :

librdf_list object

data :

the data item

Returns :

the data stored or NULL on failure (not found or list empty)

librdf_list_contains ()

int                 librdf_list_contains                (librdf_list *list,
                                                         void *data);

Check for presence of data item in list.

The search is done using the 'equals' function which may be set by librdf_list_set_equals() or by straight comparison of pointers if not set.

list :

librdf_list object

data :

the data value

Returns :

non 0 if item was found

librdf_list_size ()

int                 librdf_list_size                    (librdf_list *list);

Return the length of the list.

list :

librdf_list object

Returns :

length of the list

librdf_list_set_equals ()

void                librdf_list_set_equals              (librdf_list *list,
                                                         int (*equals) (void* data1, void *data2));

Set the equals function for the list.

The function given is used when comparing items in the list during searches such as those done in librdf_list_remove() or librdf_list_contains().

list :

librdf_list object

equals :

the equals function

librdf_list_get_iterator ()

librdf_iterator *   librdf_list_get_iterator            (librdf_list *list);

Get an iterator for the list.

list :

librdf_list object

Returns :

a new librdf_iterator object or NULL on failure

librdf_list_foreach ()

void                librdf_list_foreach                 (librdf_list *list,
                                                         void (*fn) (void *, void *),
                                                         void *user_data);

Apply a function for each data item in a librdf_list.

list :

librdf_list object

fn :

pointer to function to apply that takes data pointer and user data parameters

user_data :

user data for applied function
redland-1.0.17/docs/html/redland-stream.html0000644000175000017500000011315412257576340015636 00000000000000 Stream of triples (#librdf_statement).

Stream of triples (#librdf_statement).

Stream of triples (#librdf_statement). — Sequence of RDF Triples.

Synopsis

typedef             librdf_stream;
enum                librdf_stream_get_method_flags;
librdf_statement *  (*librdf_stream_map_handler)        (librdf_stream *stream,
                                                         void *map_context,
                                                         librdf_statement *item);
void                (*librdf_stream_map_free_context_handler)
                                                        (void *map_context);
librdf_stream *     librdf_new_stream                   (librdf_world *world,
                                                         void *context,
                                                         int (*is_end_method) (void*),
                                                         int (*next_method) (void*),
                                                         void* (*get_method) (void*, int),
                                                         void (*finished_method) (void*));
librdf_stream *     librdf_new_stream_from_node_iterator
                                                        (librdf_iterator *iterator,
                                                         librdf_statement *statement,
                                                         librdf_statement_part field);
librdf_stream *     librdf_new_empty_stream             (librdf_world *world);
void                librdf_free_stream                  (librdf_stream *stream);
int                 librdf_stream_end                   (librdf_stream *stream);
int                 librdf_stream_next                  (librdf_stream *stream);
librdf_statement *  librdf_stream_get_object            (librdf_stream *stream);
void *              librdf_stream_get_context           (librdf_stream *stream);
librdf_node *       librdf_stream_get_context2          (librdf_stream *stream);
int                 librdf_stream_add_map               (librdf_stream *stream,
                                                         librdf_stream_map_handler map_function,
                                                         librdf_stream_map_free_context_handler free_context,
                                                         void *map_context);
void                librdf_stream_print                 (librdf_stream *stream,
                                                         FILE *fh);
int                 librdf_stream_write                 (librdf_stream *stream,
                                                         raptor_iostream *iostr);

Description

Iterate a sequence of RDF triples from some object.

Details

librdf_stream

typedef struct librdf_stream_s librdf_stream;

Redland stream class.


enum librdf_stream_get_method_flags

typedef enum {
  LIBRDF_STREAM_GET_METHOD_GET_OBJECT = LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT,
  LIBRDF_STREAM_GET_METHOD_GET_CONTEXT = LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT
} librdf_stream_get_method_flags;

Flags for librdf_new_stream() get_method function pointer.

LIBRDF_STREAM_GET_METHOD_GET_OBJECT

get object from iterator - implementing librdf_stream_get_object()

LIBRDF_STREAM_GET_METHOD_GET_CONTEXT

get context from iterator - implementing librdf_stream_get_context()

librdf_stream_map_handler ()

librdf_statement *  (*librdf_stream_map_handler)        (librdf_stream *stream,
                                                         void *map_context,
                                                         librdf_statement *item);

Map function for a librdf_stream map operation.

See librdf_stream_add_map().

stream :

Stream that this map is operating over.

map_context :

Map data context pointer.

item :

Pointer to the current item in the iteration.

Returns :

item in keep the iteration or NULL to remove it

librdf_stream_map_free_context_handler ()

void                (*librdf_stream_map_free_context_handler)
                                                        (void *map_context);

Free handler function for a librdf_stream map operation.

See librdf_stream_add_map().

map_context :

Map data context pointer.

librdf_new_stream ()

librdf_stream *     librdf_new_stream                   (librdf_world *world,
                                                         void *context,
                                                         int (*is_end_method) (void*),
                                                         int (*next_method) (void*),
                                                         void* (*get_method) (void*, int),
                                                         void (*finished_method) (void*));

Constructor - create a new librdf_stream.

Creates a new stream with an implementation based on the passed in functions. The functions next_statement and end_of_stream will be called multiple times until either of them signify the end of stream by returning NULL or non 0 respectively. The finished function is called once only when the stream object is destroyed with librdf_free_stream()

A mapping function can be set for the stream using librdf_stream_add_map() function which allows the statements generated by the stream to be filtered and/or altered as they are generated before passing back to the user.

world :

redland world object

context :

context to pass to the stream implementing objects

is_end_method :

pointer to function to test for end of stream

next_method :

pointer to function to move to the next statement in stream

get_method :

pointer to function to get the current statement

finished_method :

pointer to function to finish the stream.

Returns :

a new librdf_stream object or NULL on failure

librdf_new_stream_from_node_iterator ()

librdf_stream *     librdf_new_stream_from_node_iterator
                                                        (librdf_iterator *iterator,
                                                         librdf_statement *statement,
                                                         librdf_statement_part field);

Constructor - create a new librdf_stream from an iterator of nodes.

Creates a new librdf_stream using the passed in librdf_iterator which generates a series of librdf_node objects. The resulting nodes are then inserted into the given statement and returned. The field attribute indicates which statement node is being generated.

iterator :

librdf_iterator of librdf_node objects

statement :

librdf_statement prototype with one NULL node space

field :

node part of statement

Returns :

a new librdf_stream object or NULL on failure

librdf_new_empty_stream ()

librdf_stream *     librdf_new_empty_stream             (librdf_world *world);

Constructor - create a new librdf_stream with no content.

world :

redland world object

Returns :

a new librdf_stream object or NULL on failure

librdf_free_stream ()

void                librdf_free_stream                  (librdf_stream *stream);

Destructor - destroy an libdf_stream object.

stream :

librdf_stream object

librdf_stream_end ()

int                 librdf_stream_end                   (librdf_stream *stream);

Test if the stream has ended.

stream :

librdf_stream object

Returns :

non 0 at end of stream.

librdf_stream_next ()

int                 librdf_stream_next                  (librdf_stream *stream);

Move to the next librdf_statement in the stream.

stream :

librdf_stream object

Returns :

non 0 if the stream has finished

librdf_stream_get_object ()

librdf_statement *  librdf_stream_get_object            (librdf_stream *stream);

Get the current librdf_statement in the stream.

This method returns a SHARED pointer to the current statement object which should be copied by the caller to preserve it if the stream is moved on librdf_stream_next() or if it should last after the stream is closed. librdf_new_statement_from_statement() can be used for copying the statement.

stream :

librdf_stream object

Returns :

the current librdf_statement object or NULL at end of stream.

librdf_stream_get_context ()

void *              librdf_stream_get_context           (librdf_stream *stream);

Get the context of the current object on the stream.

This method returns a SHARED pointer to the current context node object which should be copied by the caller to preserve it if the stream is moved on librdf_stream_next or if it should last after the stream is closed.

Deprecated: Use librdf_stream_get_context2() which returns a librdf_node

stream :

the librdf_stream object

Returns :

The context node (can be NULL) or NULL if the stream has finished.

librdf_stream_get_context2 ()

librdf_node *       librdf_stream_get_context2          (librdf_stream *stream);

Get the context of the current object on the stream.

This method returns a SHARED pointer to the current context node object which should be copied by the caller to preserve it if the stream is moved on librdf_stream_next or if it should last after the stream is closed.

stream :

the librdf_stream object

Returns :

The context node (can be NULL) or NULL if the stream has finished.

librdf_stream_add_map ()

int                 librdf_stream_add_map               (librdf_stream *stream,
                                                         librdf_stream_map_handler map_function,
                                                         librdf_stream_map_free_context_handler free_context,
                                                         void *map_context);

Add a librdf_stream mapping function.

Adds an stream mapping function which operates over the stream to select which elements are returned; it will be applied as soon as this method is called.

Several mapping functions can be added and they are applied in the order given.

The mapping function should return the statement to return, or NULL to remove it from the stream.

stream :

the stream

map_function :

the function to perform the mapping

free_context :

the function to use to free the context (or NULL)

map_context :

the context to pass to the map function

Returns :

Non 0 on failure

librdf_stream_print ()

void                librdf_stream_print                 (librdf_stream *stream,
                                                         FILE *fh);

Print the stream.

This prints the remaining statements of the stream to the given file handle. Note that after this method is called the stream will be empty so that librdf_stream_end() will always be true and librdf_stream_next() will always return NULL. The only useful operation is to dispose of the stream with the librdf_free_stream() destructor.

This method is for debugging and the format of the output should not be relied on.

Deprecated: Use librdf_stream_write() to write to raptor_iostream which can be made to write to a string. Use a librdf_serializer to write proper syntax formats.

stream :

the stream object

fh :

the FILE stream to print to

librdf_stream_write ()

int                 librdf_stream_write                 (librdf_stream *stream,
                                                         raptor_iostream *iostr);

Write a stream of triples to an iostream in a debug format.

This prints the remaining statements of the stream to the given raptor_iostream in a debug format.

Note that after this method is called the stream will be empty so that librdf_stream_end() will always be true and librdf_stream_next() will always return NULL. The only useful operation is to dispose of the stream with the librdf_free_stream() destructor.

This method is for debugging and the format of the output should not be relied on. In particular, when contexts are used the result may be 4 nodes.

stream :

the stream object

iostr :

the iostream to write to

Returns :

non-0 on failure

See Also

Provides a way to operate across a sequence of RDF Triples that are generated one-by-one on demand. The generated triples can be from some API call in the librdf_model class, from listing a graph content as individual triples, from parsing a syntax or returning an RDF graph result from a query. Streams can be passed into methods for the reverse operations such as adding to a graph, serializing a graph to a syntax. Streams pass individual triples (librdf_statement) between objects and are usually lazily generated and consumed.

redland-1.0.17/docs/html/left.png0000644000175000017500000000071312257576340013502 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ1&¹³[(XIDATxœµ•!OÃPEïÛ*ˆ‰ŠID%~ꊯ˜ÄÕ"pæ'öŘ`sÜ–¥rKf–´‚¤â h—mi—ÇIžz}÷ܯIû¤–.pÚö\“`xä‹ ˆl‡?l·[²,H¬‡¯×k<Ï#Žcþ%\’AUx[S³7–n6ù¾¯år¹ßèõzE‰‡’s’žŒ1³ºö“²æÅj@œ—NL$ݤiª0 ¿5/ð}¿²\E‡Ž¤KIo¥Í“$a0üjÞdF£bŠkIê„‹æAh>ŸW¶lC'?“tk;|/t*I»ÝN«ÕÊZø^`Œy•4ë÷ûšN§r]×® çJÒÌó<«’½À“Út»Ýú€à`±Xàºî1@p´ä€¸d½÷ŽZ')høÖÚK¬ ª$V?%Å]€­+³L’sgUKà"ÿw5â3O·•ÜòIEND®B`‚redland-1.0.17/docs/html/up.png0000644000175000017500000000062612257576340013177 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ2.œE€Ù#IDATxœí“=JÄ@F¿o‰] !+¤œ2…Å[ZÌ<@/á<€¥…XÛ Ú­20v±³ˆÂ…Ïj0»lþvV°ðA`˜ ïÍ ð—t*iùâHÒ­~xR~'IUUÉ9ç#OÁ‘my–eJÓTeY†GvÉ@x¤O#ß;2E>9²|t$DÞ9nnBäíÈjµò‘BRIsIªë:HîŸ8ŽU…œùëùPÖÚN™1fc­sNÎ95Mã§–ɵ¤ ׿ŸØŒ1~¸pEòe$ïIž°€Ç î7nrDòf!;Ã`¨çÝ'äykíÎI’øáû䲤sI_]ÿÇy—‡‘€ÅÀ^^I>O>Á¡ø­§²š?YBIEND®B`‚redland-1.0.17/docs/html/redland-changes-1-0-15-to-1-0-16.html0000644000175000017500000001020312257576340017617 00000000000000 Changes between Redland librdf 1.0.15 and 1.0.16

Changes between Redland librdf 1.0.15 and 1.0.16

New functions, types and enums

Functions

redland-1.0.17/docs/html/tutorial-introduction.html0000644000175000017500000000343312257576340017314 00000000000000 Tutorial Introduction

Tutorial Introduction

This chapter will describe how to use the Redland APIs. once it is written.

redland-1.0.17/docs/html/redland-concepts.html0000644000175000017500000011375112257576340016164 00000000000000 Concepts

Concepts

Concepts — Pre-defined URIS and Nodes in the RDF namespaces.

Synopsis

librdf_node *       librdf_get_concept_resource_by_index
                                                        (librdf_world *world,
                                                         librdf_concepts_index idx);
librdf_uri *        librdf_get_concept_uri_by_index     (librdf_world *world,
                                                         librdf_concepts_index idx);
librdf_uri *        librdf_get_concept_ms_namespace     (librdf_world *world);
librdf_uri *        librdf_get_concept_schema_namespace (librdf_world *world);
#define             LIBRDF_MS_Alt
#define             LIBRDF_MS_Alt_URI
#define             LIBRDF_MS_Bag
#define             LIBRDF_MS_Bag_URI
#define             LIBRDF_MS_Description
#define             LIBRDF_MS_Description_URI
#define             LIBRDF_MS_Property
#define             LIBRDF_MS_Property_URI
#define             LIBRDF_MS_RDF
#define             LIBRDF_MS_RDF_URI
#define             LIBRDF_MS_Seq
#define             LIBRDF_MS_Seq_URI
#define             LIBRDF_MS_Statement
#define             LIBRDF_MS_Statement_URI
#define             LIBRDF_MS_aboutEach
#define             LIBRDF_MS_aboutEachPrefix
#define             LIBRDF_MS_aboutEachPrefix_URI
#define             LIBRDF_MS_aboutEach_URI
#define             LIBRDF_MS_li
#define             LIBRDF_MS_li_URI
#define             LIBRDF_MS_object
#define             LIBRDF_MS_object_URI
#define             LIBRDF_MS_predicate
#define             LIBRDF_MS_predicate_URI
#define             LIBRDF_MS_subject
#define             LIBRDF_MS_subject_URI
#define             LIBRDF_MS_type
#define             LIBRDF_MS_type_URI
#define             LIBRDF_MS_value
#define             LIBRDF_MS_value_URI
#define             LIBRDF_RS_List
#define             LIBRDF_RS_List_URI
#define             LIBRDF_RS_XMLLiteral
#define             LIBRDF_RS_XMLLiteral_URI
#define             LIBRDF_RS_first
#define             LIBRDF_RS_first_URI
#define             LIBRDF_RS_nil
#define             LIBRDF_RS_nil_URI
#define             LIBRDF_RS_nodeID
#define             LIBRDF_RS_nodeID_URI
#define             LIBRDF_RS_rest
#define             LIBRDF_RS_rest_URI
#define             LIBRDF_S_Class
#define             LIBRDF_S_Class_URI
#define             LIBRDF_S_ConstraintProperty
#define             LIBRDF_S_ConstraintProperty_URI
#define             LIBRDF_S_ConstraintResource
#define             LIBRDF_S_ConstraintResource_URI
#define             LIBRDF_S_Container
#define             LIBRDF_S_ContainerMembershipProperty
#define             LIBRDF_S_ContainerMembershipProperty_URI
#define             LIBRDF_S_Container_URI
#define             LIBRDF_S_Literal
#define             LIBRDF_S_Literal_URI
#define             LIBRDF_S_Resource
#define             LIBRDF_S_Resource_URI
#define             LIBRDF_S_comment
#define             LIBRDF_S_comment_URI
#define             LIBRDF_S_domain
#define             LIBRDF_S_domain_URI
#define             LIBRDF_S_isDefinedBy
#define             LIBRDF_S_isDefinedBy_URI
#define             LIBRDF_S_label
#define             LIBRDF_S_label_URI
#define             LIBRDF_S_range
#define             LIBRDF_S_range_URI
#define             LIBRDF_S_seeAlso
#define             LIBRDF_S_seeAlso_URI
#define             LIBRDF_S_subClassOf
#define             LIBRDF_S_subClassOf_URI
#define             LIBRDF_S_subPropertyOf
#define             LIBRDF_S_subPropertyOf_URI
#define             LIBRDF_URI_RDF_MS
#define             LIBRDF_URI_RDF_SCHEMA

Description

This module presents RDF concepts from either the RDF namespace http://www.w3.org/1999/02/22-rdf-syntax-ns# or the RDF Schema namespace http://www.w3.org/2000/01/rdf-schema#

This list includes both syntax terms such as rdf:li as well as model concepts (RDF properties or classes) such as rdf:Seq

These are used in code using two lists of macros to get fast pointers to librdf_node or librdf_uri objects for the concept. These should be copied with the appropriate librdf_node or librdf_uri class copy constructors before use.

Example 1. Using macros to get a node and URI for an RDF concept

1
2
3
4
#include <redland.h>
...
librdf_node* n=librdf_new_node_from_node(LIBRDF_MS_value);
librdf_uri* u=librdf_new_uri_from_uri(LIBRDF_MS_value_URI);

Details

librdf_get_concept_resource_by_index ()

librdf_node *       librdf_get_concept_resource_by_index
                                                        (librdf_world *world,
                                                         librdf_concepts_index idx);

Get Redland node object for RDF concepts.

world :

redland world object

idx :

librdf_concepts_index

Returns :

librdf_node pointer or NULL on failure.

librdf_get_concept_uri_by_index ()

librdf_uri *        librdf_get_concept_uri_by_index     (librdf_world *world,
                                                         librdf_concepts_index idx);

Get Redland uri object for RDF concepts.

world :

redland world object

idx :

librdf_concepts_index

Returns :

librdf_uri pointer or NULL on failure.

librdf_get_concept_ms_namespace ()

librdf_uri *        librdf_get_concept_ms_namespace     (librdf_world *world);

Get a shared librdf_uri for the RDF Syntax namespace.

world :

librdf world object

Returns :

librdf_uri pointer or NULL on failure.

librdf_get_concept_schema_namespace ()

librdf_uri *        librdf_get_concept_schema_namespace (librdf_world *world);

Get a shared librdf_uri for the RDF Schema namespace.

world :

librdf world object

Returns :

librdf_uri pointer or NULL on failure.

LIBRDF_MS_Alt

#define LIBRDF_MS_Alt

RDF namespace concept librdf_node Alt


LIBRDF_MS_Alt_URI

#define LIBRDF_MS_Alt_URI

RDF namespace concept URI Alt


LIBRDF_MS_Bag

#define LIBRDF_MS_Bag

RDF namespace concept librdf_node Bag


LIBRDF_MS_Bag_URI

#define LIBRDF_MS_Bag_URI

RDF namespace concept URI Bag


LIBRDF_MS_Description

#define LIBRDF_MS_Description

RDF namespace concept librdf_node Description


LIBRDF_MS_Description_URI

#define LIBRDF_MS_Description_URI

RDF namespace concept URI Description


LIBRDF_MS_Property

#define LIBRDF_MS_Property

RDF namespace concept librdf_node Property


LIBRDF_MS_Property_URI

#define LIBRDF_MS_Property_URI

RDF namespace concept URI Property


LIBRDF_MS_RDF

#define LIBRDF_MS_RDF

RDF namespace concept librdf_node RDF


LIBRDF_MS_RDF_URI

#define LIBRDF_MS_RDF_URI

RDF namespace concept URI RDF


LIBRDF_MS_Seq

#define LIBRDF_MS_Seq

RDF namespace concept librdf_node Seq


LIBRDF_MS_Seq_URI

#define LIBRDF_MS_Seq_URI

RDF namespace concept URI Seq


LIBRDF_MS_Statement

#define LIBRDF_MS_Statement

RDF namespace concept librdf_node Statement


LIBRDF_MS_Statement_URI

#define LIBRDF_MS_Statement_URI

RDF namespace concept URI Statement


LIBRDF_MS_aboutEach

#define LIBRDF_MS_aboutEach

RDF namespace concept librdf_node aboutEach


LIBRDF_MS_aboutEachPrefix

#define LIBRDF_MS_aboutEachPrefix

RDF namespace concept librdf_node aboutEachPrefix


LIBRDF_MS_aboutEachPrefix_URI

#define LIBRDF_MS_aboutEachPrefix_URI

RDF namespace concept URI aboutEachPrefix


LIBRDF_MS_aboutEach_URI

#define LIBRDF_MS_aboutEach_URI

RDF namespace concept URI aboutEach


LIBRDF_MS_li

#define LIBRDF_MS_li

RDF namespace concept librdf_node li


LIBRDF_MS_li_URI

#define LIBRDF_MS_li_URI

RDF namespace concept URI li


LIBRDF_MS_object

#define LIBRDF_MS_object

RDF namespace concept librdf_node object


LIBRDF_MS_object_URI

#define LIBRDF_MS_object_URI

RDF namespace concept URI object


LIBRDF_MS_predicate

#define LIBRDF_MS_predicate

RDF namespace concept librdf_node predicate


LIBRDF_MS_predicate_URI

#define LIBRDF_MS_predicate_URI

RDF namespace concept URI predicate


LIBRDF_MS_subject

#define LIBRDF_MS_subject

RDF namespace concept librdf_node subject


LIBRDF_MS_subject_URI

#define LIBRDF_MS_subject_URI

RDF namespace concept URI subject


LIBRDF_MS_type

#define LIBRDF_MS_type

RDF namespace concept librdf_node type


LIBRDF_MS_type_URI

#define LIBRDF_MS_type_URI

RDF namespace concept URI type


LIBRDF_MS_value

#define LIBRDF_MS_value

RDF namespace concept librdf_node value


LIBRDF_MS_value_URI

#define LIBRDF_MS_value_URI

RDF namespace concept URI value


LIBRDF_RS_List

#define LIBRDF_RS_List

RDF namespace concept librdf_node List


LIBRDF_RS_List_URI

#define LIBRDF_RS_List_URI

RDF namespace concept URI List


LIBRDF_RS_XMLLiteral

#define LIBRDF_RS_XMLLiteral

RDF namespace concept librdf_node XMLLiteral


LIBRDF_RS_XMLLiteral_URI

#define LIBRDF_RS_XMLLiteral_URI

RDF namespace concept URI XMLLiteral


LIBRDF_RS_first

#define LIBRDF_RS_first

RDF namespace concept librdf_node first


LIBRDF_RS_first_URI

#define LIBRDF_RS_first_URI

RDF namespace concept URI first


LIBRDF_RS_nil

#define LIBRDF_RS_nil

RDF namespace concept librdf_node nil


LIBRDF_RS_nil_URI

#define LIBRDF_RS_nil_URI

RDF namespace concept URI nil


LIBRDF_RS_nodeID

#define LIBRDF_RS_nodeID

RDF namespace concept librdf_node nodeID


LIBRDF_RS_nodeID_URI

#define LIBRDF_RS_nodeID_URI

RDF namespace concept URI nodeID


LIBRDF_RS_rest

#define LIBRDF_RS_rest

RDF namespace concept librdf_node rest


LIBRDF_RS_rest_URI

#define LIBRDF_RS_rest_URI

RDF namespace concept URI rest


LIBRDF_S_Class

#define LIBRDF_S_Class

RDFS namespace concept Class


LIBRDF_S_Class_URI

#define LIBRDF_S_Class_URI

RDFS namespace concept URI Class


LIBRDF_S_ConstraintProperty

#define LIBRDF_S_ConstraintProperty

RDFS namespace concept ConstraintProperty


LIBRDF_S_ConstraintProperty_URI

#define LIBRDF_S_ConstraintProperty_URI

RDFS namespace concept URI ConstraintProperty


LIBRDF_S_ConstraintResource

#define LIBRDF_S_ConstraintResource

RDFS namespace concept ConstraintResource


LIBRDF_S_ConstraintResource_URI

#define LIBRDF_S_ConstraintResource_URI

RDFS namespace concept URI ConstraintResource


LIBRDF_S_Container

#define LIBRDF_S_Container

RDFS namespace concept Container


LIBRDF_S_ContainerMembershipProperty

#define LIBRDF_S_ContainerMembershipProperty

RDFS namespace concept ContainerMembershipProperty


LIBRDF_S_ContainerMembershipProperty_URI

#define LIBRDF_S_ContainerMembershipProperty_URI

RDFS namespace concept URI ContainerMembershipProperty


LIBRDF_S_Container_URI

#define LIBRDF_S_Container_URI

RDFS namespace concept URI Container


LIBRDF_S_Literal

#define LIBRDF_S_Literal

RDFS namespace concept Literal


LIBRDF_S_Literal_URI

#define LIBRDF_S_Literal_URI

RDFS namespace concept URI Literal


LIBRDF_S_Resource

#define LIBRDF_S_Resource

RDFS namespace concept Resource


LIBRDF_S_Resource_URI

#define LIBRDF_S_Resource_URI

RDFS namespace concept URI Resource


LIBRDF_S_comment

#define LIBRDF_S_comment

RDFS namespace concept comment


LIBRDF_S_comment_URI

#define LIBRDF_S_comment_URI

RDFS namespace concept URI comment


LIBRDF_S_domain

#define LIBRDF_S_domain

RDFS namespace concept domain


LIBRDF_S_domain_URI

#define LIBRDF_S_domain_URI

RDFS namespace concept URI domain


LIBRDF_S_isDefinedBy

#define LIBRDF_S_isDefinedBy

RDFS namespace concept isDefinedBy


LIBRDF_S_isDefinedBy_URI

#define LIBRDF_S_isDefinedBy_URI

RDFS namespace concept URI isDefinedBy


LIBRDF_S_label

#define LIBRDF_S_label

RDFS namespace concept label


LIBRDF_S_label_URI

#define LIBRDF_S_label_URI

RDFS namespace concept URI label


LIBRDF_S_range

#define LIBRDF_S_range

RDFS namespace concept range


LIBRDF_S_range_URI

#define LIBRDF_S_range_URI

RDFS namespace concept URI range


LIBRDF_S_seeAlso

#define LIBRDF_S_seeAlso

RDFS namespace concept seeAlso


LIBRDF_S_seeAlso_URI

#define LIBRDF_S_seeAlso_URI

RDFS namespace concept URI seeAlso


LIBRDF_S_subClassOf

#define LIBRDF_S_subClassOf

RDFS namespace concept subClassOf


LIBRDF_S_subClassOf_URI

#define LIBRDF_S_subClassOf_URI

RDFS namespace concept URI subClassOf


LIBRDF_S_subPropertyOf

#define LIBRDF_S_subPropertyOf

RDFS namespace concept subPropertyOf


LIBRDF_S_subPropertyOf_URI

#define LIBRDF_S_subPropertyOf_URI

RDFS namespace concept URI subPropertyOf


LIBRDF_URI_RDF_MS

#define LIBRDF_URI_RDF_MS

librdf_uri for rdf: namespace. Copy with librdf_new_uri_from_uri() before using.


LIBRDF_URI_RDF_SCHEMA

#define LIBRDF_URI_RDF_SCHEMA

librdf_uri for rdfs: namespace. Copy with librdf_new_uri_from_uri() before using.

See Also

RDF Vocabulary Description Language 1.0: RDF Schema, Graham Klyne and Jeremy J. Carroll, Editors, W3C Recommendation, 10 February 2004.

Resource Description Framework (RDF): Concepts and Abstract Syntax, Dan Brickley and R. V. Guha, Editors, W3C Recommendation, 10 February 2004.

redland-1.0.17/docs/html/tutorial.html0000644000175000017500000000427012257576340014575 00000000000000 Part I. Tutorial

Part I. Tutorial

This part will describe how to use the Redland APIs. once it is written.

The next part contains the Redland Reference Manual explaining the API in detail.

For the latest information, see the Redland Home Page

Table of Contents

Tutorial Introduction
redland-1.0.17/docs/html/redland.html0000644000175000017500000000321012257576340014334 00000000000000 Redland Overview

Redland Overview

Redland is a general-purpose Resource Description Framework (RDF) library providing APIs to the RDF model and it's concepts.

redland-1.0.17/docs/html/introduction.html0000644000175000017500000000365412257576340015460 00000000000000 Introduction

Introduction

This document describes the APIs provided by Redland to use the RDF model; manipulate statements, resources, predicates and objects in the model; parse RDF/XML syntax, query and store the models.

See also the Redland Home Page and the main document overview.

redland-1.0.17/docs/html/redland-files.html0000644000175000017500000000650212257576340015443 00000000000000 Files

Files

Files — File utility functions.

Synopsis

char *              librdf_files_temporary_file_name    (void);

Description

Portable utility functions for handling files.

Details

librdf_files_temporary_file_name ()

char *              librdf_files_temporary_file_name    (void);

Create a temporary file name.

deprecated: Do not use this, it is unsafe.

Returns :

a new filename or NULL on failure.
redland-1.0.17/docs/tmpl/0000755000175000017500000000000012257576340012131 500000000000000redland-1.0.17/docs/tmpl/files.sgml0000644000175000017500000000071712257576340014044 00000000000000 Files File utility functions. Portable utility functions for handling files. @void: @Returns: redland-1.0.17/docs/tmpl/redland-unused.sgml0000644000175000017500000001160612257576340015653 00000000000000 Internal. Internal. Internal. @cache: @key: @key_size: @value: @value_size: @Returns: @cache: @key: @key_size: @Returns: @cache: @key: @key_size: @value_size_p: @Returns: @cache: @key: @key_size: @value: @value_size: @Returns: @cache: @Returns: Internal. Internal. @world: @cache: @world: @Returns: @world: @capacity: @flush_percent: @flags: @Returns: @world: @Returns: @world: @Returns: @string: @len: @iostr: @string: @iostr: @byte: @iostr: @ptr: @size: @nmemb: @iostr: @buffer: @length: @locator: @locator: @fh: @world: @fh: @world: @string_p: @len_p: @malloc: @str: @len: @delim: @iostr: redland-1.0.17/docs/tmpl/heuristics.sgml0000644000175000017500000000152012257576340015115 00000000000000 Heuristics Utility heuristic functions. Various utility functions for performing heuristics such as generating a name, guessing if a string is a URI or RDF literal. @name: @Returns: @node: @Returns: @node: @Returns: @object: @Returns: redland-1.0.17/docs/tmpl/parser.sgml0000644000175000017500000001054712257576340014240 00000000000000 Parsers RDF parsers from syntax to triples. Provides classes to create parsers and parse syntaxes from URIs or a string into RDF graphs (#librdf_model) or sequences of triples (#librdf_stream). Parser features can be set, which are passed down to Raptor and errors and warnings that are returned can be retrieved by callbacks. @world: @name: @Returns: @world: @counter: @Returns: @world: @counter: @name: @label: @Returns: @mime_type: @buffer: @identifier: @Returns: @world: @mime_type: @buffer: @identifier: @Returns: @world: @name: @label: @mime_type: @uri_string: @factory: @world: @name: @mime_type: @type_uri: @Returns: @world: @factory: @Returns: @parser: @parser: @uri: @base_uri: @Returns: @parser: @uri: @base_uri: @model: @Returns: @parser: @fh: @close_fh: @base_uri: @Returns: @parser: @fh: @close_fh: @base_uri: @model: @Returns: @parser: @string: @base_uri: @Returns: @parser: @string: @base_uri: @model: @Returns: @parser: @user_data: @error_fn: @parser: @user_data: @warning_fn: @parser: @string: @length: @base_uri: @Returns: @parser: @string: @length: @base_uri: @model: @Returns: @parser: @iostream: @base_uri: @Returns: @parser: @iostream: @base_uri: @model: @Returns: @parser: @feature: @Returns: @parser: @feature: @value: @Returns: @parser: @Returns: @parser: @Returns: @parser: @offset: @Returns: @parser: @offset: @Returns: @parser: @user_data_p: @Returns: @parser: @filter: @user_data: redland-1.0.17/docs/tmpl/query.sgml0000644000175000017500000000363712257576340014113 00000000000000 Querying RDF query languages and execution. Provides classes to create query objects and to execute them over an RDF graph (#librdf_model) returning a #librdf_query_results Query result limits and offsets can be set. @world: @name: @uri_string: @factory: @world: @counter: @Returns: @world: @counter: @name: @uri_string: @Returns: @world: @name: @uri: @query_string: @base_uri: @Returns: @old_query: @Returns: @world: @factory: @name: @uri: @query_string: @base_uri: @Returns: @query: @query: @model: @Returns: @query: @Returns: @query: @limit: @Returns: @query: @Returns: @query: @offset: @Returns: redland-1.0.17/docs/tmpl/world.sgml0000644000175000017500000000516012257576340014066 00000000000000 World Initialisation and termination of library The Redland #librdf_world class handles startup and termination of the library and cleanup of all allocated resources. @void: @Returns: @world: @world: @world: @rasqal_world_ptr: @world: @Returns: @world: @Returns: @world: @raptor_world_ptr: @world: @world: @user_data: @error_handler: @world: @user_data: @warning_handler: @world: @user_data: @log_handler: @world: @name: @user_data: @raptor_world_ptr: @world: @user_data: @handler: @user_data: @rasqal_world_ptr: @world: @user_data: @handler: @world: @feature: @Returns: @world: @feature: @value: @Returns: @digest_factory_name: @not_used2: @void: redland-1.0.17/docs/tmpl/unicode.sgml0000644000175000017500000000262212257576340014365 00000000000000 Unicode Unicode utility functions. Utility functions to convert between UTF-8, full Unicode and Latin-1. Redland uses UTF-8 for all string formats (except where noted) but these may need to be converted to other Unicode encodings or downgraded with loss to Latin-1. @c: @output: @length: @Returns: @output: @input: @length: @Returns: @input: @length: @output_length: @Returns: @input: @length: @discard: @output_length: @Returns: @input: @length: @output_length: @Returns: @input: @length: @output_length: @Returns: @input: @length: @stream: redland-1.0.17/docs/tmpl/unused.sgml0000644000175000017500000000473712257576340014253 00000000000000 Unused Unused items. Do not read this, it is not in the document. Internal. Internal. Internal. You should not be reading this. @string_index: string index @first_to_check_index: first to check index @name: @Returns: Internal. @LIBRDF_CONCEPT_MS_Alt: offset @LIBRDF_CONCEPT_MS_Bag: offset @LIBRDF_CONCEPT_MS_Property: offset @LIBRDF_CONCEPT_MS_Seq: offset @LIBRDF_CONCEPT_MS_Statement: offset @LIBRDF_CONCEPT_MS_object: offset @LIBRDF_CONCEPT_MS_predicate: offset @LIBRDF_CONCEPT_MS_subject: offset @LIBRDF_CONCEPT_MS_type: offset @LIBRDF_CONCEPT_MS_value: offset @LIBRDF_CONCEPT_MS_li: offset @LIBRDF_CONCEPT_MS_RDF: offset @LIBRDF_CONCEPT_MS_Description: offset @LIBRDF_CONCEPT_MS_aboutEach: offset @LIBRDF_CONCEPT_MS_aboutEachPrefix: offset @LIBRDF_CONCEPT_RS_nodeID: offset @LIBRDF_CONCEPT_RS_List: offset @LIBRDF_CONCEPT_RS_first: offset @LIBRDF_CONCEPT_RS_rest: offset @LIBRDF_CONCEPT_RS_nil: offset @LIBRDF_CONCEPT_RS_XMLLiteral: offset @LIBRDF_CONCEPT_S_Class: offset @LIBRDF_CONCEPT_S_ConstraintProperty: offset @LIBRDF_CONCEPT_S_ConstraintResource: offset @LIBRDF_CONCEPT_S_Container: offset @LIBRDF_CONCEPT_S_ContainerMembershipProperty: offset @LIBRDF_CONCEPT_S_Literal: offset @LIBRDF_CONCEPT_S_Resource: offset @LIBRDF_CONCEPT_S_comment: offset @LIBRDF_CONCEPT_S_domain: offset @LIBRDF_CONCEPT_S_isDefinedBy: offset @LIBRDF_CONCEPT_S_label: offset @LIBRDF_CONCEPT_S_range: offset @LIBRDF_CONCEPT_S_seeAlso: offset @LIBRDF_CONCEPT_S_subClassOf: offset @LIBRDF_CONCEPT_S_subPropertyOf: offset @LIBRDF_CONCEPT_FIRST_S_ID: offset @LIBRDF_CONCEPT_LAST_S_ID: @LIBRDF_CONCEPT_RDF11_HTML: @LIBRDF_CONCEPT_RDF11_langString: @LIBRDF_CONCEPT_LAST: offset @world: @code: @level: @facility: @locator: @message: @...: @world: @code: @level: @facility: @locator: @message: redland-1.0.17/docs/tmpl/hash.sgml0000644000175000017500000000424012257576340013660 00000000000000 Hashes Key:Value hashes or dictionaries. Interface to implementations of key:value hashes either in memory, on disk and with persistence. Keys may have multiple and duplicate values. @world: @name: @Returns: @world: @name: @string: @Returns: @world: @name: @array: @Returns: @old_hash: @Returns: @hash: @hash: @key: @Returns: @hash: @key: @Returns: @hash: @key: @Returns: @hash: @key: @Returns: @hash: @key: @value: @Returns: @hash: @fh: @hash: @fh: @hash: @key_string: @fh: @template_string: @dictionary: @prefix: @suffix: @Returns: @hash: @string: @Returns: @hash: @filter: @Returns: redland-1.0.17/docs/tmpl/serializer.sgml0000644000175000017500000000727012257576340015114 00000000000000 Serializers RDF serializers from triples to syntax. Provides class to create serializers to turn RDF graphs into syntax in either files or strings. Serializer features can be set, which are passed down to Raptor and errors and warnings that are returned can be retrieved by callbacks. @world: @counter: @Returns: @world: @counter: @name: @label: @Returns: @world: @name: @label: @mime_type: @uri_string: @factory: @world: @name: @mime_type: @type_uri: @Returns: @world: @factory: @Returns: @serializer: @world: @name: @Returns: @serializer: @handle: @base_uri: @model: @Returns: @serializer: @handle: @base_uri: @model: @Returns: @serializer: @name: @base_uri: @model: @Returns: @serializer: @base_uri: @model: @Returns: @serializer: @base_uri: @model: @length_p: @Returns: @serializer: @base_uri: @model: @iostr: @Returns: @serializer: @base_uri: @stream: @length_p: @Returns: @serializer: @name: @base_uri: @stream: @Returns: @serializer: @handle: @base_uri: @stream: @Returns: @serializer: @base_uri: @stream: @iostr: @Returns: @serializer: @base_uri: @stream: @Returns: @serializer: @user_data: @error_fn: @serializer: @user_data: @warning_fn: @serializer: @feature: @Returns: @serializer: @feature: @value: @Returns: @serializer: @uri: @prefix: @Returns: redland-1.0.17/docs/tmpl/statement.sgml0000644000175000017500000000705112257576340014744 00000000000000 RDF Triple (librdf_statement) RDF Triple. An object representing an RDF Triple of three RDF terms (#librdf_node). Triples can be created, accessed, destroyed and en/decoded into a binary form for use in storage. @LIBRDF_STATEMENT_SUBJECT: @LIBRDF_STATEMENT_PREDICATE: @LIBRDF_STATEMENT_OBJECT: @LIBRDF_STATEMENT_ALL: @world: @Returns: @statement: @Returns: @statement: @Returns: @world: @subject: @predicate: @object: @Returns: @world: @statement: @statement: @statement: @statement: @Returns: @statement: @node: @statement: @Returns: @statement: @node: @statement: @Returns: @statement: @node: @statement: @Returns: @statement: @Returns: @statement: @fh: @statement1: @statement2: @Returns: @statement: @partial_statement: @Returns: @statement: @buffer: @length: @Returns: @world: @statement: @buffer: @length: @Returns: @statement: @context_node: @buffer: @length: @fields: @Returns: @world: @statement: @context_node: @buffer: @length: @fields: @Returns: @statement: @buffer: @length: @Returns: @world: @statement: @context_node: @buffer: @length: @Returns: @statement: @context_node: @buffer: @length: @Returns: @statement: @iostr: @Returns: redland-1.0.17/docs/tmpl/digest.sgml0000644000175000017500000000263512257576340014222 00000000000000 Digests Content digests. Create a message digest over a block of data. Includes implementations of MD5, RMD160 and SHA1. @world: @name: @Returns: @digest: @digest: @digest: @buf: @length: @digest: @string: @digest: @digest: @Returns: @digest: @Returns: @digest: @Returns: @digest: @fh: redland-1.0.17/docs/tmpl/general.sgml0000644000175000017500000000364612257576340014363 00000000000000 General Static variables and memory handling. Static variables for version numbers and strings, copyright strings and home page. Functions for in-library memory allocation and deallocation. @size: @Returns: @nmemb: @size: @Returns: @ptr: When defined before a function, indicates that the function has been deprecated and may be replaced in a future release. With some versions of gcc this may give a compilation warning. redland-1.0.17/docs/tmpl/query_results.sgml0000644000175000017500000001162112257576340015664 00000000000000 Query results RDF query results. The results of an #librdf_query execution as a sequence of individual results, an RDF graph as a sequence of triples or a boolean. For variable binding results, the binding names and values can be read in multiple forms and the number of results returned as well as the current result moved to the next. For an RDF graph result, the stream of triples can be returned. For a boolean result, the value can be returned. All results can be turned into a string XML format based on the SPARQL XML results format which can also be written to a file. @query_results: @Returns: @query_results: @Returns: @query_results: @Returns: @query_results: @Returns: @query_results: @names: @values: @Returns: @query_results: @offset: @Returns: @query_results: @offset: @Returns: @query_results: @name: @Returns: @query_results: @Returns: @query_results: @format_uri: @base_uri: @length_p: @Returns: @query_results: @name: @mime_type: @format_uri: @base_uri: @length_p: @Returns: @query_results: @format_uri: @base_uri: @Returns: @query_results: @name: @mime_type: @format_uri: @base_uri: @Returns: @query_results: @handle: @format_uri: @base_uri: @Returns: @query_results: @handle: @name: @mime_type: @format_uri: @base_uri: @Returns: @query_results: @name: @format_uri: @base_uri: @Returns: @query_results: @name: @mime_type: @format_uri: @base_uri: @Returns: @query_results: @query_results: @Returns: @query_results: @Returns: @query_results: @Returns: @query_results: @Returns: @query_results: @Returns: @query_results: @name: @uri: @Returns: @query_results: @mime_type: @Returns: @query_results: @name: @mime_type: @uri: @Returns: @formatter: @world: @name: @uri: @mime_type: @Returns: @world: @counter: @Returns: @world: @counter: @name: @label: @uri_string: @mime_type: @Returns: @iostr: @formatter: @query_results: @base_uri: @Returns: redland-1.0.17/docs/tmpl/model.sgml0000644000175000017500000001536612257576340014050 00000000000000 RDF Graph (librdf_model) RDF graph (set of triples) API. The main user API class for Redland, providing access to the RDF graph and the triples in it (#librdf_statement), storage, parsing, serializing and querying. @world: @counter: @name: @label: @Returns: @world: @storage: @options_string: @Returns: @world: @storage: @options: @Returns: @model: @Returns: @model: @model: @Returns: @model: @subject: @predicate: @object: @Returns: @model: @subject: @predicate: @literal: @xml_language: @is_wf_xml: @Returns: @model: @subject: @predicate: @literal: @xml_language: @datatype_uri: @Returns: @model: @statement: @Returns: @model: @statement_stream: @Returns: @model: @statement: @Returns: @model: @statement: @Returns: @model: @node: @property: @Returns: @model: @node: @property: @Returns: @model: @Returns: @model: @Returns: @model: @statement: @Returns: @model: @statement: @context_node: @options: @Returns: @model: @arc: @target: @Returns: @model: @source: @target: @Returns: @model: @source: @arc: @Returns: @model: @arc: @target: @Returns: @model: @source: @target: @Returns: @model: @source: @arc: @Returns: @model: @node: @Returns: @model: @node: @Returns: @model: @sub_model: @Returns: @model: @sub_model: @Returns: @model: @fh: @model: @context: @statement: @Returns: @model: @context: @stream: @Returns: @model: @context: @statement: @Returns: @model: @context: @Returns: @model: @context: @Returns: @model: @context: @Returns: @model: @context: @Returns: @model: @Returns: @model: @query: @Returns: @model: @Returns: @model: @Returns: @model: @uri: @name: @mime_type: @type_uri: @Returns: @model: @uri: @name: @mime_type: @type_uri: @string_length_p: @Returns: @model: @uri: @name: @mime_type: @type_uri: @Returns: @model: @statement: @context_node: @Returns: @model: @Returns: @model: @feature: @Returns: @model: @feature: @value: @Returns: @model: @Returns: @model: @Returns: @model: @Returns: @model: @Returns: @model: @handle: @Returns: @model: @iostr: @Returns: redland-1.0.17/docs/tmpl/log.sgml0000644000175000017500000000403012257576340013513 00000000000000 Logging Message and error logging. Provides structured access to debug, information, warning and error messages from the libraries. Structured information is most often used from errors such as parsing where file or URI and line numbers can be returned via a #raptor_locator object pointer found by librdf_log_message_locator() on the #librdf_log_message. @user_data: @message: @arguments: @Returns: @user_data: @message: @Returns: @LIBRDF_LOG_NONE: @LIBRDF_LOG_DEBUG: @LIBRDF_LOG_INFO: @LIBRDF_LOG_WARN: @LIBRDF_LOG_ERROR: @LIBRDF_LOG_FATAL: @LIBRDF_LOG_LAST: @LIBRDF_FROM_NONE: @LIBRDF_FROM_CONCEPTS: @LIBRDF_FROM_DIGEST: @LIBRDF_FROM_FILES: @LIBRDF_FROM_HASH: @LIBRDF_FROM_INIT: @LIBRDF_FROM_ITERATOR: @LIBRDF_FROM_LIST: @LIBRDF_FROM_MODEL: @LIBRDF_FROM_NODE: @LIBRDF_FROM_PARSER: @LIBRDF_FROM_QUERY: @LIBRDF_FROM_SERIALIZER: @LIBRDF_FROM_STATEMENT: @LIBRDF_FROM_STORAGE: @LIBRDF_FROM_STREAM: @LIBRDF_FROM_URI: @LIBRDF_FROM_UTF8: @LIBRDF_FROM_MEMORY: @LIBRDF_FROM_RAPTOR: @LIBRDF_FROM_LAST: @message: @Returns: @message: @Returns: @message: @Returns: @message: @Returns: @message: @Returns: redland-1.0.17/docs/tmpl/storage.sgml0000644000175000017500000001430612257576340014405 00000000000000 Triple stores RDF Triple stores Provides classes to create triple stores to back the RDF graph interface (#librdf_model). Most of the methods are for implementing the RDF model API and have the same name. @world: @name: @label: @factory: @Returns: @world: @counter: @name: @label: @Returns: @world: @storage_name: @name: @options_string: @Returns: @world: @storage_name: @name: @options: @Returns: @old_storage: @Returns: @world: @factory: @name: @options: @Returns: @storage: @storage: @model: @Returns: @storage: @Returns: @storage: @Returns: @storage: @statement: @Returns: @storage: @statement_stream: @Returns: @storage: @statement: @Returns: @storage: @statement: @Returns: @storage: @Returns: @storage: @statement: @Returns: @storage: @statement: @context_node: @options: @Returns: @storage: @arc: @target: @Returns: @storage: @source: @target: @Returns: @storage: @source: @arc: @Returns: @storage: @node: @Returns: @storage: @node: @Returns: @storage: @node: @property: @Returns: @storage: @node: @property: @Returns: @storage: @context: @statement: @Returns: @storage: @context: @stream: @Returns: @storage: @context: @statement: @Returns: @storage: @context: @Returns: @storage: @context: @Returns: @storage: @context: @Returns: @storage: @query: @Returns: @storage: @query: @Returns: @storage: @Returns: @storage: @statement: @context_node: @Returns: @storage: @Returns: @storage: @feature: @Returns: @storage: @feature: @value: @Returns: @storage: @Returns: @storage: @Returns: @storage: @Returns: @storage: @Returns: @storage: @handle: @Returns: @storage: @storage: @storage: @Returns: @storage: @instance: @storage: @Returns: @world: redland-1.0.17/docs/tmpl/list.sgml0000644000175000017500000000302112257576340013704 00000000000000 List Simple list class. A simple list class used internally. @world: @Returns: @list: @list: @list: @data: @Returns: @list: @data: @Returns: @list: @Returns: @list: @Returns: @list: @data: @Returns: @list: @data: @Returns: @list: @Returns: @list: @equals: @list: @Returns: @list: @fn: @user_data: redland-1.0.17/docs/tmpl/uri.sgml0000644000175000017500000000461412257576340013541 00000000000000 URI URI class A class for absolute URIs and relative URI computation utility functions. Only absolute URIs are provided, with no current access to internals of URIs such as URI scheme, path, authority. Relative URIs can be generated against some base or turned to and from local filenames. @world: @uri_string: @Returns: @world: @uri_string: @length: @Returns: @old_uri: @Returns: @old_uri: @local_name: @Returns: @uri: @uri: @Returns: @uri: @len_p: @Returns: @uri: @fh: @uri: @Returns: @uri: @len_p: @Returns: @first_uri: @second_uri: @Returns: @uri: @Returns: @uri: @Returns: @uri_string: @source_uri: @base_uri: @Returns: @base_uri: @uri_string: @Returns: @world: @filename: @Returns: @uri1: @uri2: @Returns: @user_data: @uri: @Returns: redland-1.0.17/docs/tmpl/concepts.sgml0000644000175000017500000001600612257576340014556 00000000000000 Concepts Pre-defined URIS and Nodes in the RDF namespaces. This module presents RDF concepts from either the RDF namespace http://www.w3.org/1999/02/22-rdf-syntax-ns# or the RDF Schema namespace http://www.w3.org/2000/01/rdf-schema# This list includes both syntax terms such as rdf:li as well as model concepts (RDF properties or classes) such as rdf:Seq These are used in code using two lists of macros to get fast pointers to #librdf_node or #librdf_uri objects for the concept. These should be copied with the appropriate #librdf_node or #librdf_uri class copy constructors before use. Using macros to get a node and URI for an RDF concept #include <redland.h> ... librdf_node* n=librdf_new_node_from_node(LIBRDF_MS_value); librdf_uri* u=librdf_new_uri_from_uri(LIBRDF_MS_value_URI); RDF Vocabulary Description Language 1.0: RDF Schema, Graham Klyne and Jeremy J. Carroll, Editors, W3C Recommendation, 10 February 2004. Resource Description Framework (RDF): Concepts and Abstract Syntax, Dan Brickley and R. V. Guha, Editors, W3C Recommendation, 10 February 2004. @world: @idx: @Returns: @world: @idx: @Returns: @world: @Returns: @world: @Returns: redland-1.0.17/docs/tmpl/iterator.sgml0000644000175000017500000000443312257576340014572 00000000000000 Iterator Iterate a sequence of objects across some other object. Provides a way to operate across a sequence of objects that are generated one-by-one on demand. The returned objects can be of any type but the main public methods are on the #librdf_model classs and return sequence of #librdf_node objects such as librdf_model_get_sources(). @LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: @LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: @LIBRDF_ITERATOR_GET_METHOD_GET_KEY: @LIBRDF_ITERATOR_GET_METHOD_GET_VALUE: @iterator: @map_context: @item: @Returns: @map_context: @world: @context: @is_end_method: @next_method: @get_method: @finished_method: @Returns: @iterator: @iterator: @Returns: @iterator: @Returns: @iterator: @Returns: @iterator: @Returns: @iterator: @Returns: @iterator: @Returns: @iterator: @Returns: @iterator: @map_function: @free_context: @map_context: @Returns: @world: @Returns: redland-1.0.17/docs/tmpl/stream.sgml0000644000175000017500000000511512257576340014232 00000000000000 Stream of triples (#librdf_statement). Sequence of RDF Triples. Iterate a sequence of RDF triples from some object. Provides a way to operate across a sequence of RDF Triples that are generated one-by-one on demand. The generated triples can be from some API call in the #librdf_model class, from listing a graph content as individual triples, from parsing a syntax or returning an RDF graph result from a query. Streams can be passed into methods for the reverse operations such as adding to a graph, serializing a graph to a syntax. Streams pass individual triples (#librdf_statement) between objects and are usually lazily generated and consumed. @LIBRDF_STREAM_GET_METHOD_GET_OBJECT: @LIBRDF_STREAM_GET_METHOD_GET_CONTEXT: @stream: @map_context: @item: @Returns: @map_context: @world: @context: @is_end_method: @next_method: @get_method: @finished_method: @Returns: @iterator: @statement: @field: @Returns: @world: @Returns: @stream: @stream: @Returns: @stream: @Returns: @stream: @Returns: @stream: @Returns: @stream: @Returns: @stream: @map_function: @free_context: @map_context: @Returns: @stream: @fh: @stream: @iostr: @Returns: redland-1.0.17/docs/tmpl/node.sgml0000644000175000017500000001101012257576340013653 00000000000000 RDF term (librdf_node) RDF triple component The (subject, predicate, object) parts of an RDF triple. @node: @world: @Returns: @world: @identifier: @Returns: @world: @identifier: @identifier_len: @Returns: @world: @uri_string: @len: @Returns: @world: @string: @xml_language: @is_wf_xml: @Returns: @node: @Returns: @world: @uri_string: @source_uri: @base_uri: @Returns: @world: @value: @value_len: @xml_language: @xml_language_len: @datatype_uri: @Returns: @world: @value: @xml_language: @datatype_uri: @Returns: @world: @uri: @Returns: @world: @uri: @local_name: @Returns: @world: @uri_string: @Returns: @world: @size_p: @buffer: @length: @Returns: @node: @buffer: @length: @Returns: @first_node: @second_node: @Returns: @node: @Returns: @node: @len_p: @Returns: @node: @Returns: @node: @Returns: @node: @len_p: @Returns: @node: @Returns: @node: @Returns: @node: @Returns: @node: @Returns: @node: @Returns: @node: @Returns: @node: @Returns: @node: @Returns: @node: @Returns: @world: @nodes: @size: @Returns: @node: @fh: @nodes: @size: @Returns: @node: @len_p: @Returns: @node: @Returns: @LIBRDF_NODE_TYPE_UNKNOWN: @LIBRDF_NODE_TYPE_RESOURCE: @LIBRDF_NODE_TYPE_LITERAL: @LIBRDF_NODE_TYPE_BLANK: @LIBRDF_NODE_TYPE_LAST: @node: @iostr: @Returns: redland-1.0.17/docs/README.html0000644000175000017500000000616411773210070012712 00000000000000 Redland RDF Application Framework - Documentation

Redland RDF Application Framework - Documentation

DOCUMENTS

The latest documentation is on the Redland Web Site.

API DOCUMENTATION

The API DocBook documentation is generated automatically from the source code using the Linux kernel kernel-doc program which you can get as the file scripts/kernel-doc in the distribution. Each of the higher level language APIs contains a mapping to the core C API and may also include extra documentation describing the native APIs along with examples of use.

PAPERS

The design and implementation of Redland are discussed in detail in the paper The Design and Implementation of the Redland RDF Application Framework presented at the WWW10 conference, May 2001. (pre-print).

The details of the technology of the WSE and RDN-WSE projects that are based on Redland are reported in Web Crawling High-Quality Metadata using RDF and Dublin Core, presented at the WWW2002 conference, May 2002.


Copyright 2000-2007 Dave Beckett, Copyright 2000-2004 University of Bristol

redland-1.0.17/docs/README0000644000175000017500000000330312257576337011762 00000000000000 Redland RDF Application Framework - Documentation DOCUMENTS The latest documentation is on the Redland Web Site. * Installation document * Testing Redland * Frequently Asked Questions * To-do list * News * Release Notes * License API DOCUMENTATION The API DocBook documentation is generated automatically from the source code using the Linux kernel kernel-doc program which you can get as the file scripts/kernel-doc in the distribution. Each of the higher level language APIs contains a mapping to the core C API and may also include extra documentation describing the native APIs along with examples of use. * Redland API documentation (HTML) * Redland storage implementations overview * Redland C# (ECMA CLI) interface (redland bindings) * Redland Java interface (redland bindings) * Redland Perl interface (redland bindings) * Redland PHP interface (redland bindings) * Redland Python interface (redland bindings) * Redland Ruby interface (redland bindings) * Redland Tcl interface (redland bindings) PAPERS The design and implementation of Redland are discussed in detail in the paper The Design and Implementation of the Redland RDF Application Framework presented at the WWW10 conference, May 2001. (pre-print). The details of the technology of the WSE and RDN-WSE projects that are based on Redland are reported in Web Crawling High-Quality Metadata using RDF and Dublin Core, presented at the WWW2002 conference, May 2002. __________________________________________________________________ Copyright 2000-2007 Dave Beckett, Copyright 2000-2004 University of Bristol redland-1.0.17/docs/redland-changes.xml0000644000175000017500000002163512253416663014642 00000000000000 API Changes This chapter describes the API changes for Redland librdf.
Introduction The following sections describe the changes in the API between versions including additions, deletions, renames (retaining the same number of parameters, types and return value type) and more complex changes to functions, types and enums.
Changes between Redland librdf 1.0.12 and 1.0.13
New functions, types and enums Functions const raptor_syntax_description* librdf_parser_get_description(librdf_world* world, unsigned int counter) - Deprecates librdf_parser_enumerate() const raptor_syntax_description* librdf_query_results_formats_get_description(librdf_world* world, unsigned int counter) - Deprecates librdf_query_results_formats_enumerate() const raptor_syntax_description* librdf_serializer_get_description(librdf_world* world, unsigned int counter) - Deprecates librdf_serializer_enumerate() Types LIBRDF_VERSION LIBRDF_VERSION_MAJOR LIBRDF_VERSION_MINOR LIBRDF_VERSION_RELEASE LIBRDF_VERSION_STRING
Changed functions and types
1.0.12 type 1.0.13 type Notes
librdf_node librdf_node Now a typedef for raptor_term
librdf_statement librdf_statement Now a typedef for raptor_statement
librdf_uri librdf_uri Now a typedef for raptor_uri
Changes between Redland librdf 1.0.13 and 1.0.14
New functions, types and enums Functions unsigned char* librdf_latin1_to_utf8(const unsigned char *input, int length, int *output_length) int librdf_parser_parse_iostream_as_stream(librdf_parser* parser, raptor_iostream *iostream, librdf_uri* base_uri) int librdf_parser_parse_iostream_into_model(librdf_parser* parser, raptor_iostream *iostream, librdf_uri* base_uri, librdf_model* model) const raptor_syntax_description* librdf_query_language_get_description(librdf_world* world, unsigned int counter) int librdf_unicode_char_to_utf8(librdf_unichar c, unsigned char *output, int length) - Documented but deprecated for raptor_unicode_utf8_string_put_char() void librdf_utf8_print(const unsigned char *input, int length, FILE *stream) unsigned char* librdf_utf8_to_latin1(const unsigned char *input, int length, int *output_length) int librdf_utf8_to_unicode_char(librdf_unichar *output, const unsigned char *input, int length) - Documented but deprecated for raptor_unicode_utf8_string_get_char()
Changes between Redland librdf 1.0.14 and 1.0.15
New functions, types and enums Functions void* librdf_alloc_memory(size_t size) void* librdf_calloc_memory(size_t nmemb, size_t size) void librdf_free_memory(void *ptr) librdf_hash* librdf_new_hash(librdf_world *world, const char *name) librdf_statement* librdf_new_statement_from_statement2(librdf_statement* statement)
Changes between Redland librdf 1.0.15 and 1.0.16
New functions, types and enums Functions unsigned char* librdf_latin1_to_utf8_2(const unsigned char *input, size_t length, size_t *output_length) - Replaces librdf_latin1_to_utf8() unsigned char* librdf_utf8_to_latin1_2(const unsigned char *input, size_t length, unsigned char discard, size_t *output_length) - Replaces librdf_utf8_to_latin1() void librdf_world_set_raptor_init_handler(librdf_world* world, void* user_data, librdf_raptor_init_handler handler) void librdf_world_set_rasqal_init_handler(librdf_world* world, void* user_data, librdf_rasqal_init_handler handler) Types librdf_raptor_init_handler librdf_rasqal_init_handler
Changes between Redland librdf 1.0.16 and 1.0.16
New functions, types and enums Types librdf_home_url_string librdf_license_string
redland-1.0.17/docs/Makefile.am0000644000175000017500000000776311773210070013131 00000000000000# -*- Mode: Makefile -*- # # Makefile.am - docs automake file for Redland librdf # # Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/ # Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # # The name of the module. DOC_MODULE=redland # The top-level SGML file. DOC_MAIN_SGML_FILE=redland-docs.xml # Extra options to supply to gtkdoc-scan SCAN_OPTIONS= --deprecated-guards="LIBRDF_DISABLE_DEPRECATED" # The directory containing the source code. Relative to $(srcdir) DOC_SOURCE_DIR=$(top_srcdir)/src # Used for dependencies HFILE_GLOB=$(top_srcdir)/src/*.h $(builddir)/filtered_rdf_log.h CFILE_GLOB=$(top_srcdir)/src/*.c IGNORE_CFILES= # Use fixed version of rdf_log.h EXTRA_HFILES= $(builddir)/filtered_rdf_log.h # Headers to ignore: yes rdf_log.h is intended to be in this list # since it is added as a fixed file filtered_rdf_log.h by EXTRA_HFILES above IGNORE_HFILES= \ rdf_log.h \ rdf_config.h \ win32_rdf_config.h \ rdf_types.h \ redland.h \ rdf_internal.h \ rdf_avltree_internal.h \ rdf_concepts_internal.h \ rdf_digest_internal.h \ rdf_hash_internal.h \ rdf_init_internal.h \ rdf_iterator_internal.h \ rdf_list_internal.h \ rdf_log_internal.h \ rdf_model_internal.h \ rdf_node_internal.h \ rdf_parser_internal.h \ rdf_query_internal.h \ rdf_raptor_internal.h \ rdf_serializer_internal.h \ rdf_statement_internal.h \ rdf_storage_internal.h \ rdf_storage_virtuoso_internal.h \ rdf_stream_internal.h \ rdf_uri_internal.h # CFLAGS and LDFLAGS for compiling scan program. Only needed # if $(DOC_MODULE).types is non-empty. AM_CPPFLAGS = GTKDOC_LIBS = # Extra options to supply to gtkdoc-mkdb MKDB_OPTIONS=--sgml-mode --output-format=xml --ignore-files="$(IGNORE_CFILES)" # Extra options to supply to gtkdoc-mktmpl MKTMPL_OPTIONS= # Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE) content_files = \ redland-changes.xml \ redland-chapter-intro.xml \ redland-chapter-objects.xml \ redland-chapter-storage-modules.xml \ version.xml # Images to copy into HTML directory HTML_IMAGES = # Extra options to supply to gtkdoc-fixref FIXXREF_OPTIONS= # gtkdoc might not define this DISTCLEANFILES= include $(top_srcdir)/gtk-doc.make man_MANS=redland.3 # Other files to distribute EXTRA_DIST += README.html README \ storage.html \ redland.pod \ $(man_MANS) \ version.xml.in \ redland-changes.tsv DISTCLEANFILES += \ filtered_rdf_log.h CLEANFILES += README \ pod2htm* $(builddir)/filtered_rdf_log.h: $(top_srcdir)/src/rdf_log.h $(srcdir)/../scripts/fix-gtkdoc-header.pl $(PERL) $(srcdir)/../scripts/fix-gtkdoc-header.pl < $< > $@ # Create some text files from HTML sources LYNX=lynx LYNXARGS=-dump -nolist if MAINTAINER_MODE redland.3: redland.pod pod2man --section=3 --center="Redland RDF Application Framework" \ --release="`date +%d-%b-%Y`" --date="@PACKAGE@ @PACKAGE_VERSION@" $< | \ sed -e "s;REDLAND_VERSION_STRING;@PACKAGE_VERSION@;" \ -e 's;^Redland Resource;redland \\- Resource;' > $@ rm -f pod2htm* else redland.3: redland.pod @echo "Creating fake $@ since maintainer mode is not enabled" touch $@ endif README: README.html $(LYNX) $(LYNXARGS) $< > $@ if MAINTAINER_MODE redland-changes.xml: $(srcdir)/redland-changes.tsv $(srcdir)/../scripts/process-changes.pl $(PERL) $(srcdir)/../scripts/process-changes.pl --package redland --docbook-xml $@ "Redland librdf" $(srcdir)/redland-changes.tsv endif redland-1.0.17/docs/Makefile.in0000644000175000017500000007357512257575714013167 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- Mode: Makefile -*- # # Makefile.am - docs automake file for Redland librdf # # Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/ # Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/version.xml.in $(top_srcdir)/gtk-doc.make subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/rdf_config.h CONFIG_CLEAN_FILES = version.xml CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man3dir = $(mandir)/man3 am__installdirs = "$(DESTDIR)$(man3dir)" NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIGEST_OBJS = @DIGEST_OBJS@ DIGEST_SRCS = @DIGEST_SRCS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HASH_OBJS = @HASH_OBJS@ HASH_SRCS = @HASH_SRCS@ HAVE_RAPTOR2_API = @HAVE_RAPTOR2_API@ HTML_DIR = @HTML_DIR@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IODBC_CONFIG = @IODBC_CONFIG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBRDF_CPPFLAGS = @LIBRDF_CPPFLAGS@ LIBRDF_DIRECT_LIBS = @LIBRDF_DIRECT_LIBS@ LIBRDF_EXTERNAL_CPPFLAGS = @LIBRDF_EXTERNAL_CPPFLAGS@ LIBRDF_EXTERNAL_LIBS = @LIBRDF_EXTERNAL_LIBS@ LIBRDF_INTERNAL_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ LIBRDF_INTERNAL_DEPS = @LIBRDF_INTERNAL_DEPS@ LIBRDF_INTERNAL_LIBS = @LIBRDF_INTERNAL_LIBS@ LIBRDF_LDFLAGS = @LIBRDF_LDFLAGS@ LIBRDF_LIBTOOLLIBS = @LIBRDF_LIBTOOLLIBS@ LIBRDF_LIBTOOL_VERSION = @LIBRDF_LIBTOOL_VERSION@ LIBRDF_PKGCONFIG_PRIVATE_LIBS = @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ LIBRDF_VERSION_DECIMAL = @LIBRDF_VERSION_DECIMAL@ LIBRDF_VERSION_MAJOR = @LIBRDF_VERSION_MAJOR@ LIBRDF_VERSION_MINOR = @LIBRDF_VERSION_MINOR@ LIBRDF_VERSION_RELEASE = @LIBRDF_VERSION_RELEASE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEM = @MEM@ MEM_LIBS = @MEM_LIBS@ MKDIR_P = @MKDIR_P@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ODBC_CFLAGS = @ODBC_CFLAGS@ ODBC_LIBS = @ODBC_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSTGRESQL_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ POSTGRESQL_LIBS = @POSTGRESQL_LIBS@ RANLIB = @RANLIB@ RAPTOR2_CFLAGS = @RAPTOR2_CFLAGS@ RAPTOR2_LIBS = @RAPTOR2_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ RASQAL_CFLAGS = @RASQAL_CFLAGS@ RASQAL_LIBS = @RASQAL_LIBS@ RASQAL_MAX_VERSION = @RASQAL_MAX_VERSION@ RASQAL_MIN_VERSION = @RASQAL_MIN_VERSION@ RECHO = @RECHO@ RECHO_C = @RECHO_C@ RECHO_N = @RECHO_N@ REDLAND_MODULE_PATH = @REDLAND_MODULE_PATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TAR = @TAR@ TSTORE_CONFIG = @TSTORE_CONFIG@ TSTORE_CPPFLAGS = @TSTORE_CPPFLAGS@ TSTORE_LIBS = @TSTORE_LIBS@ VERSION = @VERSION@ VIRTUOSO_CPPFLAGS = @VIRTUOSO_CPPFLAGS@ VIRTUOSO_LIBS = @VIRTUOSO_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # The name of the module. DOC_MODULE = redland # The top-level SGML file. DOC_MAIN_SGML_FILE = redland-docs.xml # Extra options to supply to gtkdoc-scan SCAN_OPTIONS = --deprecated-guards="LIBRDF_DISABLE_DEPRECATED" # The directory containing the source code. Relative to $(srcdir) DOC_SOURCE_DIR = $(top_srcdir)/src # Used for dependencies HFILE_GLOB = $(top_srcdir)/src/*.h $(builddir)/filtered_rdf_log.h CFILE_GLOB = $(top_srcdir)/src/*.c IGNORE_CFILES = # Use fixed version of rdf_log.h EXTRA_HFILES = $(builddir)/filtered_rdf_log.h # Headers to ignore: yes rdf_log.h is intended to be in this list # since it is added as a fixed file filtered_rdf_log.h by EXTRA_HFILES above IGNORE_HFILES = \ rdf_log.h \ rdf_config.h \ win32_rdf_config.h \ rdf_types.h \ redland.h \ rdf_internal.h \ rdf_avltree_internal.h \ rdf_concepts_internal.h \ rdf_digest_internal.h \ rdf_hash_internal.h \ rdf_init_internal.h \ rdf_iterator_internal.h \ rdf_list_internal.h \ rdf_log_internal.h \ rdf_model_internal.h \ rdf_node_internal.h \ rdf_parser_internal.h \ rdf_query_internal.h \ rdf_raptor_internal.h \ rdf_serializer_internal.h \ rdf_statement_internal.h \ rdf_storage_internal.h \ rdf_storage_virtuoso_internal.h \ rdf_stream_internal.h \ rdf_uri_internal.h # CFLAGS and LDFLAGS for compiling scan program. Only needed # if $(DOC_MODULE).types is non-empty. AM_CPPFLAGS = GTKDOC_LIBS = # Extra options to supply to gtkdoc-mkdb MKDB_OPTIONS = --sgml-mode --output-format=xml --ignore-files="$(IGNORE_CFILES)" # Extra options to supply to gtkdoc-mktmpl MKTMPL_OPTIONS = # Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE) content_files = \ redland-changes.xml \ redland-chapter-intro.xml \ redland-chapter-objects.xml \ redland-chapter-storage-modules.xml \ version.xml # Images to copy into HTML directory HTML_IMAGES = # Extra options to supply to gtkdoc-fixref FIXXREF_OPTIONS = # gtkdoc might not define this DISTCLEANFILES = filtered_rdf_log.h @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt # Other files to distribute EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) README.html README \ storage.html redland.pod $(man_MANS) version.xml.in \ redland-changes.tsv DOC_STAMPS = setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ tmpl.stamp sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) README \ pod2htm* @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp man_MANS = redland.3 # Create some text files from HTML sources LYNX = lynx LYNXARGS = -dump -nolist all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/gtk-doc.make: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): version.xml: $(top_builddir)/config.status $(srcdir)/version.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man3: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.3[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile $(MANS) all-local installdirs: for dir in "$(DESTDIR)$(man3dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man3 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local uninstall-man uninstall-man: uninstall-man3 .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local dist-hook distclean \ distclean-generic distclean-libtool distclean-local distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man3 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-local uninstall-man uninstall-man3 @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### setup-build.stamp: -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ echo ' DOC Preparing build'; \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ done; \ fi; \ test -d $(abs_srcdir)/tmpl && \ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ chmod -R u+w $(abs_builddir)/tmpl; } \ fi @touch setup-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo ' DOC Scanning header files' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ echo " DOC Introspecting gobjects"; \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo ' DOC Rebuilding template files' @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ if test -w $(abs_srcdir) ; then \ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ fi \ fi @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo ' DOC Building XML' @-chmod -R u+w $(srcdir) @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building HTML' @rm -rf html @mkdir html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; @echo ' DOC Fixing cross-references' @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building PDF' @rm -f $(DOC_MODULE).pdf @mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ rm -rf tmpl; \ fi maintainer-clean-local: clean @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/tmpl @mkdir $(distdir)/html @-cp ./tmpl/*.sgml $(distdir)/tmpl @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs $(builddir)/filtered_rdf_log.h: $(top_srcdir)/src/rdf_log.h $(srcdir)/../scripts/fix-gtkdoc-header.pl $(PERL) $(srcdir)/../scripts/fix-gtkdoc-header.pl < $< > $@ @MAINTAINER_MODE_TRUE@redland.3: redland.pod @MAINTAINER_MODE_TRUE@ pod2man --section=3 --center="Redland RDF Application Framework" \ @MAINTAINER_MODE_TRUE@ --release="`date +%d-%b-%Y`" --date="@PACKAGE@ @PACKAGE_VERSION@" $< | \ @MAINTAINER_MODE_TRUE@ sed -e "s;REDLAND_VERSION_STRING;@PACKAGE_VERSION@;" \ @MAINTAINER_MODE_TRUE@ -e 's;^Redland Resource;redland \\- Resource;' > $@ @MAINTAINER_MODE_TRUE@ rm -f pod2htm* @MAINTAINER_MODE_FALSE@redland.3: redland.pod @MAINTAINER_MODE_FALSE@ @echo "Creating fake $@ since maintainer mode is not enabled" @MAINTAINER_MODE_FALSE@ touch $@ README: README.html $(LYNX) $(LYNXARGS) $< > $@ @MAINTAINER_MODE_TRUE@redland-changes.xml: $(srcdir)/redland-changes.tsv $(srcdir)/../scripts/process-changes.pl @MAINTAINER_MODE_TRUE@ $(PERL) $(srcdir)/../scripts/process-changes.pl --package redland --docbook-xml $@ "Redland librdf" $(srcdir)/redland-changes.tsv # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: redland-1.0.17/docs/redland-sections.txt0000644000175000017500000003504312257576340015101 00000000000000
general LIBRDF_VERSION LIBRDF_VERSION_MAJOR LIBRDF_VERSION_MINOR LIBRDF_VERSION_RELEASE LIBRDF_VERSION_STRING librdf_version_decimal librdf_version_major librdf_version_release librdf_version_minor librdf_version_string librdf_copyright_string librdf_short_copyright_string librdf_license_string librdf_home_url_string librdf_alloc_memory librdf_calloc_memory librdf_free_memory REDLAND_DEPRECATED
world librdf_world librdf_new_world librdf_free_world librdf_world_open librdf_world_set_rasqal librdf_world_get_rasqal librdf_world_get_raptor librdf_world_set_raptor librdf_world_init_mutex librdf_world_set_error librdf_world_set_warning librdf_world_set_logger librdf_world_set_digest librdf_raptor_init_handler librdf_world_set_raptor_init_handler librdf_rasqal_init_handler librdf_world_set_rasqal_init_handler LIBRDF_WORLD_FEATURE_GENID_BASE LIBRDF_WORLD_FEATURE_GENID_COUNTER librdf_world_get_feature librdf_world_set_feature librdf_init_world librdf_destroy_world
digest librdf_digest librdf_digest_factory librdf_new_digest librdf_free_digest librdf_digest_init librdf_digest_update librdf_digest_update_string librdf_digest_final librdf_digest_get_digest librdf_digest_get_digest_length librdf_digest_to_string librdf_digest_print
log librdf_log_level_func librdf_log_func librdf_log_level librdf_log_facility librdf_log_message_code librdf_log_message_level librdf_log_message_facility librdf_log_message_message librdf_log_message_locator
hash librdf_hash librdf_hash_cursor librdf_new_hash librdf_new_hash_from_string librdf_new_hash_from_array_of_strings librdf_new_hash_from_hash librdf_free_hash librdf_hash_get librdf_hash_get_as_boolean librdf_hash_get_as_long librdf_hash_get_del librdf_hash_put_strings librdf_hash_print librdf_hash_print_keys librdf_hash_print_values librdf_hash_interpret_template librdf_hash_from_string librdf_hash_to_string
heuristics librdf_heuristic_gen_name librdf_heuristic_is_blank_node librdf_heuristic_get_blank_node librdf_heuristic_object_is_literal
iterator librdf_iterator librdf_iterator_get_method_flags librdf_iterator_map_handler librdf_iterator_map_free_context_handler librdf_new_iterator librdf_free_iterator librdf_iterator_end librdf_iterator_have_elements librdf_iterator_next librdf_iterator_get_object librdf_iterator_get_context librdf_iterator_get_key librdf_iterator_get_value librdf_iterator_add_map librdf_new_empty_iterator
list librdf_list librdf_new_list librdf_free_list librdf_list_clear librdf_list_add librdf_list_unshift librdf_list_shift librdf_list_pop librdf_list_remove librdf_list_contains librdf_list_size librdf_list_set_equals librdf_list_get_iterator librdf_list_foreach
model librdf_model librdf_model_factory librdf_model_enumerate librdf_new_model librdf_new_model_with_options librdf_new_model_from_model librdf_free_model librdf_model_size librdf_model_add librdf_model_add_string_literal_statement librdf_model_add_typed_literal_statement librdf_model_add_statement librdf_model_add_statements librdf_model_remove_statement librdf_model_contains_statement librdf_model_has_arc_in librdf_model_has_arc_out librdf_model_as_stream librdf_model_serialise librdf_model_find_statements LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL librdf_model_find_statements_with_options librdf_model_get_sources librdf_model_get_arcs librdf_model_get_targets librdf_model_get_source librdf_model_get_arc librdf_model_get_target librdf_model_get_arcs_in librdf_model_get_arcs_out librdf_model_add_submodel librdf_model_remove_submodel librdf_model_print librdf_model_context_add_statement librdf_model_context_add_statements librdf_model_context_remove_statement librdf_model_context_remove_statements librdf_model_context_as_stream librdf_model_context_serialize librdf_model_contains_context librdf_model_supports_contexts librdf_model_query_execute librdf_model_sync librdf_model_get_storage librdf_model_load librdf_model_to_counted_string librdf_model_to_string librdf_model_find_statements_in_context librdf_model_get_contexts LIBRDF_MODEL_FEATURE_CONTEXTS librdf_model_get_feature librdf_model_set_feature librdf_model_transaction_commit librdf_model_transaction_get_handle librdf_model_transaction_rollback librdf_model_transaction_start librdf_model_transaction_start_with_handle librdf_model_write
node librdf_free_node librdf_new_node librdf_new_node_from_blank_identifier librdf_new_node_from_counted_blank_identifier librdf_new_node_from_counted_uri_string librdf_new_node_from_literal librdf_new_node_from_node librdf_new_node_from_normalised_uri_string librdf_new_node_from_typed_counted_literal librdf_new_node_from_typed_literal librdf_new_node_from_uri librdf_new_node_from_uri_local_name librdf_new_node_from_uri_string librdf_node librdf_node_decode librdf_node_encode librdf_node_equals librdf_node_get_blank_identifier librdf_node_get_counted_blank_identifier librdf_node_get_li_ordinal librdf_node_get_literal_value librdf_node_get_literal_value_as_counted_string librdf_node_get_literal_value_as_latin1 librdf_node_get_literal_value_datatype_uri librdf_node_get_literal_value_is_wf_xml librdf_node_get_literal_value_language librdf_node_get_type librdf_node_get_uri librdf_node_is_blank librdf_node_is_literal librdf_node_is_resource librdf_node_new_static_node_iterator librdf_node_print librdf_node_static_iterator_create librdf_node_to_counted_string librdf_node_to_string librdf_node_type librdf_node_write
parser librdf_parser librdf_parser_factory librdf_parser_check_name librdf_parser_get_description librdf_parser_enumerate librdf_parser_guess_name librdf_parser_guess_name2 librdf_parser_register_factory librdf_new_parser librdf_new_parser_from_factory librdf_free_parser librdf_parser_parse_as_stream librdf_parser_parse_into_model librdf_parser_parse_file_handle_as_stream librdf_parser_parse_file_handle_into_model librdf_parser_parse_string_as_stream librdf_parser_parse_string_into_model librdf_parser_set_error librdf_parser_set_warning librdf_parser_parse_counted_string_as_stream librdf_parser_parse_counted_string_into_model librdf_parser_parse_iostream_as_stream librdf_parser_parse_iostream_into_model LIBRDF_PARSER_FEATURE_ERROR_COUNT LIBRDF_PARSER_FEATURE_WARNING_COUNT librdf_parser_get_feature librdf_parser_set_feature librdf_parser_get_accept_header librdf_parser_get_namespaces_seen_count librdf_parser_get_namespaces_seen_prefix librdf_parser_get_namespaces_seen_uri librdf_parser_get_uri_filter librdf_parser_set_uri_filter
query librdf_query librdf_query_factory librdf_query_register_factory librdf_query_language_get_description librdf_query_languages_enumerate librdf_new_query librdf_new_query_from_query librdf_new_query_from_factory librdf_free_query librdf_query_execute librdf_query_get_limit librdf_query_set_limit librdf_query_get_offset librdf_query_set_offset
query_results librdf_query_results librdf_query_results_as_stream librdf_query_results_get_count librdf_query_results_next librdf_query_results_finished librdf_query_results_get_bindings librdf_query_results_get_binding_value librdf_query_results_get_binding_name librdf_query_results_get_binding_value_by_name librdf_query_results_get_bindings_count librdf_query_results_to_counted_string librdf_query_results_to_counted_string2 librdf_query_results_to_string librdf_query_results_to_string2 librdf_query_results_to_file_handle librdf_query_results_to_file_handle2 librdf_query_results_to_file librdf_query_results_to_file2 librdf_free_query_results librdf_query_results_is_bindings librdf_query_results_is_boolean librdf_query_results_is_graph librdf_query_results_is_syntax librdf_query_results_get_boolean librdf_new_query_results_formatter librdf_new_query_results_formatter_by_mime_type librdf_new_query_results_formatter2 librdf_free_query_results_formatter librdf_query_results_formats_check librdf_query_results_formats_get_description librdf_query_results_formats_enumerate librdf_query_results_formatter librdf_query_results_formatter_write
serializer librdf_serializer librdf_serializer_factory librdf_serializer_get_description librdf_serializer_enumerate librdf_serializer_register_factory librdf_new_serializer librdf_new_serializer_from_factory librdf_free_serializer librdf_serializer_check_name librdf_serializer_serialize_model librdf_serializer_serialize_model_to_file_handle librdf_serializer_serialize_model_to_file librdf_serializer_serialize_model_to_string librdf_serializer_serialize_model_to_counted_string librdf_serializer_serialize_model_to_iostream librdf_serializer_serialize_stream_to_counted_string librdf_serializer_serialize_stream_to_file librdf_serializer_serialize_stream_to_file_handle librdf_serializer_serialize_stream_to_iostream librdf_serializer_serialize_stream_to_string librdf_serializer_set_error librdf_serializer_set_warning librdf_serializer_get_feature librdf_serializer_set_feature librdf_serializer_set_namespace
statement librdf_statement librdf_statement_part librdf_new_statement librdf_new_statement_from_statement librdf_new_statement_from_statement2 librdf_new_statement_from_nodes librdf_statement_init librdf_statement_clear librdf_free_statement librdf_statement_get_subject librdf_statement_set_subject librdf_statement_get_predicate librdf_statement_set_predicate librdf_statement_get_object librdf_statement_set_object librdf_statement_is_complete librdf_statement_to_string librdf_statement_print librdf_statement_equals librdf_statement_match librdf_statement_encode librdf_statement_encode2 librdf_statement_encode_parts librdf_statement_encode_parts2 librdf_statement_decode librdf_statement_decode2 librdf_statement_decode_parts librdf_statement_write
storage LIBRDF_STORAGE_INTERFACE_VERSION LIBRDF_STORAGE_MAX_INTERFACE_VERSION LIBRDF_STORAGE_MIN_INTERFACE_VERSION librdf_storage librdf_storage_factory librdf_storage_register_factory librdf_storage_enumerate librdf_new_storage librdf_new_storage_with_options librdf_new_storage_from_storage librdf_new_storage_from_factory librdf_free_storage librdf_storage_open librdf_storage_close librdf_storage_size librdf_storage_add_statement librdf_storage_add_statements librdf_storage_remove_statement librdf_storage_contains_statement librdf_storage_serialise librdf_storage_find_statements librdf_storage_find_statements_with_options librdf_storage_get_sources librdf_storage_get_arcs librdf_storage_get_targets librdf_storage_get_arcs_in librdf_storage_get_arcs_out librdf_storage_has_arc_in librdf_storage_has_arc_out librdf_storage_context_add_statement librdf_storage_context_add_statements librdf_storage_context_remove_statement librdf_storage_context_remove_statements librdf_storage_context_as_stream librdf_storage_context_serialise librdf_storage_supports_query librdf_storage_query_execute librdf_storage_sync librdf_storage_find_statements_in_context librdf_storage_get_contexts librdf_storage_get_feature librdf_storage_set_feature librdf_storage_transaction_commit librdf_storage_transaction_get_handle librdf_storage_transaction_rollback librdf_storage_transaction_start librdf_storage_transaction_start_with_handle librdf_storage_add_reference librdf_storage_remove_reference librdf_storage_instance librdf_storage_get_instance librdf_storage_set_instance librdf_storage_get_world librdf_storage_module_register_function
stream librdf_stream librdf_stream_get_method_flags librdf_stream_map_handler librdf_stream_map_free_context_handler librdf_new_stream librdf_new_stream_from_node_iterator librdf_new_empty_stream librdf_free_stream librdf_stream_end librdf_stream_next librdf_stream_get_object librdf_stream_get_context librdf_stream_get_context2 librdf_stream_add_map librdf_stream_print librdf_stream_write
unicode librdf_unichar librdf_unicode_char_to_utf8 librdf_utf8_to_unicode_char librdf_utf8_to_latin1 librdf_utf8_to_latin1_2 librdf_latin1_to_utf8 librdf_latin1_to_utf8_2 librdf_utf8_print
uri librdf_uri librdf_new_uri librdf_new_uri2 librdf_new_uri_from_uri librdf_new_uri_from_uri_local_name librdf_free_uri librdf_uri_as_string librdf_uri_as_counted_string librdf_uri_print librdf_uri_to_string librdf_uri_to_counted_string librdf_uri_equals librdf_uri_is_file_uri librdf_uri_to_filename librdf_new_uri_normalised_to_base librdf_new_uri_relative_to_base librdf_new_uri_from_filename librdf_uri_compare librdf_uri_filter_func
concepts librdf_get_concept_resource_by_index librdf_get_concept_uri_by_index librdf_get_concept_ms_namespace librdf_get_concept_schema_namespace LIBRDF_MS_Alt LIBRDF_MS_Alt_URI LIBRDF_MS_Bag LIBRDF_MS_Bag_URI LIBRDF_MS_Description LIBRDF_MS_Description_URI LIBRDF_MS_Property LIBRDF_MS_Property_URI LIBRDF_MS_RDF LIBRDF_MS_RDF_URI LIBRDF_MS_Seq LIBRDF_MS_Seq_URI LIBRDF_MS_Statement LIBRDF_MS_Statement_URI LIBRDF_MS_aboutEach LIBRDF_MS_aboutEachPrefix LIBRDF_MS_aboutEachPrefix_URI LIBRDF_MS_aboutEach_URI LIBRDF_MS_li LIBRDF_MS_li_URI LIBRDF_MS_object LIBRDF_MS_object_URI LIBRDF_MS_predicate LIBRDF_MS_predicate_URI LIBRDF_MS_subject LIBRDF_MS_subject_URI LIBRDF_MS_type LIBRDF_MS_type_URI LIBRDF_MS_value LIBRDF_MS_value_URI LIBRDF_RS_List LIBRDF_RS_List_URI LIBRDF_RS_XMLLiteral LIBRDF_RS_XMLLiteral_URI LIBRDF_RS_first LIBRDF_RS_first_URI LIBRDF_RS_nil LIBRDF_RS_nil_URI LIBRDF_RS_nodeID LIBRDF_RS_nodeID_URI LIBRDF_RS_rest LIBRDF_RS_rest_URI LIBRDF_S_Class LIBRDF_S_Class_URI LIBRDF_S_ConstraintProperty LIBRDF_S_ConstraintProperty_URI LIBRDF_S_ConstraintResource LIBRDF_S_ConstraintResource_URI LIBRDF_S_Container LIBRDF_S_ContainerMembershipProperty LIBRDF_S_ContainerMembershipProperty_URI LIBRDF_S_Container_URI LIBRDF_S_Literal LIBRDF_S_Literal_URI LIBRDF_S_Resource LIBRDF_S_Resource_URI LIBRDF_S_comment LIBRDF_S_comment_URI LIBRDF_S_domain LIBRDF_S_domain_URI LIBRDF_S_isDefinedBy LIBRDF_S_isDefinedBy_URI LIBRDF_S_label LIBRDF_S_label_URI LIBRDF_S_range LIBRDF_S_range_URI LIBRDF_S_seeAlso LIBRDF_S_seeAlso_URI LIBRDF_S_subClassOf LIBRDF_S_subClassOf_URI LIBRDF_S_subPropertyOf LIBRDF_S_subPropertyOf_URI LIBRDF_URI_RDF_MS LIBRDF_URI_RDF_SCHEMA
files librdf_files_temporary_file_name
unused REDLAND_API REDLAND_CALLBACK_STDCALL REDLAND_PRINTF_FORMAT librdf_basename librdf_concepts_index librdf_log librdf_log_simple
redland-1.0.17/docs/redland-overrides.txt0000644000175000017500000001352411773210070015237 00000000000000# Make the concept macros not reveal their definition LIBRDF_MS_Alt #define LIBRDF_MS_Alt LIBRDF_MS_Alt_URI #define LIBRDF_MS_Alt_URI LIBRDF_MS_Bag #define LIBRDF_MS_Bag LIBRDF_MS_Bag_URI #define LIBRDF_MS_Bag_URI LIBRDF_MS_Description #define LIBRDF_MS_Description LIBRDF_MS_Description_URI #define LIBRDF_MS_Description_URI LIBRDF_MS_Property #define LIBRDF_MS_Property LIBRDF_MS_Property_URI #define LIBRDF_MS_Property_URI LIBRDF_MS_RDF #define LIBRDF_MS_RDF LIBRDF_MS_RDF_URI #define LIBRDF_MS_RDF_URI LIBRDF_MS_Seq #define LIBRDF_MS_Seq LIBRDF_MS_Seq_URI #define LIBRDF_MS_Seq_URI LIBRDF_MS_Statement #define LIBRDF_MS_Statement LIBRDF_MS_Statement_URI #define LIBRDF_MS_Statement_URI LIBRDF_MS_aboutEach #define LIBRDF_MS_aboutEach LIBRDF_MS_aboutEachPrefix #define LIBRDF_MS_aboutEachPrefix LIBRDF_MS_aboutEachPrefix_URI #define LIBRDF_MS_aboutEachPrefix_URI LIBRDF_MS_aboutEach_URI #define LIBRDF_MS_aboutEach_URI LIBRDF_MS_li #define LIBRDF_MS_li LIBRDF_MS_li_URI #define LIBRDF_MS_li_URI LIBRDF_MS_object #define LIBRDF_MS_object LIBRDF_MS_object_URI #define LIBRDF_MS_object_URI LIBRDF_MS_predicate #define LIBRDF_MS_predicate LIBRDF_MS_predicate_URI #define LIBRDF_MS_predicate_URI LIBRDF_MS_subject #define LIBRDF_MS_subject LIBRDF_MS_subject_URI #define LIBRDF_MS_subject_URI LIBRDF_MS_type #define LIBRDF_MS_type LIBRDF_MS_type_URI #define LIBRDF_MS_type_URI LIBRDF_MS_value #define LIBRDF_MS_value LIBRDF_MS_value_URI #define LIBRDF_MS_value_URI LIBRDF_RS_List #define LIBRDF_RS_List LIBRDF_RS_List_URI #define LIBRDF_RS_List_URI LIBRDF_RS_XMLLiteral #define LIBRDF_RS_XMLLiteral LIBRDF_RS_XMLLiteral_URI #define LIBRDF_RS_XMLLiteral_URI LIBRDF_RS_first #define LIBRDF_RS_first LIBRDF_RS_first_URI #define LIBRDF_RS_first_URI LIBRDF_RS_nil #define LIBRDF_RS_nil LIBRDF_RS_nil_URI #define LIBRDF_RS_nil_URI LIBRDF_RS_nodeID #define LIBRDF_RS_nodeID LIBRDF_RS_nodeID_URI #define LIBRDF_RS_nodeID_URI LIBRDF_RS_rest #define LIBRDF_RS_rest LIBRDF_RS_rest_URI #define LIBRDF_RS_rest_URI LIBRDF_S_Class #define LIBRDF_S_Class LIBRDF_S_Class_URI #define LIBRDF_S_Class_URI LIBRDF_S_ConstraintProperty #define LIBRDF_S_ConstraintProperty LIBRDF_S_ConstraintProperty_URI #define LIBRDF_S_ConstraintProperty_URI LIBRDF_S_ConstraintResource #define LIBRDF_S_ConstraintResource LIBRDF_S_ConstraintResource_URI #define LIBRDF_S_ConstraintResource_URI LIBRDF_S_Container #define LIBRDF_S_Container LIBRDF_S_ContainerMembershipProperty #define LIBRDF_S_ContainerMembershipProperty LIBRDF_S_ContainerMembershipProperty_URI #define LIBRDF_S_ContainerMembershipProperty_URI LIBRDF_S_Container_URI #define LIBRDF_S_Container_URI LIBRDF_S_Literal #define LIBRDF_S_Literal LIBRDF_S_Literal_URI #define LIBRDF_S_Literal_URI LIBRDF_S_Resource #define LIBRDF_S_Resource LIBRDF_S_Resource_URI #define LIBRDF_S_Resource_URI LIBRDF_S_comment #define LIBRDF_S_comment LIBRDF_S_comment_URI #define LIBRDF_S_comment_URI LIBRDF_S_domain #define LIBRDF_S_domain LIBRDF_S_domain_URI #define LIBRDF_S_domain_URI LIBRDF_S_isDefinedBy #define LIBRDF_S_isDefinedBy LIBRDF_S_isDefinedBy_URI #define LIBRDF_S_isDefinedBy_URI LIBRDF_S_label #define LIBRDF_S_label LIBRDF_S_label_URI #define LIBRDF_S_label_URI LIBRDF_S_range #define LIBRDF_S_range LIBRDF_S_range_URI #define LIBRDF_S_range_URI LIBRDF_S_seeAlso #define LIBRDF_S_seeAlso LIBRDF_S_seeAlso_URI #define LIBRDF_S_seeAlso_URI LIBRDF_S_subClassOf #define LIBRDF_S_subClassOf LIBRDF_S_subClassOf_URI #define LIBRDF_S_subClassOf_URI LIBRDF_S_subPropertyOf #define LIBRDF_S_subPropertyOf LIBRDF_S_subPropertyOf_URI #define LIBRDF_S_subPropertyOf_URI LIBRDF_URI_RDF_MS #define LIBRDF_URI_RDF_MS LIBRDF_URI_RDF_SCHEMA #define LIBRDF_URI_RDF_SCHEMA redland-1.0.17/docs/redland.types0000644000175000017500000000000012257576340013562 00000000000000redland-1.0.17/docs/redland.pod0000644000175000017500000005744111773210070013210 00000000000000## -*- perl -*- ## ## redland.pod - redland Unix manual page ## ## $Id$ ## ## Copyright (C) 2002-2006, David Beckett http://purl.org/net/dajobe/ ## Copyright (C) 2002-2004, University of Bristol, UK http://www.bristol.ac.uk/ ## ## This package is Free Software and part of Redland http://librdf.org/ ## ## It is licensed under the following three licenses as alternatives: ## 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version ## 2. GNU General Public License (GPL) V2 or any newer version ## 3. Apache License, V2.0 or any newer version ## ## You may not use this file except in compliance with at least one of ## the above three licenses. ## ## See LICENSE.html or LICENSE.txt at the top of this package for the ## complete terms and further detail along with the license texts for ## the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. ## ## =pod =head1 NAME Redland Resource Description Framework (RDF) Library =head1 VERSION REDLAND_VERSION_STRING =head1 SYNOPSIS #include =head1 DESCRIPTION B is a library providing support for the Resource Description Framework (RDF) written in ANSI C with APIs in several other languages. This manual page lists most of the redland public API functions but does not claim to be a complete summary of the entire API. For the complete API with full details of the function interface, see the HTML API documentation either on the Redland web site at L or with the software release in the docs/api directory. =head1 FUNCTIONS The functions defined by B are all defined with the C prefix =head2 class world =over 4 =item librdf_world* B(I) =item void B(librdf_world* I) =item void B(librdf_world* I) =item void B(librdf_world* I, void* I, void (*I)(void* I, const char* I, ...)) =item void B(librdf_world* I, void* I, void (*I)(void* I, const char* I, ...)) =item void B(librdf_world*, const char* I) =item void B(librdf_world* I, librdf_hash* I) =item const char* B(librdf_world* I, librdf_uri* I) =item int B(librdf_world* I, librdf_uri* I, const char* I) =back =head2 class iterator =over 4 =item librdf_iterator* B(librdf_world* I, void* I, int (*I)(void*), void* (*I)(void*), void (*I)(void*)) =item void B(librdf_iterator*) =item int B(librdf_iterator* I) =item int B(librdf_iterator* I) =item int B(librdf_iterator* I) =item void* B(librdf_iterator* I) =item void* B(librdf_iterator* I) =item void* B(librdf_iterator* I) =item void* B(librdf_iterator* I) =item int B(librdf_iterator* I, void* (*I)(void* I, void* I), void* I) =item void* B(void* I, void* I) =back =head2 class digest =over 4 =item void B(librdf_world* I, const char* I, void (*I) (librdf_digest_factory*)) =item librdf_digest_factory* B(librdf_world* I, const char* I) =item librdf_digest* B(librdf_world* I, char* I) =item librdf_digest* B(librdf_world* I, librdf_digest_factory* I) =item void B(librdf_digest* I) =item void B(librdf_digest* I) =item void B(librdf_digest* I, unsigned char* I, size_t I) =item void B(librdf_digest* I) =item void* B(librdf_digest* I) =item char* B(librdf_digest* I) =item void B(librdf_digest* I, FILE* I) =back =head2 class uri =over 4 =item librdf_uri* B(librdf_world* I, const unsigned char * I) =item librdf_uri* B(librdf_uri* I) =item librdf_uri* B(librdf_uri* I, const unsigned char* I) =item void B(librdf_uri* I) =item unsigned char* B(librdf_uri* I) =item unsigned char* B(librdf_uri* I, size_t* I) =item librdf_digest* B(librdf_uri* I) =item void librdf_uri_print>(librdf_uri* I, FILE* I) =item unsigned char* B(librdf_uri* I) =item unsigned char* B(librdf_uri* I, size_t* I) =item int B(librdf_uri* I, librdf_uri* I) =item int B(librdf_uri* I) =item const char* B(librdf_uri* I) =item librdf_uri* B(const unsigned char* I, librdf_uri* I, librdf_uri* I) =item librdf_uri* B(librdf_uri* I, const unsigned char* I) =item librdf_uri* B(librdf_world* I, const char* I) =back =head2 class node =over 4 =item librdf_node* B(librdf_world* I) =item librdf_node* B(librdf_world* I, const char* I) =item librdf_node* B(librdf_world* I, librdf_uri* I) =item librdf_node* B(librdf_world* I, librdf_uri* I, const char* I) =item librdf_node* B(librdf_world* I, const char* I, librdf_uri* I, librdf_uri* I) =item librdf_node* B(librdf_world* I, const char* I, const char* I, int I, int I) =item librdf_node* B(librdf_world* I, const unsigned char* I, const char* I, librdf_uri* I) =item librdf_node* B(librdf_world* I, const unsigned char* I) =item librdf_node* B(librdf_node* I) =item void B(librdf_world* I, librdf_node* I) =item void B(librdf_node* I) =item librdf_uri* B(librdf_node* I) =item librdf_node_type B(librdf_node* I) =item unsigned char* B(librdf_node* I) =item unsigned char* B(librdf_node* I, size_t* I) =item char* B(librdf_node* I) =item char* B(librdf_node* I) =item int B(librdf_node* I) =item librdf_uri* B(librdf_node* I) =item int B(librdf_node* I) =item unsigned char* B(librdf_node* I) =item int B(librdf_node* I) =item int B(librdf_node* I) =item int B(librdf_node* I) =item librdf_digest* B(librdf_node* I) =item size_t B(librdf_node* I, unsigned char* I, size_t I) =item size_t B(librdf_node* I, unsigned char* I, size_t I) =item unsigned char* B(librdf_node* I) =item unsigned char* B(librdf_node* I, size_t* I) =item void B(librdf_node* I, FILE* I) =item int B(librdf_node* I, librdf_node* I) =back =head2 class concepts The library provides macros for all of the RDF and RDFS concepts - nodes and URIs. For example, C for the librdf_node for the rdf:Alt concept and C for the librdf_uri for the URI reference of rdf:Alt. C and C provide the librdf_uri objects for the RDF and RDFS namespace URIs. They must be copied using B to be shared correctly. =over 4 =item void B(librdf_world* I, int I, const char* I, librdf_uri **I, librdf_node **I) =back =head2 class statement =over 4 =item librdf_statement* B(librdf_world* I) =item librdf_statement* B(librdf_statement* I) =item librdf_statement* B(librdf_world* I, librdf_node* I, librdf_node* I, librdf_node* I) =item void B(librdf_world* I, librdf_statement* I) =item void B(librdf_statement* I) =item void B(librdf_statement* I) =item librdf_node* B(librdf_statement* I) =item void B(librdf_statement* I, librdf_node* I) =item librdf_node* B(librdf_statement* I) =item void B(librdf_statement* I, librdf_node* I) =item librdf_node* B(librdf_statement* I) =item void B(librdf_statement* I, librdf_node* I) =item int B(librdf_statement* I) =item char* B(librdf_statement* I) =item void B(librdf_statement* I, FILE* I) =item int B(librdf_statement* I, librdf_statement* I) =item int B(librdf_statement* I, librdf_statement* I) =item size_t B(librdf_statement* I, unsigned char* I, size_t I) =item size_t B(librdf_statement* I, unsigned char* I, size_t I, librdf_statement_part I) =item size_t B(librdf_statement* I, unsigned char* I, size_t I) =item size_t B(librdf_statement* I, librdf_node** I, unsigned char* I, size_t I) =back =head2 class model =over 4 =item librdf_model* B(librdf_world* I, librdf_storage* I, char* I) =item librdf_model* B(librdf_world* I, librdf_storage* I, librdf_hash* I) =item librdf_model* B(librdf_model* I) =item void B(librdf_model* I) =item int B(librdf_model* I) =item int B(librdf_model* I, librdf_node* I, librdf_node* I, librdf_node* I) =item int B(librdf_model* I, librdf_node* I, librdf_node* I, char* I, char* I, int I, int I) =item int B(librdf_model* I, librdf_node* I, librdf_node* I, const unsigned char* I, char* I, librdf_uri* I) =item int B(librdf_model* I, librdf_statement* I) =item int B(librdf_model* I, librdf_stream* I) =item int B(librdf_model* I, librdf_statement* I) =item int B(librdf_model* I, librdf_statement* I) =item int B(librdf_model* I, librdf_node* I, librdf_node* I) =item int B(librdf_model* I, librdf_node* I, librdf_node* I) =item librdf_stream* B(librdf_model* I) =item librdf_stream* B(librdf_model* I, librdf_statement* I) =item librdf_stream* B(librdf_model* I, librdf_statement* I, librdf_node* I) =item librdf_stream* B(librdf_model* I, librdf_statement* I, librdf_node* I, librdf_hash* I) =item librdf_iterator* B(librdf_model* I) =item librdf_iterator* B(librdf_model* I, librdf_node* I, librdf_node* I) =item librdf_iterator* B(librdf_model* I, librdf_node* I, librdf_node* I) =item librdf_iterator* B(librdf_model* I, librdf_node* I, librdf_node* I) =item librdf_node* B(librdf_model* I, librdf_node* I, librdf_node* I) =item librdf_node* B(librdf_model* I, librdf_node* I, librdf_node* I) =item librdf_node* B(librdf_model* I, librdf_node* I, librdf_node* I) =item librdf_iterator* B(librdf_model* I, librdf_node* I) =item librdf_iterator* B(librdf_model* I, librdf_node* I) =item int B(librdf_model* I, librdf_model* I) =item int B(librdf_model* I, librdf_model* I) =item void B(librdf_model* I, FILE* I) =item int B(librdf_model* I, librdf_node* I, librdf_statement* I) =item int B(librdf_model* I, librdf_node* I, librdf_stream* I) =item int B(librdf_model* I, librdf_node* I, librdf_statement* I) =item int B(librdf_model* I, librdf_node* I) =item librdf_stream* B(librdf_model* I, librdf_node* I) =item librdf_stream* B(librdf_model* I, librdf_query* I) =item librdf_stream* B(librdf_model* I, const char* I, librdf_uri* I, const unsigned char* I) =item void B(librdf_model* I) =item librdf_storage* B(librdf_model* I) =item librdf_node* B(librdf_model* I, librdf_uri* I) =item int B(librdf_model* I, librdf_uri* I, librdf_node* I) =back =head2 class storage =over 4 =item void B(const char* I, void (*I) (librdf_storage_factory*)) =item librdf_storage* B(librdf_world* I, char* I, char* I, char* I) =item librdf_storage* B(librdf_world* I, char* I, char* I, librdf_hash* I) =item librdf_storage* B(librdf_storage* I) =item librdf_storage* B(librdf_world* I, librdf_storage_factory* I, char* I, librdf_hash* I) =item void B(librdf_storage* I) =item int B(librdf_storage* I, librdf_model* I) =item int B(librdf_storage* I) =item int B(librdf_storage* I, void* I, size_t I, void **I, size_t* I, unsigned int I) =item int B(librdf_storage* I) =item int B(librdf_storage* I, librdf_statement* I) =item int B(librdf_storage* I, librdf_stream* I) =item int B(librdf_storage* I, librdf_statement* I) =item int B(librdf_storage* I, librdf_statement* I) =item librdf_stream* B(librdf_storage* I) =item librdf_stream* B(librdf_storage* I, librdf_statement* I) =item librdf_iterator* B(librdf_storage* I, librdf_node* I, librdf_node* I) =item librdf_iterator* B(librdf_storage* I, librdf_node* I, librdf_node* I) =item librdf_iterator* B(librdf_storage* I, librdf_node* I, librdf_node* I) =item librdf_iterator* B(librdf_storage* I, librdf_node* I) =item librdf_iterator* B(librdf_storage* I, librdf_node* I) =item int B(librdf_storage* I, librdf_node* I, librdf_node* I) =item int B(librdf_storage* I, librdf_node* I, librdf_node* I) =item int B(librdf_storage* I, librdf_node* I, librdf_statement* I) =item int B(librdf_storage* I, librdf_node* I, librdf_stream* I) =item int B(librdf_storage* I, librdf_node* I, librdf_statement* I) =item int B(librdf_storage* I, librdf_node* I) =item librdf_stream* B(librdf_storage* I, librdf_node* I) =item int B(librdf_storage* I, librdf_query* I) =item librdf_stream* B(librdf_storage* I, librdf_query* I) =item void B(librdf_storage* I) =back =head2 class parser =over 4 =item void B(librdf_world* I, const char* I, const char* I, const char* I, void (*I) (librdf_parser_factory*)) =item librdf_parser* B(librdf_world* I, const char* I, const char* I, librdf_uri* I) =item librdf_parser* B(librdf_world* I, librdf_parser_factory* I) =item void B(librdf_parser* I) =item librdf_stream* B(librdf_parser* I, librdf_uri* I, librdf_uri* I) =item int B(librdf_parser* I, librdf_uri* I, librdf_uri* I, librdf_model* I) =item librdf_stream* B(librdf_parser* I, const unsigned char* I, librdf_uri* I) =item int librdf_parser_parse_string_into_model(librdf_parser* I, const unsigned char* I, librdf_uri* I, librdf_model* I) =item void B(librdf_parser* I, void* I, void (*I)(void* I, const char* I, ...)) =item void B(librdf_parser* I, void* I, void (*I)(void* I, const char* I, ...)) =item librdf_node* B(librdf_parser* I, librdf_uri* I) =item int B(librdf_parser* I, librdf_uri* I, librdf_node* I) =back =head2 class serializer =over 4 =item librdf_serializer* librdf_new_serializer(librdf_world* I, const char *I, const char *I, librdf_uri *I) =item librdf_serializer* librdf_new_serializer_from_factory(librdf_world* I, librdf_serializer_factory *I) =item void librdf_free_serializer(librdf_serializer *I) =item int librdf_serializer_serialize_model(librdf_serializer* I, FILE* I, librdf_uri* I, librdf_model* I) =item int librdf_serializer_serialize_model_to_file(librdf_serializer* I, const char *I, librdf_uri* I, librdf_model* I) =item void librdf_serializer_set_error(librdf_serializer* I, void *I, void (*I)(void *user_data, const char *msg, ...)) =item void librdf_serializer_set_warning(librdf_serializer* I, void *I, void (*I)(void *user_data, const char *msg, ...)) =item librdf_node* librdf_serializer_get_feature(librdf_serializer* I, librdf_uri* I) =item int librdf_serializer_set_feature(librdf_serializer* I, librdf_uri* I, librdf_node* I)b =item int librdf_serializer_set_namespace(librdf_serializer* I, librdf_uri* I, const char* I) =back =head2 class stream =over 4 =item librdf_stream* B(librdf_world* I, void* I, int (*I)(void*), librdf_statement* (*I)(void*), void (*I)(void*)) =item librdf_stream* B(librdf_iterator* I, librdf_statement* I, librdf_statement_part I) =item void B(librdf_stream* I) =item int B(librdf_stream* I) =item int B(librdf_stream* I) =item librdf_statement* B(librdf_stream* I) =item void* B(librdf_stream* I) =item void B(librdf_stream* I, librdf_statement* (*I)(void* I, librdf_statement* I), void* I) =item void B(librdf_stream* I, FILE* I) =back =head1 EXAMPLES #include librdf_storage *storage; librdf_model* model; librdf_statement* statement; librdf_world* world world=librdf_new_world(); librdf_world_open(world); storage=librdf_new_storage(world, "hashes", "test", "hash-type='bdb',dir='.'"); model=librdf_new_model(world, storage, NULL); statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, "http://purl.org/net/dajobe/"), librdf_new_node_from_uri_string(world, "http://purl.org/dc/elements/1.1/creator"), librdf_new_node_from_literal(world, "Dave Beckett", NULL, 0)); librdf_model_add_statement(model, statement); librdf_free_statement(statement); librdf_model_print(model, stdout); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); =head1 SEE ALSO libraptor(3), libxml(4). =head1 HISTORY The B RDF library was created by Dave Beckett in June 2000. =head1 AUTHOR Dave Beckett L, =cut redland-1.0.17/docs/redland-chapter-storage-modules.xml0000644000175000017500000005577311773210070017770 00000000000000 Storage Modules
Introduction Redland includes several modules that implement the storage API and provide a variety of different features and functionality. This document gives the details of what each implementation module provides and the storage options used. Storage modules: hashes file mysql memory postgresql sqlite tstore uri Virtuoso
Store 'hashes' This module is always present (cannot be removed) and provides indexed storage using Redland to store various combinations of subject, predicate and object for faster access. Context nodes are also stored in a hash when used. The hashes may be in-memory (always available) or persistent via Sleepycat/Berkeley DB (BDB) versions 2-4. It is the most mature and primary persistent store and suitable for large models, tested in the 2-3 million range.. The main option requiring setting is the hash-type which must be one of the supported Redland hashes. Hash type memory is always available and if BDB has been compiled in, bdb is also available. Option dir can be used to set the destination directory for the BDB files when used. Boolean option new can be set to force creation or truncation of a persistent hashed store. The storage name must be given for hash type bdb since it is used for a filename. The module provides optional contexts support enabled when boolean storage option contexts is set. This can be used with any hash type. Examples: /* A new BDB hashed persistent store in the current directory */ storage=librdf_new_storage(world, "hashes", "db1", "new='yes',hash-type='bdb',dir='.'"); /* Hashed in-memory store */ storage=librdf_new_storage(world, "hashes", NULL, "hash-type='memory'"); /* An existing BDB hashed persistent store in dir /somewhere */ storage=librdf_new_storage(world, "hashes", "dv2", "hash-type='bdb',dir='/somewhere'"); /* An existing BDB hashed store with contexts */ storage=librdf_new_storage(world, "hashes", "db3", "hash-type='bdb',contexts='yes'"); In Python: from RDF import * ... # Create a new BDB store storage = HashStorage("db4", options="new='yes',hash-type='bdb'") In Perl: use RDF::Redland; ... # Open an existing BDB store $storage=new RDF::Redland::Storage("hashes", "db5", "hash-type='bdb',dir='.'"); Summary: Persistent or in-memory Suitable for larger models Indexed Large disk usage with BDB Optional contexts (with option contexts set)
Store 'memory' This module is always present (cannot be removed) and provides a simple and fast in-memory store with no persistence. It is the default store if no store name is given to the storage constructors. The memory store is not suitable for large in-memory models since it does not do any indexing. For that, use the with hash-type of memory. The module provides optional contexts support enabled when boolean storage option contexts is set. Examples: /* Explicitly named memory storage */ storage=librdf_new_storage(world, "memory", NULL, NULL); /* Default storage type, which is memory */ storage=librdf_new_storage(world, NULL, NULL, NULL); /* In-memory store with contexts */ storage=librdf_new_storage(world, NULL, NULL, "contexts='yes'"); Summary: In-memory Fast Suitable for small models No indexing No persistence Optional contexts (with option contexts set)
Store 'file' This module provides an in-memory model (internally, using a ) initialised from the RDF/XML content in a file. The file is given as the storage name and assumed to exist on opening. When a model or storage sync method is called or the model or store is closed, a new file is created, the old file renamed to a backup and the new file renamed to replace it. This store was added in Redland 0.9.15 There are no options for this store and contexts are not supported. Example: /* File based store from thing.rdf file */ storage=librdf_new_storage(world, "file", "thing.rdf", NULL); Summary: In-memory Suitable for small models Simple local storage to content in RDF/XML Not indexed No contexts
Store 'mysql' This module is compiled in when MySQL 3 or 4 is available. This store provides storage using the MySQL open source database including contexts. It was added in Redland 0.9.15. It has however been tested with several million triples and deployed. There are several options required with the mysql storage in order to connect to the database. These are: host for the database server hostname port for the database server port (defaults to the MySQL port 3306 if not given) database for the MySQL database name (not the storage name) user for the database server user name password for the database server password NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this. The storage name parameter given to the storage constructor librdf_new_storage is used inside the mysql store to allow multiple stores inside one MySQL database instance as parameterised with the above options. If boolean option new is given, any existing MySQL database named by the storage option database, say db will be dropped and the appropriate new tables created. The MySQL database db must already exist, such as made with the MySQL create database db command and the appropriate privileges set so that the user and password work. If boolean option reconnect is given, MySQL reconnection will be enabled so that if the database connection is dropped, MySQL will attempt to reconnect. This store always provides contexts; the boolean storage option contexts is not checked. Examples: /* A new MySQL store */ storage=librdf_new_storage(world, "mysql", "db1", "new='yes',host='localhost',database='red',user='foo','password='bar'"); /* A different, existing MySQL store db2 in the same database as above */ storage=librdf_new_storage(world, "mysql", "db2", "host='localhost',database='red',user='foo','password='bar'"); /* An existing MySQL store on a different database server */ storage=librdf_new_storage(world, "mysql", "db3", "host='db.example.org',database='abc',user='baz','password='blah'"); /* Opening with an options hash */ options=librdf_new_hash(world, NULL); librdf_hash_from_string(options, "host='db.example.org',database='abc',user='baz'"); librdf_hash_put_strings(options, "password", user_password); storage=librdf_new_storage_with_options(world, "mysql", "db4", options); In PHP: # An existing store $storage=librdf_new_storage($world, 'mysql', 'db4', "host='127.0.0.1',database='xyz',user='foo',password='blah'"); Summary: Persistent Suitable for very large models Indexed but not optimized Smaller disk usage than BDB Possibility of free text searching Contexts always provided
Store 'postgresql' This module is based on the MySQL store and is compiled in when PostgreSQL is available. This store provides storage using the PostgreSQL open source database including contexts. This store was added in Redland 1.0.3. There are several options required with the postgresql storage in order to connect to the database. These are: host for the database server hostname port for the database server port (defaults to the Postgresql port 3306 if not given) database for the Postgresql database name (not the storage name) user for the database server user name password for the database server password database for the Postgresql database name (not the storage name) NOTE: Before Redland 1.0.5, the parameter dbname had to be used instead of database for the Postgresql database name. NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this. The storage name parameter given to the storage constructor librdf_new_storage is used inside the postgresql store to allow multiple stores inside one PostgreSQL database instance as parameterised with the above optiosn. If boolean option new is given, any existing PostgreSQL database named by the storage option database, say db will be dropped and the appropriate new tables created. The PostgreSQL database db must already exist, such as made with the PostgreSQL create database db command and the appropriate privileges set so that the user and password work. This store always provides contexts; the boolean storage option contexts is not checked. Examples: /* A new PostgreSQL store */ storage=librdf_new_storage(world, "postgresql", "db1", "new='yes',host='localhost',database='red',user='foo','password='bar'"); /* A different, existing PostgreSQL store db2 in the same database as above */ storage=librdf_new_storage(world, "postgresql", "db2", "host='localhost',database='red',user='foo','password='bar'"); /* An existing PostgreSQL store on a different database server */ storage=librdf_new_storage(world, "postgresql", "db3", "host='db.example.org',database='abc',user='baz','password='blah'"); /* Opening with an options hash */ options=librdf_new_hash(world, NULL); librdf_hash_from_string(options, "host='db.example.org',database='abc',user='baz'"); librdf_hash_put_strings(options, "password", user_password); storage=librdf_new_storage_with_options(world, "postgresql", "db4", options); In PHP: # An existing store $storage=librdf_new_storage($world, 'postgresql', 'db4', "host='127.0.0.1',database='xyz',user='foo',password='blah'"); Summary: Persistent Suitable for very large models Indexed but not optimized Smaller disk usage than BDB Contexts always provided
Store 'sqlite' This module provides storage via the SQLite relational database when available and supports SQLite V2 and V3. It was added in Redland 1.0.0. This store provides triples and contexts. The only option respected by this store is the new one to create a new store, destroying any existing store. Summary: Persistent Suitable for small/medium models Indexed but not optimized Smaller disk usage than BDB Contexts always provided
Store 'tstore' This module provides storage via the AKT Triplestore when available. It was added in Redland 0.9.15 and is alpha quality - not complete or tested significantly (although the AKT store itself is used in production). This store provides a basic triple API but no redland contexts. The underlying RDQL support and inference is not yet exposed in Redland but may be in future. There are several options required with the tstore storage in order to connect to the tstore database (which uses MySQL). These are: host for the database server hostname port for the database server port database for the database name (not the storage name) user for the database server user name password for the database server password NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this. Summary: Persistent Suitable for very large models Indexed and optimized by the AKT project No Redland contexts Alpha quality
Store 'uri' This module provides an in-memory model (internally, using a ) initialised from the RDF/XML content in a URI. The URI is given as the storage name and on closing, the model is destroyed. This store was added in Redland 1.0.15. In future it may be extended to allow saving the store to the URI. There are no options for this store and contexts are not supported. Example: /* Read URI content into a store */ storage=librdf_new_storage(world, "uri", "http://example.org/content.rdf", NULL); Summary: In-memory Suitable for small models Easy access to web content in RDF/XML Not indexed No contexts
Store 'virtuoso' The Virtuoso Redland RDF Provider is an implementation of the Storage API, Model and Query interfaces of the Redland framework for RDF. This provider enables the execution of queries via the Redland Rasqal query engine or via Virtuoso query engine directly against the Virtuoso OpenSource Quad Store. The Virtuoso Redland RDF Provider uses ODBC as the data access mechanism for communicating the Virtuoso Quad Store and requires the Virtuoso ODBC Driver be installed on the Redland client and a suitable ODBC DSN be configured for connecting to the target Virtuoso Quad Store instance. The provider has been tested against the Redland 1.0.8 version currently available for download. Virtuoso is capable of efficiently handle large amounts of data and has been tested with upto 1B triples. There are several options required with the virtuoso storage in order to connect to the database. These are: dsn for the ODBC datasource name user for the database server user name password for the database server password database for the database name (not the storage name) host for the database server hostname charset for the database charset to use NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this. The storage name parameter given to the storage constructor librdf_new_storage is used inside the virtuoso store to allow multiple stores inside one Virtuoso database instance as parameterised with the above options. This store always provides contexts; the boolean storage option contexts is not checked. Examples: /* A new Virtuoso store */ storage=librdf_new_storage(world, "virtuoso", "db1", "dsn='Local Virtuoso',user='demo',password='demo'"); /* A different, existing Virtuoso store in the same database as above */ storage=librdf_new_storage(world, "virtuoso", "db2", "dsn='Local Virtuoso',user='demo',password='demo'"); /* An existing Virtuoso store on a different database server */ storage=librdf_new_storage(world, "virtuoso", "http://red3", "dsn='Remote Virtuoso',user='demo',password='demo'"); /* Opening with an options hash */ options=librdf_new_hash(world, NULL); librdf_hash_from_string(options, "dsn='Local Virtuoso',user='demo'"); librdf_hash_put_strings(options, "password", user_password); storage=librdf_new_storage_with_options(world, "virtuoso", "http://red3", options); In PHP: # An existing store $storage=librdf_new_storage($world, 'virtuoso', 'db4', "dsn='Local Virtuoso',user='demo',password='demo'"); Summary: Persistent Suitable for extremely large models, 1B+ triples Indexed and optimized Possibility of free text searching Contexts always provided
redland-1.0.17/docs/redland-chapter-intro.xml0000644000175000017500000000136511773210070015775 00000000000000 Introduction This document describes the APIs provided by Redland to use the RDF model; manipulate statements, resources, predicates and objects in the model; parse RDF/XML syntax, query and store the models. See also the Redland Home Page and the main document overview. redland-1.0.17/docs/storage.html0000644000175000017500000004471611773210070013426 00000000000000 Redland RDF Application Framework - Storage Modules

Redland RDF Application Framework - Storage Modules

Introduction

Redland includes several modules that implement the storage API and provide a variety of different features and functionality. This document gives the details of what each implementation module provides and the storage options used.

Store types:

Store 'hashes'

This module is always present (cannot be removed) and provides indexed storage using Redland hashes to store various combinations of subject, predicate and object for faster access. Context nodes are also stored in a hash when used. The hashes may be in-memory (always available) or persistent via Sleepycat/Berkeley DB (BDB) versions 2-4. It is the most mature and primary persistent store and suitable for large models, tested in the 2-3 million range..

The main option requiring setting is the hash-type which must be one of the supported Redland hashes. Hash type memory is always available and if BDB has been compiled in, bdb is also available. Option dir can be used to set the destination directory for the BDB files when used. Boolean option new can be set to force creation or truncation of a persistent hashed store. The storage name must be given for hash type bdb since it is used for a filename.

The module provides optional contexts support enabled when boolean storage option contexts is set. This can be used with any hash type.

Examples:

  /* A new BDB hashed persistent store in the current directory */
  storage=librdf_new_storage(world, "hashes", "db1",
                             "new='yes',hash-type='bdb',dir='.'");

  /* Hashed in-memory store */
  storage=librdf_new_storage(world, "hashes", NULL,
                             "hash-type='memory'");

  /* An existing BDB hashed persistent store in dir /somewhere */
  storage=librdf_new_storage(world, "hashes", "dv2", 
                             "hash-type='bdb',dir='/somewhere'");

  /* An existing BDB hashed store with contexts */
  storage=librdf_new_storage(world, "hashes", "db3", 
                             "hash-type='bdb',contexts='yes'");

In Python:

  from RDF import *
  ...
  # Create a new BDB store
  storage = HashStorage("db4", options="new='yes',hash-type='bdb'")

In Perl:

  use RDF::Redland;
  ...
  # Open an existing BDB store
  $storage=new RDF::Redland::Storage("hashes", "db5", 
                                     "hash-type='bdb',dir='.'");

Summary:

  • Persistent or in-memory
  • Suitable for larger models
  • Indexed
  • Large disk usage with BDB
  • Optional contexts (with option contexts set)

Store 'trees'

This module is always present (cannot be removed) and provides indexed storage using several balanced trees to store statements for fast querying. This store is not persistent, but is suitable for large models capable of fitting in main memory.

By default, the store is fully indexed providing good performance for all types of queries. Options can be used to select only specific indices to save memory and make insertion and deletion of statements faster. The four boolean indexing options are index-spo, index-sop, index-ops and index-pso. An index is fast for triple patterns where the variables are on the right hand side of the index ordering, e.g. the spo (subject, predicate, object) index will be fast for (s p o) (s p ?o) and (s ?p ?o) queries. The ideal index for every type of triple pattern is:

Any index:
(s p o)

(s p o):
(s p ?o), (s ?p ?o)

(o p s):
(?s p o), (?s ?p o)

(s o p):
(s ?p o)

(p s o):
(?s p ?o)

With full indexing the space used is roughly equivalent to the hashes store. Insertion and deletion with 2 indices will be roughly twice as fast as with 4 indices, etc. In the majority of cases, full indexing will be fine and there is no need to worry about selecting the right index for queries.

Examples:

  /* A fully indexed tree store */
  storage=librdf_new_storage(world, "trees", NULL, NULL);

  /* A tree store with only a (s p o) index */
  storage=librdf_new_storage(world, "trees", NULL, "index-spo='yes'");
  
  /* A tree store with only (s p o) and (o p s) indices
   * (fast for everything but queries with predicate variables */
  storage=librdf_new_storage(world, "trees", NULL,
    "index-spo='yes',index-ops='yes'");

Summary:

  • In-memory only
  • Suitable for larger models
  • Indexed, with selectable levels of indexing
  • No contexts
  • Significantly faster than hashes for most queries
  • Slower than hashes for exact statement search (librdf_model_contains_statement)

Store 'memory'

This module is always present (cannot be removed) and provides a simple and fast in-memory store with no persistence. It is the default store if no store name is given to the storage constructors.

The memory store is not suitable for large in-memory models since it does not do any indexing. For that, use the hash indexed store with hash-type of memory.

The module provides optional contexts support enabled when boolean storage option contexts is set.

Examples:

  /* Explicitly named memory storage */
  storage=librdf_new_storage(world, "memory", NULL, NULL);

  /* Default storage type, which is memory */
  storage=librdf_new_storage(world, NULL, NULL, NULL);

  /* In-memory store with contexts */
  storage=librdf_new_storage(world, NULL, NULL, "contexts='yes'");

Summary:

  • In-memory
  • Fast
  • Suitable for small models
  • No indexing
  • No persistence
  • Optional contexts (with option contexts set)

Store 'file'

This module provides an in-memory model (internally, using a memory storage) initialised from the RDF/XML content in a file. The file is given as the storage name and assumed to exist on opening. When a model or storage sync method is called or the model or store is closed, a new file is created, the old file renamed to a backup and the new file renamed to replace it. This store was added in Redland 0.9.15

There are no options for this store and contexts are not supported.

Example:

  /* File based store from thing.rdf file */
  storage=librdf_new_storage(world, "file", "thing.rdf", NULL);

Summary:

  • In-memory
  • Suitable for small models
  • Simple local storage to content in RDF/XML
  • Not indexed
  • No contexts

Store 'mysql'

This module was written by Morten Frederiksen and is compiled in when MySQL 3 or 4 is available. This store provides storage using the MySQL open source database including contexts. It is a new store added in Redland 0.9.15 and is still under development. It has however been tested with several million triples and deployed.

There are several options required with the mysql storage in order to connect to the database. These are:

  • host for the database server hostname
  • port for the database server port (defaults to the MySQL port 3306 if not given)
  • database for the MySQL database name (not the storage name)
  • user for the database server user name
  • password for the database server password

NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this.

The storage name parameter given to the storage constructor librdf_new_storage is used inside the mysql store to allow multiple stores inside one MySQL database instance as parameterised with the above optiosn.

If boolean option new is given, any existing MySQL database named by the storage option database, say db will be dropped and the appropriate new tables created. The MySQL database db must already exist, such as made with the MySQL create database db command and the appropriate privileges set so that the user and password work.

If boolean option reconnect is given, MySQL reconnection will be enabled so that if the database connection is dropped, MySQL will attempt to reconnect.

This store always provides contexts; the boolean storage option contexts is not checked.

Examples:

  /* A new MySQL store */
  storage=librdf_new_storage(world, "mysql", "db1",
      "new='yes',host='localhost',database='red',user='foo','password='bar'");

  /* A different, existing MySQL store db2 in the same database as above */
  storage=librdf_new_storage(world, "mysql", "db2",
      "host='localhost',database='red',user='foo','password='bar'");

  /* An existing MySQL store on a different database server */
  storage=librdf_new_storage(world, "mysql", "db3",
      "host='db.example.org',database='abc',user='baz','password='blah'");

  /* Opening with an options hash */
  options=librdf_new_hash(world, NULL);
  librdf_hash_from_string(options, 
      "host='db.example.org',database='abc',user='baz'");
  librdf_hash_put_strings(options, "password", user_password);
  storage=librdf_new_storage_with_options(world, "mysql", "db4", options);

In PHP:

  # An existing store
  $storage=librdf_new_storage($world, 'mysql', 'db4', 
      "host='127.0.0.1',database='xyz',user='foo',password='blah'");

Summary:

  • Persistent
  • Suitable for very large models
  • Indexed but not optimised
  • Smaller disk usage than BDB
  • Possibility of free text searching
  • Contexts always provided

Store 'postgresql'

This module was written by Shi Wenzhong based on the MySQL store written by Morten Frederiksen and is compiled in when PostgreSQL is available. This store provides storage using the PostgreSQL open source database including contexts. This store was added in This Redland 1.0.3.

There are several options required with the postgresql storage in order to connect to the database. These are:

  • host for the database server hostname
  • port for the database server port (defaults to the Postgresql port 3306 if not given)
  • database for the Postgresql database name (not the storage name)
  • user for the database server user name
  • password for the database server password
  • database for the Postgresql database name (not the storage name)

NOTE: Before Redland 1.0.5, the parameter dbname had to be used instead of database for the Postgresql database name

NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this.

The storage name parameter given to the storage constructor librdf_new_storage is used inside the postgresql store to allow multiple stores inside one PostgreSQL database instance as parameterised with the above optiosn.

If boolean option new is given, any existing PostgreSQL database named by the storage option database, say db will be dropped and the appropriate new tables created. The PostgreSQL database db must already exist, such as made with the PostgreSQL create database db command and the appropriate privileges set so that the user and password work.

This store always provides contexts; the boolean storage option contexts is not checked.

Examples:

  /* A new PostgreSQL store */
  storage=librdf_new_storage(world, "postgresql", "db1",
      "new='yes',host='localhost',database='red',user='foo','password='bar'");

  /* A different, existing PostgreSQL store db2 in the same database as above */
  storage=librdf_new_storage(world, "postgresql", "db2",
      "host='localhost',database='red',user='foo','password='bar'");

  /* An existing PostgreSQL store on a different database server */
  storage=librdf_new_storage(world, "postgresql", "db3",
      "host='db.example.org',database='abc',user='baz','password='blah'");

  /* Opening with an options hash */
  options=librdf_new_hash(world, NULL);
  librdf_hash_from_string(options, 
      "host='db.example.org',database='abc',user='baz'");
  librdf_hash_put_strings(options, "password", user_password);
  storage=librdf_new_storage_with_options(world, "postgresql", "db4", options);

In PHP:

  # An existing store
  $storage=librdf_new_storage($world, 'postgresql', 'db4', 
      "host='127.0.0.1',database='xyz',user='foo',password='blah'");

Summary:

  • Persistent
  • Suitable for very large models
  • Indexed but not optimised
  • Smaller disk usage than BDB
  • Contexts always provided

Store 'sqlite'

This module provides storage via the SQLite relational database when available and supports SQLite V2 and V3. It was added in Redland 1.0.0 and is of beta quality. This store provides triples and contexts.

The only option respected by this store is the new one to create a new store, destroying any existing store.

Summary:

  • Persistent
  • Suitable for small/medium models
  • Indexed but not optimized
  • Smaller disk usage than BDB
  • Contexts always provided

Store 'tstore'

This module provides storage via the AKT Triplestore when available. It was added in Redland 0.9.15 and is alpha quality - not complete or tested significantly (although the AKT store itself is used in production). This store provides a basic triple API but no redland contexts. The underlying RDQL support and inference is not yet exposed in Redland but may be in future.

There are several options required with the tstore storage in order to connect to the tstore database (which uses MySQL). These are:

  • host for the database server hostname
  • port for the database server port
  • database for the database name (not the storage name)
  • user for the database server user name
  • password for the database server password

NOTE: Take care exposing the password as for example, program arguments or environment variables. The rdfproc utility can with help this by reading the password from standard input. Inside programs, one way to prevent storing the password in a string is to construct a Redland hash of the storage options such as via librdf_hash_from_string and use librdf_new_storage_with_options to create a storage. The rdfproc utility source code demonstrates this.

Summary:

  • Persistent
  • Suitable for very large models
  • Indexed and optimised by the AKT project
  • No Redland contexts
  • Alpha quality

Store 'uri'

This module provides an in-memory model (internally, using a memory storage) initialised from the RDF/XML content in a URI. The URI is given as the storage name and on closing, the model is destroyed. This is a new store added in Redland 0.9.15 and is still under development. In future it may be extended to allow saving the store to the URI.

There are no options for this store and contexts are not supported.

Example:

  /* Read URI content into a store */
  storage=librdf_new_storage(world, "uri", 
     "http://example.org/content.rdf", NULL);

Summary:

  • In-memory
  • Suitable for small models
  • Easy access to web content in RDF/XML
  • Not indexed
  • No contexts

Copyright 2004-2007 Dave Beckett, Copyright 2004 University of Bristol

redland-1.0.17/docs/redland-docs.xml0000644000175000017500000001154312067705431014154 00000000000000 ]> Redland RDF Library Manual Manual for Redland &version; Dave Beckett
http://www.dajobe.org/
This documentation is Free Software / Open Source - you can redistribute it and/or modify it under the same licenses as Redland. It is licensed under the following three licenses as alternatives: GNU Lesser General Public License (LGPL) V2.1 or any newer version GNU General Public License (GPL) V2 or any newer version Apache License, V2.0 or any newer version You may not use this documentation except in compliance with at least one of the above three licenses. See the Redland site for the full license terms. 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 Dave Beckett 2000 2001 2002 2003 2004 2005 University of Bristol
Redland Overview Redland is a general-purpose Resource Description Framework (RDF) library providing APIs to the RDF model and it's concepts. Tutorial This part will describe how to use the Redland APIs. once it is written. The next part contains the Redland Reference Manual explaining the API in detail. For the latest information, see the Redland Home Page Tutorial Introduction This chapter will describe how to use the Redland APIs. once it is written. Reference Manual This part contains the Redland Reference Manual which comprehensively describes every class and function of the API. The previous part contains the Redland Tutorial explaining how to use the API parts. For the latest information, see the Redland Home Page Index
redland-1.0.17/docs/redland.30000644000175000017500000014112611773210344012566 00000000000000.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "redland 3" .TH redland 3 "redland 1.0.16" "28-Jun-2012" "Redland RDF Application Framework" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" redland \- Resource Description Framework (RDF) Library .SH "VERSION" .IX Header "VERSION" \&\s-11.0.16\s0 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& #include .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBredland\fR is a library providing support for the Resource Description Framework (\s-1RDF\s0) written in \s-1ANSI\s0 C with APIs in several other languages. .PP This manual page lists most of the redland public \s-1API\s0 functions but does not claim to be a complete summary of the entire \s-1API\s0. For the complete \s-1API\s0 with full details of the function interface, see the \&\s-1HTML\s0 \s-1API\s0 documentation either on the Redland web site at or with the software release in the docs/api directory. .SH "FUNCTIONS" .IX Header "FUNCTIONS" The functions defined by \fBredland\fR are all defined with the \&\f(CW\*(C`librdf_\*(C'\fR prefix .SS "class world" .IX Subsection "class world" .IP "librdf_world* \fBlibrdf_new_world\fR(\fIvoid\fR)" 4 .IX Item "librdf_world* librdf_new_world(void)" .PD 0 .IP "void \fBlibrdf_free_world\fR(librdf_world* \fIworld\fR)" 4 .IX Item "void librdf_free_world(librdf_world* world)" .IP "void \fBlibrdf_world_open\fR(librdf_world* \fIworld\fR)" 4 .IX Item "void librdf_world_open(librdf_world* world)" .IP "void \fBlibrdf_world_set_error\fR(librdf_world* \fIworld\fR, void* \fIuser_data\fR, void (*\fIerror_fn\fR)(void* \fIuser_data\fR, const char* \fImsg\fR, ...))" 4 .IX Item "void librdf_world_set_error(librdf_world* world, void* user_data, void (*error_fn)(void* user_data, const char* msg, ...))" .IP "void \fBlibrdf_world_set_warning\fR(librdf_world* \fIworld\fR, void* \fIuser_data\fR, void (*\fIwarning_fn\fR)(void* \fIuser_data\fR, const char* \fImsg\fR, ...))" 4 .IX Item "void librdf_world_set_warning(librdf_world* world, void* user_data, void (*warning_fn)(void* user_data, const char* msg, ...))" .IP "void \fBlibrdf_world_set_digest\fR(librdf_world*, const char* \fIname\fR)" 4 .IX Item "void librdf_world_set_digest(librdf_world*, const char* name)" .IP "void \fBlibrdf_world_set_uris_hash\fR(librdf_world* \fIworld\fR, librdf_hash* \fIuris_hash\fR)" 4 .IX Item "void librdf_world_set_uris_hash(librdf_world* world, librdf_hash* uris_hash)" .IP "const char* \fBlibrdf_world_get_feature\fR(librdf_world* \fIworld\fR, librdf_uri* \fIfeature\fR)" 4 .IX Item "const char* librdf_world_get_feature(librdf_world* world, librdf_uri* feature)" .IP "int \fBlibrdf_world_set_feature\fR(librdf_world* \fIworld\fR, librdf_uri* \fIfeature\fR, const char* \fIvalue\fR)" 4 .IX Item "int librdf_world_set_feature(librdf_world* world, librdf_uri* feature, const char* value)" .PD .SS "class iterator" .IX Subsection "class iterator" .IP "librdf_iterator* \fBlibrdf_new_iterator\fR(librdf_world* \fIworld\fR, void* \fIcontext\fR, int (*\fIis_end\fR)(void*), void* (*\fIget_next\fR)(void*), void (*\fIfinished\fR)(void*))" 4 .IX Item "librdf_iterator* librdf_new_iterator(librdf_world* world, void* context, int (*is_end)(void*), void* (*get_next)(void*), void (*finished)(void*))" .PD 0 .IP "void \fBlibrdf_free_iterator\fR(librdf_iterator*)" 4 .IX Item "void librdf_free_iterator(librdf_iterator*)" .IP "int \fBlibrdf_iterator_end\fR(librdf_iterator* \fIiterator\fR)" 4 .IX Item "int librdf_iterator_end(librdf_iterator* iterator)" .IP "int \fBlibrdf_iterator_finished\fR(librdf_iterator* \fIiterator\fR)" 4 .IX Item "int librdf_iterator_finished(librdf_iterator* iterator)" .IP "int \fBlibrdf_iterator_next\fR(librdf_iterator* \fIiterator\fR)" 4 .IX Item "int librdf_iterator_next(librdf_iterator* iterator)" .IP "void* \fBlibrdf_iterator_get_object\fR(librdf_iterator* \fIiterator\fR)" 4 .IX Item "void* librdf_iterator_get_object(librdf_iterator* iterator)" .IP "void* \fBlibrdf_iterator_get_context\fR(librdf_iterator* \fIiterator\fR)" 4 .IX Item "void* librdf_iterator_get_context(librdf_iterator* iterator)" .IP "void* \fBlibrdf_iterator_get_key\fR(librdf_iterator* \fIiterator\fR)" 4 .IX Item "void* librdf_iterator_get_key(librdf_iterator* iterator)" .IP "void* \fBlibrdf_iterator_get_value\fR(librdf_iterator* \fIiterator\fR)" 4 .IX Item "void* librdf_iterator_get_value(librdf_iterator* iterator)" .IP "int \fBlibrdf_iterator_add_map\fR(librdf_iterator* \fIiterator\fR, void* (*\fIfn\fR)(void* \fIcontext\fR, void* \fIitem\fR), void* \fIcontext\fR)" 4 .IX Item "int librdf_iterator_add_map(librdf_iterator* iterator, void* (*fn)(void* context, void* item), void* context)" .IP "void* \fBlibrdf_iterator_map_remove_duplicate_nodes\fR(void* \fIitem\fR, void* \fIuser_data\fR)" 4 .IX Item "void* librdf_iterator_map_remove_duplicate_nodes(void* item, void* user_data)" .PD .SS "class digest" .IX Subsection "class digest" .IP "void \fBlibrdf_digest_register_factory\fR(librdf_world* \fIworld\fR, const char* \fIname\fR, void (*\fIfactory\fR) (librdf_digest_factory*))" 4 .IX Item "void librdf_digest_register_factory(librdf_world* world, const char* name, void (*factory) (librdf_digest_factory*))" .PD 0 .IP "librdf_digest_factory* \fBlibrdf_get_digest_factory\fR(librdf_world* \fIworld\fR, const char* \fIname\fR)" 4 .IX Item "librdf_digest_factory* librdf_get_digest_factory(librdf_world* world, const char* name)" .IP "librdf_digest* \fBlibrdf_new_digest\fR(librdf_world* \fIworld\fR, char* \fIname\fR)" 4 .IX Item "librdf_digest* librdf_new_digest(librdf_world* world, char* name)" .IP "librdf_digest* \fBlibrdf_new_digest_from_factory\fR(librdf_world* \fIworld\fR, librdf_digest_factory* \fIfactory\fR)" 4 .IX Item "librdf_digest* librdf_new_digest_from_factory(librdf_world* world, librdf_digest_factory* factory)" .IP "void \fBlibrdf_free_digest\fR(librdf_digest* \fIdigest\fR)" 4 .IX Item "void librdf_free_digest(librdf_digest* digest)" .IP "void \fBlibrdf_digest_init\fR(librdf_digest* \fIdigest\fR)" 4 .IX Item "void librdf_digest_init(librdf_digest* digest)" .IP "void \fBlibrdf_digest_update\fR(librdf_digest* \fIdigest\fR, unsigned char* \fIbuf\fR, size_t \fIlength\fR)" 4 .IX Item "void librdf_digest_update(librdf_digest* digest, unsigned char* buf, size_t length)" .IP "void \fBlibrdf_digest_final\fR(librdf_digest* \fIdigest\fR)" 4 .IX Item "void librdf_digest_final(librdf_digest* digest)" .IP "void* \fBlibrdf_digest_get_digest\fR(librdf_digest* \fIdigest\fR)" 4 .IX Item "void* librdf_digest_get_digest(librdf_digest* digest)" .IP "char* \fBlibrdf_digest_to_string\fR(librdf_digest* \fIdigest\fR)" 4 .IX Item "char* librdf_digest_to_string(librdf_digest* digest)" .IP "void \fBlibrdf_digest_print\fR(librdf_digest* \fIdigest\fR, FILE* \fIfh\fR)" 4 .IX Item "void librdf_digest_print(librdf_digest* digest, FILE* fh)" .PD .SS "class uri" .IX Subsection "class uri" .IP "librdf_uri* \fBlibrdf_new_uri\fR(librdf_world* \fIworld\fR, const unsigned char * \fIstring\fR)" 4 .IX Item "librdf_uri* librdf_new_uri(librdf_world* world, const unsigned char * string)" .PD 0 .IP "librdf_uri* \fBlibrdf_new_uri_from_uri\fR(librdf_uri* \fIuri\fR)" 4 .IX Item "librdf_uri* librdf_new_uri_from_uri(librdf_uri* uri)" .IP "librdf_uri* \fBlibrdf_new_uri_from_uri_local_name\fR(librdf_uri* \fIuri\fR, const unsigned char* \fIlocal_name\fR)" 4 .IX Item "librdf_uri* librdf_new_uri_from_uri_local_name(librdf_uri* uri, const unsigned char* local_name)" .IP "void \fBlibrdf_free_uri\fR(librdf_uri* \fIuri\fR)" 4 .IX Item "void librdf_free_uri(librdf_uri* uri)" .IP "unsigned char* \fBlibrdf_uri_as_string\fR(librdf_uri* \fIuri\fR)" 4 .IX Item "unsigned char* librdf_uri_as_string(librdf_uri* uri)" .IP "unsigned char* \fBlibrdf_uri_as_counted_string\fR(librdf_uri* \fIuri\fR, size_t* \fIlen_p\fR)" 4 .IX Item "unsigned char* librdf_uri_as_counted_string(librdf_uri* uri, size_t* len_p)" .IP "librdf_digest* \fBlibrdf_uri_get_digest\fR(librdf_uri* \fIuri\fR)" 4 .IX Item "librdf_digest* librdf_uri_get_digest(librdf_uri* uri)" .IP "void librdf_uri_print>(librdf_uri* \fIuri\fR, FILE* \fIfh\fR)" 4 .IX Item "void librdf_uri_print>(librdf_uri* uri, FILE* fh)" .IP "unsigned char* \fBlibrdf_uri_to_string\fR(librdf_uri* \fIuri\fR)" 4 .IX Item "unsigned char* librdf_uri_to_string(librdf_uri* uri)" .IP "unsigned char* \fBlibrdf_uri_to_counted_string\fR(librdf_uri* \fIuri\fR, size_t* \fIlen_p\fR)" 4 .IX Item "unsigned char* librdf_uri_to_counted_string(librdf_uri* uri, size_t* len_p)" .IP "int \fBlibrdf_uri_equals\fR(librdf_uri* \fIfirst_uri\fR, librdf_uri* \fIsecond_uri\fR)" 4 .IX Item "int librdf_uri_equals(librdf_uri* first_uri, librdf_uri* second_uri)" .IP "int \fBlibrdf_uri_is_file_uri\fR(librdf_uri* \fIuri\fR)" 4 .IX Item "int librdf_uri_is_file_uri(librdf_uri* uri)" .IP "const char* \fBlibrdf_uri_to_filename\fR(librdf_uri* \fIuri\fR)" 4 .IX Item "const char* librdf_uri_to_filename(librdf_uri* uri)" .IP "librdf_uri* \fBlibrdf_new_uri_normalised_to_base\fR(const unsigned char* \fIuri_string\fR, librdf_uri* \fIsource_uri\fR, librdf_uri* \fIbase_uri\fR)" 4 .IX Item "librdf_uri* librdf_new_uri_normalised_to_base(const unsigned char* uri_string, librdf_uri* source_uri, librdf_uri* base_uri)" .IP "librdf_uri* \fBlibrdf_new_uri_relative_to_base\fR(librdf_uri* \fIbase_uri\fR, const unsigned char* \fIuri_string\fR)" 4 .IX Item "librdf_uri* librdf_new_uri_relative_to_base(librdf_uri* base_uri, const unsigned char* uri_string)" .IP "librdf_uri* \fBlibrdf_new_uri_from_filename\fR(librdf_world* \fIworld\fR, const char* \fIfilename\fR)" 4 .IX Item "librdf_uri* librdf_new_uri_from_filename(librdf_world* world, const char* filename)" .PD .SS "class node" .IX Subsection "class node" .IP "librdf_node* \fBlibrdf_new_node\fR(librdf_world* \fIworld\fR)" 4 .IX Item "librdf_node* librdf_new_node(librdf_world* world)" .PD 0 .IP "librdf_node* \fBlibrdf_new_node_from_uri_string\fR(librdf_world* \fIworld\fR, const char* \fIstring\fR)" 4 .IX Item "librdf_node* librdf_new_node_from_uri_string(librdf_world* world, const char* string)" .IP "librdf_node* \fBlibrdf_new_node_from_uri\fR(librdf_world* \fIworld\fR, librdf_uri* \fIuri\fR)" 4 .IX Item "librdf_node* librdf_new_node_from_uri(librdf_world* world, librdf_uri* uri)" .IP "librdf_node* \fBlibrdf_new_node_from_uri_local_name\fR(librdf_world* \fIworld\fR, librdf_uri* \fIuri\fR, const char* \fIlocal_name\fR)" 4 .IX Item "librdf_node* librdf_new_node_from_uri_local_name(librdf_world* world, librdf_uri* uri, const char* local_name)" .IP "librdf_node* \fBlibrdf_new_node_from_normalised_uri_string\fR(librdf_world* \fIworld\fR, const char* \fIuri_string\fR, librdf_uri* \fIsource_uri\fR, librdf_uri* \fIbase_uri\fR)" 4 .IX Item "librdf_node* librdf_new_node_from_normalised_uri_string(librdf_world* world, const char* uri_string, librdf_uri* source_uri, librdf_uri* base_uri)" .IP "librdf_node* \fBlibrdf_new_node_from_literal\fR(librdf_world* \fIworld\fR, const char* \fIstring\fR, const char* \fIxml_language\fR, int \fIxml_space\fR, int \fIis_wf_xml\fR)" 4 .IX Item "librdf_node* librdf_new_node_from_literal(librdf_world* world, const char* string, const char* xml_language, int xml_space, int is_wf_xml)" .IP "librdf_node* \fBlibrdf_new_node_from_typed_literal\fR(librdf_world* \fIworld\fR, const unsigned char* \fIstring\fR, const char* \fIxml_language\fR, librdf_uri* \fIdatatype_uri\fR)" 4 .IX Item "librdf_node* librdf_new_node_from_typed_literal(librdf_world* world, const unsigned char* string, const char* xml_language, librdf_uri* datatype_uri)" .IP "librdf_node* \fBlibrdf_new_node_from_blank_identifier\fR(librdf_world* \fIworld\fR, const unsigned char* \fIidentifier\fR)" 4 .IX Item "librdf_node* librdf_new_node_from_blank_identifier(librdf_world* world, const unsigned char* identifier)" .IP "librdf_node* \fBlibrdf_new_node_from_node\fR(librdf_node* \fInode\fR)" 4 .IX Item "librdf_node* librdf_new_node_from_node(librdf_node* node)" .IP "void \fBlibrdf_node_init\fR(librdf_world* \fIworld\fR, librdf_node* \fInode\fR)" 4 .IX Item "void librdf_node_init(librdf_world* world, librdf_node* node)" .IP "void \fBlibrdf_free_node\fR(librdf_node* \fIr\fR)" 4 .IX Item "void librdf_free_node(librdf_node* r)" .IP "librdf_uri* \fBlibrdf_node_get_uri\fR(librdf_node* \fInode\fR)" 4 .IX Item "librdf_uri* librdf_node_get_uri(librdf_node* node)" .IP "librdf_node_type \fBlibrdf_node_get_type\fR(librdf_node* \fInode\fR)" 4 .IX Item "librdf_node_type librdf_node_get_type(librdf_node* node)" .IP "unsigned char* \fBlibrdf_node_get_literal_value\fR(librdf_node* \fInode\fR)" 4 .IX Item "unsigned char* librdf_node_get_literal_value(librdf_node* node)" .IP "unsigned char* \fBlibrdf_node_get_literal_value_as_counted_string\fR(librdf_node* \fInode\fR, size_t* \fIlen_p\fR)" 4 .IX Item "unsigned char* librdf_node_get_literal_value_as_counted_string(librdf_node* node, size_t* len_p)" .IP "char* \fBlibrdf_node_get_literal_value_as_latin1\fR(librdf_node* \fInode\fR)" 4 .IX Item "char* librdf_node_get_literal_value_as_latin1(librdf_node* node)" .IP "char* \fBlibrdf_node_get_literal_value_language\fR(librdf_node* \fInode\fR)" 4 .IX Item "char* librdf_node_get_literal_value_language(librdf_node* node)" .IP "int \fBlibrdf_node_get_literal_value_is_wf_xml\fR(librdf_node* \fInode\fR)" 4 .IX Item "int librdf_node_get_literal_value_is_wf_xml(librdf_node* node)" .IP "librdf_uri* \fBlibrdf_node_get_literal_value_datatype_uri\fR(librdf_node* \fInode\fR)" 4 .IX Item "librdf_uri* librdf_node_get_literal_value_datatype_uri(librdf_node* node)" .IP "int \fBlibrdf_node_get_li_ordinal\fR(librdf_node* \fInode\fR)" 4 .IX Item "int librdf_node_get_li_ordinal(librdf_node* node)" .IP "unsigned char* \fBlibrdf_node_get_blank_identifier\fR(librdf_node* \fInode\fR)" 4 .IX Item "unsigned char* librdf_node_get_blank_identifier(librdf_node* node)" .IP "int \fBlibrdf_node_is_resource\fR(librdf_node* \fInode\fR)" 4 .IX Item "int librdf_node_is_resource(librdf_node* node)" .IP "int \fBlibrdf_node_is_literal\fR(librdf_node* \fInode\fR)" 4 .IX Item "int librdf_node_is_literal(librdf_node* node)" .IP "int \fBlibrdf_node_is_blank\fR(librdf_node* \fInode\fR)" 4 .IX Item "int librdf_node_is_blank(librdf_node* node)" .IP "librdf_digest* \fBlibrdf_node_get_digest\fR(librdf_node* \fInode\fR)" 4 .IX Item "librdf_digest* librdf_node_get_digest(librdf_node* node)" .IP "size_t \fBlibrdf_node_encode\fR(librdf_node* \fInode\fR, unsigned char* \fIbuffer\fR, size_t \fIlength\fR)" 4 .IX Item "size_t librdf_node_encode(librdf_node* node, unsigned char* buffer, size_t length)" .IP "size_t \fBlibrdf_node_decode\fR(librdf_node* \fInode\fR, unsigned char* \fIbuffer\fR, size_t \fIlength\fR)" 4 .IX Item "size_t librdf_node_decode(librdf_node* node, unsigned char* buffer, size_t length)" .IP "unsigned char* \fBlibrdf_node_to_string\fR(librdf_node* \fInode\fR)" 4 .IX Item "unsigned char* librdf_node_to_string(librdf_node* node)" .IP "unsigned char* \fBlibrdf_node_to_counted_string\fR(librdf_node* \fInode\fR, size_t* \fIlen_p\fR)" 4 .IX Item "unsigned char* librdf_node_to_counted_string(librdf_node* node, size_t* len_p)" .IP "void \fBlibrdf_node_print\fR(librdf_node* \fInode\fR, FILE* \fIfh\fR)" 4 .IX Item "void librdf_node_print(librdf_node* node, FILE* fh)" .IP "int \fBlibrdf_node_equals\fR(librdf_node* \fIfirst_node\fR, librdf_node* \fIsecond_node\fR)" 4 .IX Item "int librdf_node_equals(librdf_node* first_node, librdf_node* second_node)" .PD .SS "class concepts" .IX Subsection "class concepts" The library provides macros for all of the \s-1RDF\s0 and \s-1RDFS\s0 concepts \- nodes and URIs. For example, \f(CW\*(C`LIBRDF_MS_Alt\*(C'\fR for the librdf_node for the rdf:Alt concept and \f(CW\*(C`LIBRDF_MS_Alt_URI\*(C'\fR for the librdf_uri for the \s-1URI\s0 reference of rdf:Alt. .PP \&\f(CW\*(C`LIBRDF_URI_RDF_MS\*(C'\fR and \f(CW\*(C`LIBRDF_URI_RDF_SCHEMA\*(C'\fR provide the librdf_uri objects for the \s-1RDF\s0 and \s-1RDFS\s0 namespace URIs. They must be copied using \fBlibrdf_new_uri_from_uri\fR to be shared correctly. .IP "void \fBlibrdf_get_concept_by_name\fR(librdf_world* \fIworld\fR, int \fIis_ms\fR, const char* \fIname\fR, librdf_uri **\fIuri_p\fR, librdf_node **\fInode_p\fR)" 4 .IX Item "void librdf_get_concept_by_name(librdf_world* world, int is_ms, const char* name, librdf_uri **uri_p, librdf_node **node_p)" .SS "class statement" .IX Subsection "class statement" .PD 0 .IP "librdf_statement* \fBlibrdf_new_statement\fR(librdf_world* \fIworld\fR)" 4 .IX Item "librdf_statement* librdf_new_statement(librdf_world* world)" .IP "librdf_statement* \fBlibrdf_new_statement_from_statement\fR(librdf_statement* \fIstatement\fR)" 4 .IX Item "librdf_statement* librdf_new_statement_from_statement(librdf_statement* statement)" .IP "librdf_statement* \fBlibrdf_new_statement_from_nodes\fR(librdf_world* \fIworld\fR, librdf_node* \fIsubject\fR, librdf_node* \fIpredicate\fR, librdf_node* \fIobject\fR)" 4 .IX Item "librdf_statement* librdf_new_statement_from_nodes(librdf_world* world, librdf_node* subject, librdf_node* predicate, librdf_node* object)" .IP "void \fBlibrdf_statement_init\fR(librdf_world* \fIworld\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "void librdf_statement_init(librdf_world* world, librdf_statement* statement)" .IP "void \fBlibrdf_statement_clear\fR(librdf_statement* \fIstatement\fR)" 4 .IX Item "void librdf_statement_clear(librdf_statement* statement)" .IP "void \fBlibrdf_free_statement\fR(librdf_statement* \fIstatement\fR)" 4 .IX Item "void librdf_free_statement(librdf_statement* statement)" .IP "librdf_node* \fBlibrdf_statement_get_subject\fR(librdf_statement* \fIstatement\fR)" 4 .IX Item "librdf_node* librdf_statement_get_subject(librdf_statement* statement)" .IP "void \fBlibrdf_statement_set_subject\fR(librdf_statement* \fIstatement\fR, librdf_node* \fIsubject\fR)" 4 .IX Item "void librdf_statement_set_subject(librdf_statement* statement, librdf_node* subject)" .IP "librdf_node* \fBlibrdf_statement_get_predicate\fR(librdf_statement* \fIstatement\fR)" 4 .IX Item "librdf_node* librdf_statement_get_predicate(librdf_statement* statement)" .IP "void \fBlibrdf_statement_set_predicate\fR(librdf_statement* \fIstatement\fR, librdf_node* \fIpredicate\fR)" 4 .IX Item "void librdf_statement_set_predicate(librdf_statement* statement, librdf_node* predicate)" .IP "librdf_node* \fBlibrdf_statement_get_object\fR(librdf_statement* \fIstatement\fR)" 4 .IX Item "librdf_node* librdf_statement_get_object(librdf_statement* statement)" .IP "void \fBlibrdf_statement_set_object\fR(librdf_statement* \fIstatement\fR, librdf_node* \fIobject\fR)" 4 .IX Item "void librdf_statement_set_object(librdf_statement* statement, librdf_node* object)" .IP "int \fBlibrdf_statement_is_complete\fR(librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_statement_is_complete(librdf_statement* statement)" .IP "char* \fBlibrdf_statement_to_string\fR(librdf_statement* \fIstatement\fR)" 4 .IX Item "char* librdf_statement_to_string(librdf_statement* statement)" .IP "void \fBlibrdf_statement_print\fR(librdf_statement* \fIstatement\fR, FILE* \fIfh\fR)" 4 .IX Item "void librdf_statement_print(librdf_statement* statement, FILE* fh)" .IP "int \fBlibrdf_statement_equals\fR(librdf_statement* \fIstatement1\fR, librdf_statement* \fIstatement2\fR)" 4 .IX Item "int librdf_statement_equals(librdf_statement* statement1, librdf_statement* statement2)" .IP "int \fBlibrdf_statement_match\fR(librdf_statement* \fIstatement\fR, librdf_statement* \fIpartial_statement\fR)" 4 .IX Item "int librdf_statement_match(librdf_statement* statement, librdf_statement* partial_statement)" .IP "size_t \fBlibrdf_statement_encode\fR(librdf_statement* \fIstatement\fR, unsigned char* \fIbuffer\fR, size_t \fIlength\fR)" 4 .IX Item "size_t librdf_statement_encode(librdf_statement* statement, unsigned char* buffer, size_t length)" .IP "size_t \fBlibrdf_statement_encode_parts\fR(librdf_statement* \fIstatement\fR, unsigned char* \fIbuffer\fR, size_t \fIlength\fR, librdf_statement_part \fIfields\fR)" 4 .IX Item "size_t librdf_statement_encode_parts(librdf_statement* statement, unsigned char* buffer, size_t length, librdf_statement_part fields)" .IP "size_t \fBlibrdf_statement_decode\fR(librdf_statement* \fIstatement\fR, unsigned char* \fIbuffer\fR, size_t \fIlength\fR)" 4 .IX Item "size_t librdf_statement_decode(librdf_statement* statement, unsigned char* buffer, size_t length)" .IP "size_t \fBlibrdf_statement_decode_parts\fR(librdf_statement* \fIstatement\fR, librdf_node** \fIcontext_node\fR, unsigned char* \fIbuffer\fR, size_t \fIlength\fR)" 4 .IX Item "size_t librdf_statement_decode_parts(librdf_statement* statement, librdf_node** context_node, unsigned char* buffer, size_t length)" .PD .SS "class model" .IX Subsection "class model" .IP "librdf_model* \fBlibrdf_new_model\fR(librdf_world* \fIworld\fR, librdf_storage* \fIstorage\fR, char* \fIoptions_string\fR)" 4 .IX Item "librdf_model* librdf_new_model(librdf_world* world, librdf_storage* storage, char* options_string)" .PD 0 .IP "librdf_model* \fBlibrdf_new_model_with_options\fR(librdf_world* \fIworld\fR, librdf_storage* \fIstorage\fR, librdf_hash* \fIoptions\fR)" 4 .IX Item "librdf_model* librdf_new_model_with_options(librdf_world* world, librdf_storage* storage, librdf_hash* options)" .IP "librdf_model* \fBlibrdf_new_model_from_model\fR(librdf_model* \fImodel\fR)" 4 .IX Item "librdf_model* librdf_new_model_from_model(librdf_model* model)" .IP "void \fBlibrdf_free_model\fR(librdf_model* \fImodel\fR)" 4 .IX Item "void librdf_free_model(librdf_model* model)" .IP "int \fBlibrdf_model_size\fR(librdf_model* \fImodel\fR)" 4 .IX Item "int librdf_model_size(librdf_model* model)" .IP "int \fBlibrdf_model_add\fR(librdf_model* \fImodel\fR, librdf_node* \fIsubject\fR, librdf_node* \fIpredicate\fR, librdf_node* \fIobject\fR)" 4 .IX Item "int librdf_model_add(librdf_model* model, librdf_node* subject, librdf_node* predicate, librdf_node* object)" .IP "int \fBlibrdf_model_add_string_literal_statement\fR(librdf_model* \fImodel\fR, librdf_node* \fIsubject\fR, librdf_node* \fIpredicate\fR, char* \fIstring\fR, char* \fIxml_language\fR, int \fIxml_space\fR, int \fIis_wf_xml\fR)" 4 .IX Item "int librdf_model_add_string_literal_statement(librdf_model* model, librdf_node* subject, librdf_node* predicate, char* string, char* xml_language, int xml_space, int is_wf_xml)" .IP "int \fBlibrdf_model_add_typed_literal_statement\fR(librdf_model* \fImodel\fR, librdf_node* \fIsubject\fR, librdf_node* \fIpredicate\fR, const unsigned char* \fIstring\fR, char* \fIxml_language\fR, librdf_uri* \fIdatatype_uri\fR)" 4 .IX Item "int librdf_model_add_typed_literal_statement(librdf_model* model, librdf_node* subject, librdf_node* predicate, const unsigned char* string, char* xml_language, librdf_uri* datatype_uri)" .IP "int \fBlibrdf_model_add_statement\fR(librdf_model* \fImodel\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_model_add_statement(librdf_model* model, librdf_statement* statement)" .IP "int \fBlibrdf_model_add_statements\fR(librdf_model* \fImodel\fR, librdf_stream* \fIstatement_stream\fR)" 4 .IX Item "int librdf_model_add_statements(librdf_model* model, librdf_stream* statement_stream)" .IP "int \fBlibrdf_model_remove_statement\fR(librdf_model* \fImodel\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_model_remove_statement(librdf_model* model, librdf_statement* statement)" .IP "int \fBlibrdf_model_contains_statement\fR(librdf_model* \fImodel\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_model_contains_statement(librdf_model* model, librdf_statement* statement)" .IP "int \fBlibrdf_model_has_arc_in\fR(librdf_model* \fImodel\fR, librdf_node* \fInode\fR, librdf_node* \fIproperty\fR)" 4 .IX Item "int librdf_model_has_arc_in(librdf_model* model, librdf_node* node, librdf_node* property)" .IP "int \fBlibrdf_model_has_arc_out\fR(librdf_model* \fImodel\fR, librdf_node* \fInode\fR, librdf_node* \fIproperty\fR)" 4 .IX Item "int librdf_model_has_arc_out(librdf_model* model, librdf_node* node, librdf_node* property)" .IP "librdf_stream* \fBlibrdf_model_as_stream\fR(librdf_model* \fImodel\fR)" 4 .IX Item "librdf_stream* librdf_model_as_stream(librdf_model* model)" .IP "librdf_stream* \fBlibrdf_model_find_statements\fR(librdf_model* \fImodel\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "librdf_stream* librdf_model_find_statements(librdf_model* model, librdf_statement* statement)" .IP "librdf_stream* \fBlibrdf_model_find_statements_in_context\fR(librdf_model* \fImodel\fR, librdf_statement* \fIstatement\fR, librdf_node* \fIcontext_node\fR)" 4 .IX Item "librdf_stream* librdf_model_find_statements_in_context(librdf_model* model, librdf_statement* statement, librdf_node* context_node)" .IP "librdf_stream* \fBlibrdf_model_find_statements_with_options\fR(librdf_model* \fImodel\fR, librdf_statement* \fIstatement\fR, librdf_node* \fIcontext_node\fR, librdf_hash* \fIoptions\fR)" 4 .IX Item "librdf_stream* librdf_model_find_statements_with_options(librdf_model* model, librdf_statement* statement, librdf_node* context_node, librdf_hash* options)" .IP "librdf_iterator* \fBlibrdf_model_get_contexts\fR(librdf_model* \fImodel\fR)" 4 .IX Item "librdf_iterator* librdf_model_get_contexts(librdf_model* model)" .IP "librdf_iterator* \fBlibrdf_model_get_sources\fR(librdf_model* \fImodel\fR, librdf_node* \fIarc\fR, librdf_node* \fItarget\fR)" 4 .IX Item "librdf_iterator* librdf_model_get_sources(librdf_model* model, librdf_node* arc, librdf_node* target)" .IP "librdf_iterator* \fBlibrdf_model_get_arcs\fR(librdf_model* \fImodel\fR, librdf_node* \fIsource\fR, librdf_node* \fItarget\fR)" 4 .IX Item "librdf_iterator* librdf_model_get_arcs(librdf_model* model, librdf_node* source, librdf_node* target)" .IP "librdf_iterator* \fBlibrdf_model_get_targets\fR(librdf_model* \fImodel\fR, librdf_node* \fIsource\fR, librdf_node* \fIarc\fR)" 4 .IX Item "librdf_iterator* librdf_model_get_targets(librdf_model* model, librdf_node* source, librdf_node* arc)" .IP "librdf_node* \fBlibrdf_model_get_source\fR(librdf_model* \fImodel\fR, librdf_node* \fIarc\fR, librdf_node* \fItarget\fR)" 4 .IX Item "librdf_node* librdf_model_get_source(librdf_model* model, librdf_node* arc, librdf_node* target)" .IP "librdf_node* \fBlibrdf_model_get_arc\fR(librdf_model* \fImodel\fR, librdf_node* \fIsource\fR, librdf_node* \fItarget\fR)" 4 .IX Item "librdf_node* librdf_model_get_arc(librdf_model* model, librdf_node* source, librdf_node* target)" .IP "librdf_node* \fBlibrdf_model_get_target\fR(librdf_model* \fImodel\fR, librdf_node* \fIsource\fR, librdf_node* \fIarc\fR)" 4 .IX Item "librdf_node* librdf_model_get_target(librdf_model* model, librdf_node* source, librdf_node* arc)" .IP "librdf_iterator* \fBlibrdf_model_get_arcs_in\fR(librdf_model* \fImodel\fR, librdf_node* \fInode\fR)" 4 .IX Item "librdf_iterator* librdf_model_get_arcs_in(librdf_model* model, librdf_node* node)" .IP "librdf_iterator* \fBlibrdf_model_get_arcs_out\fR(librdf_model* \fImodel\fR, librdf_node* \fInode\fR)" 4 .IX Item "librdf_iterator* librdf_model_get_arcs_out(librdf_model* model, librdf_node* node)" .IP "int \fBlibrdf_model_add_submodel\fR(librdf_model* \fImodel\fR, librdf_model* \fIsub_model\fR)" 4 .IX Item "int librdf_model_add_submodel(librdf_model* model, librdf_model* sub_model)" .IP "int \fBlibrdf_model_remove_submodel\fR(librdf_model* \fImodel\fR, librdf_model* \fIsub_model\fR)" 4 .IX Item "int librdf_model_remove_submodel(librdf_model* model, librdf_model* sub_model)" .IP "void \fBlibrdf_model_print\fR(librdf_model* \fImodel\fR, FILE* \fIfh\fR)" 4 .IX Item "void librdf_model_print(librdf_model* model, FILE* fh)" .IP "int \fBlibrdf_model_context_add_statement\fR(librdf_model* \fImodel\fR, librdf_node* \fIcontext\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_model_context_add_statement(librdf_model* model, librdf_node* context, librdf_statement* statement)" .IP "int \fBlibrdf_model_context_add_statements\fR(librdf_model* \fImodel\fR, librdf_node* \fIcontext\fR, librdf_stream* \fIstream\fR)" 4 .IX Item "int librdf_model_context_add_statements(librdf_model* model, librdf_node* context, librdf_stream* stream)" .IP "int \fBlibrdf_model_context_remove_statement\fR(librdf_model* \fImodel\fR, librdf_node* \fIcontext\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_model_context_remove_statement(librdf_model* model, librdf_node* context, librdf_statement* statement)" .IP "int \fBlibrdf_model_context_remove_statements\fR(librdf_model* \fImodel\fR, librdf_node* \fIcontext\fR)" 4 .IX Item "int librdf_model_context_remove_statements(librdf_model* model, librdf_node* context)" .IP "librdf_stream* \fBlibrdf_model_context_as_stream\fR(librdf_model* \fImodel\fR, librdf_node* \fIcontext\fR)" 4 .IX Item "librdf_stream* librdf_model_context_as_stream(librdf_model* model, librdf_node* context)" .IP "librdf_stream* \fBlibrdf_model_query\fR(librdf_model* \fImodel\fR, librdf_query* \fIquery\fR)" 4 .IX Item "librdf_stream* librdf_model_query(librdf_model* model, librdf_query* query)" .IP "librdf_stream* \fBlibrdf_model_query_string\fR(librdf_model* \fImodel\fR, const char* \fIname\fR, librdf_uri* \fIuri\fR, const unsigned char* \fIquery_string\fR)" 4 .IX Item "librdf_stream* librdf_model_query_string(librdf_model* model, const char* name, librdf_uri* uri, const unsigned char* query_string)" .IP "void \fBlibrdf_model_sync\fR(librdf_model* \fImodel\fR)" 4 .IX Item "void librdf_model_sync(librdf_model* model)" .IP "librdf_storage* \fBlibrdf_model_get_storage\fR(librdf_model* \fImodel\fR)" 4 .IX Item "librdf_storage* librdf_model_get_storage(librdf_model* model)" .IP "librdf_node* \fBlibrdf_model_get_feature\fR(librdf_model* \fImodel\fR, librdf_uri* \fIfeature\fR) =item int \fBlibrdf_model_set_feature\fR(librdf_model* \fImodel\fR, librdf_uri* \fIfeature\fR, librdf_node* \fIvalue\fR)" 4 .IX Item "librdf_node* librdf_model_get_feature(librdf_model* model, librdf_uri* feature) =item int librdf_model_set_feature(librdf_model* model, librdf_uri* feature, librdf_node* value)" .PD .SS "class storage" .IX Subsection "class storage" .IP "void \fBlibrdf_storage_register_factory\fR(const char* \fIname\fR, void (*\fIfactory\fR) (librdf_storage_factory*))" 4 .IX Item "void librdf_storage_register_factory(const char* name, void (*factory) (librdf_storage_factory*))" .PD 0 .IP "librdf_storage* \fBlibrdf_new_storage\fR(librdf_world* \fIworld\fR, char* \fIstorage_name\fR, char* \fIname\fR, char* \fIoptions_string\fR)" 4 .IX Item "librdf_storage* librdf_new_storage(librdf_world* world, char* storage_name, char* name, char* options_string)" .IP "librdf_storage* \fBlibrdf_new_storage_with_options\fR(librdf_world* \fIworld\fR, char* \fIstorage_name\fR, char* \fIname\fR, librdf_hash* \fIoptions\fR)" 4 .IX Item "librdf_storage* librdf_new_storage_with_options(librdf_world* world, char* storage_name, char* name, librdf_hash* options)" .IP "librdf_storage* \fBlibrdf_new_storage_from_storage\fR(librdf_storage* \fIold_storage\fR)" 4 .IX Item "librdf_storage* librdf_new_storage_from_storage(librdf_storage* old_storage)" .IP "librdf_storage* \fBlibrdf_new_storage_from_factory\fR(librdf_world* \fIworld\fR, librdf_storage_factory* \fIfactory\fR, char* \fIname\fR, librdf_hash* \fIoptions\fR)" 4 .IX Item "librdf_storage* librdf_new_storage_from_factory(librdf_world* world, librdf_storage_factory* factory, char* name, librdf_hash* options)" .IP "void \fBlibrdf_free_storage\fR(librdf_storage* \fIstorage\fR)" 4 .IX Item "void librdf_free_storage(librdf_storage* storage)" .IP "int \fBlibrdf_storage_open\fR(librdf_storage* \fIstorage\fR, librdf_model* \fImodel\fR)" 4 .IX Item "int librdf_storage_open(librdf_storage* storage, librdf_model* model)" .IP "int \fBlibrdf_storage_close\fR(librdf_storage* \fIstorage\fR)" 4 .IX Item "int librdf_storage_close(librdf_storage* storage)" .IP "int \fBlibrdf_storage_get\fR(librdf_storage* \fIstorage\fR, void* \fIkey\fR, size_t \fIkey_len\fR, void **\fIvalue\fR, size_t* \fIvalue_len\fR, unsigned int \fIflags\fR)" 4 .IX Item "int librdf_storage_get(librdf_storage* storage, void* key, size_t key_len, void **value, size_t* value_len, unsigned int flags)" .IP "int \fBlibrdf_storage_size\fR(librdf_storage* \fIstorage\fR)" 4 .IX Item "int librdf_storage_size(librdf_storage* storage)" .IP "int \fBlibrdf_storage_add_statement\fR(librdf_storage* \fIstorage\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_storage_add_statement(librdf_storage* storage, librdf_statement* statement)" .IP "int \fBlibrdf_storage_add_statements\fR(librdf_storage* \fIstorage\fR, librdf_stream* \fIstatement_stream\fR)" 4 .IX Item "int librdf_storage_add_statements(librdf_storage* storage, librdf_stream* statement_stream)" .IP "int \fBlibrdf_storage_remove_statement\fR(librdf_storage* \fIstorage\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_storage_remove_statement(librdf_storage* storage, librdf_statement* statement)" .IP "int \fBlibrdf_storage_contains_statement\fR(librdf_storage* \fIstorage\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_storage_contains_statement(librdf_storage* storage, librdf_statement* statement)" .IP "librdf_stream* \fBlibrdf_storage_serialise\fR(librdf_storage* \fIstorage\fR)" 4 .IX Item "librdf_stream* librdf_storage_serialise(librdf_storage* storage)" .IP "librdf_stream* \fBlibrdf_storage_find_statements\fR(librdf_storage* \fIstorage\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "librdf_stream* librdf_storage_find_statements(librdf_storage* storage, librdf_statement* statement)" .IP "librdf_iterator* \fBlibrdf_storage_get_sources\fR(librdf_storage* \fIstorage\fR, librdf_node* \fIarc\fR, librdf_node* \fItarget\fR)" 4 .IX Item "librdf_iterator* librdf_storage_get_sources(librdf_storage* storage, librdf_node* arc, librdf_node* target)" .IP "librdf_iterator* \fBlibrdf_storage_get_arcs\fR(librdf_storage* \fIstorage\fR, librdf_node* \fIsource\fR, librdf_node* \fItarget\fR)" 4 .IX Item "librdf_iterator* librdf_storage_get_arcs(librdf_storage* storage, librdf_node* source, librdf_node* target)" .IP "librdf_iterator* \fBlibrdf_storage_get_targets\fR(librdf_storage* \fIstorage\fR, librdf_node* \fIsource\fR, librdf_node* \fIarc\fR)" 4 .IX Item "librdf_iterator* librdf_storage_get_targets(librdf_storage* storage, librdf_node* source, librdf_node* arc)" .IP "librdf_iterator* \fBlibrdf_storage_get_arcs_in\fR(librdf_storage* \fIstorage\fR, librdf_node* \fInode\fR)" 4 .IX Item "librdf_iterator* librdf_storage_get_arcs_in(librdf_storage* storage, librdf_node* node)" .IP "librdf_iterator* \fBlibrdf_storage_get_arcs_out\fR(librdf_storage* \fIstorage\fR, librdf_node* \fInode\fR)" 4 .IX Item "librdf_iterator* librdf_storage_get_arcs_out(librdf_storage* storage, librdf_node* node)" .IP "int \fBlibrdf_storage_has_arc_in\fR(librdf_storage* \fIstorage\fR, librdf_node* \fInode\fR, librdf_node* \fIproperty\fR)" 4 .IX Item "int librdf_storage_has_arc_in(librdf_storage* storage, librdf_node* node, librdf_node* property)" .IP "int \fBlibrdf_storage_has_arc_out\fR(librdf_storage* \fIstorage\fR, librdf_node* \fInode\fR, librdf_node* \fIproperty\fR)" 4 .IX Item "int librdf_storage_has_arc_out(librdf_storage* storage, librdf_node* node, librdf_node* property)" .IP "int \fBlibrdf_storage_context_add_statement\fR(librdf_storage* \fIstorage\fR, librdf_node* \fIcontext\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_storage_context_add_statement(librdf_storage* storage, librdf_node* context, librdf_statement* statement)" .IP "int \fBlibrdf_storage_context_add_statements\fR(librdf_storage* \fIstorage\fR, librdf_node* \fIcontext\fR, librdf_stream* \fIstream\fR)" 4 .IX Item "int librdf_storage_context_add_statements(librdf_storage* storage, librdf_node* context, librdf_stream* stream)" .IP "int \fBlibrdf_storage_context_remove_statement\fR(librdf_storage* \fIstorage\fR, librdf_node* \fIcontext\fR, librdf_statement* \fIstatement\fR)" 4 .IX Item "int librdf_storage_context_remove_statement(librdf_storage* storage, librdf_node* context, librdf_statement* statement)" .IP "int \fBlibrdf_storage_context_remove_statements\fR(librdf_storage* \fIstorage\fR, librdf_node* \fIcontext\fR)" 4 .IX Item "int librdf_storage_context_remove_statements(librdf_storage* storage, librdf_node* context)" .IP "librdf_stream* \fBlibrdf_storage_context_as_stream\fR(librdf_storage* \fIstorage\fR, librdf_node* \fIcontext\fR)" 4 .IX Item "librdf_stream* librdf_storage_context_as_stream(librdf_storage* storage, librdf_node* context)" .IP "int \fBlibrdf_storage_supports_query\fR(librdf_storage* \fIstorage\fR, librdf_query* \fIquery\fR)" 4 .IX Item "int librdf_storage_supports_query(librdf_storage* storage, librdf_query* query)" .IP "librdf_stream* \fBlibrdf_storage_query\fR(librdf_storage* \fIstorage\fR, librdf_query* \fIquery\fR)" 4 .IX Item "librdf_stream* librdf_storage_query(librdf_storage* storage, librdf_query* query)" .IP "void \fBlibrdf_storage_sync\fR(librdf_storage* \fIstorage\fR)" 4 .IX Item "void librdf_storage_sync(librdf_storage* storage)" .PD .SS "class parser" .IX Subsection "class parser" .IP "void \fBlibrdf_parser_register_factory\fR(librdf_world* \fIworld\fR, const char* \fIname\fR, const char* \fImime_type\fR, const char* \fIuri_string\fR, void (*\fIfactory\fR) (librdf_parser_factory*))" 4 .IX Item "void librdf_parser_register_factory(librdf_world* world, const char* name, const char* mime_type, const char* uri_string, void (*factory) (librdf_parser_factory*))" .PD 0 .IP "librdf_parser* \fBlibrdf_new_parser\fR(librdf_world* \fIworld\fR, const char* \fIname\fR, const char* \fImime_type\fR, librdf_uri* \fItype_uri\fR)" 4 .IX Item "librdf_parser* librdf_new_parser(librdf_world* world, const char* name, const char* mime_type, librdf_uri* type_uri)" .IP "librdf_parser* \fBlibrdf_new_parser_from_factory\fR(librdf_world* \fIworld\fR, librdf_parser_factory* \fIfactory\fR)" 4 .IX Item "librdf_parser* librdf_new_parser_from_factory(librdf_world* world, librdf_parser_factory* factory)" .IP "void \fBlibrdf_free_parser\fR(librdf_parser* \fIparser\fR)" 4 .IX Item "void librdf_free_parser(librdf_parser* parser)" .IP "librdf_stream* \fBlibrdf_parser_parse_as_stream\fR(librdf_parser* \fIparser\fR, librdf_uri* \fIuri\fR, librdf_uri* \fIbase_uri\fR)" 4 .IX Item "librdf_stream* librdf_parser_parse_as_stream(librdf_parser* parser, librdf_uri* uri, librdf_uri* base_uri)" .IP "int \fBlibrdf_parser_parse_into_model\fR(librdf_parser* \fIparser\fR, librdf_uri* \fIuri\fR, librdf_uri* \fIbase_uri\fR, librdf_model* \fImodel\fR)" 4 .IX Item "int librdf_parser_parse_into_model(librdf_parser* parser, librdf_uri* uri, librdf_uri* base_uri, librdf_model* model)" .IP "librdf_stream* \fBlibrdf_parser_parse_string_as_stream\fR(librdf_parser* \fIparser\fR, const unsigned char* \fIstring\fR, librdf_uri* \fIbase_uri\fR)" 4 .IX Item "librdf_stream* librdf_parser_parse_string_as_stream(librdf_parser* parser, const unsigned char* string, librdf_uri* base_uri)" .IP "int librdf_parser_parse_string_into_model(librdf_parser* \fIparser\fR, const unsigned char* \fIstring\fR, librdf_uri* \fIbase_uri\fR, librdf_model* \fImodel\fR)" 4 .IX Item "int librdf_parser_parse_string_into_model(librdf_parser* parser, const unsigned char* string, librdf_uri* base_uri, librdf_model* model)" .IP "void \fBlibrdf_parser_set_error\fR(librdf_parser* \fIparser\fR, void* \fIuser_data\fR, void (*\fIerror_fn\fR)(void* \fIuser_data\fR, const char* \fImsg\fR, ...))" 4 .IX Item "void librdf_parser_set_error(librdf_parser* parser, void* user_data, void (*error_fn)(void* user_data, const char* msg, ...))" .IP "void \fBlibrdf_parser_set_warning\fR(librdf_parser* \fIparser\fR, void* \fIuser_data\fR, void (*\fIwarning_fn\fR)(void* \fIuser_data\fR, const char* \fImsg\fR, ...))" 4 .IX Item "void librdf_parser_set_warning(librdf_parser* parser, void* user_data, void (*warning_fn)(void* user_data, const char* msg, ...))" .IP "librdf_node* \fBlibrdf_parser_get_feature\fR(librdf_parser* \fIparser\fR, librdf_uri* \fIfeature\fR)" 4 .IX Item "librdf_node* librdf_parser_get_feature(librdf_parser* parser, librdf_uri* feature)" .IP "int \fBlibrdf_parser_set_feature\fR(librdf_parser* \fIparser\fR, librdf_uri* \fIfeature\fR, librdf_node* \fIvalue\fR)" 4 .IX Item "int librdf_parser_set_feature(librdf_parser* parser, librdf_uri* feature, librdf_node* value)" .PD .SS "class serializer" .IX Subsection "class serializer" .IP "librdf_serializer* librdf_new_serializer(librdf_world* \fIworld\fR, const char *\fIname\fR, const char *\fImime_type\fR, librdf_uri *\fItype_uri\fR)" 4 .IX Item "librdf_serializer* librdf_new_serializer(librdf_world* world, const char *name, const char *mime_type, librdf_uri *type_uri)" .PD 0 .IP "librdf_serializer* librdf_new_serializer_from_factory(librdf_world* \fIworld\fR, librdf_serializer_factory *\fIfactory\fR)" 4 .IX Item "librdf_serializer* librdf_new_serializer_from_factory(librdf_world* world, librdf_serializer_factory *factory)" .IP "void librdf_free_serializer(librdf_serializer *\fIserializer\fR)" 4 .IX Item "void librdf_free_serializer(librdf_serializer *serializer)" .IP "int librdf_serializer_serialize_model(librdf_serializer* \fIserializer\fR, FILE* \fIhandle\fR, librdf_uri* \fIbase_uri\fR, librdf_model* \fImodel\fR)" 4 .IX Item "int librdf_serializer_serialize_model(librdf_serializer* serializer, FILE* handle, librdf_uri* base_uri, librdf_model* model)" .IP "int librdf_serializer_serialize_model_to_file(librdf_serializer* \fIserializer\fR, const char *\fIname\fR, librdf_uri* \fIbase_uri\fR, librdf_model* \fImodel\fR)" 4 .IX Item "int librdf_serializer_serialize_model_to_file(librdf_serializer* serializer, const char *name, librdf_uri* base_uri, librdf_model* model)" .IP "void librdf_serializer_set_error(librdf_serializer* \fIserializer\fR, void *\fIuser_data\fR, void (*\fIerror_fn\fR)(void *user_data, const char *msg, ...))" 4 .IX Item "void librdf_serializer_set_error(librdf_serializer* serializer, void *user_data, void (*error_fn)(void *user_data, const char *msg, ...))" .IP "void librdf_serializer_set_warning(librdf_serializer* \fIserializer\fR, void *\fIuser_data\fR, void (*\fIwarning_fn\fR)(void *user_data, const char *msg, ...))" 4 .IX Item "void librdf_serializer_set_warning(librdf_serializer* serializer, void *user_data, void (*warning_fn)(void *user_data, const char *msg, ...))" .IP "librdf_node* librdf_serializer_get_feature(librdf_serializer* \fIserializer\fR, librdf_uri* \fIfeature\fR)" 4 .IX Item "librdf_node* librdf_serializer_get_feature(librdf_serializer* serializer, librdf_uri* feature)" .IP "int librdf_serializer_set_feature(librdf_serializer* \fIserializer\fR, librdf_uri* \fIfeature\fR, librdf_node* \fIvalue\fR)b" 4 .IX Item "int librdf_serializer_set_feature(librdf_serializer* serializer, librdf_uri* feature, librdf_node* value)b" .IP "int librdf_serializer_set_namespace(librdf_serializer* \fIserializer\fR, librdf_uri* \fIuri\fR, const char* \fIprefix\fR)" 4 .IX Item "int librdf_serializer_set_namespace(librdf_serializer* serializer, librdf_uri* uri, const char* prefix)" .PD .SS "class stream" .IX Subsection "class stream" .IP "librdf_stream* \fBlibrdf_new_stream\fR(librdf_world* \fIworld\fR, void* \fIcontext\fR, int (*\fIend_of_stream\fR)(void*), librdf_statement* (*\fInext_statement\fR)(void*), void (*\fIfinished\fR)(void*))" 4 .IX Item "librdf_stream* librdf_new_stream(librdf_world* world, void* context, int (*end_of_stream)(void*), librdf_statement* (*next_statement)(void*), void (*finished)(void*))" .PD 0 .IP "librdf_stream* \fBlibrdf_new_stream_from_node_iterator\fR(librdf_iterator* \fIiterator\fR, librdf_statement* \fIstatement\fR, librdf_statement_part \fIfield\fR)" 4 .IX Item "librdf_stream* librdf_new_stream_from_node_iterator(librdf_iterator* iterator, librdf_statement* statement, librdf_statement_part field)" .IP "void \fBlibrdf_free_stream\fR(librdf_stream* \fIstream\fR)" 4 .IX Item "void librdf_free_stream(librdf_stream* stream)" .IP "int \fBlibrdf_stream_end\fR(librdf_stream* \fIstream\fR)" 4 .IX Item "int librdf_stream_end(librdf_stream* stream)" .IP "int \fBlibrdf_stream_next\fR(librdf_stream* \fIstream\fR)" 4 .IX Item "int librdf_stream_next(librdf_stream* stream)" .IP "librdf_statement* \fBlibrdf_stream_get_object\fR(librdf_stream* \fIstream\fR)" 4 .IX Item "librdf_statement* librdf_stream_get_object(librdf_stream* stream)" .IP "void* \fBlibrdf_stream_get_context\fR(librdf_stream* \fIstream\fR)" 4 .IX Item "void* librdf_stream_get_context(librdf_stream* stream)" .IP "void \fBlibrdf_stream_set_map\fR(librdf_stream* \fIstream\fR, librdf_statement* (*\fImap\fR)(void* \fIcontext\fR, librdf_statement* \fIstatement\fR), void* \fImap_context\fR)" 4 .IX Item "void librdf_stream_set_map(librdf_stream* stream, librdf_statement* (*map)(void* context, librdf_statement* statement), void* map_context)" .IP "void \fBlibrdf_stream_print\fR(librdf_stream* \fIstream\fR, FILE* \fIfh\fR)" 4 .IX Item "void librdf_stream_print(librdf_stream* stream, FILE* fh)" .PD .SH "EXAMPLES" .IX Header "EXAMPLES" .Vb 1 \& #include \& \& librdf_storage *storage; \& librdf_model* model; \& librdf_statement* statement; \& librdf_world* world \& \& world=librdf_new_world(); \& \& librdf_world_open(world); \& \& storage=librdf_new_storage(world, "hashes", "test", "hash\-type=\*(Aqbdb\*(Aq,dir=\*(Aq.\*(Aq"); \& model=librdf_new_model(world, storage, NULL); \& statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, "http://purl.org/net/dajobe/"), librdf_new_node_from_uri_string(world, "http://purl.org/dc/elements/1.1/creator"), librdf_new_node_from_literal(world, "Dave Beckett", NULL, 0)); \& \& librdf_model_add_statement(model, statement); \& librdf_free_statement(statement); \& \& librdf_model_print(model, stdout); \& \& librdf_free_model(model); \& librdf_free_storage(storage); \& librdf_free_world(world); .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIlibraptor\fR\|(3), \fIlibxml\fR\|(4). .SH "HISTORY" .IX Header "HISTORY" The \fBredland\fR \s-1RDF\s0 library was created by Dave Beckett in June 2000. .SH "AUTHOR" .IX Header "AUTHOR" Dave Beckett , redland-1.0.17/docs/version.xml.in0000644000175000017500000000001211773210070013665 00000000000000@VERSION@ redland-1.0.17/docs/redland-changes.tsv0000644000175000017500000000730711773210070014644 00000000000000# OLD VERSIONOLD RETURNOLD NAMEOLD ARGSNEW VERSIONNEW RETURNNEW NAMENEW ARGSNOTES # OLD VERSIONtypeOLD NAME-NEW VERSIONtypeNEW NAME-NOTES # OLD VERSIONenumOLD NAME-NEW VERSIONtypeNEW NAME-NOTES # # Functions # 1.0.12 - - - 1.0.13 const raptor_syntax_description* librdf_parser_get_description (librdf_world* world, unsigned int counter) Deprecates librdf_parser_enumerate() 1.0.12 - - - 1.0.13 const raptor_syntax_description* librdf_query_results_formats_get_description (librdf_world* world, unsigned int counter) Deprecates librdf_query_results_formats_enumerate() 1.0.12 - - - 1.0.13 const raptor_syntax_description* librdf_serializer_get_description (librdf_world* world, unsigned int counter) Deprecates librdf_serializer_enumerate() 1.0.13 - - - 1.0.14 int librdf_parser_parse_iostream_as_stream (librdf_parser* parser, raptor_iostream *iostream, librdf_uri* base_uri) - 1.0.13 - - - 1.0.14 int librdf_parser_parse_iostream_into_model (librdf_parser* parser, raptor_iostream *iostream, librdf_uri* base_uri, librdf_model* model) - 1.0.13 - - - 1.0.14 const raptor_syntax_description* librdf_query_language_get_description (librdf_world* world, unsigned int counter) - 1.0.13 - - - 1.0.14 int librdf_unicode_char_to_utf8 (librdf_unichar c, unsigned char *output, int length) Documented but deprecated for raptor_unicode_utf8_string_put_char() 1.0.13 - - - 1.0.14 int librdf_utf8_to_unicode_char (librdf_unichar *output, const unsigned char *input, int length) Documented but deprecated for raptor_unicode_utf8_string_get_char() 1.0.13 - - - 1.0.14 unsigned char* librdf_utf8_to_latin1 (const unsigned char *input, int length, int *output_length) - 1.0.13 - - - 1.0.14 unsigned char* librdf_latin1_to_utf8 (const unsigned char *input, int length, int *output_length) - 1.0.13 - - - 1.0.14 void librdf_utf8_print (const unsigned char *input, int length, FILE *stream) - 1.0.14 - - - 1.0.15 void librdf_free_memory (void *ptr) - 1.0.14 - - - 1.0.15 void* librdf_alloc_memory (size_t size) - 1.0.14 - - - 1.0.15 void* librdf_calloc_memory (size_t nmemb, size_t size) - 1.0.14 - - - 1.0.15 librdf_statement* librdf_new_statement_from_statement2 (librdf_statement* statement) - 1.0.14 - - - 1.0.15 librdf_hash* librdf_new_hash (librdf_world *world, const char *name) - 1.0.15 - - - 1.0.16 void librdf_world_set_raptor_init_handler (librdf_world* world, void* user_data, librdf_raptor_init_handler handler) - 1.0.15 - - - 1.0.16 void librdf_world_set_rasqal_init_handler (librdf_world* world, void* user_data, librdf_rasqal_init_handler handler) - 1.0.15 - - - 1.0.16 unsigned char* librdf_utf8_to_latin1_2 (const unsigned char *input, size_t length, unsigned char discard, size_t *output_length) Replaces librdf_utf8_to_latin1() 1.0.15 - - - 1.0.16 unsigned char* librdf_latin1_to_utf8_2 (const unsigned char *input, size_t length, size_t *output_length) Replaces librdf_latin1_to_utf8() # # Types # 1.0.12 type - - 1.0.13 type LIBRDF_VERSION - - 1.0.12 type - - 1.0.13 type LIBRDF_VERSION_STRING - - 1.0.12 type - - 1.0.13 type LIBRDF_VERSION_MAJOR - - 1.0.12 type - - 1.0.13 type LIBRDF_VERSION_MINOR - - 1.0.12 type - - 1.0.13 type LIBRDF_VERSION_RELEASE - - 1.0.12 type librdf_uri - 1.0.13 type librdf_uri - Now a typedef for raptor_uri 1.0.12 type librdf_node - 1.0.13 type librdf_node - Now a typedef for raptor_term 1.0.12 type librdf_statement - 1.0.13 type librdf_statement - Now a typedef for raptor_statement 1.0.15 type - - 1.0.16 type librdf_raptor_init_handler - - 1.0.15 type - - 1.0.16 type librdf_rasqal_init_handler - - 1.0.16 type - - 1.0.16 type librdf_license_string - - 1.0.16 type - - 1.0.16 type librdf_home_url_string - - # # Enums # redland-1.0.17/ChangeLog.60000644000175000017500000074326711171007723012072 000000000000002005-12-21 Dave Beckett * raptor/configure.ac, raptor/raptor.spec.in, raptor/Makefile.am: Write rpm release as 1 (with --enable-release) or SNAP otherwise. * raptor/src/turtle_parser.y, raptor/src/raptor_general.c, raptor/utils/rapper.1, rasqal/docs/librasqal.3, rasqal/utils/roqet.1, rasqal/fix-groff-xhtml, rasqal/rasqal-src-config.in, rasqal/configure.ac, rasqal/Makefile.am: updated urls * raptor/docs/tmpl/section-feature.sgml: Added @RAPTOR_FEATURE_WRITER_XML_DECLARATION * redland-config.in, redland-src-config.in, configure.ac, Redland.i, Makefile.am, Makefile.PL: updated urls 2005-12-20 Dave Beckett * raptor/utils/Makefile.am: Added rapper.html to dist * raptor/raptor-src-config.in, raptor/Makefile.am, raptor/manifest.pl, raptor/configure.ac: ILRT/UB link updates * raptor/docs/libraptor.3: Updated docs for 1.4.8 2005-11-30 Dave Beckett * raptor/src/raptor_xml_writer.c (raptor_xml_writer_indent): Fix writing an extra newline at doc start. 2005-11-26 Dave Beckett * raptor/docs/tmpl/section-feature.sgml: Added new feature RAPTOR_FEATURE_WRITER_XML_DECLARATION. * raptor/src/raptor_rdfxml.c (raptor_start_element_grammar): Disable XML declaration when building XML fragment for parseType="Literal". * raptor/src/raptor_xml_writer.c: Add automatic writing of the XML declaration (dependent on the XML version). (raptor_xml_writer_write_xml_declaration): Added, to support this. New feature RAPTOR_FEATURE_WRITER_XML_DECLARATION can disable this. (main): Update the test code to expect an XML declaration in the string. * raptor/src/raptor_parse.c: Add do-nothing switch cases for RAPTOR_FEATURE_WRITER_XML_DECLARATION. * raptor/src/raptor_serialize_rdfxmla.c: Add Adobe XMP compatible output as new serializer rdfxml-xmp based on patch from Sid Steward. Duplicate predicates are ignored for a single subject. * raptor/src/raptor_serialize_rdfxml.c: Defer writing xml declaration to the xml writer. * raptor/src/raptor_serialize.c: Add XML declaration writing feature support (RAPTOR_FEATURE_WRITER_XML_DECLARATION) for serializer. * raptor/utils/Makefile.am, raptor/utils/rdfcat.1, raptor/utils/rdfcat.c: Delete rdfcat for now * raptor/utils/Makefile.am, raptor/utils/rdfcat.1, raptor/utils/rdfcat.c: Added rdfcat from Sid Steward. Not automatically built or installed 2005-11-25 Dave Beckett * configure.ac: Remove multi-level escapings - dquote in backticks in dquote that are likely not very portable. Fixes Issue#0000058. * raptor/configure.ac: Add test X = 1 for expat and libxml tests. Fixes Issue#0000060 2005-11-22 Dave Beckett * raptor/src/raptor_feature.c: Added RAPTOR_FEATURE_WRITER_XML_DECLARATION feature. * raptor/src/raptor.h: Added RAPTOR_FEATURE_WRITER_XML_DECLARATION to control generating the XML declaration on serializers and XML writer. 2005-11-21 Dave Beckett * raptor/src/raptor_internal.h: docs 2005-11-20 Dave Beckett * rasqal/src/Makefile.am, rasqal/src/rasqal_internal.h: Disable skiplist code for now (don't ship it) 2005-11-10 Dave Beckett * raptor/raptor.spec.in: Add gtk-doc docs to rpm 2005-11-05 Dave Beckett * raptor/docs/tmpl/section-xml.sgml: new functions * raptor/docs/tmpl/section-feature.sgml: New feature * raptor/docs/libraptor.3: Updated for 1.4.8 2005-11-03 Dave Beckett * raptor/docs/raptor-sections.txt: Added raptor_iostream_write_xml_any_escaped_string raptor_xml_any_escape_string * raptor/src/n3_parser.y, raptor/src/raptor_internal.h, raptor/src/turtle_parser.y: Added RAPTOR_ASSERT with no return value and use it for turtle and n3 parsers. Some compilers complain at an empty 3rd macro arg with RAPTOR_ASSERT_RETURN. * raptor/src/raptor_serialize_rss.c: remove ;; * raptor/src/raptor_rdfxml.c (raptor_generate_statement): Make predicate type fix in reifying. * raptor/src/raptor_rdfxml.c (raptor_generate_statement): Make predicate revert fix actually work. * raptor/src/raptor_rdfxml.c, raptor/src/raptor_rss.c, raptor/src/turtle_parser.y, raptor/src/n3_parser.y, raptor/src/ntriples_parse.c, raptor/src/raptor.h: Revert RAPTOR_IDENTIFIER_TYPE_PREDICATE to RAPTOR_IDENTIFIER_TYPE_RESOURCE change for predicates until the next release. 2005-09-22 Dave Beckett * rasqal/tests/sparql/SyntaxFull/Makefile.am: Add new tests, 2 fail * rasqal/tests/sparql/SyntaxFull/Makefile.am: Added new tests, 2 fail * rasqal/tests/sparql/SyntaxFull/syntax-keywords-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-keywords-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-keywords-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-06.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-11.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-12.rq, rasqal/tests/sparql/ExprEquals/Makefile.am, rasqal/tests/sparql/ExprEquals/query-eq-graph-1.rq, rasqal/tests/sparql/ExprEquals/query-eq-graph-2.rq, rasqal/tests/sparql/ExprEquals/query-eq-graph-3.rq, rasqal/tests/sparql/ExprEquals/query-eq-graph-4.rq, rasqal/tests/sparql/ExprEquals/query-eq-graph-5.rq, rasqal/tests/sparql/ExprEquals/query-eq2-graph-1.rq, rasqal/tests/sparql/ExprEquals/result-eq-graph-1.ttl, rasqal/tests/sparql/ExprEquals/result-eq-graph-2.ttl, rasqal/tests/sparql/ExprEquals/result-eq-graph-3.ttl, rasqal/tests/sparql/ExprEquals/result-eq-graph-4.ttl, rasqal/tests/sparql/ExprEquals/result-eq-graph-5.ttl: Added new tests * rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/Makefile.am: Added the 9 EXPECTED_SPARQL_PARSER_FAILURES * rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/Makefile.am: Added 3 EXPECTED_SPARQL_PARSER_FAILURES: syn-05.rq syn-06.rq syn-07.rq * rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/Makefile.am: ADded 3 EXPECTED_SPARQL_CORRECT_FAILURES: syn-05.rq syn-06.rq syn-07.rq * rasqal/tests/sparql/check-sparql: If returning no results and expect fail, return 1 * rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/Makefile.am: Added 9 EXPECTED_SPARQL_CORRECT_FAILURES * rasqal/tests/sparql/ExprEquals/Makefile.am: Failures +1: "Equality - 2 var - test equals -- graph", total 3 * rasqal/tests/sparql/check-sparql: report if expected failure happens OK early on * rasqal/tests/sparql/ExprEquals/manifest.n3: Update to DAWG CVS 2005-09-21 Dave Beckett * raptor/utils/rdfdiff.c: Some code style tidying. (rdfdiff_statement_equals): Fix comparisons of literals with/out language with/out datatype. * raptor/tests/Makefile.am: break on error with rdfxml * raptor/src/raptor_serialize.c (raptor_new_serializer): Init default xml_version to 10 (XML 1.0) * raptor/src/raptor_uri.c: (raptor_new_uri_for_xmlbase, raptor_new_uri_for_retrieval): Set ud->path_len to 1 when adding a default path of / Fixes bug 0000045 http://bugs.librdf.org/mantis/view.php?id=45 2005-09-20 Dave Beckett * raptor/src/raptor_serialize_rdfxmla.c (raptor_rdfxmla_serialize_start): Pass down xml_version to the raptor_xml_writer and write the versioned header. * raptor/src/raptor_serialize_rdfxml.c (raptor_rdfxml_serialize_start): Pass down xml_version to the raptor_xml_writer and write the versioned header. * raptor/src/raptor_xml_writer.c: Add xml_version to raptor_xml_writer structure. (raptor_iostream_write_xml_element_start): Add xml_version field and pass it down to the XML escape function. (raptor_new_xml_writer): Init xml_version to 10. (raptor_xml_writer_empty_element, raptor_xml_writer_start_element, raptor_xml_writer_cdata, raptor_xml_writer_cdata_counted): Pass down xml_version. (raptor_xml_writer_set_feature, raptor_xml_writer_get_feature): Handle RAPTOR_FEATURE_WRITER_XML_VERSION. * raptor/src/raptor_xml.c (raptor_xml_any_escape_string, raptor_iostream_write_xml_any_escaped_string): Added, handling XML 1.0 or XML 1.1 Error if writing #x1-#x1f (excluding #x9, #xA, #xD) or #x7F for XML 1.0 * raptor/src/raptor_serialize.c (raptor_serializer_set_feature, raptor_serializer_get_feature): Add RAPTOR_FEATURE_WRITER_XML_VERSION * raptor/src/raptor_parse.c: switch on enum updates for feature RAPTOR_FEATURE_WRITER_XML_VERSION for serializer and xml writer * raptor/src/raptor_feature.c: Added RAPTOR_FEATURE_WRITER_XML_VERSION for serializer and xml writer with short name xmlVersion * raptor/src/raptor.h: Added RAPTOR_FEATURE_WRITER_XML_VERSION for serializer, xml writer. Added prototypes for raptor_xml_any_escape_string and raptor_iostream_write_xml_any_escaped_string * raptor/src/raptor_internal.h: raptor_serializer_s gains an xml_version field * raptor/src/raptor_sax2.c (raptor_sax2_parse_chunk): Once more with static buffer, no vsnprintf * raptor/src/raptor_sax2.c (raptor_sax2_parse_chunk): Fix error message with 2 args for expat using raptor_vsnprintf. * raptor/src/raptor_namespace.c (raptor_namespaces_format): XML escape the written namespace name URI * raptor/tests/ex-59.rdf: correct result * raptor/tests/ex-59.nt, raptor/tests/ex-59.rdf: Test rdfxml serializer escapes dquote in uri attrs * raptor/tests/Makefile.am: Added RDF_SERIALIZE_TEST_FILES, RDF_SERIALIZE_OUT_FILES and ex-59 for testing the rdfxml serializer * raptor/examples/Makefile.am: fix libraptor.la dir 2005-09-18 Dave Beckett * raptor/src/raptor_rdfxml.c (raptor_generate_statement): When reifiying, just copy predicate_type. * raptor/src/raptor_uri.c (raptor_uri_equals): Alter to accept NULL pointers, which do not compare equal to a non-NULL URI. NULL does equal NULL. * raptor/src/raptor.h: Document that RAPTOR_IDENTIFIER_TYPE_PREDICATE is never generated by a parser from now, replaced by RAPTOR_IDENTIFIER_TYPE_RESOURCE and RAPTOR_IDENTIFIER_TYPE_XML_LITERAL replaced by RAPTOR_IDENTIFIER_TYPE_LITERAL with the rdf:XMLLiteral datatype. * raptor/src/n3_parser.y, raptor/src/ntriples_parse.c, raptor/src/turtle_parser.y: Replace all RAPTOR_IDENTIFIER_TYPE_PREDICATE with RAPTOR_IDENTIFIER_TYPE_RESOURCE * raptor/src/raptor_rss.c: *** empty log message *** * raptor/src/raptor_rdfxml.c: Replace all RAPTOR_IDENTIFIER_TYPE_PREDICATE with RAPTOR_IDENTIFIER_TYPE_RESOURCE * raptor/src/raptor_rdfxml.c: Added a new concept for rdf:XMLLiteral Rename RAPTOR_N_CONCEPTS to RAPTOR_RDFXML_N_CONCEPTS (raptor_rdfxml_parse_init): Init it. (raptor_end_element_grammar): Never generate RAPTOR_IDENTIFIER_TYPE_XML_LITERAL, instead generate a RAPTOR_IDENTIFIER_TYPE_LITERAL with the rdf:XMLLiteral datatype. 2005-09-16 Dave Beckett * raptor/docs/libraptor.3: Update for 1.4.8 - added raptor_set_namespace_handler * raptor/src/raptor.h, raptor/src/raptor_www.c: Revert: remove raptor_www_set_source_uri, raptor_www_set_source_file_handle, raptor_www_retrieve and raptor_www_retrieve_to_string 2005-09-15 Dave Beckett * raptor/src/raptor.h: delete unused raptor_www_fetch_to_string prototype * raptor/src/raptor_www.c: autodocs (raptor_www_set_source_uri): Added to set URI for content source (raptor_www_set_source_file_handle): Added to set URI for content source. (raptor_www_file_handle_fetch): Added, with guts of raptor_www_file_fetch. (raptor_www_file_fetch): Modified to call raptor_www_file_handle_fetch. (raptor_www_retrieve): Added to retrieve from whatever source (URI or handle). (raptor_www_retrieve_to_string): Added to retrieve from whatever source (URI or handle) into a string. (raptor_www_fetch): Now a wrapper over raptor_www_retrieve. (raptor_www_fetch_to_string): Now a wrapper over raptor_www_retrieve_to_string. * raptor/src/raptor.h: Added prototypes for raptor_www_set_source_uri, raptor_www_set_source_file_handle, raptor_www_retrieve, raptor_www_retrieve_to_string and raptor_www_fetch_from_file_handle * raptor/src/raptor_internal.h: (struct raptor_www_s) gains a handle field 2005-09-14 Dave Beckett * librdf/rdf_parser_raptor.c (librdf_parser_raptor_parse_file_handle_as_stream): Renamed from librdf_parser_raptor_parse_file_as_stream and use FILE* arg. (librdf_parser_raptor_parse_as_stream_common): Update to handle rename. * raptor/docs/tmpl/section-parser.sgml: new functions * librdf/rdf_serializer_internal.h: struct librdf_serializer_factory_s gains serialize_model_to_iostream method. * librdf/rdf_serializer_raptor.c (librdf_serializer_raptor_serialize_model_to_iostream): Added to write to a raptor_iostream object. * librdf/rdf_serializer.c (librdf_serializer_serialize_model_to_iostream): Added to write to a raptor_iostream object. * librdf/rdf_serializer.h: Added librdf_serializer_serialize_model_to_iostream 2005-09-12 Dave Beckett * rasqal/src/sparql_parser.y (ConstructTriplesList): renamed from TriplesList and allow an empty list. * rasqal/docs/tmpl/section-unused.sgml: less unused * rasqal/src/sparql_parser.y (GraphGraphPattern): Handle return of NULL graph pattern * rasqal/src/sparql_lexer.l ({QUOTEDURI}\(?): Pass the matched string through rasqal_escaped_name_to_utf8_string to expand \u and \Us and fail on errors, then make a new URI. (rasqal_sparql_name_check): Add debug messages. (sparql_copy_qname, sparql_copy_string_token): Report name errors in prefix or local name part of a qname. * rasqal/src/rasqal_general.c (rasqal_escaped_name_to_utf8_string): Calculate dest size from result pointers, not original string source. * rasqal/configure.ac, rasqal/tests/sparql/Makefile.am, rasqal/tests/sparql/SyntaxDev/Makefile.am, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/Makefile.am, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/manifest.ttl, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-basic-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-basic-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-basic-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-basic-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-basic-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-basic-06.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-bnodes-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-bnodes-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-bnodes-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-bnodes-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-bnodes-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-bnodes-06.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-bnodes-07.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-expr-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-expr-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-expr-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-expr-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-expr-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-forms-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-forms-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-limit-offset-07.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-limit-offset-08.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-limit-offset-09.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lists-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lists-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lists-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lists-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lists-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-06.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-07.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-08.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-09.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-10.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-11.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-12.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-13.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-lit-14.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-order-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-order-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-order-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-order-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-order-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-order-06.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-pat-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-pat-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-pat-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-pat-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-qname-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-qname-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-qname-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-qname-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-qname-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-qname-06.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-qname-07.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-qname-08.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-06.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-07.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-08.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-09.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-10.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-11.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-struct-12.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-union-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL/syntax-union-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/Makefile.am, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/manifest.ttl, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-bnode-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-bnode-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-bnode-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-dataset-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-dataset-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-dataset-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-dataset-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-esc-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-esc-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-esc-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-esc-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-ask-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-ask-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-construct01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-construct02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-construct03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-construct04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-construct05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-construct06.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-describe01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-describe02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-select-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-select-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-function-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-function-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-function-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-function-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-general-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-general-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-general-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-graph-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-graph-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-graph-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-graph-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-graph-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-graph-06.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-keywords-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-keywords-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-keywords-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-lists-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-lists-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-lists-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-lists-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL2/syntax-lists-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/Makefile.am, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/bnode-dot.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/bnodes-missing-pvalues-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/bnodes-missing-pvalues-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/empty-optional-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/empty-optional-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/filter-missing-parens.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/lone-list.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/lone-node.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/manifest.ttl, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-06.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-07.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-08.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-bad-01.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-bad-02.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-bad-03.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-bad-04.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-bad-05.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-bad-06.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-bad-07.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-bad-08.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-bad-09.rq, rasqal/tests/sparql/SyntaxDev/Syntax-SPARQL3/syn-bad-10.rq: Added unapproved sparql syntax tests from DAWG SyntaxDev area * rasqal/tests/sparql/check-sparql: Ad -n flag if no data is present * rasqal/tests/sparql/check-sparql: Handle expect fail tests of type mfx:TestBadSyntax Check return code of roqet for failing. * rasqal/tests/sparql/check-sparql: Handle mfx:SyntaxType rdf:typed actions and in that case pick up the action node as the query to use (no data, no result) Only evaluate queries that have files 2005-09-10 Dave Beckett * raptor/src/raptor_expat.c: Updates to use new raptor_sax2 handler style. The user data now points at the raptor_sax2* object, not the parser. (raptor_expat_init): send SAX2 events to core raptor_sax2_EVENT routines. (raptor_expat_update_document_locator): Moved from raptor_parser.c * raptor/src/raptor_libxml.c: Updates to use new raptor_sax2 handler style. The user data now points at the raptor_sax2* object, not the parser. All raptor_parser* references are gone and error/fatal error/warnings are returned via handler/data pairs. (raptor_libxml_call_handler): Added to aid returning messages. Deleted old and unused internal entity resolution code. (raptor_libxml_init): send SAX2 events to core raptor_sax2_EVENT routines. * raptor/src/raptor_internal.h: Removed old and hardly tested internal handling of libxml entities * raptor/src/raptor_rdfxml.c: Rename raptor_xml_* to raptor_rdfxml_* in structs and functions. (raptor_rdfxml_start_element_handler, raptor_rdfxml_end_element_handler, raptor_cdata_grammar): Move expat BOM fixes to raptor_sax2.c (raptor_rdfxml_parse_init): Use new raptor_sax2_set_EVENT_handler methods. Use raptor_sax2_set_locator. (raptor_get_libxml_context, raptor_set_libxml_document_locator, raptor_get_libxml_document_locator, raptor_get_libxml_entities, raptor_set_libxml_entities, raptor_expat_update_document_locator): Deleted or merged into raptor_sax2.c * raptor/src/raptor_parse.c (raptor_parser_fatal_error_message_handler, raptor_parser_error_message_handler, raptor_parser_warning_message_handler): Added handlers that take location in same style as user message handler callbacks. (raptor_stats_print): Update for raptor_rdfxml_parser * raptor/src/raptor_locator.c (raptor_update_document_locator): Moved to raptor_sax2.c * raptor/src/raptor_general.c (raptor_init, raptor_finish): Call raptor_init_sax2 and raptor_finish_sax2 respectively. * raptor/src/raptor_internal.h: Removed several libxml/expat/rdxml functions used to be too friendly with internals of other classes. Renamed raptor_xml_parser to raptor_rdfxml_parser. Updated prototype of raptor_libxml_update_document_locator. Added new parser handler prototypes raptor_parser_error_message_handler, raptor_parser_fatal_error_message_handler and raptor_parser_warning_message_handler Added handlers for SAX2 events - start element, end element, characters, cdata, comment, unparsed_entity_decl, external_entity_ref named as raptor_sax2_EVENT_handler. raptor_sax2 gains a magic field as this is used as the user data for libxml. raptor_sax2 uses the handler typedefs for the event handlers. raptor_sax2 gains erorr, fatal and warning handler and data fields. Added prototypes for raptor_init_sax2 and raptor_finish_sax2. Updated prototype for raptor_new_sax2. Added prototypes for raptor_sax2_set_start_element_handler, raptor_sax2_set_end_element_handler, raptor_sax2_set_characters_handler, raptor_sax2_set_cdata_handler, raptor_sax2_set_comment_handler, raptor_sax2_set_unparsed_entity_decl_handler and raptor_sax2_set_external_entity_ref_handler Added prototype for raptor_sax2_set_locator. Added prototypes for: raptor_sax2_start_element raptor_sax2_end_element, raptor_sax2_characters, raptor_sax2_cdata, raptor_sax2_comment, raptor_sax2_unparsed_entity_decl and raptor_sax2_external_entity_ref. * raptor/src/raptor_sax2.c: Now a more complete class (raptor_init_sax2, raptor_finish_sax2): Added, calling any static initialising/finishing. (raptor_new_sax2): Added error, fatal_error and warning data and handler registers. Register magic for libxml2 user_data fixups (raptor_sax2_set_start_element_handler, raptor_sax2_set_end_element_handler, raptor_sax2_set_characters_handler, raptor_sax2_set_cdata_handler, raptor_sax2_set_comment_handler, raptor_sax2_set_unparsed_entity_decl_handler, raptor_sax2_set_external_entity_ref_handler): Added for setting SAX2 callback handlers. (raptor_sax2_set_locator): Added, to set SAX2 file locator. (raptor_sax2_parse_chunk): Update for new handlers, remove all mention of raptor_parser. Use this object (raptor_sax2*) as the user data now, not an external raptor_parser*. (raptor_sax2_update_document_locator): Added, updating the current location for the internal parser. (raptor_sax2_start_element): Added, internal function calling the start element handler, adding various workarounds needed. (raptor_sax2_end_element): Added, internal function calling the end element handler, adding various workarounds needed. (raptor_sax2_characters, raptor_sax2_cdata, raptor_sax2_comment, raptor_sax2_unparsed_entity_decl, raptor_sax2_external_entity_ref): Added, internal functions calling the same-named handler. 2005-09-09 Dave Beckett * raptor/docs/raptor-sections.txt: Added new fns * rasqal/docs/rasqal-sections.txt: No rasqal_variable_s * rasqal/docs/tmpl/section-graph_pattern.sgml, rasqal/docs/tmpl/section-query.sgml: add new fns * rasqal/docs/tmpl/section-literal.sgml: remove dup text * rasqal/docs/rasqal-sections.txt: add new fns * rasqal/src/Makefile.am, rasqal/utils/Makefile.am: Include @RASQAL_INTERNAL_LIBS@ in linking flags to ensure internal raptor is used. * raptor/src/raptor_internal.h (raptor_parser_s): Add new fields to the end of the struct; add unused1 to try to make old offsets work * docs/tmpl/iterator.sgml: sgml docs for iterator * docs/tmpl/stream.sgml: sgml docs for stream * raptor/src/raptor_namespace.c (raptor_namespaces_init): Remove un-necessary casts for constant namespace names. * raptor/src/raptor_uri.c (raptor_uri_uri_string_to_filename_fragment): For win32, only remove leading / if there is one present. (patch from John C. Barstow) (main): Correct test case result to match above. * raptor/src/raptor_xslt.c (raptor_xslt_parse_chunk): If the content is in one chunk and is_end is true, call xmlParseChunk with the is_end flag. (René Puls) 2005-09-07 Dave Beckett * raptor/src/n3_parser.y, raptor/src/turtle_parser.y (statement): Handle error recovery when subject is NULL 2005-09-06 Dave Beckett * raptor/utils/rapper.c: fix #ifdef SHOW_NAMESPACES_FLAG * raptor/src/turtle_common.c (raptor_stringbuffer_append_turtle_string): Do not check unsigned for <0 * raptor/src/raptor_xml.c (raptor_xml_name_check): Do not check unsigned for <0 * raptor/src/raptor_utf8.c (raptor_utf8_check): Do not check unsigned for <0 * raptor/src/raptor_serialize.c (raptor_serializers_enumerate): counter can never be <0 * raptor/src/raptor_rdfxml.c (raptor_element_content_type_as_string): Do not check unsigned for <0 * raptor/src/raptor_feature.c (raptor_feature_value_type): Do not check unsigned for <0 * raptor/src/ntriples_parse.c (raptor_ntriples_term): Do not check unsigned for <0 * raptor/src/raptor_parse.c (raptor_syntaxes_enumerate): counter can never be <0 2005-09-01 Dave Beckett * utils/rdfproc.c: one fprintf stderr to stdout * rasqal/src/sparql_lexer.l: "true" and "false" are now case independent 2005-08-31 Dave Beckett * rasqal/configure.ac: Added --with-redland-config * rasqal/src/rasqal_internal.h: Updated erasqal_engine_merge_graph_patterns and rasqal_engine_merge_triples prototypes to return an int status. * rasqal/src/rasqal_engine.c: (rasqal_engine_merge_graph_patterns, rasqal_engine_merge_triples): Visitor function now returns a status. * rasqal/src/rasqal_query.c: Moved rasqal_graph_pattern_visit to rasqal_graph_pattern.c * rasqal/src/rasqal.h: Added rasqal_graph_pattern_visit_fn. Added prototype for rasqal_graph_pattern_visit * rasqal/src/rasqal_graph_pattern.c (rasqal_graph_pattern_visit:): Moved from rasqal_query.c * rasqal/docs/tmpl/section-expression.sgml, rasqal/docs/tmpl/section-query_results.sgml: docs * rasqal/src/sparql_lexer.l, rasqal/src/sparql_parser.y: Remove NULL_LITERAL - not in SPARQL 2005-08-24 Dave Beckett * raptor/src/Makefile.am: Add more conditional compiles for serializers * raptor/src/Makefile.am: Added raptor_serialize_rdfxml.c raptor_serialize_ntriples.c raptor_serialize_simple.c * raptor/src/raptor_serialize.c: Moved specific serializers into separate files - rdfxml, ntriples, simple * raptor/src/raptor_serialize_rdfxml.c: RDF/XML serializer * raptor/src/raptor_serialize_ntriples.c: N-Triples serializer * raptor/src/raptor_serialize_simple.c: Simple serializer * raptor/src/raptor-config.1, raptor/src/raptor-config.in: s/features/options/ so not to confuse with raptor_feature * raptor/utils/rapper.c: Add HELP_TEXT_LONG to deal with help that has no short option. * raptor/utils/rapper.c: fix --show-namespaces help * raptor/utils/rapper.1: Added --show-namespaces * raptor/utils/rapper.c: (print_namespaces) Added Added --show-namespaces option - long options only. * raptor/src/n3_parser.y, raptor/src/raptor_rdfxml.c, raptor/src/turtle_parser.y: Handle raptor_new_namespace failing. * raptor/src/n3_parser.y, raptor/src/raptor_rdfxml.c, raptor/src/turtle_parser.y: Remove calls to raptor_namespaces_start_namespace_full and use the three functions raptor_new_namespace, raptor_namespaces_start_namespace and raptor_parser_start_namespace instead. * raptor/src/raptor_parse.c (raptor_set_namespace_handler): Added. New user method. (raptor_parser_start_namespace): Added. Internal function to operate when namespaces are declared. * raptor/src/raptor.h: Added raptor_namespace_handler typedef. Added raptor_set_namespace_handler prototype. * raptor/src/raptor_internal.h: raptor_parser_s gains namespace_handler and namespace_handler_user_data fields. Added raptor_parser_start_namespace prototype. * raptor/tests/Makefile.am: link to libxml2 bug report * raptor/src/raptor_rss.c (raptor_rss_emit_type_triple, raptor_rss_emit_enclosure, raptor_rss_emit_connection): Zap literal language and datatype before setting up statement objects. * raptor/src/ntriples_parse.c (raptor_ntriples_generate_statement): Zap literal language and datatype before setting up statement objects. * raptor/src/n3_parser.y (raptor_n3_generate_statement): Zap literal language and datatype for !literals. Add assertion. * raptor/src/raptor_internal.h (RAPTOR_ASSERT_RETURN): Remove ()s around return to allow no-value. * raptor/src/turtle_parser.y (raptor_turtle_generate_statement): Zap literal language and datatype for !literals. Add assertion. 2005-08-23 Dave Beckett * rasqal/docs/tmpl/section-triples_source.sgml: section title * rasqal/docs/rasqal-sections.txt: Added rasqal_new_expression_from_expression * rasqal/src/rasqal_expr.c: Added usage count to rasqal_expression constructors (rasqal_new_expression_from_expression): Added copy constructor. * rasqal/src/rasqal_engine.c (rasqal_engine_join_graph_patterns): Move constraints taking care to copy then free correctly. * rasqal/src/rasqal.h: Added usage count to rasqal_expression. Added rasqal_new_expression_from_expression prototype. 2005-08-22 Dave Beckett * raptor/docs/raptor-sections.txt: raptor_uri_init now internal * raptor/docs/tmpl/section-unused.sgml: raptor_uri_init now internal * raptor/docs/tmpl/section-general.sgml, raptor/src/raptor_internal.h: Remove unused container_test_handler function. * raptor/docs/raptor-sections.txt: No raptor_container_test_handler * raptor/src/raptor.h: raptor_uri_init was internal * raptor/src/raptor_internal.h: raptor_uri_init was internal 2005-08-19 Dave Beckett * raptor/Makefile.am: Enable gtk doc with make distcheck * raptor/docs/tmpl/section-xml-namespace.sgml: args * raptor/docs/version.xml.in: version.xml.in * raptor/docs/tmpl/section-serializer.sgml: whitespace * raptor/src/ntriples_parse.c, raptor/src/raptor.h, raptor/src/raptor_feature.c, raptor/src/raptor_general.c, raptor/src/raptor_identifier.c, raptor/src/raptor_iostream.c, raptor/src/raptor_locator.c, raptor/src/raptor_namespace.c, raptor/src/raptor_nfc.c, raptor/src/raptor_nfc_test.c, raptor/src/raptor_parse.c, raptor/src/raptor_qname.c, raptor/src/raptor_rdfxml.c, raptor/src/raptor_rfc2396.c, raptor/src/raptor_sequence.c, raptor/src/raptor_serialize.c, raptor/src/raptor_serialize_rdfxmla.c, raptor/src/raptor_set.c, raptor/src/raptor_stringbuffer.c, raptor/src/raptor_uri.c, raptor/src/raptor_utf8.c, raptor/src/raptor_www.c, raptor/src/raptor_www_libwww.c, raptor/src/raptor_xml.c, raptor/src/raptor_xml_writer.c, raptor/src/turtle_common.c: autodocs reformatted for gtk-doc * raptor/docs/tmpl/section-constants.sgml, raptor/docs/tmpl/section-feature.sgml, raptor/docs/tmpl/section-general.sgml, raptor/docs/tmpl/section-iostream.sgml, raptor/docs/tmpl/section-locator.sgml, raptor/docs/tmpl/section-memory.sgml, raptor/docs/tmpl/section-parser.sgml, raptor/docs/tmpl/section-sequence.sgml, raptor/docs/tmpl/section-serializer.sgml, raptor/docs/tmpl/section-stringbuffer.sgml, raptor/docs/tmpl/section-triples.sgml, raptor/docs/tmpl/section-unicode.sgml, raptor/docs/tmpl/section-unused.sgml, raptor/docs/tmpl/section-uri-factory.sgml, raptor/docs/tmpl/section-uri.sgml, raptor/docs/tmpl/section-www.sgml, raptor/docs/tmpl/section-xml-namespace.sgml, raptor/docs/tmpl/section-xml-qname.sgml, raptor/docs/tmpl/section-xml.sgml: initial templates * raptor/docs/raptor-docs.xml: fix * raptor/docs/raptor-docs.xml, raptor/docs/raptor-overrides.txt, raptor/docs/raptor-sections.txt: gtk-doc files * raptor/configure.ac, raptor/docs/Makefile.am: Enable gtk-doc * raptor/configure.ac: check for gtk-doc * raptor/src/raptor-config.1: Document --features and --help. Order flags alphabetically in summary and body. * raptor/src/raptor-config.in: Add --features argument to list configured or discovered features of the raptor library * raptor/configure.ac: Add AC_SUBSTs for recording discovered features: RAPTOR_WWW_LIBRARY (or none), RAPTOR_XML_PARSER (or none), RAPTOR_PARSERS (list) and RAPTOR_SERIALIZERS (list). * rasqal/src/rasqal.h, rasqal/src/rasqal_expr.c: autodocs fixes - use %RASQAL_ * rasqal/docs/tmpl/section-graph_pattern.sgml: use %RASQAL 2005-08-18 Dave Beckett * rasqal/docs/tmpl/section-query_results.sgml, rasqal/docs/tmpl/section-literal.sgml, rasqal/docs/tmpl/section-query.sgml: document literal, query, query_results types * rasqal/docs/rasqal-sections.txt: Add rasqal_query and rasqal_query_results * rasqal/docs/rasqal-overrides.txt: override rasqal_query and rasqal_query_results * rasqal/docs/Makefile.am: Make gtkdoc-mkdb ignore the C files * raptor/src/raptor_sax2.c (raptor_sax2_parse_start): Fix for expat * raptor/src/raptor_rdfxml.c (raptor_xml_unparsed_entity_decl_handler, raptor_xml_external_entity_ref_handler): Casts for gcc4 * raptor/src/raptor_expat.c (raptor_expat_init): Casts for expat to use sax2 handlers. * raptor/src/raptor_internal.h: Move raptor_sax2 declaration outside libxml-only block Fixup general arguments for raptor_xml_unparsed_entity_decl_handler and raptor_xml_external_entity_ref_handler. * raptor/src/raptor_rdfxml.c (raptor_xml_unparsed_entity_decl_handler, raptor_xml_external_entity_ref_handler): Generalise args from expat-specific. (raptor_xml_parse_init): Init sax2 handler fields * raptor/src/raptor_libxml.c (raptor_libxml_init): Use sax2 structure handlers * raptor/src/raptor_expat.c (raptor_expat_init): Use sax2 structure handlers * raptor/src/raptor_internal.h: raptor_sax2 gains handlers for start/end element, characters, cdata, comment, unparsed entity declaration, extenal entity reference. * rasqal/src/rasqal_query.c (rasqal_graph_pattern_visit): Make this recursive. * rasqal/tests/sparql/ExprBuiltins/Makefile.am: datatype-1 works * rasqal/src/rasqal_expr.c (rasqal_expression_evaluate): For datatype, if is a typed literal it has a datatype field then return that, otherwise fail. * rasqal/tests/sparql/ExprBuiltins/Makefile.am: str-1 passes * raptor/src/raptor_sax2.c (raptor_sax2_parse_start): Init expat and libxml the same * raptor/src/raptor_libxml.c (raptor_libxml_init): Take raptor_sax2* and raptor_uri* args * raptor/src/raptor_expat.c (raptor_expat_init): Take raptor_sax2* and raptor_uri* args * raptor/src/raptor_internal.h: raptor_libxml_init and raptor_expat_init take same args * raptor/src/n3_parser.y, raptor/src/ntriples_parse.c, raptor/src/raptor_guess.c, raptor/src/raptor_rdfxml.c, raptor/src/raptor_rss.c, raptor/src/raptor_xslt.c, raptor/src/turtle_parser.y: Update uses of raptor_parser_register_factory to remove alias argument and add calls to raptor_parser_factory_add_alias for raptor (rdfxml) and ntriplesplus (turtle) * raptor/src/raptor_internal.h: Update raptor_parser_register_factory prototype to return the registered factory and remvoe the alias arg. Added prototype for raptor_parser_factory_add_alias * raptor/src/raptor_parse.c (raptor_parser_register_factory): Now returns the registered factory. Removed alias arg into new function: (raptor_parser_factory_add_alias): Added. 2005-08-17 Dave Beckett * raptor/src/Makefile.am: maintainer clean n3 files * raptor/src/Makefile.am: clean n3 tests * raptor/src/n3_lexer.l (n3_lexer_syntax_error): Added, from turtle. * raptor/src/n3_lexer.l: Added n3_lexer_syntax_error (\"\"\"): Copy just the len and always terminate the string. (n3_copy_string_token): Handle empty strings without stringbuffer and use raptor_stringbuffer_append_turtle_string for escapes. Ensure string is always termianted. * raptor/src/n3_common.h: added stringbuffer field * raptor/src/turtle_parser.y: Expect 9 conflicts. Added FLOATING_LITERAL (FLOATING_LITERAL): Use raptor_new_identifier_from_double common with n3. * raptor/src/n3_parser.y (FLOATING_LITERAL): Use raptor_new_identifier_from_double common with turtle. * raptor/src/turtle_lexer.l (\"\"\"): Copy just the len and always terminate the string. Added doubles to Turtle. (turtle_copy_string_token): Handle empty strings without stringbuffer. Ensure string is always termianted. (turtle_token_print): Print FLOATING_LITERAL * raptor/tests/turtle/Makefile.am, raptor/tests/turtle/test-20.out, raptor/tests/turtle/test-20.ttl: Add test-20 for empty literals * raptor/tests/turtle/Makefile.am: re-add test-19 2005-08-16 Dave Beckett * raptor/src/raptor_internal.h: Added raptor_new_identifier_from_double pointer * raptor/src/Makefile.am: Added raptor_xsd.c * raptor/src/raptor_xsd.c: raptor_xsd.c * raptor/src/n3_lexer.l, raptor/src/n3_parser.y: Add double constants to N3 parser * raptor/src/n3_lexer.l (main): Make uri_string an unsigned char* * raptor/tests/turtle/Makefile.am: remove test-19 for now, no double constants * raptor/tests/turtle/Makefile.am, raptor/tests/turtle/test-19.out, raptor/tests/turtle/test-19.ttl: added test-19 for 1.0 as a double * raptor/src/Makefile.am: Add turtle_common.c * raptor/tests/turtle/test-18.out: Remove header/footer * raptor/src/turtle_parser.y: 2005 * raptor/src/turtle_lexer.l: Added turtle_lexer_syntax_error Build up long strings inside a stringbuffer with raptor_stringbuffer_append_turtle_string and avoid greedy match of """s (turtle_copy_string_token): Use raptor_stringbuffer_append_turtle_string (turtle_lexer_syntax_error): Added. * raptor/src/raptor_internal.h: Added raptor_stringbuffer_append_turtle_string prototype * raptor/src/turtle_common.h: Added raptor_stringbuffer* field sb * raptor/src/turtle_common.c: Raptor Turtle common code with raptor_stringbuffer_append_turtle_string from raptor_turtle.l * raptor/tests/turtle/Makefile.am, raptor/tests/turtle/test-18.out, raptor/tests/turtle/test-18.ttl: Added test-18 for multiple long literals with escapes * raptor/src/raptor_serialize_rss.c (raptor_rss10_emit_item): Die in debug mode with NULL item - all calls to this are currently wrapped with a check. (raptor_rss10_emit_item): Do not emit atom author when no such item exists. * raptor/manifest.pl: typo 2005-08-13 Dave Beckett * redland-src-config.in: Add --version and --version-decimal * rasqal/docs/tmpl/section-unused.sgml, rasqal/docs/tmpl/section-variable.sgml, rasqal/docs/tmpl/section-query_results.sgml, rasqal/docs/tmpl/section-triple.sgml, rasqal/docs/tmpl/section-prefix.sgml, rasqal/docs/tmpl/section-query.sgml, rasqal/docs/tmpl/section-graph_pattern.sgml, rasqal/docs/tmpl/section-literal.sgml, rasqal/docs/tmpl/section-expression.sgml, rasqal/docs/tmpl/section-general.sgml, rasqal/docs/rasqal-sections.txt: autodocs - sections intros * rasqal/src/rasqal.h, rasqal/src/rasqal_expr.c, rasqal/src/rasqal_general.c, rasqal/src/rasqal_engine.c: autodocs * rasqal/src/rasqal.h: Remove unused rasqal_new_variable_expression prototype. Deprecate rasqal_expression_foreach for rasqal_expression_visit Add rasqal_expression_visit prototype and rasqal_expression_visit_fn. * rasqal/docs/rasqal-sections.txt: Add rasqal_expression_visit_fn rasqal_expression_visit 2005-08-11 Dave Beckett * autogen.sh, raptor/autogen.sh: update autogen.sh again * rasqal/autogen.sh: programs spello * autogen.sh, raptor/autogen.sh: update autogen.sh again * rasqal/autogen.sh: Add gtkdocize and swig (for bindings) only if seen in top-level configure.ac Add swig-specific version check, different from gnu style * autogen.sh, rasqal/autogen.sh: update autogen.sh again * raptor/autogen.sh: Move warning to end * raptor/autogen.sh, autogen.sh, rasqal/autogen.sh: Rewrite with functions, generalize to any redland package. Add docs. * rasqal/src/rasqal_engine.c: restore undef RASQAL_DEBUG * rasqal/tests/sparql/part1/dawg-query-003.rq: Declare rdf: * rasqal/src/sparql_parser.y (rasqal_sparql_query_engine_init): Do not declare any namespaces by default. * rasqal/tests/sparql/syntax/Makefile.am: Added namespaces.rq * rasqal/tests/sparql/syntax/namespaces.rq: namespaces.rq * librdf/redland.spec.in: - Update Source: - Do not require python-devel at build time - Add sqlite-devel build requirement. - Use %configure and %makeinstall * rasqal/rasqal.spec.in, raptor/raptor.spec.in: - Update Source: - Use %makeinstall 2005-08-10 Dave Beckett * rasqal/src/rasqal_engine.c (rasqal_engine_merge_graph_patterns): Renamed from rasqal_engine_make_basic_graph_pattern and added some docucomments. It no longer handles UNIONS - they are never merged, the code was just handling them in order to descend down the tree, now done by the visitor calling this function. Remove calling lower sub-GPs. (rasqal_engine_merge_triples): Renamed from rasqal_engine_merge_basic_graph_patterns and added some docucomments. * rasqal/src/rasqal_internal.h: Added rasqal_graph_pattern_visit_fn typdef. Added prototype for rasqal_query_graph_pattern_visit * rasqal/src/rasqal_query.c (rasqal_query_prepare): Rewrite to use rasqal_query_graph_pattern_visit to do graph pattern transforms. (rasqal_graph_pattern_visit): Added, called by: (rasqal_query_graph_pattern_visit): Added to walk all graph patterns in a query. * rasqal/src/rasqal_engine.c (rasqal_engine_make_basic_graph_pattern): Do not lose sub-grpah pattern UNION type. * rasqal/src/sparql_parser.y (PrimaryExpression): Explain rq23 weirdness * raptor/raptor.spec.in: Use %configure and %{_make} * rasqal/tests/sparql/survey/query-survey-10.rq, rasqal/tests/sparql/survey/query-survey-11.rq, rasqal/tests/sparql/survey/query-survey-13.rq: FILTER() syntax * rasqal/rasqal.spec.in: Use %configure * rasqal/src/sparql_lexer.l: Remove '%' as a token. (sparql_token_print): Remove '%' * rasqal/src/sparql_parser.y: Remove '%' as a token. Whitespace style fixes near rule definitions. * rasqal/src/sparql_parser.y: Make FILTER use Constraint for multiple forms. (Constraint): Added. Allow the BrackettedExpression, BuiltInCall or FunctionCall alternatives. (Expression): Added. 9ConditionalOrExpression): Make it recursive rather than just allow 0 or 1 &&s. (MultiplicativeExpression): Remove '%' operator, not in SPARQL. (BuiltInCall): Renamed from CallExpression and remove FunctionCall from it. (PrimaryExpression): use BuiltInCall and add FunctionCall from above. * rasqal/tests/sparql/ValueTesting/Makefile.am: +3 more tests, extendedType-literal-ne fails. * rasqal/tests/sparql/syntax/cast0.rq, rasqal/tests/sparql/syntax/cast1.rq, rasqal/tests/sparql/bound/bound1.rq: FILTER() syntax * rasqal/tests/sparql/examples/ex11.2.3.8_0.rq, rasqal/tests/sparql/examples/ex3.rq: Updates from DAWG for FILTER() * rasqal/tests/sparql/SyntaxFull/manifest.ttl, rasqal/tests/sparql/simple/manifest.n3, rasqal/tests/sparql/sort/manifest.ttl, rasqal/tests/sparql/examples/manifest.n3: Update to DAWG tests - some approved * rasqal/tests/sparql/ValueTesting/extendedType-eq-pass-result.n3, rasqal/tests/sparql/ValueTesting/extendedType-eq-pass.rq, rasqal/tests/sparql/ValueTesting/extendedType-graph-result.n3, rasqal/tests/sparql/ValueTesting/extendedType-graph.rq, rasqal/tests/sparql/ValueTesting/extendedType-literal-eq-result.n3, rasqal/tests/sparql/ValueTesting/extendedType-literal-eq.rq, rasqal/tests/sparql/ValueTesting/extendedType-literal-ne-result.n3, rasqal/tests/sparql/ValueTesting/extendedType-literal-ne.rq, rasqal/tests/sparql/ValueTesting/extendedType-ne-fail-result.n3, rasqal/tests/sparql/ValueTesting/extendedType-ne-fail.rq, rasqal/tests/sparql/ValueTesting/manifest.n3: Update to DAWG tests 2005-08-08 Dave Beckett * raptor/src/raptor_rss_common.c, raptor/src/raptor_internal.h, raptor/src/raptor_rss.c: Move time.h and sys/time.h #ifdef and includes to raptor_internal.h since time_t is mentioned there and visible to all files. * raptor/tests/Makefile.am: adjust -I to point to srcdir for raptor_empty_test 2005-08-04 Dave Beckett * rasqal/src/rasqal_engine.c (rasqal_engine_join_graph_patterns): Renamed from rasqal_engine_join_basic_graph_patterns. Warn if types are different. Merge sub graph sequences. (rasqal_engine_make_basic_graph_pattern): Operate over unions recursively for any lower-level basic graph patterns. Don't merge if all sub-graph patterns aren't of the same type. Never merge union sequences of size>1 * rasqal/src/rasqal_internal.h: rasqal_engine_join_basic_graph_patterns now rasqal_engine_join_graph_patterns 2005-08-03 Dave Beckett * configure.ac, rasqal/configure.ac: gtk-doc 1.3 is ok 2005-08-01 Dave Beckett * rasqal/utils/Makefile.am: Add AM_CPPFLAGS and AM_CFLAGS back 2005-07-31 Dave Beckett * raptor/src/raptor_xml_writer.c (main): syntax * configure.ac, rasqal/configure.ac: Fix for compiling against internal raptor * raptor/src/raptor_uri.c: Add (void) casts for fwrite debug messages * raptor/utils/Makefile.am: Re-add rapper.1 to dist * raptor/src/raptor_rdfxml.c, raptor/src/raptor_xml_writer.c, raptor/src/raptor_nfc_test.c: Add (void) casts for fwrite debug messages * raptor/utils/Makefile.am, raptor/Makefile.am, raptor/configure.ac, raptor/docs/Makefile.am, raptor/raptor-src-config.in, raptor/src/Makefile.am, raptor/tests/Makefile.am, raptor/tests/turtle/Makefile.am: Reorganise sources - libraptor is in src, man pages in docs, rapper in utils * configure.ac, librdf/Makefile.am: adjust source of librasqal.la * docs/Makefile.am, rasqal/docs/Makefile.am: Added version.xml to content_files * rasqal/docs/Makefile.am, rasqal/utils/Makefile.am: restore mans to dist * rasqal/src/Makefile.am: if STRCASECMP not GETOPT * rasqal/Makefile.am: Add utils dir * rasqal/utils/Makefile.am: roqet.html * rasqal/utils/Makefile.am: utils automakefile * rasqal/src/Makefile.am: Add Makefile.am * rasqal/tests/sparql/survey/Makefile.am, rasqal/tests/sparql/syntax/Makefile.am, rasqal/tests/sparql/ExprEquals/Makefile.am, rasqal/tests/sparql/SyntaxFull/Makefile.am, rasqal/tests/sparql/ValueTesting/Makefile.am, rasqal/tests/sparql/bound/Makefile.am, rasqal/tests/sparql/examples/Makefile.am, rasqal/tests/sparql/part1/Makefile.am, rasqal/tests/sparql/regex/Makefile.am, rasqal/tests/sparql/simple/Makefile.am, rasqal/tests/sparql/sort/Makefile.am, rasqal/docs/Makefile.am, rasqal/tests/rdql/Makefile.am, rasqal/tests/rdql/testsuite/Makefile.am, rasqal/tests/sparql/Expr1/Makefile.am, rasqal/tests/sparql/Expr2/Makefile.am, rasqal/tests/sparql/ExprBuiltins/Makefile.am, rasqal/Makefile.am, rasqal/configure.ac, rasqal/rasqal-src-config.in: Reorganise sources - librasqal is in src, man pages are in docs, roqt in utils. 2005-07-30 Dave Beckett * rasqal/src/rasqal_expr.c, rasqal/src/rasqal.h: autodocs * rasqal/docs/tmpl/section-variable.sgml, rasqal/docs/tmpl/section-unused.sgml, rasqal/docs/tmpl/section-query_results.sgml, rasqal/docs/tmpl/section-triple.sgml, rasqal/docs/tmpl/section-query.sgml, rasqal/docs/tmpl/section-literal.sgml, rasqal/docs/tmpl/section-prefix.sgml, rasqal/docs/tmpl/section-general.sgml, rasqal/docs/tmpl/section-graph_pattern.sgml: Updated templates. * rasqal/docs/tmpl/section-expression.sgml: short and long desc add rasqal_compare_flags not #defines * rasqal/docs/tmpl/section-data.sgml: short and long desc * rasqal/docs/rasqal-overrides.txt: override some things to hide internals. * rasqal/docs/rasqal-sections.txt, rasqal/docs/rasqal-docs.xml, rasqal/src/rasqal_literal.c, rasqal/src/rasqal_expr.c, rasqal/src/rasqal_general.c, rasqal/src/rasqal.h: more autodocs * rasqal/src/rasqal_query.c, rasqal/src/rasqal_general.c, rasqal/src/rasqal_expr.c: more autodocs and fixes for gtk-doc style * rasqal/src/rasqal_expr.c: autodocs for rasqal_data_graph * rasqal/src/rasqal_query.c, rasqal/src/rasqal_expr.c, rasqal/src/rasqal_graph_pattern.c, rasqal/src/rasqal.h: Source code arg fixes for gtk-doc 2005-07-29 Dave Beckett * rasqal/docs/rasqal.types: empty types for gtk-doc * rasqal/Makefile.am: Added DISTCHECK_CONFIGURE_FLAGS * rasqal/rasqal.spec.in: Updated for gtk-doc locations * rasqal/docs/tmpl/section-data.sgml, rasqal/docs/tmpl/section-expression.sgml, rasqal/docs/tmpl/section-general.sgml, rasqal/docs/tmpl/section-graph_pattern.sgml, rasqal/docs/tmpl/section-literal.sgml, rasqal/docs/tmpl/section-prefix.sgml, rasqal/docs/tmpl/section-query.sgml, rasqal/docs/tmpl/section-query_results.sgml, rasqal/docs/tmpl/section-triple.sgml, rasqal/docs/tmpl/section-unused.sgml, rasqal/docs/tmpl/section-variable.sgml, rasqal/docs/rasqal-overrides.txt, rasqal/autogen.sh, rasqal/configure.ac, rasqal/docs/Makefile.am, rasqal/docs/api.sgml.in, rasqal/docs/build-docs, rasqal/docs/kernel-doc, rasqal/docs/rasqal-docs.xml, rasqal/docs/rasqal-sections.txt, rasqal/src/rasqal.h, rasqal/src/rasqal_engine.c, rasqal/src/rasqal_expr.c, rasqal/src/rasqal_general.c, rasqal/src/rasqal_graph_pattern.c, rasqal/src/rasqal_literal.c, rasqal/src/rasqal_map.c, rasqal/src/rasqal_query.c, rasqal/src/rasqal_raptor.c, rasqal/src/rasqal_skiplist.c: Switch to gtkdoc for autodocs. Adjust source code comment style. * rasqal/docs/version.xml.in: version xml * configure.ac: require gtk-doc 1.4 * rasqal/autogen.sh: run gtkdocize * rasqal/configure.ac, configure.ac: require gtk-doc 1.4 2005-07-28 Dave Beckett * rasqal/utils/roqet.1: Update for newer result formats. * rasqal/tests/sparql/syntax/manifest.n3, rasqal/tests/sparql/syntax/Makefile.am: distinct-with-undef-var * rasqal/tests/sparql/syntax/distinct-undef.rq, rasqal/tests/sparql/syntax/result-distinct-undef.ttl: tests for distinct with an undef var * rasqal/src/rasqal_query.c (rasqal_query_result_literal_sequence_compare): Two NULL literals means equality not a final comparison result, so keep searching. * rasqal/tests/sparql/syntax/Makefile.am, rasqal/tests/sparql/syntax/manifest.n3, rasqal/tests/sparql/syntax/order-distinct.rq, rasqal/tests/sparql/syntax/order.ttl, rasqal/tests/sparql/syntax/result-order-distinct.ttl: Added order and distinct check * rasqal/src/sparql_parser.y (PatternElement): Error recovery from NULL triples but do return a graph pattern of some sort. * rasqal/src/sparql_parser.y (PatternElement): Error recovery - do not die when triples is NULL. 2005-07-27 Dave Beckett * raptor/Makefile.am, raptor/docs/Makefile.am, raptor/src/Makefile.am, raptor/utils/Makefile.am: Add n3_lexer_test, n3_parser_test for maintainer * raptor/src/n3_parser.y, raptor/src/turtle_parser.y (main): Make it compile * raptor/src/n3_parser.y: Updates from turtle_parser.y: gcc4 ignored return warning fixes: (main): Check fread() return value and throw a user error. (main): Fix for gcc4 (main) Move filename here * raptor/examples/grapper.c: Add author url * raptor/src/raptor_rss.c (raptor_rss_uplift_fields): Add possibility of normalizing fields, but no code to do it yet. * raptor/src/raptor_rss_common.c (raptor_rss_date_uplift): fail and do nothing if function returns <0 * raptor/src/raptor_rss.c (raptor_rss_uplift_fields): Moved date code into raptor_rss_date_uplift and call it. * raptor/src/raptor_rss.h: Added raptor_rss_date_uplift prototype * raptor/src/raptor_rss_common.c (raptor_rss_date_uplift): Added, pulled out of raptor_rss.c * raptor/src/turtle_parser.y: gcc4 ignored return warning fixes: (main): Check fread() return value and throw a user error. * rasqal/src/sparql_parser.y, rasqal/utils/roqet.c, rasqal/src/rdql_parser.y, rasqal/src/rasqal_map.c: gcc4 ignored return warning fixes: Discard fwrite() return values since fprintf/fputs() aren't checked. Check fread() return values and throw a user error. * rasqal/src/rasqal_skiplist.c, rasqal/src/rasqal_map.c: autodocs * rasqal/src/rasqal_query.c (rasqal_query_execute): For a stored sequence of result rows, use result_count as an offset so initialise to 0 always (rasqal_query_results_next, rasqal_query_results_get_bindings, rasqal_query_results_get_binding_value, rasqal_query_results_get_binding_value_by_name): Adjust to use offset. * rasqal/src/rasqal_query.c: Removed RASQAL_MAP define; it's the default now. * rasqal/src/rasqal_skiplist.c (main): Update for new rasqal_new_skiplist API * rasqal/src/rasqal_query.c: General: rasqal_tree renamed to rasqal_map and code moved to rasqal_map.c (rasqal_new_query_result_row, rasqal_free_query_result_row): Init/use usage counting. (rasqal_new_query_result_row_from_query_result_row): Added. (rasqal_query_result_row_compare): Take void* args, like a qsort() compare Do a distinct comparison on values before an ordering, if needed and discard duplicates there. (rasqal_map_print_query_result_row, rasqal_map_free_query_result_row): Added as rasqal_map helpers. (rasqal_query_execute): Make a new map, not tree, calling above helpers. * rasqal/src/rasqal_map.c: autodocs * rasqal/src/rasqal_map.c (rasqal_free_map_node): follow subtrees recursively. * rasqal/src/rasqal_skiplist.c: rasqal_skiplist_s gains split key/value print handler methods (rasqal_new_skiplist): Split print_fn into print_key_fn and print_value_fn (rasqal_skiplist_node_print): Use new functions. * rasqal/src/rasqal_internal.h: rasqal_query_result_row gains usage count Changed skiplist API to split key/value print handler methods Added rasqal_map class, methods. * rasqal/Makefile.am: Added rasqal_map.c * rasqal/src/rasqal_map.c: Rasqal simple Key:Value Map with duplicates allowed * rasqal/src/rasqal_query.c (rasqal_query_execute): If added a duplicate, free the row. * rasqal/src/rasqal_raptor.c (ordinal_as_uri): off by 1 in making ordinal URI. 2005-07-26 Dave Beckett * rasqal/src/rasqal_query.c: sparql-results * rasqal/src/rasqal_query.c, rasqal/utils/roqet.c: Changed results namespace from http://www.w3.org/2005/06/sparqlResults to http://www.w3.org/2005/sparql-results# 2005-07-25 Dave Beckett * raptor/examples/grapper.c (fs_ok_button_callback): Protect from defining when when not used as a callback. (open_button_callback): cast for gcc4 2005-07-24 Dave Beckett * raptor/src/raptor_rss.c (raptor_rss_parser_processNode): for rss:link and atom:link with href, allow multiple link for atom, and continue to ignore all but for rss. * raptor/src/raptor_rss_common.c: Tidying. Added atom:feed and atom:entry to raptor_rss_types_info. Declare atom namespace URI string raptor_atom_namespace_uri * raptor/src/raptor_rss.h: Added RAPTOR_ATOM_FEED, RAPTOR_ATOM_ENTRY. * raptor/src/raptor_serialize_rss.c: Add atom 1.0 serializing by generalising rss 1.0 serializing. Change field names to reflect this rdf_nspace -> default_nspace, rdf_RDF_element -> root_element. Add is_atom flag. (raptor_rss10_serialize_init): Init is_atom flag. (raptor_rss10_move_statements, raptor_rss10_store_statement): Rename back fields translated to rss: namespace. (raptor_rss10_build_xml_names): Init namespace qname for rss/atom. Declare the default namespace to rss/atom. Ignore all item types but rss:item for atom; all but atom:author for rss. For item node type use atom:entry / rss:item. (raptor_rss10_emit_item): Add emit_container flag to prevent generating the containing elements. For atom:author, generate it inline for atom, ignore it for rss. When generating URI-valued fields for atom, make them element content. For atom, do not generate rdf:Seq block. (raptor_rss10_serialize_end): Only emit node type rss:item (aka atom:entry) for atom. (raptor_init_serializer_atom): Added. * raptor/configure.ac: Added atom serializer, enabled for maintainer only. * raptor/src/raptor_general.c (raptor_init): Add call to raptor_init_serializer_atom if enabled * raptor/src/raptor_internal.h: Added prototype for raptor_init_serializer_atom Added raptor_atom_namespace_uri * raptor/src/raptor_serialize_rss.c (raptor_rss10_serialize_end): End with an error if no rss channel was found. * raptor/Makefile.am, raptor/docs/Makefile.am, raptor/src/Makefile.am, raptor/utils/Makefile.am: Use RAPTOR_SERIALIZER_RSS_1_0 for new separate rss serializer. Use RAPTOR_RSS_COMMON when either rss parser or serializer is needed. * raptor/configure.ac: RSS 1.0 serializer is always available and does not need the libxml requirements of the RSS tag soup parser. Added RAPTOR_SERIALIZER_RSS_1_0 define and makefile conditional. Added RAPTOR_RSS_COMMON when any rss code is needed. * raptor/src/raptor_rss.c, raptor/src/raptor_rss_common.c, raptor/src/raptor_serialize_rss.c: Moved common code between parser and serializer from raptor_rss.c into new raptor_rss_common.c as new class raptor_rss_model. Moved rss-1.0 serializer into new raptor_serialize_rss.c. Both can be compiled independent of the other. * raptor/src/raptor_rss.h: Redland Parser Toolkit Internal RSS Model and API * raptor/src/raptor_internal.h: Add RAPTOR_PARSEDATE_FUNCTION macro for parsedate.c * raptor/src/raptor_general.c (raptor_init): Use define RAPTOR_SERIALIZER_RSS_1_0 to call raptor_init_serializer_rss10 * raptor/src/raptor_xml.c, raptor/src/raptor_sax2.c: Moved raptor_new_xml_element, raptor_free_xml_element, raptor_xml_element_set_attributes, raptor_xml_element_declare_namespace, raptor_print_xml_element, raptor_iostream_write_xml_element from raptor_sax2.c to raptor_xml.c 2005-07-23 Dave Beckett * librdf/redland.spec.in: date typo * raptor/src/raptor_rss.c, raptor/src/raptor_rss_common.c, raptor/src/raptor_serialize_rss.c: More base URIs on base URIs fixes. (raptor_rss_parser_processNode): Ensure base URI is always copied at start element, always freed at end element. Make sure xml:base processing is done for all elements including document and typed-node ones. (raptor_rss_parse_chunk): Remove duplicate document base URI setting. 2005-07-22 Dave Beckett * raptor/src/raptor_rss.c, raptor/src/raptor_rss_common.c, raptor/src/raptor_serialize_rss.c: raptor_rss_info gains flags field to store RAPTOR_RSS_INFO_FLAG_URI_VALUE where the value of the element value is always a URI. Apply that to atom:id, atom:icon and atom:logo. struct raptor_rss_parser_context_s gains a sequence of base URIs per-element. (raptor_rss_context_init, raptor_rss_context_terminate): Init and free sequence of base URIs. (raptor_rss_parse_start): Start base URI sequence with parser base URI. (raptor_rss_parser_processNode): Init base_uri from top of stack of base URIs. Update base_uri from an xml:base arg, relative to the current base URI. Use the base URI for all URi constructions. Push the new base URI after an element has been found. Pop the base URI at the end of an element. At the end of an element, if the field always has a URI value, convert it. (raptor_rss_parse_chunk): Init the URI sequence with the parser base URI. * raptor/src/raptor_rss.c, raptor/src/raptor_rss_common.c, raptor/src/raptor_serialize_rss.c: map raptor_atom_to_rss: turn more atom cloned rss fields into rss fields. (raptor_rss_uplift_fields): Change default action to copy (duplicate) fields. (raptor_rss10_emit_item): Do not emit link to atom:author types in rss1.0 (raptor_rss10_serialize_end): Do not emit atom:author type in rss1.0 * raptor/src/raptor_rss.c, raptor/src/raptor_rss_common.c, raptor/src/raptor_serialize_rss.c: Added atom 1.0 namespace (ATOM1_0_NAMESPACE_URI, ASTOM1_0_NS) and terms. Turn old atom 0.3 terms into 1.0 versions where known using raptor_atom_to_rss. (raptor_rss_parser_processNode): Handle atom feed element properly, make a new channel item. Convert atom 0.3 namespaced elements to atom 1.0 Use atom:id to get a URI for the feed/entry Copy atom:published to dc:date and atom:rights to dc:rights via raptor_rss_uplift_map. (raptor_rss_uplift_fields): Copy dc:date and atom:rights * raptor/src/raptor_rss.c, raptor/src/raptor_rss_common.c, raptor/src/raptor_serialize_rss.c: Added content: namespace CONTENT_NAMESPACE_URI, prefix "content:" Added content:encoded field RAPTOR_RSS_FIELD_CONTENT_ENCODED (raptor_rss_uplift_fields): Added an uplift from description to content:encoded (raptor_rss10_emit_item): Write content:encoded using 2005-07-21 Dave Beckett * librdf/rdf_concepts.h: Move some docs into the sgml template * configure.ac: Added docs/version.xml * docs/Makefile.am, docs/redland-chapter-intro.xml, docs/redland-chapter-objects.xml, docs/redland-docs.xml, docs/redland-intro.xml, docs/redland-objects-in-c.xml, docs/version.xml.in: more gtk-doc * librdf/redland.spec.in: Updated for gtk-doc locations * rasqal/rasqal_query.c (rasqal_query_results_write_xml_result2, rasqal_query_results_write_xml_result3): Use RASQAL_XSD_BOOLEAN_TRUE and RASQAL_XSD_BOOLEAN_FALSE for boolean result value. (rasqal_query_results_write_xml_result3): Add ordered and distinct attributes to element. * rasqal/rasqal_literal.c (rasqal_literal_string_to_native, rasqal_new_boolean_literal): Use RASQAL_XSD_BOOLEAN_TRUE and RASQAL_XSD_BOOLEAN_FALSE. * rasqal/rasqal_internal.h: Added RASQAL_XSD_BOOLEAN_TRUE and RASQAL_XSD_BOOLEAN_FALSE, maybe could be pointers to a shared string but compilers can work it out. * docs/redland-sections.txt: remove internal librdf_concept_ms_namespace_uri and librdf_concept_schema_namespace_uri * librdf/rdf_concepts.h: docs * docs/Makefile.am: Remove unused SCAN_OPTIONS 2005-07-20 Dave Beckett * examples/Makefile.am: added example7 * examples/example7.c: read from a file 'file.rdf', add a triple, write it again 2005-07-19 Dave Beckett * librdf/Makefile.am: Remove 1-function headers from dist * librdf/rdf_node.h: removed librdf_node_init - has no code * docs/redland-docs.xml: redland doc * docs/redland-intro.xml: Doc intro * docs/redland-objects-in-c.xml: Objects in C * librdf/rdf_uri.c (librdf_uri_print): xml fix * docs/redland-sections.txt: doc sections * librdf/rdf_node.h: librdf_node_init removed - in header only * docs/Makefile.am: ignore internal headers * librdf/rdf_query_results.c, librdf/rdf_node.c: More fixes for gtkdoc * librdf/rdf_stream.c, librdf/rdf_stream.h, librdf/rdf_uri.c, librdf/rdf_uri.h, librdf/rdf_utf8.c, librdf/rdf_concepts.c, librdf/rdf_digest.c, librdf/rdf_digest.h, librdf/rdf_digest_md5.c, librdf/rdf_digest_openssl.c, librdf/rdf_digest_sha1.c, librdf/rdf_hash.c, librdf/rdf_hash.h, librdf/rdf_hash_bdb.c, librdf/rdf_hash_cursor.c, librdf/rdf_hash_memory.c, librdf/rdf_heuristics.c, librdf/rdf_init.c, librdf/rdf_init.h, librdf/rdf_iterator.c, librdf/rdf_iterator.h, librdf/rdf_list.c, librdf/rdf_log.c, librdf/rdf_log.h, librdf/rdf_model.c, librdf/rdf_model.h, librdf/rdf_model_storage.c, librdf/rdf_node.c, librdf/rdf_node.h, librdf/rdf_parser.c, librdf/rdf_parser.h, librdf/rdf_parser_raptor.c, librdf/rdf_query.c, librdf/rdf_query.h, librdf/rdf_query_results.c, librdf/rdf_query_triples.c, librdf/rdf_serializer.c, librdf/rdf_serializer.h, librdf/rdf_serializer_raptor.c, librdf/rdf_statement.c, librdf/rdf_statement.h, librdf/rdf_storage.c, librdf/rdf_storage.h, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage_tstore.c: automated docucomments updates for gtk-doc * autogen.sh: allow gtkdocize to fail * librdf/rdf_concepts_internal.h, librdf/rdf_digest_internal.h, librdf/rdf_hash_internal.h, librdf/rdf_iterator_internal.h, librdf/rdf_list_internal.h, librdf/rdf_log_internal.h, librdf/rdf_model_internal.h, librdf/rdf_node_internal.h, librdf/rdf_query_internal.h, librdf/rdf_serializer_internal.h, librdf/rdf_statement_internal.h, librdf/rdf_storage_internal.h, librdf/rdf_stream_internal.h, librdf/rdf_uri_internal.h: comment words * raptor/raptor_guess.c (raptor_guess_parse_chunk): unused var parser * librdf/rdf_list_internal.h: Remove some calls to public headers that are in redland.h also. * raptor/ntriples_parse.c (raptor_init_parser_ntriples): Do not register interest in text/plain -- too general. * librdf/Makefile.am: Added more internal headers * librdf/librdf.h, librdf/rdf_concepts.h, librdf/rdf_digest.h, librdf/rdf_hash.c, librdf/rdf_hash.h, librdf/rdf_hash_bdb.c, librdf/rdf_hash_memory.c, librdf/rdf_init.h, librdf/rdf_internal.h, librdf/rdf_iterator.h, librdf/rdf_list.h, librdf/rdf_log.h, librdf/rdf_model.h, librdf/rdf_model_storage.h, librdf/rdf_node.h, librdf/rdf_parser.h, librdf/rdf_query.h, librdf/rdf_serializer.h, librdf/rdf_statement.h, librdf/rdf_storage.h, librdf/rdf_storage_hashes.c, librdf/rdf_stream.h, librdf/rdf_uri.h: use rdf_MODULE_internal.h headersrdf_*.h * librdf/rdf_concepts_internal.h, librdf/rdf_digest_internal.h, librdf/rdf_hash_internal.h, librdf/rdf_iterator_internal.h, librdf/rdf_list_internal.h, librdf/rdf_log_internal.h, librdf/rdf_model_internal.h, librdf/rdf_node_internal.h, librdf/rdf_parser_internal.h, librdf/rdf_query_internal.h, librdf/rdf_serializer_internal.h, librdf/rdf_statement_internal.h, librdf/rdf_storage_internal.h, librdf/rdf_stream_internal.h: added rdf_MODULE_internal.h headers * librdf/rdf_hash_bdb.h, librdf/rdf_hash_memory.h, librdf/rdf_storage_hashes.h, librdf/rdf_storage_list.h: delete 1 function headers * docs/redland.types: must be empty * docs/kernel-doc, docs/build-docs: replace with gtk-doc * docs/api.html.in, docs/api.sgml.in: switch to gtk-doc * docs/redland-intro.xml, docs/redland-docs.xml: gtk-doc bit * autogen.sh: Run gtkdocize * docs/Makefile.am: Switch to gtk-doc * configure.ac: Added GTK_DOC_CHECK * Makefile.am: Added gtk-doc.make * librdf/Makefile.am: Added rdf_init_internal.h rdf_uri_internal.h * librdf/rdf_storage_sqlite.c, librdf/rdf_storage_tstore.c, librdf/rdf_stream.c, librdf/rdf_uri.c, librdf/rdf_uri.h, librdf/rdf_uri_internal.h, librdf/rdf_utf8.c, librdf/librdf.h, librdf/rdf_concepts.c, librdf/rdf_digest.c, librdf/rdf_digest_md5.c, librdf/rdf_digest_sha1.c, librdf/rdf_hash.c, librdf/rdf_hash_bdb.c, librdf/rdf_hash_cursor.c, librdf/rdf_hash_memory.c, librdf/rdf_init.c, librdf/rdf_init.h, librdf/rdf_init_internal.h, librdf/rdf_internal.h, librdf/rdf_iterator.c, librdf/rdf_list.c, librdf/rdf_log.c, librdf/rdf_model.c, librdf/rdf_model.h, librdf/rdf_model_storage.c, librdf/rdf_node.c, librdf/rdf_parser.c, librdf/rdf_parser_raptor.c, librdf/rdf_query.c, librdf/rdf_query_results.c, librdf/rdf_query_triples.c, librdf/rdf_serializer.c, librdf/rdf_serializer_raptor.c, librdf/rdf_statement.c, librdf/rdf_storage.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c: Updates for gtk-doc. Pull out internal headers * Switch API docs from gnome-doc / kernel-doc to gtk-doc. This requires a variety of source level changes that edit the docucomments as well as some header file edits to work with gtk-doc. Internal symbols are removed from public headers entirely. 2005-07-18 Dave Beckett * librdf/rdf_concepts.c: death to M&S for xml docs * raptor/raptor_guess.c: Slim down, to use raptor_parser_exec. (raptor_guess_parse_start): Deleted again. (raptor_guess_parse_chunk): Use guessing and raptor_parser_exec to switch to the right parser. * raptor/raptor_internal.h: Added prototype to raptor_parser_exec * raptor/raptor_parse.c (raptor_parser_exec): Added to turn one parser type into another in-situ. * raptor/rdfdump.c: make -g invoke the guess parser and report the resulting parser at the first triple returned * raptor/raptor_guess.c (raptor_guess_parse_start): Added. (raptor_guess_parse_chunk): Pass in buffer to raptor_guess_parser_name since we have it. Work with no content_type such as when using a filename alone. * raptor/ntriples_parse.c (raptor_ntriples_parse_chunk): Handle ending on \r\n by updating 'start' by 1 position. * configure.ac: Require rasqal 0.9.11 * configure.ac: Require raptor 1.4.8 for guess parser. * rasqal/rasqal_raptor.c (rasqal_raptor_new_triples_source): Use raptor guess parser. * rasqal/configure.ac: Require raptor 1.4.8 for guess parser. * raptor/ntriples_parse.c (raptor_ntriples_term): Check sscanf return to catch bad \u or \U hex escape. * raptor/turtle_lexer.l (turtle_copy_string_token): Check sscanf return to catch bad \u or \U hex escape. * raptor/raptor_general.c (raptor_init): Added guessing parser * raptor/configure.ac, raptor/Makefile.am: Added raptor_guess.c * raptor/raptor_guess.c: guessing parser using content type and an internal parser * raptor/raptor_xslt.c (raptor_xslt_parse_start): No need to init column, byte locator. * raptor/raptor_rdfxml.c (raptor_xml_parse_recognise_syntax): Guess that application/xml is likely RDF/XML * raptor/raptor_internal.h: raptor_parser_factory_s gains a content_type_handler field. * raptor/raptor_parse.c (raptor_start_parse): Init locator line, column, byte to -1 (unknown) (raptor_parse_uri_content_type_handler): Added to handle raptor_www content type field return. Pass on to factory method content_type_handler if present. (raptor_parse_uri_with_connection): Init raptor_parse_uri_content_type_handler to receive raptor_www callbacks using raptor_www_set_content_type_handler. (raptor_guess_parser_name): Check static buffer size for overflow. Add some comments. * raptor/raptor_xslt.c (raptor_xslt_parse_start): Use raptor_parser_copy_user_state * raptor/raptor_parse.c (raptor_parser_copy_user_state): docs * raptor/raptor_parse.c (raptor_parser_copy_user_state): Added. * raptor/raptor_internal.h: Added prototype for raptor_parser_copy_user_state * raptor/tests/ex-58.rdf, raptor/tests/ex-58.out, raptor/tests/Makefile.am: Added ex-58 * raptor/raptor_rdfxml.c (raptor_end_element_grammar): When emitting literals, handle a datatyped empty literal. Merge the property element/member property element code. * raptor/tests/ex-57.rdf, raptor/tests/ex-57.out, raptor/tests/Makefile.am: Added ex-57 2005-07-17 Dave Beckett * librdf/rdf_storage_tstore.c: Unbreak 3store backend from not compiling. 2005-07-14 Dave Beckett * rasqal/sparql_parser.y: Update to rq23 CVS 1.423 2005/07/14 12:04:17 * rasqal/Makefile.am: rasqal_skiplist_test is in TESTS * rasqal/rasqal_internal.h, rasqal/rasqal_skiplist.c: Moved internal struct rasqal_skiplist_node into rasqal_skiplist.c again. * rasqal/rasqal_internal.h: words * rasqal/rasqal_internal.h, rasqal/rasqal_skiplist.c: Moved rasqal_skiplist headers into rasqal_internal.h for now. * rasqal/rasqal_skiplist.c: Skip list implememntation * rasqal/Makefile.am: Added rasqal_skiplist.c and rasqal_skiplist_test 2005-07-13 Dave Beckett * rasqal/rasqal_query.c (rasqal_query_results_write_xml_result3): Indent by 2 * rasqal/roqet.c: Added new xml format with URI http://www.w3.org/2005/06/sparqlResults and made old one available via xml-v2 * rasqal/rasqal_query.c (rasqal_query_results_write): comments docs for URI http://www.w3.org/2005/06/sparqlResults. * rasqal/rasqal_query.c (rasqal_query_results_write): Allow NULL URI for default format. Add format V3 with URi http://www.w3.org/2005/06/sparqlResults. (rasqal_query_results_write_xml_result3): Added for latest format and new namespace. * rasqal/sparql_lexer.l (// comment rule, # comment rule): Use better grab-till-newline form. * raptor/turtle_lexer.l: Switch qname, blank node and prefix definitions to SPARQL ones. (main): Fixes for gcc4 * raptor/turtle_parser.y (main): Fix for gcc4 * rasqal/tests/sparql/SyntaxFull/manifest.ttl, rasqal/tests/sparql/ValueTesting/extendedType-0.n3, rasqal/tests/sparql/ValueTesting/extendedType-eq-pass.rq, rasqal/tests/sparql/regex/regex-query-003.rq, rasqal/tests/sparql/regex/regex-query-004.rq: Update tests from DAWG CVS * raptor/raptor_utf8.c (raptor_unicode_is_xml11_namechar): Call raptor_unicode_is_xml11_namestartchar. * rasqal/sparql_lexer.l (rasqal_sparql_name_check): Ignore 0 length names - checked in parser. Make all name problems into errors rather than warnings. 2005-07-12 Dave Beckett * rasqal/sparql_lexer.l: Reference rq23 Added sparql_name_check_flags enum for sparql name checking. Updated SPARQL name tokens to match latest rq23 - lots of comments. (// C++ comment rule): Use pattern to find end of line with multiple line endings. Count line. (/* C comment block rule): Use returned lines to bump the current line number. ({VARNAME} rule): Check varnames. ({NCNAME_PREFIX}":" rule): Check prefix. ({BNAME} rule): Check ncname. (rasqal_sparql_name_check): Added to do XML Name 1.1 check and others. (sparql_copy_name): Add check_flag and use it with rasqal_sparql_name_check instead of raptor_xml_name_check. (sparql_copy_qname, sparql_copy_string_token): Use rasqal_sparql_name_check instead of raptor_xml_name_check. (sparql_skip_cpp_comment): Deleted. * rasqal/rdql_lexer.l (// C++ comment rule): Use pattern to find end of line with multiple line endings. Count line. (/* C comment block rule): Use returned lines to bump the current line number. (rdql_skip_cpp_comment): Deleted. * rasqal/tests/sparql/SyntaxFull/manifest.ttl, rasqal/tests/sparql/SyntaxFull/syntax-qname-08.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-14.rq: Updates from DAWG tests 2005-07-01 Dave Beckett * rasqal/configure.ac: time headers * rasqal/configure.ac: Test for srandomdev * raptor/configure.ac: Check for isascii, for parsedate.y * raptor/parsedate.y: Update source links 2005-06-29 Dave Beckett * rasqal/rasqal_query.c (rasqal_query_execute): Do the result making outside #ifdef RASQAL_DEBUG ... #endif Oops! * rasqal/rasqal_expr.c (main): Add flags arg to rasqal_expression_evaluate * rasqal/tests/sparql/survey/Makefile.am: survey-10 works. now 1 failure * rasqal/rasqal_query.c: Added alternate results sorting using RASQAL_TREE define trigger to merge into a b-tree. (rasqal_query_result_row_update): Pass query compare_flags argument to rasqal_expression_evaluate. (rasqal_query_result_literal_sequence_compare): Added with main contant from rasqal_engine_query_results_compare. Operates over arrays of values of the given size. (rasqal_query_results_row_compare): Call above for order conditions or row values to handle ORDER BY(with/without DISTINCT) or DISTINCT alone. (rasqal_query_results_compare): Added. (rasqal_new_tree_node, rasqal_free_tree_node, rasqal_new_tree, rasqal_free_tree, rasqal_tree_node_add_row, rasqal_tree_add_row, rasqal_tree_node_write_indent, rasqal_tree_node_print_internal, rasqal_tree_print, rasqal_tree_node_visit, rasqal_tree_visit, rasqal_tree_add_to_sequence): Added to implement tree of rows sorted on add with optional distinct results. (rasqal_query_execute): Add alternate tree results collation enabled by RASQAL_TREE implementing distinct. * rasqal/tests/sparql/sort/Makefile.am: sort-6 now passes. no sort failures * rasqal/tests/sparql/ExprEquals/Makefile.am: "Equality 1-1" and "Equality 1-2" now pass. down to 2 failures * rasqal/rasqal_engine.c (rasqal_engine_check_constraint, rasqal_engine_expression_foreach_fold): Use flags argument in. rasqal_expression_evaluate taken from query compare_flags field. * rasqal/sparql_parser.y (rasqal_sparql_query_engine_init): Set query compare_flags to RASQAL_COMPARE_XQUERY enabling XQuery comparison and promotions. * rasqal/rasqal_expr.c (rasqal_expression_evaluate): Added flags argument, to pass down to rasqal_literal_compare. Pass it down to internal uses of rasqal_expression_evaluate also. * rasqal/rasqal_literal.c: rasqal_literal_type_labels reordered to match changes to rasqal_literal_type in rasqal.h (rasqal_literal_compare): Added RASQAL_COMPARE_XQUERY to use XQuery comparison and type promotions. When the above flag is set, only promote numeric types and otherwise compare different types using the order in rasqal_literal_type enum. * rasqal/rasqal_internal.h: rasqal_query gains compare_flags structure * rasqal/roqet.c: spaces 80 * rasqal/rasqal.h: Reordered the types in rasqal_literal_type to make them useful for sparql type promotion. Added define RASQAL_COMPARE_XQUERY Added flags argument to rasqal_expression_evaluate prototype. * rasqal/roqet.c (roqet_write_indent): Handle any depth indenting. * raptor/raptor_rss.c (raptor_rss_uplift_fields): Fix valid condition. * raptor/raptor_rss.c: raptor_rss_uplift_map - added, rss091:pubDate -> dc:date in ISO format (raptor_rss_uplift_fields): Added, to search for fields to uplift. (raptor_rss_uplift_items): Added, to scan items to uplift. (raptor_rss_parse_chunk): Call raptor_rss_uplift_items. 2005-06-28 Dave Beckett * rasqal/rasqal_engine.c: Fixes for C++. * rasqal/tests/sparql/check-sparql: Warn short form of cmd lines 2005-06-26 Dave Beckett * rasqal/rasqal_engine.c (rasqal_engine_prepare): Call rasqal_engine_query_fold_expressions. (rasqal_engine_expression_foreach_fold): Added to use with rasqal_expression_foreach. (rasqal_engine_expression_fold): Added, to fold an expression tree until no changes are made. (rasqal_engine_graph_pattern_fold_expressions): Added, to fold expressions inside a graph pattern - in sub graph patterns and in constraint expression. (rasqal_engine_query_fold_expressions): Added, to fold expressions inside a graph - in graph patterns and order conditions. * rasqal/rasqal_expr.c (rasqal_expression_clear): Added, to deallocate a static rasqal_expression. (rasqal_free_expression): Use above. (rasqal_expression_foreach): Do current node explicitly first, before op check is done so that the user function could change the op potentially. Handle op LITERAL and op FUNCTION correctly. (rasqal_expression_is_constant): Added to check if the expression tree is a constant expression. (rasqal_expression_convert_to_literal): Convert an expression tree into a literal in-situ. * rasqal/rasqal_literal.c (rasqal_literal_is_constant): Added returning non-0 if literal is a constant i.e. not a variable. * rasqal/rasqal_internal.h: Added prototypes for rasqal_engine_expression_fold, rasqal_engine_graph_pattern_fold_expressions, rasqal_engine_query_fold_expressions, rasqal_literal_is_constant, rasqal_expression_is_constant, rasqal_expression_clear and rasqal_expression_convert_to_literal. * rasqal/tests/sparql/examples/Makefile.am: sparql-query-example-Testing-Values-isLiteral works. 3 fail now. * rasqal/tests/sparql/examples/ex11.2.3.1_1.n3, rasqal/tests/sparql/examples/ex11.2.3.2_0.n3, rasqal/tests/sparql/examples/ex11.2.3.5_0.n3, rasqal/tests/sparql/examples/ex11_0.n3: Date fixes from DAWG CVS * rasqal/tests/sparql/examples/ex11.2.3.1_1.rq, rasqal/tests/sparql/examples/ex11.2.3.2_0.rq, rasqal/tests/sparql/examples/ex11.2.3.2_1.rq, rasqal/tests/sparql/examples/ex11.2.3.7_0.rq, rasqal/tests/sparql/examples/ex11_0.rq, rasqal/tests/sparql/examples/ex11_1.rq, rasqal/tests/sparql/examples/ex11.2.3.1_0.rq: Update for FILTER() * rasqal/tests/sparql/examples/Makefile.am: Correct test failures, count remains same 2005-06-25 Dave Beckett * rasqal/tests/sparql/survey/Makefile.am: survey-13 now passes. now 2 failures * rasqal/rasqal_query.c (rasqal_query_results_write_xml_20041221, rasqal_query_results_write_xml_result2): Use string_len rather than strlen(). * rasqal/rasqal_internal.h: Added prototype for rasqal_literal_ebv. Added constants rasqal_xsd_decimal_uri, rasqal_xsd_datetime_uri and rasqal_xsd_string_uri. * rasqal/rasqal_literal.c (rasqal_new_integer_literal, rasqal_new_double_literal, rasqal_new_pattern_literal, rasqal_new_string_literal, rasqal_new_simple_literal, rasqal_new_boolean_literal): Initialise the string_len field. (rasqal_literal_string_to_native): Initialise string_len field when turning into a boolean. (rasqal_literal_expand_qname): Use string_len field to initialise raptor_qname_string_to_uri. (rasqal_literal_as_node): When making a new typed literal, initialise string_len field. (rasqal_literal_ebv): Added, to return the Effective Boolean Value (EBV) of a literal. * rasqal/rasqal.h: rasqal_literal gains string_len field. * rasqal/sparql_parser.y (sparql_is_builtin_xsd_datatype): Added to check for the types that sparql supports. (FunctionCall): Use sparql_is_builtin_xsd_datatype to distinguish a cast from a function - name is the datatype URI, has 1 arg. * rasqal/rasqal_general.c: Added constants rasqal_xsd_decimal_uri, rasqal_xsd_datetime_uri and rasqal_xsd_string_uri constants. (rasqal_uri_init, rasqal_uri_finish): Init and free rasqal_xsd_decimal_uri, rasqal_xsd_datetime_uri and rasqal_xsd_string_uri. 2005-06-24 Dave Beckett * rasqal/tests/sparql/Expr1/expr-1.rq, rasqal/tests/sparql/Expr1/expr-2.rq, rasqal/tests/sparql/Expr1/expr-3.rq, rasqal/tests/sparql/Expr2/query-bev-1.rq, rasqal/tests/sparql/Expr2/query-bev-3.rq, rasqal/tests/sparql/Expr2/query-bev-4.rq, rasqal/tests/sparql/Expr2/query-bev-5.rq, rasqal/tests/sparql/Expr2/query-bev-6.rq, rasqal/tests/sparql/ExprBuiltins/q-datatype-1.rq, rasqal/tests/sparql/ExprBuiltins/q-str-1.rq, rasqal/tests/sparql/ExprBuiltins/q-str-2.rq, rasqal/tests/sparql/ExprBuiltins/q-str-3.rq, rasqal/tests/sparql/ExprBuiltins/q-str-4.rq, rasqal/tests/sparql/ExprEquals/query-eq-1.rq, rasqal/tests/sparql/ExprEquals/query-eq-2.rq, rasqal/tests/sparql/ExprEquals/query-eq-3.rq, rasqal/tests/sparql/ExprEquals/query-eq-4.rq, rasqal/tests/sparql/ExprEquals/query-eq-5.rq, rasqal/tests/sparql/ExprEquals/query-eq2-1.rq, rasqal/tests/sparql/ExprEquals/query-eq2-2.rq, rasqal/tests/sparql/SyntaxFull/manifest.ttl, rasqal/tests/sparql/SyntaxFull/syntax-expr-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-expr-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-expr-06.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-07.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-08.rq, rasqal/tests/sparql/ValueTesting/extendedType-0.n3, rasqal/tests/sparql/regex/regex-query-001.rq, rasqal/tests/sparql/regex/regex-query-002.rq, rasqal/tests/sparql/regex/regex-query-003.rq, rasqal/tests/sparql/regex/regex-query-004.rq: Updates from DAWG CVS * rasqal/rasqal_query.c: Moved rasqal_query_result_row to rasqal-internal.h (rasqal_new_query_result_row): Handle no order_conditions_sequence present. Set NULL literal values when they appear, as from OPTIONAL. (rasqal_query_results_update): Added, based on core of rasqal_query_results_next to get next result from query engine, including offsets. (rasqal_query_execute): Use rasqal_query_results_update when not sorting and make a query_results->row (rasqal_free_query_results): Free any row field used. (rasqal_query_results_get_bindings, rasqal_query_results_get_binding_value, rasqal_query_results_get_binding_value_by_name): Return row values, using query_results row field for stream results. * rasqal/rasqal_raptor.c (rasqal_raptor_bind_match): Use rasqal_new_literal_from_literal when binding literal values, do not turn them into nodes this early. * rasqal/tests/sparql/sort/Makefile.am: sort-4 sort-7 pass now only fail sort-6 * rasqal/rasqal_expr.c (rasqal_expression_evaluate): For case RASQAL_EXPR_LT, RASQAL_EXPR_GT, RASQAL_EXPR_LE, RASQAL_EXPR_GE - invert the test for the result of rasqal_literal_compare test as it was totally backwards for ints and doubles. * rasqal/rasqal_literal.c (rasqal_literal_compare): Return correct <0, 0, >0 for integers and doubles. It was formerly negative the right result. * rasqal/rasqal_internal.h: Added struct rasqal_query_result_row internal for now. rasqal_query_results gains field row for use as the current result row when streaming results. * rasqal/tests/sparql/check-sparql: tidy messages * rasqal/rasqal_query.c (rasqal_new_query_result_row): Just do allocations here, and use rasqal_query_result_row_update to update the contents from the current query engine result. (rasqal_query_result_row_update): Added, updating the given row with the current query engine result. 2005-06-23 Dave Beckett * rasqal/rasqal_literal.c (rasqal_literal_print): Fix formats for decimal, datetime * rasqal/rasqal_query.c (rasqal_query_results_write_xml_20041221, rasqal_query_results_write_xml_result2, rasqal_query_results_get_triple): Handle RASQAL_LITERAL_FLOAT (as a double), RASQAL_LITERAL_DECIMAL (as a string) and RASQAL_LITERAL_DATETIME (as a string). * rasqal/rasqal_literal.c (rasqal_new_double_literal): Added, based on rasqal_new_floating_literal. (rasqal_new_floating_literal): Now a wrapper around the above. (rasqal_literal_string_to_native): Promote xsd:float too. (rasqal_free_literal, rasqal_literal_print, rasqal_literal_as_boolean, rasqal_literal_as_integer, rasqal_literal_as_floating, rasqal_literal_as_string, rasqal_literal_compare, rasqal_literal_equals, rasqal_literal_as_node): Handle RASQAL_LITERAL_FLOAT (as a double), RASQAL_LITERAL_DECIMAL (as a string) and RASQAL_LITERAL_DATETIME (as a string). * rasqal/rasqal_redland.c: Use RASQAL_LITERAL_DOUBLE instead of RASQAL_LITERAL_FLOATING * rasqal/sparql_lexer.l, rasqal/rdql_lexer.l, rasqal/rasqal_expr.c: Replace rasqal_new_floating_literal with rasqal_new_double_literal * rasqal/rasqal_general.c: Added rasqal_xsd_float_uri URI constant. (rasqal_uri_init, rasqal_uri_finish): Init/free it. * rasqal/rasqal_internal.h: Added rasqal_xsd_float_uri. * rasqal/rasqal.h: Added RASQAL_LITERAL_DOUBLE (formerly RASQAL_LITERAL_FLOATING), RASQAL_LITERAL_FLOAT, RASQAL_LITERAL_DECIMAL and RASQAL_LITERAL_DATETIME. float uses the 'double floating' field. decimal and datetime use the string field, for now. Deprecated rasqal_new_floating_literal Added prototype for rasqal_new_double_literal * rasqal/roqet.c: Added a -e/--exec option to execute a query string directly. Usage updated to show the two forms. 2005-06-22 Dave Beckett * librdf/rdf_storage_mysql.c, rasqal/win32_rasqal_config.h: win32 fixes from John Barstow. 2005-06-17 Dave Beckett * librdf/rdf_hash.c: Ignore fwrite return values (gcc4 warning). It's not like anyone ever checks fprintf, fputs either... * rasqal/sparql_lexer.l, rasqal/rdql_lexer.l: Check for sscanf failure and return errors for hex, floating, \u and \U constants. * rasqal/rasqal_literal.c (rasqal_literal_string_to_native): Add error handler and data args. Use it if sscanf fails on converting a float string. (rasqal_new_string_literal): If rasqal_literal_string_to_native fails, tidy up and return NULL. (rasqal_literal_expand_qname): if rasqal_literal_string_to_native fails, tidy up and return 1. * rasqal/rasqal_internal.h: Update rasqal_literal_string_to_native prototype to take an error handler and data. * rasqal/rasqal_general.c (rasqal_escaped_name_to_utf8_string): Check for sscanf failure with \u and \U such as \uGHIJ which isn't hex. * librdf/rdf_storage_list.c: remove librdf_node_encode2 * librdf/redland.spec.in, rasqal/rasqal.spec.in, raptor/raptor.spec.in: License not Copyright header 2005-06-16 Dave Beckett * librdf/rdf_storage.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage_tstore.c, librdf/rdf_stream.c, librdf/rdf_hash_bdb.c, librdf/rdf_hash_memory.c, librdf/rdf_list.c, librdf/rdf_parser_raptor.c, librdf/rdf_query.c, librdf/rdf_query_rasqal.c, librdf/rdf_serializer_raptor.c, librdf/rdf_statement.c, librdf/rdf_hash.c: Remove \n from the end of log messages. * librdf/rdf_node.c (librdf_node_encode): Give an error when a node cannot be encoded due to string data being too long. Remove legacy 0.9.12+ #if-defed out encoding code. It remains in librdf_node_decode. 2005-06-15 Dave Beckett * rasqal/tests/sparql/check-sparql: updated messages * rasqal/tests/sparql/regex/Makefile.am: 1 failure * rasqal/tests/sparql/ExprEquals/Makefile.am: 4 failures. Add explicit count. * rasqal/tests/sparql/ExprBuiltins/Makefile.am: 4 failures * rasqal/tests/sparql/Expr2/Makefile.am: 6 failures. Add explict count. * rasqal/tests/sparql/Expr1/Makefile.am: 2 failures. Add explict count. * rasqal/tests/sparql/ExprBuiltins/Makefile.am: manifest.ttl * rasqal/configure.ac: Add tests/sparql regex, Expr1, Expr2, ExprBuiltins, ExprEquals dirs * rasqal/tests/sparql/ExprEquals/data-eq.ttl, rasqal/tests/sparql/ExprEquals/manifest.n3, rasqal/tests/sparql/ExprEquals/query-eq-1.rq, rasqal/tests/sparql/ExprEquals/query-eq-2.rq, rasqal/tests/sparql/ExprEquals/query-eq-3.rq, rasqal/tests/sparql/ExprEquals/query-eq-4.rq, rasqal/tests/sparql/ExprEquals/query-eq-5.rq, rasqal/tests/sparql/ExprEquals/query-eq2-1.rq, rasqal/tests/sparql/ExprEquals/query-eq2-2.rq, rasqal/tests/sparql/ExprEquals/result-eq-1.ttl, rasqal/tests/sparql/ExprEquals/result-eq-2.ttl, rasqal/tests/sparql/ExprEquals/result-eq-3.ttl, rasqal/tests/sparql/ExprEquals/result-eq-4.ttl, rasqal/tests/sparql/ExprEquals/result-eq-5.ttl, rasqal/tests/sparql/ExprEquals/result-eq2-1.ttl, rasqal/tests/sparql/ExprEquals/result-eq2-2.ttl, rasqal/tests/sparql/regex/Makefile.am, rasqal/tests/sparql/regex/manifest.n3, rasqal/tests/sparql/regex/regex-data-01.n3, rasqal/tests/sparql/regex/regex-query-001.rq, rasqal/tests/sparql/regex/regex-query-002.rq, rasqal/tests/sparql/regex/regex-query-003.rq, rasqal/tests/sparql/regex/regex-query-004.rq, rasqal/tests/sparql/regex/regex-result-001.n3, rasqal/tests/sparql/regex/regex-result-002.n3, rasqal/tests/sparql/regex/regex-result-003.n3, rasqal/tests/sparql/regex/regex-result-004.n3, rasqal/tests/sparql/Expr2/data-1.ttl, rasqal/tests/sparql/Expr2/data-2.ttl, rasqal/tests/sparql/Expr2/manifest.n3, rasqal/tests/sparql/Expr2/query-bev-1.rq, rasqal/tests/sparql/Expr2/query-bev-2.rq, rasqal/tests/sparql/Expr2/query-bev-3.rq, rasqal/tests/sparql/Expr2/query-bev-4.rq, rasqal/tests/sparql/Expr2/query-bev-5.rq, rasqal/tests/sparql/Expr2/query-bev-6.rq, rasqal/tests/sparql/Expr2/result-bev-1.ttl, rasqal/tests/sparql/Expr2/result-bev-2.ttl, rasqal/tests/sparql/Expr2/result-bev-3.ttl, rasqal/tests/sparql/Expr2/result-bev-4.ttl, rasqal/tests/sparql/Expr2/result-bev-5.ttl, rasqal/tests/sparql/Expr2/result-bev-6.ttl, rasqal/tests/sparql/ExprBuiltins/Makefile.am, rasqal/tests/sparql/ExprBuiltins/data-builtin-1.ttl, rasqal/tests/sparql/ExprBuiltins/manifest.ttl, rasqal/tests/sparql/ExprBuiltins/q-blank-1.rq, rasqal/tests/sparql/ExprBuiltins/q-datatype-1.rq, rasqal/tests/sparql/ExprBuiltins/q-str-1.rq, rasqal/tests/sparql/ExprBuiltins/q-str-2.rq, rasqal/tests/sparql/ExprBuiltins/q-str-3.rq, rasqal/tests/sparql/ExprBuiltins/q-str-4.rq, rasqal/tests/sparql/ExprBuiltins/q-uri-1.rq, rasqal/tests/sparql/ExprBuiltins/result-blank-1.ttl, rasqal/tests/sparql/ExprBuiltins/result-datatype-1.ttl, rasqal/tests/sparql/ExprBuiltins/result-str-1.ttl, rasqal/tests/sparql/ExprBuiltins/result-str-2.ttl, rasqal/tests/sparql/ExprBuiltins/result-str-3.ttl, rasqal/tests/sparql/ExprBuiltins/result-str-4.ttl, rasqal/tests/sparql/ExprBuiltins/result-uri-1.ttl, rasqal/tests/sparql/ExprEquals/Makefile.am, rasqal/tests/sparql/Expr1/Makefile.am, rasqal/tests/sparql/Expr1/data-1.ttl, rasqal/tests/sparql/Expr1/expr-1-result.ttl, rasqal/tests/sparql/Expr1/expr-1.rq, rasqal/tests/sparql/Expr1/expr-2-result.ttl, rasqal/tests/sparql/Expr1/expr-2.rq, rasqal/tests/sparql/Expr1/expr-3-result.ttl, rasqal/tests/sparql/Expr1/expr-3.rq, rasqal/tests/sparql/Expr1/manifest.n3, rasqal/tests/sparql/Expr2/Makefile.am, rasqal/tests/sparql/Makefile.am: Import Expr1 Expr2 ExprBuiltins ExprEquals regex from DAWG tests 2005-06-14 Dave Beckett * rasqal/rasqal_engine.c (rasqal_select_NULL_last_compare): Added helper for removing duplicate select variables. (rasqal_engine_assign_variables): Look for duplicate select variables, warn about them and remove them by sorting and then deleting NULL variables. * rasqal/tests/sparql/syntax/Makefile.am: Added select-dup.rq * rasqal/tests/sparql/syntax/select-dup.rq: Test for duplicates in select 2005-06-13 Dave Beckett * rasqal/tests/sparql/examples/Makefile.am: sparql-query-example-Testing-Values-isBlank now works * rasqal/tests/sparql/survey/Makefile.am: survey-2 now works. * rasqal/rasqal_query.c (rasqal_query_prepare): Call rasqal_engine_merge_basic_graph_patterns * rasqal/rasqal_engine.c (rasqal_engine_join_basic_graph_patterns): Move the triples and constraints from a source to a destination graph pattern. (rasqal_engine_make_basic_graph_pattern): Use rasqal_engine_join_basic_graph_patterns to merge: 1) a group of all basic graph patterns 2) an optional group of all basic graph patterns 3) a graph pattern with 1 sub-graph pattern Have to play some games with graph pattern operators. (rasqal_engine_merge_basic_graph_patterns): Use rasqal_engine_join_basic_graph_patterns to merge all basic graph patterns in a group into group of a single basic graph pattern of all the triples and constraints. * rasqal/rasqal_internal.h: Added prototypes for rasqal_engine_join_basic_graph_patterns and rasqal_engine_merge_basic_graph_patterns * rasqal/rasqal_query.c (rasqal_query_execute): For ordering results, directly use rasqal_engine_get_next_result to avoid doing limit and offset checks too early. Start off from result_count 1. (rasqal_query_results_next): For ordered results, handle limit and offset with a loop and a check with rasqal_engine_check_limit_offset. For streaming results, move check code to rasqal_engine_check_limit_offset and use it. (rasqal_query_results_get_bindings, rasqal_query_results_get_binding_value, rasqal_query_results_get_binding_value_by_name): For ordered results, use result_count-1 as an index. * rasqal/rasqal_engine.c (rasqal_engine_check_limit_offset): Added to check the current query result is in the range specified by limit and offset * rasqal/rasqal_internal.h: Added prototype for rasqal_engine_check_limit_offset 2005-06-12 Dave Beckett * raptor/raptor_rss.c: update for INN parsedate * raptor/configure.ac: Look for parsedate in libINN 2005-06-11 Dave Beckett * raptor/Makefile.am: Add parsedate.y to EXTRA_DIST * raptor/configure.ac: Better check for parsedate function * raptor/raptor_rss.c: Add the time includes for AC_HEADER_TIME * raptor/configure.ac: Add the standard AC_HEADER_TIME checks. * raptor/raptor_rss.c: Turn rss091:date into dc:date using a date parsing function PARSEDATE_FUNCTION to decode it and strftiem to make the new ISO format. * raptor/configure.ac: Get date parsing code from parsedate, curl curl_getdate or raptor parsedate if neither is available. * raptor/Makefile.am: Add parsedate.c if PARSEDATE defined Build parsedate.c from parsedate.y * raptor/parsedate.y: Fixes to build in raptor * raptor/parsedate.y: Imported from http://cvs.php.net/php-src/ext/standard/parsedate.y 2005-06-10 Dave Beckett * librdf/win32_rdf_config.h, configure.ac: Bumped version to 1.0.3 * Snapshotted redland_1_0_2 for 1.0.2 release * raptor/raptor_rss.c: Added Suzan Foster to copyright 2005-06-09 Dave Beckett * configure.ac: raptor min 1.4.4 (same as rasqal) rasqal min 0.9.10 * rasqal/: Snapshotted rasqal_0_9_10 for 0.9.10 release * rasqal/tests/sparql/ValueTesting/Makefile.am: extendedType-eq-pass passes * rasqal/rasqal_query.c (rasqal_new_query_result_row): Added offset to store original sort order in case it is needed to order two identical literals. (rasqal_query_result_row_print): Print offset. (rasqal_engine_query_results_compare): Renamed from rasqal_engine_query_results_sort. Lots more debug messages and checks. Order NULL literals before other types. (rasqal_query_execute): Pass result offset into rasqal_new_query_result_row. * rasqal/rasqal_literal.c (rasqal_literal_compare): Make comparison stable for URIs and datatyped strings - use strcmp on string values of URIs. * rasqal/tests/sparql/sort/Makefile.am: sort-3 works * rasqal/librasqal.3: Updates for 0.9.10 2005-06-08 Dave Beckett * rasqal/win32_rasqal_config.h: Undefine OPTIONAL as something in win32 defines it. * rasqal/sparql_parser.y, rasqal/roqet.c, rasqal/rasqal_query.c, rasqal/rasqal_internal.h, rasqal/rasqal_graph_pattern.c, rasqal/rasqal_engine.c: Rename rasqal_graph_pattern_operator variables called 'operator' to 'op' for C++. Other casts for C++ * rasqal/rasqal_internal.h: Added RASQAL_DEPRECATED_WARNING to generate a rasqal warning once only. * rasqal/sparql_parser.y (OrderCondition): Use RASQAL_DEPRECATED_WARNING to explain ASC[] and DESC[] have been replaced. * rasqal/sparql_parser.y (OrderCondition): Use RASQAL_EXPR_ORDER_COND_ASC or DESC not NONE which is deleted. * rasqal/rasqal_query.c, rasqal/rasqal_expr.c, rasqal/rasqal.h: Deleted RASQAL_EXPR_ORDER_COND_NONE * rasqal/rasqal_query.c (rasqal_engine_query_results_sort): If result is 0 at the end, use the difference between the object pointers to create a stable sort when duplicates occur. * rasqal/Makefile.am: Do not build rasqal_xsd_datatypes_test unless RASQAL_DATATYPES makefile conditional is enabled. * rasqal/configure.ac: Add makefile conditional RASQAL_DATATYPES true when datatypes enabled. * rasqal/rasqal.pc.in: Add PKGCONFIG_REQUIRES, PKGCONFIG_LIBS and PKGCONFIG_CFLAGS * rasqal/configure.ac: Tidy specification of min versions Added pkgconfig specific additions: +PKGCONFIG_REQUIRES, PKGCONFIG_LIBS and PKGCONFIG_CFLAGS substituted into rasqal.pc.in Add PCRE cflags, libs to PKGCONFIG cflags/libs when used. Add libxml-2.0 to PKGCONFIG requires when used. * raptor/: Snapshotted raptor_1_4_7 for 1.4.7 release * raptor/libraptor.3: Note no changes in 1.4.6 and 1.4.7 * rasqal/rasqal_query.c (rasqal_query_execute): When sorting, set finished flag if there are no results. (rasqal_query_results_next): When sorting, set finished flag if match or exceed number of results. (rasqal_query_results_get_binding_value, rasqal_query_results_get_binding_value_by_name): When sorting, set finished flag if current row is beyond results. 2005-06-07 Dave Beckett * raptor/raptor_serialize_rdfxmla.c (raptor_new_qname_from_resource): Fail to split predicate if entire uri is an XML name - it's probably not an absolute URI. * raptor/raptor_serialize.c (raptor_rdfxml_serialize_statement): Fail to split predicate if entire uri is an XML name - it's probably not an absolute URI. * raptor/raptor_namespace.c (raptor_namespaces_find_namespace_by_uri): Return NULL if ns_uri is NULL. * rasqal/tests/sparql/ValueTesting/extendedType-ne-fail.rq, rasqal/tests/sparql/ValueTesting/extendedType-eq-pass-result.n3: Update to DAWG cvs * rasqal/tests/sparql/ValueTesting/extendedType-eq-pass-result.n3: delete results from extendedType-eq-pass-result.n3 * rasqal/tests/sparql/ValueTesting/Makefile.am: 2 fail * rasqal/configure.ac: Added tests/sparql/ValueTesting * rasqal/tests/sparql/Makefile.am, rasqal/tests/sparql/ValueTesting/Makefile.am, rasqal/tests/sparql/ValueTesting/extendedType-0.n3, rasqal/tests/sparql/ValueTesting/extendedType-eq-pass-result.n3, rasqal/tests/sparql/ValueTesting/extendedType-eq-pass.rq, rasqal/tests/sparql/ValueTesting/extendedType-ne-fail-result.n3, rasqal/tests/sparql/ValueTesting/extendedType-ne-fail.rq, rasqal/tests/sparql/ValueTesting/manifest.n3: Added ValueTesting * rasqal/rasqal_engine.c (rasqal_engine_make_basic_graph_pattern): Allow OPTIONAL to gather up inner basic graph patterns. Print operator type when debugging. * rasqal/rasqal_engine.c (rasqal_engine_make_basic_graph_pattern): More debug explanations of why merging/not merging. Only work on a GROUP graph pattern. * rasqal/rasqal_query.c (rasqal_new_query, rasqal_free_query): Init/free query->results_sequence. Added internal rasqal_query_result_row (rasqal_new_query_result_row): Added to make a row out from a copy of all of the values of the current query result including the values of the ordering expressions for this row. (rasqal_free_query_result_row): Added to free a row. (rasqal_query_result_row_print): Added to print a row. (rasqal_engine_query_results_sort): Sequence helper function to do the query results ordering using rasqal_literal_compare. (rasqal_query_execute): If an ordering condition sequence is present, gather all the results, order them and store them in query->results_sequence. (rasqal_query_results_next, rasqal_query_results_get_bindings, rasqal_query_results_get_binding_value, rasqal_query_results_get_binding_value_by_name): Handle getting ordered result values from query->results_sequence. * rasqal/rasqal_expr.c (rasqal_expression_evaluate): Return the expression argumetn for ordering conditions. * rasqal/tests/sparql/sort/Makefile.am: Fail 4 now it does something * rasqal/tests/sparql/check-sparql: Handle sorted results by not sorting, and unsorted results by sorting. Clear? * rasqal/rasqal_internal.h: rasqal_query structure gains internal results_sequence * rasqal/rasqal_literal.c (rasqal_literal_as_node): Handle unbound variable values. * rasqal/librasqal.3: rasqal_query_results_write: Note 2005-05-27 WD and add format uris * rasqal/rasqal_query.c (rasqal_query_results_write): Note 2005-05-27 WD and add format uris * rasqal/sparql_parser.y (PatternElementsList 2): Added debugging. * rasqal/sparql_parser.y (PatternElementsList): Doesn't need mygp 2005-06-06 Dave Beckett * raptor/raptor_rss.c (raptor_rss_emit): Fix crash when no RSS channel is present (Suzan Foster) 2005-06-04 Dave Beckett * rasqal/rasqal_engine.c: wrods * rasqal/rasqal_engine.c (rasqal_engine_execute_init): Update the hack modification to report it with a debug dump after, and set top graph pattern operator to GROUP * rasqal/sparql_parser.y (PatternElementsList): Set graph pattern operator to GROUP bydefault. * rasqal/configure.ac: Simplify libxml check Add message/report for datatypes support * rasqal/configure.ac: Check for libxml2, add xml2-config and xmlschema header files. Added --enable-datatypes method to enable linking libxml for datatypes. * rasqal/rasqal_xsd_datatypes.c: Protect xml includes with HAVE_LIBXML_XMLSCHEMAS_H 2005-06-03 Dave Beckett * rasqal/Makefile.am: Remove XML2_CONFIG 2005-06-02 Dave Beckett * rasqal/rasqal_engine.c (rasqal_engine_make_basic_graph_pattern): Change resulting graph parent pattern operator to BASIC if it was GROUP * rasqal/tests/sparql/SyntaxFull/Makefile.am: 0 failures now * rasqal/sparql_parser.y: Document the 12 shift/reduce conflicts now. (PropertyListOpt): Docs. (PropertyListTail): Use PropertyListOpt to allow ending on a ';' * rasqal/sparql_parser.y (AskClause): ASK is done * rasqal/tests/sparql/SyntaxFull/Makefile.am: Update lists * rasqal/tests/sparql/SyntaxFull/syntax-forms-03.arq: Remove unused tests * rasqal/tests/sparql/SyntaxFull/syntax-query-pat-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-05.rq: Delete old tests * rasqal/tests/sparql/SyntaxFull/syntax-bnodes-09.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-08.rq: Remove unused tests * rasqal/tests/sparql/SyntaxFull/Makefile.am: Added check-sparql-correct target * rasqal/tests/sparql/SyntaxFull/syntax-query-pat-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-08.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-09.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-04.rq: Added syntax-bnodes-08.rq syntax-bnodes-09.rq syntax-query-pat-01.rq syntax-query-pat-02.rq syntax-query-pat-03.rq syntax-query-pat-04.rq syntax-query-pat-05.rq tests * rasqal/tests/sparql/SyntaxFull/Makefile.am: 3 to 1 failure * rasqal/rasqal_xsd_datatypes.c: Pull in libxml schema headers * rasqal/sparql_parser.y (OrderClauseOpt, LimitClauseOpt, OffsetClauseOpt): Check that ORDER BY is not used with ASK, LIMIT or OFFSET rather than put in grammar now. (OrderCondition): Allow FunctionCall, Var and '(' Expression ')' after rq23 latest. * rasqal/Makefile.am: Added XML2_CONFIG for datatypes testing * rasqal/rasqal_xsd_datatypes.c (main): run rasqal_init/finish. * rasqal/sparql_parser.y: Document 6 shift/reduce * rasqal/tests/sparql/SyntaxFull/Makefile.am: from 4 to 3 failures * rasqal/sparql_lexer.l: Ensure <> does not get grabbed as LT GT * rasqal/tests/sparql/SyntaxFull/Makefile.am: from 8 to 4 failures * rasqal/sparql_parser.y: Added PropertyListOpt as an outer triple in SPARQL can be just a subject [ :a :b ] (ObjectTail): Added to tidy up Object lists, remove duplicates. * rasqal/rasqal_graph_pattern.c (rasqal_graph_pattern_print): No \n after ( * rasqal/sparql_parser.y (GraphPattern): Do not set graph pattern operator here. (PropertyListTail): Added after last WD grammer to aid in allowing a trailing ; (PatternElementsList): Set default operator to basic. (PropertyList): Use PropertyListTail (PropertyList): Added (VarOrBnodeOrURI): Moved '[' ']' to BlankNode. (BlankNode): Allow '[' ']' in all cases. * librdf/rdf_stream.c (librdf_free_stream): Only call finished_method if it exists. This likely caused crashes with empty iterators 2005-06-01 Dave Beckett * rasqal/tests/sparql/SyntaxFull/Makefile.am: crashes stopped * rasqal/sparql_parser.y (VarOrBnodeOrURI): Added, used for Predicate and allows explicit bnode or [] * rasqal/rasqal_graph_pattern.c (rasqal_graph_pattern_init): Add init of current_graph_pattern field when there are sub-graph patterns. Moved from rasqal_engine_execute_init. * rasqal/rasqal_engine.c (rasqal_engine_execute_init): Move init of current_graph_pattern field into rasqal_graph_pattern_init * rasqal/tests/sparql/examples/ex11.2.3.1_0-result.n3, rasqal/tests/sparql/examples/ex11.2.3.2_0-result.n3, rasqal/tests/sparql/examples/ex11.2.3.5_0-result.n3, rasqal/tests/sparql/examples/ex11_0-result.n3, rasqal/tests/sparql/examples/ex11_1-result.n3: Updated examples * rasqal/tests/sparql/sort/query-sort-6.rq, rasqal/tests/sparql/sort/query-sort-5.rq, rasqal/tests/sparql/sort/query-sort-4.rq, rasqal/tests/sparql/sort/query-sort-3.rq, rasqal/tests/sparql/sort/query-sort-2.rq: Use ASC() and DESC() * rasqal/tests/sparql/sort/manifest.ttl: rdfs:comment * rasqal/tests/sparql/SyntaxFull/Makefile.am: 10 failures * rasqal/tests/sparql/SyntaxFull/Makefile.am: note latest failures * rasqal/tests/sparql/SyntaxFull/Makefile.am: Added new tests * rasqal/tests/sparql/SyntaxFull/manifest.ttl: Added tests syntax-bnodes-0[567] syntax-limit-offset-0[789] and syntax-order[06] * rasqal/tests/sparql/SyntaxFull/syntax-limit-offset-07.rq, rasqal/tests/sparql/SyntaxFull/syntax-limit-offset-08.rq, rasqal/tests/sparql/SyntaxFull/syntax-limit-offset-09.rq: tests for limit and offset * rasqal/tests/sparql/SyntaxFull/syntax-bnodes-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-06.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-07.rq: More bnodes forms * rasqal/tests/sparql/SyntaxFull/syntax-order-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-order-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-order-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-order-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-order-06.rq: ASC/DESC using () not []s * rasqal/tests/sparql/examples/Makefile.am: sparql-query-example-Testing-Values-RDFterm-equal now passes * rasqal/sparql_parser.y (OrderCondition): Accept ASC() and DESC() deprecating ASC[] and DESC[] * rasqal/sparql_lexer.l: ASC and DESC are just the tokens, no [ * raptor/Makefile.am: Added ChangeLog.[2-5] * raptor/ChangeLog: 2004 to ChangeLog.5 * raptor/raptor_rss.c (raptor_rss_parser_processNode): Copy attribute value before storing in the item field. 2005-05-31 Dave Beckett * rasqal/roqet.c (roqet_graph_pattern_walk): Print graph pattern operator * rasqal/sparql_parser.y: Updates for graph pattern operators, not flags. (GraphPattern): Set group graph pattern operator. (PatternElementsList): Start off with an unknown grpah pattern operator, to catch missing cases. (PatternElement): Set basic graph pattern operator. (OptionalGraphPattern): Set optional graph pattern operator. (GraphGraphPattern): Set graph graph pattern operator. (UnionGraphPattern): Set union graph pattern operator. * rasqal/rdql_parser.y (rasqal_rdql_query_engine_prepare): Make a root basic graph pattern. * rasqal/rasqal_engine.c (rasqal_engine_get_next_result): Print the graph pattern operator and update to check for optional step by operator. (rasqal_engine_make_basic_graph_pattern): Fold in a set of sub-graph patterns that are all basic graph patterns. * rasqal/rasqal_graph_pattern.c (rasqal_new_graph_pattern_from_sequence, rasqal_graph_pattern_add_triples): Final argument is now a graph pattern operator. (rasqal_graph_pattern_order): Sort optionals by operator. (rasqal_graph_pattern_init): Check for graph pattern operator. (rasqal_graph_pattern_get_operator, rasqal_graph_pattern_operator_as_string): Added. (rasqal_graph_pattern_print): Print the graph pattern operator. * rasqal/rasqal_query.c (rasqal_graph_pattern_get_flags): Deprecated, always returns 0. * rasqal/rasqal_internal.h: Added operator field to rasqal_graph_pattern. Change final argument of rasqal_new_graph_pattern_from_sequence and rasqal_graph_pattern_add_triples to operator. * rasqal/rasqal.h: Added rasqal_graph_pattern_operator Deprecated rasqal_graph_pattern_get_flags Added prototypes for rasqal_graph_pattern_get_operator and rasqal_graph_pattern_operator_as_string * rasqal/sparql_parser.y: Update grammar doc references to use SPARQL Query Language for RDF, 19 April 2005 http://www.w3.org/TR/2005/WD-rdf-sparql-query-20050419/ 2005-05-29 Dave Beckett * configure.ac, librdf/win32_rdf_config.h: Bumped version to 1.0.2 * Snapshotted redland_1_0_1 for 1.0.1 release * librdf/rdf_storage_mysql.c: remove errbuff * configure.ac: remove mysql -fno-common fix, breaks regular stuff 2005-05-28 Dave Beckett * librdf/rdf_storage_mysql.c: Define mysql common symbol errbuff if NEED_MYSQL_ERRBUFF defined. * configure.ac: If -fno-common is in the PIC compile args, define the mysql errbuff common symbol. * configure.ac: Only look for BDB in /sw (fink) if /sw/bin is in the path. 2005-05-25 Dave Beckett * raptor/raptor_xslt.c: docs 2005-05-24 Dave Beckett * rasqal/roqet.c: Removed deprecated flags -f and -o * rasqal/rasqal_expr.c (rasqal_triple_set_flags, rasqal_triple_get_flags): Removed deprecated functions. * rasqal/rasqal_engine.c (rasqal_new_triples_match): Removed rasqal_triples_source deprecated factory method new_triples_match. * rasqal/rasqal_query.c: (rasqal_new_query, rasqal_free_query, rasqal_query_add_data_graph): Removed rasqal_query deprecated list sources. (rasqal_query_add_source, rasqal_query_get_source_sequence, rasqal_query_get_source, rasqal_query_add_constraint, rasqal_query_get_constraint_sequence, rasqal_query_get_constraint): Removed deprecated functions. * rasqal/rasqal_internal.h: Removed rasqal_query deprecated list sources. * rasqal/rasqal.h: Removed deprecated functions: rasqal_query_add_source, rasqal_query_get_source_sequence, rasqal_query_get_source, rasqal_query_add_constraint, rasqal_query_get_constraint_sequence, rasqal_query_get_constraint, rasqal_triple_set_flags and rasqal_triple_get_flags. Removed rasqal_triples_source deprecated factory method new_triples_match * rasqal/rasqal_engine.c (rasqal_set_triples_source_factory): Does not need RASQAL_API in the C * rasqal/rasqal_engine.c (rasqal_reset_triple_meta): Removed code that will never be called, freeing triples_match field for the second time * rasqal/rasqal_engine.c (rasqal_engine_expand_wildcards): Added, containing code from rasqal_engine_assign_variables to handle wildcard *. Handle remaining query verbs. (rasqal_engine_assign_variables): Moved wildcard handling code above. (rasqal_engine_prepare): Call rasqal_engine_expand_wildcards. 2005-05-23 Dave Beckett * librdf/Makefile.am: Added COMPILE_LINK rule for making tests in one step. * configure.ac: syntax - delete ;s * librdf/rdf_digest_sha1.c (SHA1Transform): Take const buffer * librdf/rdf_digest_md5.c: duplicate const * librdf/rdf_hash.c: docs * Redland.i: Added digest and hash classes to API emphasising methods for creating hex-strings digests of strings and making hashes for model options. * librdf/rdf_uri.c (librdf_uri_get_digest): No need to call librdf_digest_init as the constructor does that. * librdf/rdf_digest.c: Docs. (librdf_new_digest_from_factory): Call init factory method here. (librdf_digest_init): Note this is a re-init. * librdf/rdf_digest.c (librdf_digest_update_string): Added. * librdf/rdf_digest.h: Added prototype for librdf_digest_update_string * librdf/rdf_digest_sha1.c, librdf/rdf_digest_openssl.c, librdf/rdf_digest_md5.c: Update the factory method to take a const buffer. * librdf/rdf_digest.c (librdf_digest_get_digest_length): Added. * librdf/rdf_digest.h: Factory method update takes const buffer. Reduced public API removing methods mentioning librdf_digest_factory. Added prototype for librdf_digest_get_digest_length * librdf/rdf_hash.c (librdf_hash_get_as_boolean, librdf_hash_get_as_long librdf_hash_get_del): Take const key args * librdf/rdf_hash.h: Make librdf_hash_get_as_boolean, librdf_hash_get_as_long and librdf_hash_get_del take const key args * librdf/rdf_hash.c: (librdf_new_hash_from_string, librdf_new_hash_from_array_of_strings): return NULL if inner constructor fails. * librdf/rdf_hash.h: Make public API smaller; do not mention librdf_hash_factory or librdf_hash_datum. Added prototypes for new public constructors librdf_new_hash_from_string and librdf_new_hash_from_array_of_strings * librdf/rdf_hash.c: (librdf_new_hash_from_string, librdf_new_hash_from_array_of_strings): Added constructors around internal functions for use by public API. (librdf_hash_from_array_of_strings): Take const array. (main): Update for const args. * librdf/win32/README.txt: Add win32 README.txt 2005-05-22 Dave Beckett * raptor/configure.ac: Test for libxslt/xslt.h as well as library, and disable if missing. 2005-05-20 Dave Beckett * librdf/Makefile.am, librdf/rdf_internal.h, librdf/librdf.h: Add rdf_digest.h and rdf_hash.h to public includes. * librdf/rdf_digest.h, librdf/rdf_hash.h: Make API public, declare with REDLAND_API * librdf/rdf_digest.h, librdf/rdf_hash.h: Moved class init/finish methods into internal * librdf/rdf_query.c: (main) option of memory/disk test and comments * librdf/rdf_model.c: (main) comments * librdf/Makefile.am: clean any sqlite test file * librdf/rdf_storage_sqlite.c: The change below fixes Issue #0000006 - http://bugs.librdf.org/mantis/view.php?id=6 * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_serialise): Do not free query stringbuffer before reporting error. (librdf_storage_sqlite_serialise_next_statement): Finish if failed. (librdf_storage_sqlite_find_statements): Restructure need_and code and fix AND string count. Do not free query stringbuffer before reporting error. (librdf_storage_sqlite_find_statements_end_of_stream): Do not read an extra statement when testing for end, only if there is no current statement. (librdf_storage_sqlite_find_statements_next_statement): Finish if failed. (librdf_storage_sqlite_context_serialise): Do not free query stringbuffer before reporting error. (librdf_storage_sqlite_context_serialise_end_of_stream): Do not read an extra context when testing for end, only if there is no current context. (librdf_storage_sqlite_context_serialise_next_statement): Finish if failed. (librdf_storage_sqlite_get_contexts_is_end): Do not read an extra context when testing for end, only if there is no current context. (librdf_storage_sqlite_get_contexts_next_method): Finish if failed. (librdf_storage_sqlite_get_contexts): Do not free query stringbuffer before reporting error. * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_serialise_end_of_stream): Do not read an extra statement when testing for end, only if there is no current statement. * configure.ac: Edit mysql_config --cflags output to prevent it defining -O Edit *CFLAGS and *CPPFLAGS to delete -O options just before writing files. 2005-05-19 Dave Beckett * rasqal/win32_rasqal_config.h, rasqal/configure.ac: Bumped version to 0.9.10 * Snapshotted rasqal_0_9_9 for 0.9.9 release * rasqal/rasqal_engine.c (rasqal_new_triples_match): Restore but deprecate rasqal_triples_source factory method new_triples_match for now. * rasqal/rasqal.h: Restore rasqal_triples_source factory method new_triples_match for now. * Makefile.am: added redland.sln * redland.sln: Import configuration from John Barstow * configure.ac: Added librdf/win32 subdir * librdf/Makefile.am: Added win32 subdir * librdf/win32/msvc.def, librdf/win32/Makefile.am, librdf/win32/librdf.vcproj, raptor/win32/Makefile.am, rasqal/win32/README.txt, rasqal/win32/Makefile.am, rasqal/win32/rasqal.vcproj, raptor/win32/rapper.vcproj, raptor/win32/raptor.sln, raptor/win32/raptor.vcproj, raptor/win32/raptortest.vcproj: Import configuration from John Barstow * raptor/win32/README.txt: updates * librdf/rdf_internal.h: Added REDLAND_INLINE * librdf/librdf.h: REDLAND_API before public statics * librdf/win32_rdf_config.h: Added REDLAND_INLINE Defines updated for win32 (John Barstow) * librdf/rdf_model.c (librdf_model_supports_contexts): Use REDLAND_INLINE * raptor/win32_raptor_config.h: Switch to libxml * rasqal/rasqal.h: RASQAL_API before public statics * rasqal/win32_rasqal_config.h: Added #define YY_NO_UNISTD_H * raptor/win32_raptor_config.h: Spelling: RAPTOR_INLINE * raptor/raptor_general.c (raptor_init): Added conditionals around serializers: RAPTOR_SERIALIZER_RDFXML/NTRIPLES/RDFXML_ABBREV * raptor/Makefile.am: Added conditionally included RAPTOR_SERIALIZER_RDFXML_ABBREV * raptor/configure.ac: Added --enable-serializers=LIST and serializers to summary. Reformat other help messages to match. 2005-05-18 Dave Beckett * raptor/turtle_parser.y: (main) Move filename here * raptor/configure.ac: Add proper check for libxslt * rasqal/sparql_parser.y: Add print handler to all sequences, not conditional on debugging. * configure.ac, rasqal/configure.ac, raptor/configure.ac: default memory-signing no * configure.ac: usage formatting * configure.ac: Added --with-memory-sign default no. DANGER: When enabled, memory returned to bindings which is freed, such as the node/uri/.._to_string() memory is off by 4 bytes from the pointer that free() expects. Typically causes crashes. * librdf/rdf_log.h: Added LIBRDF_FROM_MEMORY * librdf/rdf_init.c (librdf_sign_malloc, librdf_sign_calloc, librdf_sign_realloc, librdf_sign_free): Added for signed memory checking. * librdf/rdf_internal.h: Added signed memory functions * librdf/rdf_storage_sqlite.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage.c: Revert returning an empty iterator on failure to create an inner iterator, which is caused only by out of memory. * librdf/rdf_storage_list.c (librdf_storage_list_serialise): Return empty stream if list iterator ends. (librdf_storage_list_context_serialise): Return empty stream if contexts hash iterator ends. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_serialise_common): Return empty stream if hash iterator ends. (librdf_storage_hashes_context_serialise): Return empty stream if contexts hash iterator ends. * librdf/rdf_model.c (librdf_model_find_statements_in_context): Return empty stream if context_as_stream returns nULL * librdf/rdf_stream.c (librdf_new_empty_stream): Added helper for empty stream. * librdf/rdf_stream.h: Added prototype for librdf_new_empty_stream * librdf/rdf_storage_sqlite.c (librdf_storage_sqlite_get_contexts): Return an empty iterator when the iterator fails to be constructed. * librdf/rdf_storage_mysql.c (librdf_storage_mysql_get_context): Return an empty iterator when the contexts returns NULL immediately or the iterator fails to be constructed. * librdf/rdf_storage_list.c (librdf_storage_list_get_contexts): Return an empty iterator when the hashes keys iterator returns NULL or the hashes iterator fails to be constructed. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_node_iterator_create): Return an empty iterator when the hahes node iterator returns NULL. * librdf/rdf_storage.c (librdf_storage_node_stream_to_node_create): Return an empty iterator when find_statements returns NULL. * librdf/rdf_iterator.c (librdf_new_empty_iterator): Added helper to make an always-empty iterator. * librdf/rdf_iterator.h: Added prototype for librdf_new_empty_iterator * librdf/rdf_query_rasqal.c (redland_node_to_rasqal_literal): Use rasqal_alloc_memory to make things for inside rasqal. * rasqal/rasqal_general.c: (rasqal_free_memory, rasqal_alloc_memory, rasqal_calloc_memory): Added, for allocating and freeingmemory inside rasqal. * rasqal/rasqal.h: Added prototypes for rasqal_free_memory, rasqal_alloc_memory and rasqal_calloc_memory * rasqal/librasqal.3: Updates for 0.9.9 * rasqal/rasqal_query.c: thethe * utils/rdfproc.c, configure.ac, rasqal/roqet.c, rasqal/configure.ac, raptor/rdfdump.c, raptor/configure.ac: Bugs to http://bugs.librdf.org/ * rasqal/sparql_lexer.l (NCCHAR): Add _ which the comment says but wasn't actually done. (NCCHARV): Adjust comment to match regex 2005-05-17 Dave Beckett * raptor/raptor_identifier.c, raptor/raptor_parse.c, raptor/raptor_serialize_rdfxmla.c, raptor/raptor_serialize.c, raptor/raptor_sax2.c, raptor/raptor_rdfxml.c: Casts for RAPTOR_FREE * librdf/rdf_init.c (librdf_world_open): Init query after parser and explain why. * librdf/rdf_query_rasqal.c (rasqal_redland_init_triples_match): Renamed from rasqal_redland_new_triples_match. Update for rasqal 0.9.9. Takes an existing rasqal_triples_match structure and returns non-0 on failure. * rasqal/rasqal_redland.c (rasqal_redland_init_triples_match): Renamed from rasqal_redland_new_triples_match. Takes an existing rasqal_triples_match structure and returns non-0 on failure. * rasqal/rasqal_raptor.c (rasqal_raptor_init_triples_match): Renamed from rasqal_raptor_new_triples_match. Takes an existing rasqal_triples_match structure and returns non-0 on failure. * rasqal/rasqal_engine.c (rasqal_new_triples_match): Call init_triples_match factory method with an already alloced rasqal_triples_match structure. Free it here on error. * rasqal/rasqal.h: rasqal_triples_source factory method new_triples_match changed to init_triples_match, taking an initialised rtm field, returning a status. * rasqal/rasqal_general.c, rasqal/rasqal_literal.c, rasqal/rasqal.h, rasqal/rasqal_engine.c, rasqal/rasqal_expr.c: Casts for RASQAL_FREE. * raptor/configure.ac: usage message formatting * rasqal/rdql_lexer.l, rasqal/sparql_lexer.l: Use RASQAL_MALLOC/CALLOC/FREE * rasqal/configure.ac: Added --with-memory-signing rasqal signing memory debugging * raptor/raptor_general.c (raptor_free_statement): Casts for RAPTOR_FREE * rasqal/rasqal_general.c (rasqal_sign_malloc, rasqal_sign_calloc, rasqal_sign_realloc, rasqal_sign_free): Added rasqal signing memory debugging trigged by RASQAL_MEMORY_SIGN. * rasqal/rasqal_internal.h: Added rasqal signing memory debugging trigged by RASQAL_MEMORY_SIGN * rasqal/rasqal_query_test.c (main): Use RASQAL_MALLOC/FREE * raptor/configure.ac: Added --with-memory-signing raptor signing memory debugging Reformatted some other --with help messages. * raptor/raptor_general.c (raptor_sign_malloc, raptor_sign_calloc, raptor_sign_realloc, raptor_sign_free): Added raptor signing memory debugging trigged by RAPTOR_MEMORY_SIGN. * raptor/raptor_internal.h: Added raptor signing memory debugging trigged by RAPTOR_MEMORY_SIGN * raptor/n3_lexer.l: Use RAPTOR_MALLOC, RAPTOR_FREE * raptor/n3_parser.y, raptor/turtle_parser.y (directive, resource): Use RAPTOR_MALLOC, RAPTOR_FREE * raptor/turtle_lexer.l: Use RAPTOR_MALLOC, RAPTOR_FREE * raptor/rdfdiff.c: (rdfdiff_new_file, rdfdiff_new_blank) Use RAPTOR_MALLOC rather than strdup. * raptor/raptor_www_curl.c (raptor_www_curl_header_callback): Use RAPTOR_MALLOC on type field data. * raptor/rdfdump.c: Add raptor_finish() before usage exit 2005-05-14 Dave Beckett * rasqal/sparql_parser.y (TriplesList): Do not lose triples sequence after sequence join. * rasqal/rasqal_expr.c: docs 2005-05-13 Dave Beckett * raptor/raptor_rss.c, rasqal/rasqal_query.c, rasqal/roqet.c, rasqal/sparql_parser.y, rasqal/rasqal_expr.c: Casts for C++ * rasqal/sparql_parser.y (DefaultGraphClause, NamedGraphClause): Free URI literal * rasqal/sparql_parser.y: ItemList is now a raptor_sequence of rasqal_formula. (ItemList): Update to do that, copy over any underlying triples (Collection): Walk the list of formula to create the RDF collection triples. * raptor/raptor_serialize_rdfxmla.c: (raptor_rdfxmla_serialize_init, raptor_rdfxmla_serialize_terminate): Init/free rdf_xml_literal_uri for the rdf:XMLLiteral URI. (raptor_rdfxmla_serialize_statement): Turn datatyped literals that are rdf:XMLLiteral into inline XML, not escaped. 2005-05-12 Dave Beckett * raptor/raptor_serialize.c: (raptor_rdfxml_serialize_init, raptor_rdfxml_serialize_terminate): Init/free rdf_xml_literal_uri for the rdf:XMLLiteral URI. (raptor_rdfxml_serialize_statement): Turn datatyped literals that are rdf:XMLLiteral into inline XML, not escaped. * rasqal/tests/sparql/survey/Makefile.am: survey-11 works * rasqal/rasqal_engine.c (rasqal_engine_assign_variables): adjust anon variables offsets to point to absolute index in full list of variables (rasqal_query field variables) * rasqal/sparql_parser.y (Triples): When predicate list is empty, return subject formula. * rasqal/sparql_parser.y (Triples): Protect when list is empty * rasqal/sparql_parser.y (Triples): Copy along any triples from subject formula. * rasqal/rasqal_engine.c, rasqal/rasqal_query.c (rasqal_query_prepare, rasqal_engine_execute_init): Move rasqal_engine_make_basic_graph_pattern call to rasqal_query_prepare after factory has prepared (parsed) * rasqal/roqet.c: Really make sparql the default * rasqal/roqet.c (roqet_graph_pattern_walk): space * rasqal/roqet.c (roqet_graph_pattern_walk): Add {}s around constraints * rasqal/roqet.c (roqet_query_walk): Print bound variables. * rasqal/roqet.1: Updates for 0.9.9 Do not mention deprecated -f/--format and -o/--output. Merge -f and -o into in -r/--results and complete the list. Added V1 and V2 of sparql query results xml format. For -i, note sparql is default query language. * rasqal/rasqal_general.c (rasqal_init): sparql is now the default query language. * rasqal/roqet.c: Deprecated -f/--format and -o/--output both now in -r/--results. Add V1 and V2 xml results formats. Deleted invalid argument help for -r, see usage instead. * rasqal/roqet.c (roqet_write_indent): Added. (roqet_graph_pattern_walk): Add lots of {...}s around blocks. use #number for gps, triples. Change to use roqet_write_indent. (roqet_query_walk): Take indent arg, use it with roqet_write_indent. Walk constructed triples. * rasqal/rasqal_query.c (rasqal_query_get_construct_triples_sequence, rasqal_query_get_construct_triple): Added, to get access to construct triples via API. (rasqal_query_verb_as_string): Added to get a string for a verb. (rasqal_query_print): Use the above. * rasqal/rasqal.h: Added prototypes for rasqal_query_get_construct_triples_sequence and rasqal_query_get_construct_triple * Redland.i: Added librdf_query_get_limit, librdf_query_set_limit, librdf_query_get_offset and librdf_query_set_offset * librdf/rdf_query_rasqal.c (librdf_query_rasqal_get_limit, librdf_query_rasqal_set_limit, librdf_query_rasqal_get_offset, librdf_query_rasqal_set_offset): Added to implement factory methods for get/setting of query results limit and offsets. (librdf_query_rasqal_register_factory): Register the above methods. * librdf/rdf_query.c (librdf_query_get_limit, librdf_query_set_limit, librdf_query_get_offset, librdf_query_set_offset): Added to provide access to new factory methods for get/setting of query results limit - max results to return and offset - initial results to skip. * librdf/rdf_query.h: Added factory methods: get_limit, set_limit, get_offset and set_offset. Added prototypes for librdf_query_get_limit, librdf_query_set_limit, librdf_query_get_offset and librdf_query_set_offset * configure.ac: require rasqal 0.9.9 * rasqal/roqet.c: Make -c/--count work properly. Print count to stdout. Tidy result format wording. * rasqal/rasqal_query.c (rasqal_query_results_get_count): Adjust the returned count by any offset. (rasqal_query_results_next): Implement limit and offset. Addresses Issue#0000005 - http://bugs.librdf.org/mantis/view.php?id=5 * rasqal/rasqal_query.c (rasqal_query_results_next): Adjust result_count here. * rasqal/rasqal_engine.c (rasqal_engine_get_next_result): Move result_count to rasqal_query_results_next. 2005-05-10 Dave Beckett * raptor/configure.ac: Change quotes around bison test * raptor/configure.ac: Try to work for older bison version styles 2005-05-08 Dave Beckett * raptor/raptor_rss.c: Update from Suzan Foster to reflect the latest status of the enclosure vocabulary and allow multiple common items and fields. Fields in items are now a linked list of raptor_rss_field items. (raptor_rss_context_init): Empty common area. (raptor_enclosure_free): Use raptor_enclosure_free to empty enclosure list. (raptor_rss_field_free): Added to free a list of rss fields. (raptor_clear_rss_item): Use raptor_rss_field_free for freeing duplicate fields. (raptor_clear_rss_common_items): added to empty common item field lists. (raptor_rss_context_terminate): Empty common item fields with raptor_clear_rss_common_items. (raptor_rss_new_field): Added. (raptor_rss_enclosure_add): Added. (raptor_rss_field_add): Added to add a new field value to the list of values for one field item. (raptor_rss_common_add): Added to add a new common item to the list of common items for the current type. (raptor_rss_common_get): Added to get the last common item for the current type. (raptor_rss_parser_processNode): Updates for new fields structure. (raptor_rss_insert_enclosure_identifiers): Update for handling uris and bnodes. (raptor_rss_insert_identifiers): Update for lists for common items and lists of ields. (raptor_rss_emit_enclosure): Update for handling uris and bnodes. (raptor_rss_emit_item, raptor_rss_emit, raptor_rss10_move_statements, raptor_rss10_store_statement, raptor_rss10_serialize_statement, raptor_rss10_build_xml_names): Updates for lists of common items and lists of fields. (raptor_rss10_emit_item): Added fix for moving fields to the item when they got stuck on the enclosure when the enclosure uri = the guid. Updates for lists of common items and lists of fields. (raptor_rss10_serialize_end): Updates for lists of common items and lists of fields. * rasqal/rasqal_query.c (rasqal_query_results_write_xml_20041221): Check only variable bindings are asked for. (rasqal_query_results_write_xml_result2): Check only variable bindings or boolean are asked for. Add boolean results format. * rasqal/rasqal_query.c (rasqal_query_results_write_xml_result2): Write with name attribute. * rasqal/rasqal_query.c (rasqal_query_results_write_xml_result2): Write out bnode strings right. * rasqal/roqet.c: Default to unpublished version2 of the XML results format. * rasqal/rasqal_query.c (rasqal_query_results_write_xml_20041221): Added, renamed from rasqal_query_results_write contents to emit the 2004-12-21 XML format (rasqal_query_results_write_xml_result2): Added, to emit the unpublished version2 of the XML format. (rasqal_query_results_write): Call above functions depending on the format_uri. * librdf/rdf_storage_mysql.c: Added MySQL connection handle pooling by Morten Frederiksen. Added librdf_storage_mysql_connection_status enum and staruct librdf_storage_mysql_connection to store used/opened connections. (librdf_storage_mysql_init_connections, librdf_storage_mysql_finish_connections): Added to init/finish connections (librdf_storage_mysql_get_handle): Added helper to get a connection handle either from the pool or make a new one. (librdf_storage_mysql_release_handle): Release a connection handle back to the pool. (librdf_storage_mysql_*): Use the connection pool to get handles using librdf_storage_mysql_get_handle. No longer return 0-mysql_errno(&context->connection) error codes, just -1 as the connection is strictly no longer available. Fixes Issue#0000027 - http://bugs.librdf.org/mantis/view.php?id=27 2005-05-06 Dave Beckett * utils/rdfproc.1: Document query command Fixes Issue#0000024 - http://bugs.librdf.org/mantis/view.php?id=24 * librdf/rdf_storage_mysql.c (librdf_storage_mysql_hash): Copy the first 8 bytes of digest into unsigned 64bit hash using a method portable across big/little endianness. Fixes Issue#0000023 - http://bugs.librdf.org/mantis/view.php?id=23 * rasqal/librasqal.3: Updated for 0.9.9 * rasqal/rasqal_query.c: typo 2005-05-05 Dave Beckett * rasqal/rasqal.h: Added prototype for rasqal_query_get_wildcard * rasqal/rasqal_query.c (rasqal_query_get_wildcard): Added * rasqal/rasqal.h: Added prototypes for rasqal_query_get_order_conditions_sequence rasqal_query_get_order_condition * rasqal/rasqal_query.c (rasqal_query_get_order_conditions_sequence,rasqal_query_get_order_condition): Added to return query order conditions. 2005-05-06 Dave Beckett * librdf/rdf_storage_mysql.c (librdf_storage_mysql_hash): Copy the first 8 bytes of digest into unsigned 64bit hash using a method portable across big/little endianness. Fixes Issue#0000023 - http://bugs.librdf.org/mantis/view.php?id=23 (Morten Frederiksen) * rasqal/librasqal.3: Updated for 0.9.9 * rasqal/rasqal_query.c: typo 2005-05-05 Dave Beckett * rasqal/rasqal_query.c (rasqal_query_get_wildcard): Added * rasqal/rasqal.h: Added prototype for rasqal_query_get_wildcard * rasqal/rasqal.h: Added prototypes for rasqal_query_get_order_conditions_sequence rasqal_query_get_order_condition * rasqal/rasqal_query.c: (rasqal_query_get_order_conditions_sequence, rasqal_query_get_order_condition): Added to return query order conditions. 2005-05-04 Dave Beckett * rasqal/sparql_lexer.l (VARNAME): Use NCCHARV to allow vars to start with _, [0-9] too. * raptor/win32_raptor_config.h: Added SIZEOF_UNSIGNED_SHORT 2005-05-03 Dave Beckett * rasqal/configure.ac: Added tests/sparql/sort dir * rasqal/tests/sparql/Makefile.am: Added sort dir * rasqal/tests/sparql/sort/result-sort-3.rdf, rasqal/tests/sparql/sort/result-sort-4.rdf, rasqal/tests/sparql/sort/result-sort-5.rdf, rasqal/tests/sparql/sort/result-sort-6.rdf, rasqal/tests/sparql/sort/result-sort-7.rdf, rasqal/tests/sparql/sort/result-sort-8.rdf, rasqal/tests/sparql/sort/Makefile.am, rasqal/tests/sparql/sort/data-sort-1.ttl, rasqal/tests/sparql/sort/data-sort-3.ttl, rasqal/tests/sparql/sort/data-sort-4.ttl, rasqal/tests/sparql/sort/data-sort-6.ttl, rasqal/tests/sparql/sort/data-sort-7.ttl, rasqal/tests/sparql/sort/data-sort-8.ttl, rasqal/tests/sparql/sort/manifest.ttl, rasqal/tests/sparql/sort/query-sort-1.rq, rasqal/tests/sparql/sort/query-sort-2.rq, rasqal/tests/sparql/sort/query-sort-3.rq, rasqal/tests/sparql/sort/query-sort-4.rq, rasqal/tests/sparql/sort/query-sort-5.rq, rasqal/tests/sparql/sort/query-sort-6.rq, rasqal/tests/sparql/sort/result-sort-1.rdf, rasqal/tests/sparql/sort/result-sort-2.rdf: added dawg sort tests 2005-05-02 Dave Beckett * rasqal/tests/sparql/survey/Makefile.am: More diagnosis of failures * rasqal/rasqal_engine.c (rasqal_engine_assign_variables): Add anonymous variables to the variables/variables_declared_in arrays. (rasqal_query_graph_pattern_build_declared_in_variable): Added helper. (rasqal_query_graph_pattern_build_declared_in): Use above (rasqal_engine_do_optional_step): Check any outermost constraint expression if there is a match. (rasqal_engine_make_basic_graph_pattern): Use rasqal_graph_pattern_add_constraint when moving constraints. Rebuild constraints expression after moving constraints. * rasqal/tests/sparql/survey/Makefile.am: 5 failures now * rasqal/roqet.c (roqet_query_walk): Start from top graph pattern, not contents of it. * rasqal/rasqal_query.c (rasqal_query_get_query_graph_pattern): Added to get the top graph pattern. * rasqal/rasqal.h: Added prototype for rasqal_query_get_query_graph_pattern * rasqal/rasqal_engine.c (rasqal_engine_assign_variables): Use the wildcard flag for SELECT * and CONSTRUCT * * rasqal/rasqal_query.c: Added rasqal_query_verb_labels for debug printing. (rasqal_query_print): Print out the query verb. (rasqal_query_results_is_bindings, rasqal_query_results_is_boolean, rasqal_query_results_is_graph): Use the query verb to decide this. (rasqal_query_get_verb): Added. * rasqal/sparql_parser.y (Report): Set the query verb to SELECT, CONSTRUCT, DESCRIBE or ASK. Do not use select_is_describe or ask. (SelectClause): Set wildcard flag with SELECT (DISTINCT) * (ConstructClause): Set the wildcard flag with CONSTRUCT * * rasqal/rdql_parser.y (Query): Set query verb to SELECT. (SelectClause): Set wildcard flag with SELECT * * rasqal/rasqal_internal.h: rasqal_query gains a verb and wildcard fields replacing select_all, select_is_describe, construct_all and ask * rasqal/rasqal.h: Added rasqal_query_verb enum. Added prototype for rasqal_query_get_verb * rasqal/sparql_parser.y (OptionalGraphPattern): Do not set optional flags on triples. * rasqal/rasqal_graph_pattern.c (rasqal_graph_pattern_init): Record triple_meta is_exact field. * rasqal/rasqal_expr.c: Removed rasqal_triple_flag_strings (rasqal_triple_print): Removed printing flags. (rasqal_triple_set_flags, rasqal_triple_get_flags): Note deprecated. * rasqal/rasqal_engine.c (rasqal_graph_pattern_get_next_match): Use triple_meta file is_exact instead of rasqal_triple flag field (rasqal_engine_prepare): No longer init triple flags. * rasqal/rasqal.h: Deprecated rasqal_triple flags field. - the value EXACT was only used in the execution engine and properly lives in rasqal_triple_meta. The value OPTIONAL was never used. Added is_exact file to rasqal_triple_meta. Deprecated rasqal_triple_set_flags and rasqal_triple_get_flags. * rasqal/rasqal_engine.c (rasqal_engine_execute_init): Transform the query graph pattern for execution purposes - make basic graph patterns and make sure the top is always a sequence of graph patterns, for now. * rasqal/sparql_parser.y (rasqal_sparql_query_engine_prepare): Remove the building of basic graph patterns from here. Just build the simplest graph pattern and let the execution engine change it if it needs to. * rasqal/rdql_parser.y (rasqal_rdql_query_engine_prepare): Just build the simplest graph pattern here, let the executionengine change it if it needs to. 2005-05-01 Dave Beckett * rasqal/tests/sparql/SyntaxFull/Makefile.am: Updated for tests updates, removals for required top level graph pattern. * rasqal/tests/sparql/SyntaxFull/syntax-bnodes-06.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-07.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-08.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-09.rq: Removed renamed syntax-bnodes tests * rasqal/tests/sparql/SyntaxFull/syntax-query-pat-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-05.rq: Removed WHERE no {} tests 2005-04-27 Dave Beckett * rasqal/tests/sparql/examples/Makefile.am: sparql-query-example-Testing-Values-str works with right data * rasqal/tests/sparql/examples/Makefile.am: sparql-query-example-Testing-Values-str fails * rasqal/sparql_parser.y (CallExpression): use nflags for pattern expression flags * rasqal/tests/sparql/SyntaxFull/Makefile.am: fix dup terms * rasqal/tests/sparql/SyntaxFull/Makefile.am: Added empty.nt * rasqal/tests/sparql/SyntaxFull/empty.nt: empty.nt * rasqal/tests/sparql/SyntaxFull/syntax-bnodes-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-04.rq, rasqal/tests/sparql/SyntaxFull/manifest.ttl, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-02.rq, rasqal/tests/sparql/SyntaxFull/Makefile.am: Added syntax-bnodes-01,02,03 and 04 * rasqal/tests/sparql/check-sparql: Handle no result in manifest * rasqal/rasqal_engine.c (rasqal_engine_convert_blank_node_to_anonymous_variable): Helper added. (rasqal_engine_build_anonymous_variables): Added to turn bnodes inside graph pattern triples into variables. ISSUE: should not do this with construct triples * rasqal/rasqal_query.c (rasqal_new_query, rasqal_free_query): init/free anon_variables_sequence (rasqal_query_print): Print anonymous variables * rasqal/rasqal_expr.c (rasqal_new_variable_typed): Added with type parameter. (rasqal_new_variable): Changed to use it. (rasqal_variable_print): Print variable type. * rasqal/rasqal_internal.h: Added anon_variables_sequence and anon_variables_count * rasqal/rasqal.h: typoo * rasqal/rasqal.h: Added rasqal_variable_type enum. rasqal_variable gained field 'type' Added prototypes for rasqal_query_set_distinct, rasqal_query_set_limit, rasqal_query_set_offset and rasqal_new_variable_typed * rasqal/rasqal_query.c (rasqal_query_set_distinct, rasqal_query_set_limit, rasqal_query_set_offset): Added. * rasqal/sparql_lexer.l, rasqal/sparql_parser.y: Removed unused tokens PATTERN_LITERAL and '&'. * rasqal/tests/sparql/survey/Makefile.am: fix failure count * rasqal/tests/sparql/syntax/cast1.rq: no == operator * rasqal/tests/sparql/bound/Makefile.am, rasqal/tests/sparql/part1/Makefile.am, rasqal/tests/sparql/simple/Makefile.am, rasqal/tests/sparql/survey/Makefile.am: Remove check-sparql-works targets - check-sparql-correct does it better and using manifest * rasqal/tests/sparql/examples/ex11.2.3.5_0-result.n3, rasqal/tests/sparql/examples/ex11.2.3.5_0.n3, rasqal/tests/sparql/examples/ex11.2.3.6_0-result.n3: Fix what I think are test query/data bugs * rasqal/tests/sparql/examples/Makefile.am: Added ex11_1.rq ex11_1-result.n3 Note which query files have the failing query. * rasqal/tests/sparql/examples/ex11_1-result.n3, rasqal/tests/sparql/examples/ex11_1.rq: example ex11_1 * rasqal/tests/sparql/examples/ex11.2.3.6_0-result.n3, rasqal/tests/sparql/examples/ex11_0-result.n3, rasqal/tests/sparql/examples/manifest.n3: Sync tests to dawg 2005-04-26 Dave Beckett * rasqal/tests/rdql/testsuite/check-rdql, rasqal/tests/sparql/check-sparql (toDebug): Handle no value. * rasqal/tests/sparql/survey/Makefile.am: Added expected failures * rasqal/sparql_lexer.l: Remove == token * rasqal/sparql_lexer.l: Align name tokens with rq23 post WD 2005-04-19 CVS 1.326 * rasqal/tests/sparql/bound/bound1.rq: new turtley syntax * rasqal/tests/sparql/examples/Makefile.am: Annotate failures. * rasqal/sparql_parser.y: less super-debuggy * rasqal/sparql_parser.y: (CallExpression) Copy the string from rasqal_literal_as_string when making pattern literals or flags. Free the unused literal args. * rasqal/rasqal_expr.c: (rasqal_expression_evaluate) For the RASQAL_EXPR_STR operation, copy the string from rasqal_literal_as_string. * rasqal/sparql_parser.y (rasqal_sparql_query_engine_prepare): Restore hack to build an outer list of GPs if the folding made it all into one. * rasqal/sparql_parser.y (rasqal_sparql_query_engine_prepare): Just call rasqal_engine_make_basic_graph_pattern on the query graph pattern. * rasqal/rasqal_engine.c (rasqal_engine_make_basic_graph_pattern): More debug messages. Always merge a GP with a GP of size 1 inside. Ignore any inner OPTIONAL GPs Merge sequences of triples if seen. * rasqal/tests/sparql/SyntaxFull/Makefile.am: syntax-struct-01.rq no longer crashes * rasqal/sparql_parser.y (OptionalGraphPattern): Don't die if no GraphPattern. * rasqal/sparql_parser.y: Debug messages * rasqal/rasqal_graph_pattern.c (rasqal_graph_pattern_print): Print graph pattern/triple sequence sizes. * rasqal/rasqal_query.c (rasqal_new_query): Set initial offset to unset (<0) * rasqal/rasqal_engine.c (rasqal_query_build_declared_in): warning wording * rasqal/rasqal_engine.c (rasqal_query_build_declared_in): No \n in warning. * rasqal/sparql_parser.y (UnionGraphPatternList): Added. (UnionGraphPattern): Make a graph pattern with the contained union graphs. Renamed from OptionalGraphPatternList. * rasqal/tests/sparql/SyntaxFull/Makefile.am: Fixed syntax-union-02.rq * rasqal/sparql_parser.y (OptionalGraphPatternList): Require UNION between GPs * rasqal/tests/sparql/SyntaxFull/Makefile.am: Typo * rasqal/rasqal_expr.c (rasqal_expression_evaluate): Warn and then return false for function expressions - not implemented. * rasqal/sparql_parser.y: Removed string operators STR_EQ STR_NE STR_MATCH STR_NMATCH (OptionalGraphPatternList): List cannnot be empty Lots of renaming of grammar terms to match rq23 / WD 19 April 2005 (RelationalExpression): Renamed from ValueLogical and merged with former RelationalExpression. (CallExpression): Renamed from BuiltinExpression and reordered to match rq23 * rasqal/sparql_lexer.l: Removed regex pattern literals, PATTERN state, sparql_copy_regex_token, EQ/eq, NE/NE, =~, ~~, !~ * rasqal/sparql_parser.y (OptionalGraphPatternList): Added, to allow GraphPattern UNION GraphPattern* * rasqal/rasqal_engine.c (rasqal_engine_make_basic_graph_pattern): Verbose debugging if RASQAL_DEBUG > 1 2005-04-25 Dave Beckett * rasqal/tests/sparql/SyntaxFull/Makefile.am: Note failures so far * rasqal/sparql_parser.y (BuiltinExpression): Move URIBrace work into FunctionCall (FunctionCall): Pick cast or function, I choose function * rasqal/sparql_lexer.l: Widen QUOTEDURI and include <> * rasqal/sparql_parser.y (WhereClauseOpt): Warn WHERE omitted. (BuiltinExpression): Call FunctionCall (PrimaryExpression): Add '(' Expression ')' (FunctionCall): Add URI name. (ArgList): Now a list of expressions * rasqal/sparql_parser.y (OrderClauseOpt): Use OrderConditionList and store it in query field order_conditions_seequence. (OrderConditionList): Added, making a raptor_sequence of expressions (OrderCondition): Implemented ASC/DESC/none (OrderExpression): Added, using FunctionCall or Var (ItemList): Init $$->triples and set formula. (PrimaryExpression): Use FunctionCall (FunctionCall): Restored, now it's used twice. * rasqal/rasqal.h: Added RASQAL_EXPR_ORDER_COND_ASC, RASQAL_EXPR_ORDER_COND_DESC and RASQAL_EXPR_ORDER_COND_NONE * rasqal/rasqal_internal.h: Added order_conditions_sequence to query * rasqal/rasqal_query.c (rasqal_query_print): Print order conditions. * rasqal/rasqal_query.c (rasqal_new_query,rasqal_free_query): Init and free order_conditions_sequence * rasqal/rasqal_expr.c (rasqal_free_expression, rasqal_expression_foreach, rasqal_expression_evaluate, rasqal_expression_print): Added cases for RASQAL_EXPR_ORDER_COND_ASC, RASQAL_EXPR_ORDER_COND_DESC and RASQAL_EXPR_ORDER_COND_NONE * rasqal/sparql_lexer.l: ASC, DESC take following [ too (sparql_token_print): Added ASC, DESC * rasqal/sparql_parser.y, rasqal/sparql_lexer.l: Added ASC, DESC * rasqal/sparql_lexer.l (PREFIX, NAME): Allow . after first char * rasqal/sparql_lexer.l: Added '''strings''' (not in Turtle) * rasqal/sparql_lexer.l: Added """string""" literals * rasqal/tests/sparql/SyntaxFull/syntax-union-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-union-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-09.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-10.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-07.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-08.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-06.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-struct-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-14.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-query-pat-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-12.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-13.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-11.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-09.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-10.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-07.rq, rasqal/tests/sparql/SyntaxFull/syntax-qname-08.rq, rasqal/tests/sparql/SyntaxFull/syntax-pat-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-pat-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-pat-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-pat-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-order-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-order-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-order-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-order-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-order-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-14.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-13.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-12.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-11.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-10.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-09.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-07.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-08.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-06.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-lists-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-lists-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-lists-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-lit-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-lists-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-lists-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-forms-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-forms-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-forms-03.arq, rasqal/tests/sparql/SyntaxFull/syntax-expr-04.rq, rasqal/tests/sparql/SyntaxFull/syntax-expr-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-expr-06.rq, rasqal/tests/sparql/SyntaxFull/syntax-expr-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-expr-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-expr-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-07.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-08.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-09.rq, rasqal/tests/sparql/SyntaxFull/syntax-basic-05.rq, rasqal/tests/sparql/SyntaxFull/syntax-basic-06.rq, rasqal/tests/sparql/SyntaxFull/syntax-bnodes-06.rq, rasqal/tests/sparql/SyntaxFull/syntax-basic-01.rq, rasqal/tests/sparql/SyntaxFull/syntax-basic-02.rq, rasqal/tests/sparql/SyntaxFull/syntax-basic-03.rq, rasqal/tests/sparql/SyntaxFull/syntax-basic-04.rq, rasqal/tests/sparql/Makefile.am, rasqal/tests/sparql/SyntaxFull/Makefile.am, rasqal/tests/sparql/SyntaxFull/manifest.ttl, rasqal/configure.ac: Added SyntaxFull tests from dawg 2005-04-20 Dave Beckett * rasqal/tests/sparql/survey/Makefile.am: data is survey-sample.ttl 2005-04-19 Dave Beckett * rasqal/rasqal_expr.c (rasqal_expression_evaluate): Handle unbound variable values in RASQAL_EXPR_DATATYPE, RASQAL_EXPR_ISURI, RASQAL_EXPR_ISBLANK, RASQAL_EXPR_ISLITERAL * rasqal/sparql_lexer.l: Make keyword tokens case independent not just upper or lowercase. * rasqal/tests/sparql/examples/Makefile.am: Update for new example files * rasqal/sparql_parser.y: No conflicts * rasqal/tests/sparql/examples/ex11.2.3.1_0.n3, rasqal/tests/sparql/examples/ex11.2.3.1_0.rq, rasqal/tests/sparql/examples/ex11.2.3.1_1.n3, rasqal/tests/sparql/examples/ex11.2.3.1_1.rq, rasqal/tests/sparql/examples/ex11.2.3.2_0.n3, rasqal/tests/sparql/examples/ex11.2.3.2_0.rq, rasqal/tests/sparql/examples/ex11.2.3.2_1.rq, rasqal/tests/sparql/examples/ex11.2.3.3_0.n3, rasqal/tests/sparql/examples/ex11.2.3.3_0.rq, rasqal/tests/sparql/examples/ex11.2.3.4_0.n3, rasqal/tests/sparql/examples/ex11.2.3.4_0.rq, rasqal/tests/sparql/examples/ex11.2.3.5_0.n3, rasqal/tests/sparql/examples/ex11.2.3.5_0.rq, rasqal/tests/sparql/examples/ex11.2.3.6_0.n3, rasqal/tests/sparql/examples/ex11.2.3.6_0.rq, rasqal/tests/sparql/examples/ex11.2.3.7_0.n3, rasqal/tests/sparql/examples/ex11.2.3.7_0.rq, rasqal/tests/sparql/examples/ex11.2.3.8_0.n3, rasqal/tests/sparql/examples/ex11.2.3.8_0.rq, rasqal/tests/sparql/examples/ex11_0.n3, rasqal/tests/sparql/examples/ex11_0.rq, rasqal/tests/sparql/examples/ex3.rq, rasqal/tests/sparql/examples/ex11.2.3.1_0-result.n3, rasqal/tests/sparql/examples/ex11.2.3.1_1-result.n3, rasqal/tests/sparql/examples/ex11.2.3.2_0-result.n3, rasqal/tests/sparql/examples/ex11.2.3.2_1-result.n3, rasqal/tests/sparql/examples/ex11.2.3.3_0-result.n3, rasqal/tests/sparql/examples/ex11.2.3.4_0-result.n3, rasqal/tests/sparql/examples/ex11.2.3.5_0-result.n3, rasqal/tests/sparql/examples/ex11.2.3.6_0-result.n3, rasqal/tests/sparql/examples/ex11.2.3.7_0-result.n3, rasqal/tests/sparql/examples/ex11.2.3.8_0-result.n3, rasqal/tests/sparql/examples/ex11_0-result.n3, rasqal/tests/sparql/examples/manifest.n3: Imported updated examples * rasqal/tests/sparql/check-sparql: remove debug print * rasqal/sparql_parser.y: Make construct work again. Now %type : TriplesList ConstructTemplate (ConstructClause): Take triples from seq ConstructTemplate (ConstructTemplate): Use TriplesList (TriplesList): Added, making a raptor_sequence of triples from triples in Triples formulas. * rasqal/rasqal_graph_pattern.c (rasqal_new_graph_pattern): Init columns to defaults here. * rasqal/rasqal_engine.c (rasqal_engine_make_basic_graph_pattern): Added. * rasqal/rasqal_internal.h: Added rasqal_engine_make_basic_graph_pattern prototype. * rasqal/sparql_parser.y (rasqal_sparql_query_engine_prepare): Call rasqal_engine_make_basic_graph_pattern on the top level subgraph patterns. * rasqal/tests/sparql/syntax/Makefile.am: Print failure summaries * rasqal/tests/sparql/syntax/offset0.rq, rasqal/tests/sparql/syntax/cast0.rq, rasqal/tests/sparql/syntax/cast1.rq: updates for turtle sparql syntax * rasqal/tests/sparql/check-sparql: Read manfiest.ttl or manifest.n3 * rasqal/tests/rdql/testsuite/check-rdql, rasqal/tests/sparql/check-sparql: Emit failing roqet line when roqet returns errors. * rasqal/tests/rdql/testsuite/check-rdql, rasqal/tests/sparql/check-sparql: Emit failing roqet line on FAILURE 2005-04-18 Dave Beckett * librdf/rdf_storage_list.c (librdf_storage_list_node_equals): Not equal if only one context is NULL. 2005-04-17 Dave Beckett * rasqal/sparql_parser.y: Updates to SPARQL rq23 around $Revision: 1.303 $ of $Date: 2005/04/16 17:13:51 $ Removed AND, WITH. Added NAMED. Removed many %type that were used with NULL value or none. (DatasetClauseOpt, DefaultGraphClause): Added after rq23 (NamedGraphClauseList): Added (PatternElementsList): Renamed from PatternElementList and now in rq23, returns a graph pattern. FILTER handled here, not in older PatternElementConstraint. (PatternElementConstraint): Deleted. (ItemList): Moved adjacent to Collection which it serves. (URIList): Deleted, no longer used. * rasqal/rasqal_engine.c (rasqal_engine_build_constraints_expression): Handle no graph pattern. (rasqal_engine_execute_init): Handle no graph pattern. * rasqal/tests/sparql/syntax/describe1.rq, rasqal/tests/sparql/syntax/groups.rq, rasqal/tests/sparql/syntax/construct1.rq, rasqal/tests/sparql/syntax/limit0.rq, rasqal/tests/sparql/syntax/construct0.rq, rasqal/tests/sparql/syntax/construct2.rq, rasqal/tests/sparql/syntax/distinct0.rq, rasqal/tests/sparql/syntax/ask0.rq: Update to turtle query syntax * rasqal/rasqal_graph_pattern.c (rasqal_new_graph_pattern_from_sequence): Do not flatten gps. * rasqal/tests/sparql/part1/Makefile.am, rasqal/tests/sparql/part1/dawg-query-001, rasqal/tests/sparql/part1/dawg-query-001.rq, rasqal/tests/sparql/part1/dawg-query-002, rasqal/tests/sparql/part1/dawg-query-002.rq, rasqal/tests/sparql/part1/dawg-query-003, rasqal/tests/sparql/part1/dawg-query-003.rq, rasqal/tests/sparql/part1/dawg-query-004, rasqal/tests/sparql/part1/dawg-query-004.rq, rasqal/tests/sparql/part1/manifest.n3: Updated to turtle query syntax and renamed dawg-query-001.rq dawg-query-002.rq dawg-query-003.rq dawg-query-004.rq * rasqal/tests/sparql/examples/ex2-1a.rq, rasqal/tests/sparql/examples/ex2-1b.rq, rasqal/tests/sparql/examples/ex2-1c.rq, rasqal/tests/sparql/examples/ex2-1e.rq, rasqal/tests/sparql/examples/ex2-2a.rq, rasqal/tests/sparql/examples/ex2-3a.rq, rasqal/tests/sparql/examples/ex2-4a.rq, rasqal/tests/sparql/examples/manifest.n3: update to turtle syntax queries, latest naming * rasqal/tests/sparql/simple/data-03.n3, rasqal/tests/sparql/simple/dawg-tp-05.rq: import from dawg * rasqal/tests/sparql/simple/dawg-tp-01.rq, rasqal/tests/sparql/simple/dawg-tp-02.rq, rasqal/tests/sparql/simple/dawg-tp-03.rq, rasqal/tests/sparql/simple/dawg-tp-04.rq, rasqal/tests/sparql/simple/manifest.n3: update to turtle syntax queries * rasqal/rdql_parser.y (rasqal_rdql_query_engine_prepare): Init query graph pattern. * rasqal/rasqal_query.c (rasqal_new_query): Start with a NULL query graph pattern. * rasqal/sparql_lexer.l: -AND * rasqal/sparql_lexer.l: -WITH, +NAMED * rasqal/tests/sparql/survey/manifest.ttl: Added manifest.ttl * rasqal/tests/sparql/survey/query-survey-1.rq, rasqal/tests/sparql/survey/query-survey-10.rq, rasqal/tests/sparql/survey/query-survey-11.rq, rasqal/tests/sparql/survey/query-survey-12.rq, rasqal/tests/sparql/survey/query-survey-13.rq, rasqal/tests/sparql/survey/query-survey-2.rq, rasqal/tests/sparql/survey/query-survey-3.rq, rasqal/tests/sparql/survey/query-survey-8.rq, rasqal/tests/sparql/survey/query-survey-9.rq, rasqal/tests/sparql/survey/result-survey-10.ttl, rasqal/tests/sparql/survey/result-survey-3.ttl, rasqal/tests/sparql/survey/survey-sample.ttl: Update to latest DAWG versions of test * rasqal/tests/sparql/survey/Makefile.am: manifest file is manifest.ttl * ChangeLog, ChangeLog.5, Makefile.am: Added ChangeLog.5 for 2004 * librdf/rdf_query.c: Mark class librdf_init/finish_FOO as INTERNAL. Tidy head doc * librdf/rdf_log.c: Export several useful internal documented functions marked INTERNAL. * librdf/rdf_serializer.c, librdf/rdf_storage.c, librdf/rdf_uri.c, librdf/rdf_init.c, librdf/rdf_model.c, librdf/rdf_parser.c, librdf/rdf_digest.c, librdf/rdf_hash.c, librdf/rdf_concepts.c: Mark class librdf_init/finish_FOO as INTERNAL. Tidy head doc, 2005. * autogen.sh, raptor/autogen.sh, rasqal/autogen.sh: allow envariables to override the programs 2005-04-16 Dave Beckett * raptor/raptor_iostream.c: (raptor_string_iostream_finish): Fixes bug 0000021: the output of to_string for an empty model should always be parsable and result in an empty model http://bugs.librdf.org/mantis/view.php?id=21 * Redland.i: Typo: fraptor_locator_line -> raptor_locator_line * raptor/raptor_iostream.c (raptor_string_iostream_finish): Return an empty string "" (aka 1 byte, \0) when the stringbuffer is NULL, do not return the NULL. 2005-04-14 Dave Beckett * rasqal/sparql_parser.y: First set of sparql turtle syntax changes Added %token: ORDER, BY, REGEX Added %type: OrderClauseOpt, PatternElementList, DotOptional, ConstructTemplate, Triples, PropertyList, ObjectList, ItemList Collection, Subject, Predicate Object, TriplesNode, GraphPattern, GraphGraphPattern, UnionGraphPattern (based on rq23) Removed %type: VarOrURIOrBNode as turtle syntax rules cover it Many terms renamed to match rq23 terms, updated to use formula. Other changes: (Query): Added OrderClauseOpt (BaseDeclOpt, PrefixDeclOpt): moved in source, no change. (WhereClauseOpt): Just assign GraphPattern value (OrderClauseOpt): Skeletal and incomplete. (GraphPattern): Take a list of .-separated triples, with optional . or an empty {} (DotOptional): Added (Triples, PropertyList, ObjectList, ItemList, Subject, Predicate, Object, Collection): imported for turtle and updated to pass around rasqal_formula and use them to store triples + literal value. (TriplesNode): Imported from rq23 partially. (BuiltinExpression): Added REGEX * rasqal/sparql_lexer.l: Added tokens: ORDER, By, REGEX, ., ; for rq23 sparql Noted FIXME to remove old comparison ops EQ/eq, NE/ne, ==, != * rasqal/rasqal.h: Added rasqal_generate_bnodeid_handler typedef. Added prototypes for rasqal_query_set_default_generate_bnodeid_parameters and rasqal_query_set_generate_bnodeid_handler * rasqal/rasqal_graph_pattern.c: docs * rasqal/rasqal_internal.h: Added bnodeid handler params to query. Added prototype for rasqal_query_set_generate_bnodeid_handler. Added extern references for rasqal_rdf_namespace_uri, rasqal_rdf_first_uri, rasqal_rdf_rest_uri and rasqal_rdf_nil_uri * rasqal/rasqal_general.c: Add rdf uris for namespace, rdf:first, rdf:rest, rdf:nul (rasqal_uri_init, rasqal_uri_finish): Init and tidy up above. (rasqal_query_set_default_generate_bnodeid_parameters, rasqal_query_set_generate_bnodeid_handler, rasqal_default_generate_bnodeid_handler, rasqal_query_generate_bnodeid): Added, import from raptor. * raptor/raptor_parse.c: docs typo * rasqal/rasqal_literal.c: Added rasqal_formula for sparql parser. (rasqal_new_formula): Added constructor (rasqal_free_formula): Added destructor (rasqal_formula_print): Added print method, for sequences of formulas * rasqal/rasqal_internal.h: Added rasqal_formula for sparql parser. Added prototypes for rasqal_new_formula, rasqal_free_formula and rasqal_formula_print * rasqal/tests/sparql/syntax/cast0.rq, rasqal/tests/sparql/syntax/cast1.rq: AND to FILTER * rasqal/tests/sparql/syntax/Makefile.am: Added offset0.rq * rasqal/sparql_parser.y: Added tokens FILTER OFFSET A Now up to expecting 3 shift/reduce (filter + offset can both be missing) Added LimitClauseOpt OffsetClauseOpt types (Query): Added OffsetClause (OffsetClauseOpt): Added, not in 2005-02-17 SPARQL WD (PatternElementConstraint): Deprecate AND (removed 2005-04-19 SPARQL WD) and add FILTER. * rasqal/roqet.c (roqet_query_walk): Print any result offset (main): Fix help message * rasqal/tests/sparql/syntax/offset0.rq: LIMIT and OFFSET test * rasqal/rasqal_engine.c (rasqal_engine_query_constraints_has_qname): Handle no query_graph_pattern present. * rasqal/sparql_lexer.l: Added FILTER, OFFSET, A tokens * rasqal/rasqal_query.c (rasqal_query_get_offset): Added, returning the query results offset. (rasqal_query_print): Print query results offset * rasqal/rasqal.h: Added rasqal_query_get_offset prototype. * rasqal/rasqal_internal.h: Added offset to query structure 2005-04-11 Dave Beckett * rasqal/sparql_lexer.l: Deleted keyword LOAD * rasqal/sparql_parser.y (LoadClauseOpt): Deleted, along with old keyword LOAD * rasqal/sparql_parser.y: Removed deprecated [ ... ] syntax for optionals * rasqal/sparql_lexer.l, rasqal/sparql_parser.y: Removed deprecated SOURCE keyword * rasqal/configure.ac: Added tests/sparql/survey/Makefile * rasqal/tests/sparql/Makefile.am: Added survey dir * rasqal/tests/sparql/survey/Makefile.am, rasqal/tests/sparql/survey/query-survey-1.rq, rasqal/tests/sparql/survey/query-survey-10.rq, rasqal/tests/sparql/survey/query-survey-11.rq, rasqal/tests/sparql/survey/query-survey-12.rq, rasqal/tests/sparql/survey/query-survey-13.rq, rasqal/tests/sparql/survey/query-survey-2.rq, rasqal/tests/sparql/survey/query-survey-3.rq, rasqal/tests/sparql/survey/query-survey-8.rq, rasqal/tests/sparql/survey/query-survey-9.rq, rasqal/tests/sparql/survey/result-survey-1.ttl, rasqal/tests/sparql/survey/result-survey-10.ttl, rasqal/tests/sparql/survey/result-survey-11.ttl, rasqal/tests/sparql/survey/result-survey-12.ttl, rasqal/tests/sparql/survey/result-survey-13.ttl, rasqal/tests/sparql/survey/result-survey-2.ttl, rasqal/tests/sparql/survey/result-survey-3.ttl, rasqal/tests/sparql/survey/result-survey-8.ttl, rasqal/tests/sparql/survey/result-survey-9.ttl, rasqal/tests/sparql/survey/survey-sample.ttl: dawg suvey tests * raptor/tests/Makefile.am, raptor/tests/ex-56.out, raptor/tests/ex-56.rdf: Added ex-56 test that relative URIs in datatypes work (Graham Klyne) 2005-04-10 Dave Beckett * rasqal/configure.ac, rasqal/win32_rasqal_config.h: Bumped version to 0.9.9 * rasqal: Snapshotted rasqal_0_9_8 for 0.9.8 release 2005-04-08 Dave Beckett * librdf/rdf_serializer.c: Add missing switch cases to make -Wswitch-enum happy. * configure.ac: More gcc -W flags in maintainer mode. Require rasqal 0.9.8 * librdf/rdf_stream.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage.c, librdf/rdf_serializer_raptor.c, librdf/rdf_node.c, librdf/rdf_log.c: Add missing switch cases to make -Wswitch-enum happy. * librdf/rdf_query_rasqal.c (rasqal_redland_new_triples_source): Use new rasqal 0.9.8+ rasqal_query_get_data_graph_sequence * librdf/rdf_node.h: Remove unused LIBRDF_NODE_TYPE_RESERVED1 (#3) from librdf_node_type enum * raptor/raptor_xml_writer.c, raptor/raptor_serialize_rdfxmla.c, raptor/raptor_serialize.c, raptor/raptor_rdfxml.c, raptor/raptor_parse.c, raptor/raptor_general.c: Add missing switch cases to make -Wswitch-enum happy. * raptor/configure.ac: More gcc -W flags in maintainer mode. * raptor/raptor_xslt.c: Casts for C++ * rasqal/configure.ac: More gcc -W flags in maintainer mode. * rasqal/rasqal_literal.c, rasqal/rasqal_general.c: Casts for C++ 2005-04-07 Dave Beckett * raptor/raptor_xslt.c (raptor_init_parser_grddl): Expand grddl parser description. * raptor/libraptor.3: Added missing 1.4.5 API changes, adding XML writer features and support functions as used by the rdf/xml-abbrev serializer. * raptor/tests/Makefile.am: test should use = not == for string compare portability 2005-04-06 Dave Beckett * raptor/raptor_xslt.c: Added a list of XPaths to try, fixed searching for a profile. Now handles 2 XHTML forms and XML. (raptor_xslt_parse_chunk): Walk through the list of XPaths. Do not give an error if no GRDDL is found, 0 triples are ok. * raptor/raptor_libxml.c (raptor_libxml_error_common): Added, passing in prefix and is_fatal flag. Handle NULL ctx and hence NULL parser. (raptor_libxml_error, raptor_libxml_generic_error, raptor_libxml_fatal_error, raptor_libxml_validation_error): Use the new function, share very common code. * raptor/raptor_parse.c (raptor_parser_error_varargs): Survive a NULL parser. * raptor/raptor_rdfxml.c (raptor_get_libxml_context, raptor_set_libxml_document_locator, raptor_get_libxml_document_locator): Survive NULL rdf_parser calls. * raptor/raptor_internal.h: Added raptor_libxml_init_generic_error_handlers prototype * raptor/raptor_xslt.c (raptor_xslt_parse_start): Init column, byte to -1 (raptor_xslt_xmlStructuredErrorFunc): Added, not tested. (raptor_xslt_parse_chunk): Ensure last chunk with is_end is always run. Report error if no XML DOM made. Set xslt context structured error handler to raptor_xslt_xmlStructuredErrorFunc. 2005-04-04 Dave Beckett * raptor/raptor_xslt.c (raptor_xslt_parse_chunk): Declare 'nodes' at top of block. Init doc_txt/doc_txt_len earlier so do not free junk. Get the base URI string from the XML doc if it exists. 2005-03-25 Dave Beckett * raptor/configure.ac: Added --with-xslt-config Added grddl parser and checking. Added simple search for libxslt needed by grddl. * raptor/Makefile.am: Added grddl if RAPTOR_PARSER_GRDDL * raptor/raptor_general.c (raptor_init): Added grddl * raptor/raptor_libxml.c (raptor_libxml_init_sax_error_handlers): Added to just init the static error handlers for libxml for grddl. * raptor/raptor_internal.h: Export raptor_libxml_init_sax_error_handlers for grddl. Added raptor_init_parser_grddl * raptor/raptor_xslt.c: Generates triples via in internal rdf/xml parser. (raptor_xslt_parse_start): Copy any user-set handlers to the internal rdf/xml parser. (main): Deleted, experimental code merged. * raptor/raptor_xslt.c: Reformed test code into parser named 'grddl' (raptor_xslt_parse_init, raptor_xslt_parse_terminate, raptor_xslt_parse_start, raptor_xslt_parse_chunk, raptor_xslt_parse_recognise_syntax, raptor_xslt_parser_register_factory, raptor_init_parser_xslt): Added 2005-03-24 Dave Beckett * raptor/raptor_xslt.c: Fix memory leaks. * raptor/raptor_xslt.c: Remove commented out standalone xslt * raptor/Makefile.am: Added bodge raptor_xslt_test * raptor/raptor_xslt.c: Raptor GRDDL XSLT * raptor/raptor_parse.c (raptor_parse_chunk): docs * librdf/rdf_storage.c (librdf_storage_node_stream_to_node_create): node1 or node2 can be NULL but not both - edit docs and assertion. 2005-03-21 Dave Beckett * rasqal/rasqal_graph_pattern.c (rasqal_graph_pattern_init): Set origin parts only if there is an origin. * rasqal/rasqal_engine.c (rasqal_query_graph_pattern_build_declared_in): Set origin vars only if there is an origin. * rasqal/rasqal_query.c (rasqal_graph_pattern_set_origin): Set all columns, not 1 less. * rasqal/rasqal_graph_pattern.c (rasqal_graph_pattern_init): Add origin triple parts. * rasqal/rasqal_engine.c (rasqal_query_graph_pattern_build_declared_in): Mark vars declared in origin. * rasqal/rdql_parser.y (Query): Add background data graphs as this rdql does not allow origin queries. * rasqal/sparql_parser.y (LoadClauseOpt): Add named data graphs from LOAD (GraphOrPattern, NamedGraphPattern, OptionalGraphPattern): Add FIXMEs for UNION, GRAPH *, SOURCE *, deprecated SOURCE, deprecated [] * rasqal/rasqal_query.c (rasqal_query_add_data_graph, rasqal_query_add_variable, rasqal_query_add_prefix): Add data graphs, sources, variables, prefixes to the end of the sequence - more sensible and also quicker. * rasqal/rasqal_graph_pattern.c (rasqal_graph_pattern_add_constraint): Add constraints to end of sequence - more sensible and also quicker. * rasqal/rdql_parser.y (Query): Make data graphs here, don't edit deprecated sources list. * rasqal/rasqal_raptor.c (rasqal_raptor_new_triples_source): Pass in graph names as base URIs to parsing. * rasqal/rasqal_redland.c (rasqal_redland_new_triples_source): Use data graphs to gather source URIs and graph URI names. Pass in graph names as base URIs to parsing. * rasqal/rasqal_raptor.c (rasqal_raptor_new_triples_source): Use data graphs to gather source URIs and graph URI names 2005-03-20 Dave Beckett * rasqal/sparql_parser.y (NamedGraphClauseOpt): Set name uri when adding a data graph, to same uri as source uri * rasqal/librasqal.3: 0.9.8 API changes, style, refs * rasqal/rasqal.h, rasqal/rasqal_query.c: (rasqal_query_get_variable_sequence, rasqal_query_add_triple): Removed. Were announced deprecated in 0.9.7 * rasqal/rasqal_expr.c (main): Call rasqal_uri_init and rasqal_uri_finish around test code. * rasqal/rasqal_literal.c (rasqal_new_integer_literal): Use rasqal_xsd_integer_uri. (rasqal_new_floating_literal): Use rasqal_xsd_double_uri. (rasqal_literal_string_to_native): Use rasqal_xsd_integer_uri and rasqal_xsd_double_uri. Also convert xsd:boolean rdf literals into internal RASQAL_LITERAL_BOOLEAN * rasqal/rasqal_general.c (rasqal_init): Call rasqal_uri_init (rasqal_finish): Call rasqal_uri_finish and always call raptor_finish. (rasqal_uri_init, rasqal_uri_finish): Added to initialise/free URIs used in the library. * rasqal/rasqal_internal.h: Added interanl URIs rasqal_xsd_namespace_uri, rasqal_xsd_integer_uri, rasqal_xsd_double_uri and rasqal_xsd_boolean_uri. Added prototypes for rasqal_uri_init and rasqal_uri_finish to make them. * rasqal/tests/sparql/syntax/cast1.rq: Type check should be xsd:integer. 2005-03-17 Dave Beckett * rasqal/rasqal_engine.c (rasqal_engine_get_next_result): Finish if the query has query graph or the query graph has no graph patterns in it. 2005-03-16 Dave Beckett * rasqal/tests/sparql/syntax/Makefile.am, rasqal/tests/sparql/syntax/cast1.rq: Added cast1.rq * Redland.i: Added librdf_log_message_code, librdf_log_message_level, librdf_log_message_facility, librdf_log_message_message, librdf_log_message_locator, fraptor_locator_line, raptor_locator_column, raptor_locator_byte, raptor_locator_file, raptor_locator_uri for raptor locators. * rasqal/sparql_parser.y (PatternElementConstraint): Added, Taking the AND Expression out of PatternElement, ensuring the constraint gets added to the adjacent graph pattern rather than one with no other content. Replaced all other references to PatternElement with this term. [now have 2 shift/reduce conflicts] * rasqal/rasqal_engine.c (rasqal_query_build_declared_in): Less debug noise for defined variables * rasqal/tests/sparql/syntax/describe1.rq: use ?p in the query * rasqal/tests/sparql/syntax/groups.rq: select ?mbox mentioned in query 2005-03-15 Dave Beckett * rasqal/Makefile.am, rasqal/rasqal_engine.c, rasqal/rasqal_internal.h, rasqal/rasqal_graph_pattern.c: Move rasqal_graph_pattern to new rasqal_graph_pattern.c 2005-03-14 Dave Beckett * rasqal/rasqal_engine.c (rasqal_engine_query_constraints_has_qname): Check for query constraints in sub-graph patterns via rasqal_engine_graph_pattern_constraints_has_qname on query_graph_pattern. (rasqal_engine_graph_pattern_constraints_has_qname): Check in sub-graph patterns here. (rasqal_engine_expand_graph_pattern_constraints_qnames): Expand qnames in sub graph patterns via recursion. (rasqal_engine_expand_query_constraints_qnames): Expand via rasqal_engine_expand_graph_pattern_constraints_qnames on query_graph_pattern. (rasqal_engine_build_constraints_expression): Build constraints in sub graph patterns via recursion. (rasqal_new_graph_pattern_from_triples): Use rasqal_graph_pattern_add_triples to init. (rasqal_graph_pattern_add_triples): Added, to add triples to an existing graph pattern. (rasqal_graph_pattern_init): Init sub graph_patterns by recusion. Optional flags are now stored per graph pattern. (rasqal_query_graph_pattern_build_declared_in): Added to build the variables_declared_in fields per graph_pattern. (rasqal_query_build_declared_in): Use the above to init from the query_graph_pattern down. (rasqal_engine_prepare): Use rasqal_engine_build_constraints_expression to init query_graph_pattern constraints. (rasqal_engine_execute_init): Moved graph pattern sequence init into rasqal_graph_pattern_init. (rasqal_engine_move_to_graph_pattern): Move within an outer graph pattern not a query. (rasqal_engine_do_step, rasqal_engine_do_optional_step): Perform a step within an outer graph_pattern containing graph pattern gp. (rasqal_engine_get_next_result): Execute over contents of query's query_graph_pattern. * rasqal/sparql_parser.y (WhereClauseOpt): Append to query_graph_pattern * rasqal/rdql_parser.y (rasqal_rdql_query_engine_prepare): Use rasqal_graph_pattern_add_sub_graph_pattern on query_graph_pattern * rasqal/rasqal_query.c (rasqal_new_query, rasqal_free_query): Remove graph_patterns and optional_graph_pattern fields. (rasqal_query_add_constraint, rasqal_query_get_constraint_sequence, rasqal_query_get_constraint): Still deprecated, but now use the query's query_graph_pattern field. (rasqal_query_get_graph_pattern_sequence, rasqal_query_get_graph_pattern): Use the graph pattern sequence inside the query's query_graph_pattern. (rasqal_graph_pattern_add_sub_graph_pattern): Added. (rasqal_query_print): Print from the query_graph_pattern. * rasqal/rasqal_internal.h: Moved from structure rasqal_query to rasqal_graph_pattern fields: current_graph_pattern, max_optional_graph_pattern, optional_graph_pattern_matches_count to graph_pattern structure for execution of sub-graph patterns. Added prototype of rasqal_graph_pattern_add_triples. * rasqal/rasqal.h: Added prototype for rasqal_graph_pattern_add_sub_graph_pattern 2005-03-13 Dave Beckett * rasqal/rasqal_engine.c (rasqal_new_graph_pattern): Added. * rasqal/rasqal_query.c (rasqal_new_query, rasqal_free_query): Init query_graph_pattern using rasqal_new_graph_pattern. * rasqal/rasqal_internal.h: Added prototype for rasqal_new_graph_pattern * rasqal/sparql_parser.y, rasqal/rdql_parser.y: execute factory method takes rasqal_query_results* arg * rasqal/rasqal_engine.c: style * rasqal/rasqal_query.c (rasqal_query_execute): execute factory method takes rasqal_query_results* * rasqal/rasqal_internal.h: execute method takes rasqal_query_results* * rasqal/rasqal_internal.h: style 2005-03-10 Dave Beckett * rasqal/sparql_parser.y (rasqal_sparql_query_engine_prepare): Move qname expansion checks from sparql_parse. * rasqal/sparql_parser.y: Restore TriplePatternList as first part of PatternElement. * rasqal/tests/sparql/syntax/data.n3: Add something for casting * rasqal/rasqal_expr.c (rasqal_expression_evaluate): Evaluate RASQAL_EXPR_CAST. * rasqal/rdql_parser.y (main): Cast for C++ * rasqal/tests/sparql/syntax/Makefile.am: Added cast0.rq * rasqal/tests/sparql/syntax/cast0.rq: Added cast test * rasqal/sparql_lexer.l: and {QUOTEDURI} add optional ')' and return URI_LITERAL_BRACE, QNAME_LITERAL_BRACE instead of URI_LITERAL / QNAME_LITERAL. * rasqal/sparql_parser.y: Added tokens URI_LITERAL_BRACE QNAME_LITERAL_BRACE for URI+'(' and QNAME+'(' (URIBrace): Added for handling the two above, replacing two alternatives in BuiltinExpression, removing a conflict. * raptor/tests/turtle/Makefile.am: add test-17.out * rasqal/rasqal_expr.c (rasqal_new_cast_expression): Added for type casting (rasqal_free_expression, rasqal_expression_foreach, rasqal_expression_evaluate, rasqal_expression_print): Added RASQAL_EXPR_CAST support * rasqal/rasqal.h: Added RASQAL_EXPR_CAST for sparql type casting Added prototype for rasqal_new_cast_expression * rasqal/sparql_lexer.l, rasqal/rdql_lexer.l, raptor/turtle_lexer.l, raptor/n3_lexer.l: Tidy to use .|\n to match any char * raptor/n3_lexer.l, raptor/turtle_lexer.l: Added """long literals""" Use yyterminate() to end on errors * raptor/tests/turtle/test-17.out: test-17 * raptor/tests/turtle/bad-14.ttl, raptor/tests/turtle/test-17.ttl: long literals * raptor/tests/turtle/Makefile.am: Added test-17.ttl bad-14.ttl for long literals * rasqal/rdql_lexer.l, rasqal/sparql_lexer.l ('-strings, and "-strings): Count passed into sparql_copy_string_token is one too small. * rasqal/rasqal_query.c (rasqal_graph_pattern_set_origin): Set origin only on this graph pattern's columns/triples. * rasqal/roqet.c: Indenting tidying 2005-03-09 Dave Beckett * rasqal/roqet.c (roqet_graph_pattern_walk): Print constraints per-graph pattern. * rasqal/rasqal_engine.c (rasqal_graph_pattern_get_constraint): use idx * rasqal/sparql_lexer.l: Remove NOT * rasqal/sparql_parser.y: Updates to grammar structure to match that of the 17 February 2005 WD in http://www.w3.org/TR/2005/WD-rdf-sparql-query-20050217/ Remove unused NOT token 1 shift/reduce conflcit near: URI '(' which can be a cast in a rule part of BuiltinExpression or a Literal. * rasqal/sparql_parser.y (sparql_parse): Use rasqal_engine_query_constraints_has_qname. * rasqal/rdql_parser.y: Construct constraints in parsing via query field constraints_sequence (rasqal_rdql_query_engine_prepare): Init constraints_sequence and after parsing, assign to the main graph pattern and delete it. Then do the qname expansion. (rdql_parse): Remove qname expansion to above function. (main): Use rasqal_query_prepare rather than writing internal fields directly. * rasqal/rasqal.h: Deprecate rasqal_query_add_constraint, rasqal_query_get_constraint_sequence and rasqal_query_get_constraint Added prototypes for rasqal_graph_pattern_add_constraint, rasqal_graph_pattern_get_constraint_sequence and rasqal_graph_pattern_get_constraint * rasqal/rasqal_query.c: Moved constraints code to graph_pattern (rasqal_free_query): Removed constraints code. (rasqal_query_add_source, rasqal_query_get_source_sequence, rasqal_query_get_source, rasqal_query_get_variable_sequence): Add RASQAL_DEPRECATED_MESSAGE pointing at new choice. (rasqal_query_add_constraint, rasqal_query_get_constraint_sequence, rasqal_query_get_constraint): Deprecated to methods on a rasqal_graph_pattern (rasqal_query_print): Remove constraints printing. * rasqal/rasqal_engine.c (rasqal_engine_query_constraints_has_qname): Renamed from rasqal_engine_constraints_has_qname (rasqal_engine_graph_pattern_constraints_has_qname): Added. (rasqal_engine_expand_graph_pattern_constraints_qnames): Renamed from rasqal_engine_expand_constraints_qnames (rasqal_engine_expand_query_constraints_qnames): Added. (rasqal_free_graph_pattern): Free constraints_expression and constraints when present (moved from rasqal_free_query). (rasqal_graph_pattern_add_constraint): Added, based on rasqal_query_add_constraint. (rasqal_graph_pattern_get_constraint_sequence): Added, based on rasqal_query_get_constraint_sequence (rasqal_graph_pattern_get_constraint): Added, based on rasqal_query_get_constraint (rasqal_graph_pattern_print): Add printing of constraints (rasqal_engine_prepare): Build constraints expressions per graph pattern. (rasqal_engine_check_constraint, rasqal_engine_do_step, rasqal_engine_do_optional_step): Operate constraints per-current graph pattern. * rasqal/rasqal_internal.h: RASQAL_DEPRECATED_MESSAGE gains a count so it warns just once. rasqal_graph_pattern gains constraints, constraints_expression fields. rasqal_query internal looses constraints. Gains constraints_equence for rdql parsing use. Added prototypes for rasqal_engine_query_constraints_has_qname, rasqal_engine_graph_pattern_constraints_has_qname, rasqal_engine_expand_query_constraints_qnames and rasqal_engine_expand_graph_pattern_constraints_qnames 2005-03-06 Dave Beckett * raptor/raptor_serialize_rdfxmla.c (raptor_new_qname_from_resource): Use maximal xml name length for splitting predicate. * raptor/raptor_serialize.c (raptor_rdfxml_serialize_statement): Use maximal xml name length for splitting predicate. 2005-03-01 Dave Beckett * rasqal/roqet.c: Update to use rasqal_data_graph* and methods. * rasqal/rasqal_query.c (rasqal_query_print): Prefer printing query->data_graphs not sources. * rasqal/sparql_parser.y (FromClauseOpt): Add either a NAMED or BACKGROUND rasqal_data_graph with FROM and WITH respectively. * rasqal/rasqal_internal.h: rasqal_query gains data_graphs field, note sources is DEPRECATED. * rasqal/rasqal_query.c (rasqal_new_query, rasqal_free_query): Added data_graphs field init, tidy. (rasqal_query_add_data_graph, rasqal_query_get_data_graph_sequence, rasqal_query_get_data_graph): Added for rasqal_data_graph access (rasqal_query_add_source, rasqal_query_get_source_sequence, rasqal_query_get_source): Added deprecated docs * rasqal/rasqal_expr.c (rasqal_query_add_source, rasqal_query_get_source_sequence and rasqal_query_get_source): Added deprecated notices. (rasqal_new_data_graph, rasqal_free_data_graph, rasqal_data_graph_print): Added for rasqal_data_graph class. * rasqal/rasqal.h: Added rasqal_data_graph and rasqal_data_graph_flags. Deprecated rasqal_query_add_source, rasqal_query_get_source_sequence and rasqal_query_get_source Added prototypes for rasqal_query_add_data_graph, rasqal_query_get_data_graph_sequence, rasqal_query_get_data_graph, rasqal_new_data_graph, rasqal_free_data_graph, rasqal_data_graph_print 2005-02-27 Dave Beckett * rasqal/win32_rasqal_config.h, rasqal/configure.ac, rasqal/ChangeLog: Bumped version to 0.9.8 2005-02-24 Dave Beckett * rasqal/roqet.1: roqet is a query util * rasqal/roqet.c (roqet_graph_pattern_walk): Renamed from roqet_walk_graph_pattern * rasqal/roqet.c (roqet_query_walk): Added to do all query API walking. * rasqal/rasqal_query.c (rasqal_query_print): Tweak distinct, limits wording> * rasqal/tests/sparql/syntax/Makefile.am: Added distinct0.rq limit0.rq * rasqal/tests/sparql/syntax/distinct0.rq, rasqal/tests/sparql/syntax/limit0.rq: Tests for DISTINCT and LIMIT syntax * rasqal/librasqal.3: Added rasqal_query_get_distinct and rasqal_query_get_limit * rasqal/sparql_parser.y (LimitClauseOpt): Set limit field. * rasqal/rasqal_query.c: Tidy some docucomments. (rasqal_new_query): Initialise distinct, limit fields. (rasqal_query_get_distinct): Added, returning if query results should be distinct. (rasqal_query_get_limit): Added, returning the query results limit specified in the query. (rasqal_query_print): Print distinct, limit fields. * rasqal/rasqal.h: Added rasqal_query_get_distinct and rasqal_query_get_limit * rasqal/rasqal_internal.h: Added limit field to struct rasqal_query_s * rasqal/rasqal_literal.c (rasqal_literal_compare): Recheck for NULL variable values so that ?var1 compare ?var2 fails properly when one is not bound. * rasqal/sparql_parser.y: tweak optional warning 2005-02-23 Dave Beckett * rasqal/roqet.c: Casts for C++ * rasqal/rasqal_redland.c (rasqal_redland_new_triples_source): Return -1 on no data. * rasqal/rasqal_raptor.c (rasqal_raptor_new_triples_source): Return -1 on no data. * rasqal/rasqal_query.c (rasqal_query_prepare): Init line, column, byte to undefined. * rasqal/rasqal_engine.c (rasqal_new_triples_source): Throw no data/general error when new triple source factory fails to construct. (rasqal_engine_execute_init): Remove error throwing from here. * rasqal/rasqal.h: new_triples_source factory method document return value * rasqal/roqet.c: Use raptor_stringbuffer to read large queries from files, > buffer size. 2005-02-21 Dave Beckett * raptor/examples/Makefile.am: Add gconf-2.0 to grapper args 2005-02-19 Dave Beckett * rasqal/tests/sparql/part1/Makefile.am: Add dawg-query-004 dawg-result-004.n3 * rasqal/tests/sparql/part1/dawg-query-001, rasqal/tests/sparql/part1/dawg-query-002, rasqal/tests/sparql/part1/dawg-query-003, rasqal/tests/sparql/part1/dawg-query-004: 2005-02-17 WD syntax changes 2005-02-18 Dave Beckett * rasqal/roqet.c: help typo * rasqal/tests/sparql/syntax/construct2.rq, rasqal/tests/sparql/syntax/construct1.rq, rasqal/tests/sparql/syntax/construct0.rq, rasqal/tests/sparql/syntax/ask0.rq: FROM to WITH for 2005-02-17 WD * rasqal/sparql_parser.y (PatternElementForms): Remove unused vars. * rasqal/sparql_parser.y: Some updates for 2005-02-17 SPARQL query WD. Added GRAPH, WITH tokens (FromClauseOpt): Warn about FROM, add WITH. (PatternElementForms): Warn with SOURCE, add GRAPH. Use rasqal_graph_pattern_set_origin to pass on the varOrURI (PatternElementForms): Warn about [] * rasqal/sparql_lexer.l: Added graph, with * rasqal/rasqal_internal.h: Added rasqal_graph_pattern_set_origin prototype. * rasqal/rasqal_query.c (rasqal_graph_pattern_set_origin): Added, to recursively set the origin on all triples inside. 2005-02-17 Dave Beckett * rasqal/librasqal.3: Document 0.9.7 and graph pattern api calls. * rasqal/roqet.1: Document -d, -n * rasqal/roqet.c: Added -n/--dryrun to stop after preparing the query. Added -w/--walk-query to walk and print the query using the API. (roqet_walk_graph_pattern): Added to walk the tree. * rasqal/rasqal_query.c (rasqal_graph_pattern_get_triple): fix range check * rasqal/rasqal_query.c (rasqal_query_add_triple): Deprecated as it doesn't construct the graph patterns and is of little use. (rasqal_query_get_graph_pattern_sequence, rasqal_query_get_graph_pattern): Added to get the rasqal_graph_patterns inside a query. (rasqal_graph_pattern_get_triple): Added to get a rasqal_triple inside a graph_pattern. (rasqal_graph_pattern_get_sub_graph_pattern_sequence, (rasqal_graph_pattern_get_sub_graph_pattern): Added to get a sub-graph pattern inside a graph pattern. (rasqal_graph_pattern_get_flags): Added to get graph pattern flags. * rasqal/rasqal.h: Typo * rasqal/rasqal_internal.h: Move rasqal_graph_pattern typedef, rasqal_pattern_flags and rasqal_graph_pattern_print to public api. Added RASQAL_DEPRECATED_MESSAGE macro. * rasqal/rasqal.h: Export rasqal_graph_pattern typedef Export rasqal_pattern_flags enum with value RASQAL_PATTERN_FLAGS_OPTIONAL Deprecate rasqal_query_add_triple as it doesn't construct the graph patterns and is of little use. Added prototypes for rasqal_query_get_graph_pattern_sequence, rasqal_query_get_graph_pattern, rasqal_graph_pattern_get_triple, rasqal_graph_pattern_get_sub_graph_patterns_sequence, rasqal_graph_pattern_get_sub_graph_pattern, rasqal_graph_pattern_get_flags and exported rasqal_graph_pattern_print * rasqal/tests/rdql/testsuite/check-rdql, rasqal/tests/sparql/check-sparql: Handle roqet select: and bound variables: * rasqal/rasqal.h: Added RASQAL_DEPRECATED macro. Deprecated rasqal_query_get_variable_sequence Added rasqal_query_get_bound_variable_sequence and rasqal_query_get_all_variable_sequence. * rasqal/rasqal_query.c (rasqal_query_get_variable_sequence): Deprecate, prefer rasqal_query_get_bound_variable_sequence (rasqal_query_get_bound_variable_sequence): Added, returning the sequence of rasqal_variable* that are to be bound - appearing in the query result. (rasqal_query_get_all_variable_sequence): Added, return the sequence of all rasqal_variable* mentioned in the query. (rasqal_query_print): Print all variables as well as selected. * rasqal/rasqal_literal.c (rasqal_literal_as_integer, rasqal_literal_as_floating, rasqal_literal_as_string, rasqal_literal_compare): Added remaining LITERAL enums for -Wswitch-enum. (rasqal_literal_compare): Handle two literal values. (rasqal_literal_as_node): Handle RASQAL_LITERAL_BOOLEAN into a xsd:boolean typed value. * rasqal/rasqal_query.c (rasqal_query_results_get_binding_name): Work even when query results are finished. * rasqal/rasqal_query.c (rasqal_query_set_feature): Added RASQAL_FEATURE_LAST case for -Wswitch-enum (there are no features). (rasqal_query_results_write, rasqal_query_results_get_triple): Added RASQAL_LITERAL_UNKNOWN case for -Wswitch-enum. (rasqal_query_results_get_triple): Added remaining LITERAL enums for -Wswitch-enum. Note why forbidden - literal subjects, predicates, bnode predicates. * rasqal/rasqal_expr.c (rasqal_free_expression, rasqal_expression_foreach, rasqal_expression_evaluate, rasqal_expression_print): Added RASQAL_EXPR_UNKNOWN case for -Wswitch-enum. Deleted "pattern" from rasqal_op_labels. (rasqal_expression_print): Deleted RASQAL_EXPR_PATTERN Handle RASQAL_EXPR_FUNCTION. * rasqal/rasqal_literal.c (rasqal_free_literal, rasqal_literal_print, rasqal_literal_as_boolean, rasqal_literal_as_integer, rasqal_literal_as_floating, rasqal_literal_as_string, rasqal_literal_compare, rasqal_literal_equals): Added RASQAL_LITERAL_UNKNOWN case for -Wswitch-enum. (rasqal_literal_as_integer, rasqal_literal_as_floating): Return RASQAL_LITERAL_BLANK as an error. * rasqal/rasqal.h: Deleted RASQAL_EXPR_PATTERN - never used. * rasqal/configure.ac: Add -Wswitch-enum to maintainer-mode gcc switches to catch missing enum values in switches. Lots of those near expression and literal handling. * librdf/rdf_statement.c (librdf_free_statement): with threads fix 2005-02-16 Dave Beckett * raptor/examples/grapper.c: Added gconf storing of window width/height at namespace /apps/grapper 2005-02-14 Dave Beckett * raptor/win32_raptor_config.h: Define RASQAL_INLINE to __inline * raptor/raptor_nfc.c: Change inline to RAPTOR_INLINE * raptor/raptor_internal.h: Define RAPTOR_INLINE to inline if not alerady defined to something else * rasqal/win32_rasqal_config.h: Define RASQAL_INLINE to __inline * rasqal/rasqal_query.c: Change inline to RASQAL_INLINE * rasqal/rasqal_internal.h: Add RASQAL_INLINE protection and set RASQAL_DEBUG if LIBRDF_DEBUG set. * rasqal/rasqal.h: rasqal_query_results_write with RASQAL_API prefix. 2005-02-12 Dave Beckett * raptor/raptor_serialize_rdfxmla.c (raptor_rdfxmla_emit_subject_list_items, raptor_rdfxmla_emit_subject_properties, raptor_rdfxmla_emit_subject, raptor_rdfxmla_serialize_start): Copy base URIs only when they are not NULL. (raptor_rdfxmla_serialize_statement): Handle predicate type RAPTOR_IDENTIFIER_TYPE_RESOURCE as an alternative. * librdf/rdf_query_rasqal.c (librdf_query_rasqal_execute): Free any existing stored rasqal result before executing. (librdf_query_rasqal_free_results): Zap results pointer after freeing rasqal results. * rasqal/rasqal_engine.c (rasqal_reset_triple_meta): End any triples match when resetting rasqal_triple_meta; this frees any resources that were providing a source of triples. 2005-02-10 Dave Beckett * raptor/raptor_xml.c (raptor_valid_xml_ID): Just return an error status, don't error out here. * rasqal/rasqal_query_test.c (main): Execute a query/free twice with no checking of results in between. 2005-02-08 Dave Beckett * rasqal/tests/sparql/bound/Makefile.am, rasqal/tests/sparql/examples/Makefile.am, rasqal/tests/sparql/part1/Makefile.am, rasqal/tests/sparql/simple/Makefile.am, rasqal/tests/sparql/syntax/Makefile.am, rasqal/configure.ac, rasqal/tests/rdql/testsuite/Makefile.am: Add @RAPPER_PATH@ to the PATH before check-rdql/sparql calls so that if both raptor and rasqal are being built, rapper can be found before installation. * raptor/Makefile.am: Add n3_lexer.l n3_parser.y to EXTRA_DIST otherwise building with --enable-maintainer-mode from tarball will fail. * raptor/raptor_rss.c: Add RSS enclosures serializing into RSS 1.0 raptor_rss10_serializer_context gains enclosures sequence (raptor_rss10_serialize_init, raptor_rss10_serialize_terminate): Init, free enclosures sequence. (raptor_rss10_store_statement): If subject isn't an RSS item, see if it is an enclosure and if so, set the type. (raptor_rss10_serialize_statement): If type is enclosure, walk the list of enclosures and add a new one if not seen already. (raptor_rss10_emit_item): Add indent arg as this is called recursively. Use it to print spaces from teh raptor_rss10_spaces constant. Only serialize an rdf:about if the item has a URI. If field is enc:enclosure, find the enclosure item and write it indented further recursively calling raptor_rss10_emit_item. * raptor/raptor_rss.c: re-comment back item enclosure thing 2005-02-07 Dave Beckett * raptor/raptor_rss.c (raptor_rss_parser_processNode): Do not assign 'alternate' attribute values when there's no field to use. * librdf/rdf_node.c (librdf_node_encode): init datatype_uri_string to prevent a gcc warning. 2005-02-06 Dave Beckett * configure.ac, librdf/win32_rdf_config.h: Bumped version to 1.0.1 * rasqal/configure.ac, rasqal/win32_rasqal_config.h: Bumped version to 0.9.7 * raptor/configure.ac, raptor/win32_raptor_config.h: Bumped version to 1.4.6 * librdf/win32_rdf_config.h, configure.ac: 1.0.0 * Snapshotted redland_1_0_0 for 1.0.0 release 2005-02-04 Dave Beckett * Redland.i: librdf_query_results_to_string returns a char* * Redland.i: librdf_query_results_to_file returns an int. %newobject librdf_query_results_to_string * rasqal/autogen.sh, raptor/autogen.sh: Add autoheader to the path search. * rasqal/configure.ac, raptor/configure.ac, configure.ac: AM_PROG_LIBTOOL to AC_PROG_LIBTOOL seems to make things happier * autogen.sh: fix * autogen.sh: Add autoheader to the fun * rasqal/autogen.sh: Add libtoolize to the path search. * raptor/autogen.sh: tidy * raptor/autogen.sh: Add libtoolize to the path search. * autogen.sh: No need for swig here. Add libtoolize to the path search. 2005-02-03 Dave Beckett * utils/rdfproc.c, rasqal/sparql_lexer.l, rasqal/rasqal_expr.c: casts for C++ * rasqal/configure.ac: In maintainer mode, stop if flex is too old, no flex or YACC is not GNU bison. * raptor/configure.ac: In maintainer mode, stop if there is no flex. * raptor/configure.ac: In maintainer mode, stop if flex is too old or YACC is not GNU bison. * rasqal/sparql_lexer.l (sparql_copy_string_token): Fix wrong length on checking qname. * rasqal/sparql_lexer.l ({QNAME}): Now assigns a uri using sparql_copy_qname. (sparql_copy_qname): expands and returns a raptor_uri* here. When running standalone as rasqal_lexer_test, ignore unexpanded qnames. (sparql_copy_string_token): When running standalone as rasqal_lexer_test, ignore unexpanded qnames. * rasqal/sparql_lexer.l (sparql_copy_string_token): Check and expand datatype qnames here, since prefixes are always defined before qname use.. * rasqal/rasqal_expr.c: Added support for expressions: STR, LANG, DATATYPE, ISURI, ISBLANK and ISLITERAL (rasqal_free_expression, rasqal_expression_foreach, rasqal_expression_print_op, rasqal_expression_print): Updated to handle the expression types above. (rasqal_expression_evaluate): Print evaluation before and after debug messages. Edit main body to not return in cases. Implement the expressions above. * rasqal/sparql_parser.y: Added tokens STR, LANG, DATATYPE, ISURI, ISBLANK and ISLITERAL (BuiltinExpression): Use the tokens above to implement built in functions of the same names. * rasqal/sparql_lexer.l: Added keywords STR, LANG, DATATYPE, ISURI, ISBLANK and ISLITERAL * rasqal/rasqal.h: Added rasqal_op RASQAL_EXPR_STR, RASQAL_EXPR_LANG, RASQAL_EXPR_DATATYPE, RASQAL_EXPR_ISURI, RASQAL_EXPR_ISBLANK, RASQAL_EXPR_ISLITERAL, * rasqal/librasqal.3, rasqal/rasqal_literal.c: Updates for 0.9.6 * raptor/raptor_libxml.c: Use RAPTOR_LIBXML_XMLSAX2INTERNALSUBSET test for a function rather than HAVE_LIBXML_SAX2_H test for a header to work on OSX 10.3.x which has inconsistent system libxml shared library/headers. * raptor/configure.ac: Test for xmlSAX2InternalSubset so that it checks for the broken OSX 10.3.x libxml features in the shared library rather than the ones declared in the inconsistent header. 2005-02-02 Dave Beckett * rasqal/rasqal.rdf.in: Updates for schema * configure.ac, Makefile.am: Added redland.rdf.in DOAP * redland.rdf.in: Redland DOAP * raptor/raptor.rdf.in: Updates for schema * configure.ac: need rasqal 0.9.6 * configure.ac: Sleepycat/BDB 4.3 * raptor/tests/Makefile.am (check-rdfxmla): rdfdiff should read $name-rdfxmla.rdf from builddir 2005-02-01 Dave Beckett * raptor/rdfdiff.c: C style Move more declarations to start of blocks. * raptor/rdfdiff.c (rdfdiff_free_file): Restore what I broke. * raptor/rdfdiff.c: C style Move more declarations to start of blocks. * raptor/raptor_xml_writer.c (raptor_xml_writer_end_element): Move int decl to start of block. * raptor/raptor_serialize_rdfxmla.c (raptor_unique_id): Terminate string right. * raptor/rdfdiff.c, raptor/raptor_serialize_rdfxmla.c: Casts for C++ * raptor/raptor_serialize_rdfxmla.c: C style (raptor_rdfxmla_emit_subject_list_items, raptor_rdfxmla_emit_subject_properties): Declare i at start of block. * raptor/rdfdiff.c, raptor/raptor_serialize_rdfxmla.c: Import rdf/xml with abbreviations serializer 'rdfxml-abbrev' written by Steve Shepard * raptor/rapper.1: rdfxml-abbrev * raptor/rdfdump.c: Widen help formatting for longer serializer name * raptor/raptor_xml_writer.c: Various C style fixes. Make an enum for raptor_xml_writer_flags. Added XML_WRITER_ prefixes to macro and defines. Moved spaces_buffer to module static. Noted struct nsd and namespaces sorting are duplicated code. Docucomments for several methods (not yet used by doc system) noting use of the flags. * raptor/Makefile.am: clean rdfdiff * raptor/Makefile.am: rdfdiff to EXTRA_PROGRAMS for now * raptor/ChangeLog, raptor/Makefile.am, raptor/raptor.h, raptor/raptor_feature.c, raptor/raptor_general.c, raptor/raptor_internal.h, raptor/raptor_xml_writer.c, raptor/tests/Makefile.am: Import rdf/xml with abbreviations serializer 'rdfxml-abbrev' written by Steve Shepard * rasqal/rasqal_engine.c (rasqal_engine_do_optional_step): When the constraint fails, zero the new_bindings_count since none matter now. * rasqal/sparql_lexer.l: Added BNAME token ({BNAME}): Added to just do a blank node. * rasqal/configure.ac: Added dir tests/sparql/bound * rasqal/tests/sparql/syntax/Makefile.am, rasqal/tests/sparql/syntax/construct2.rq: Construct with bnodes in construct2.rq * rasqal/tests/sparql/bound/Makefile.am, rasqal/tests/sparql/bound/bound1-result.n3, rasqal/tests/sparql/bound/bound1.rq, rasqal/tests/sparql/bound/data.n3, rasqal/tests/sparql/bound/manifest.n3: DAWG BOUND tests * rasqal/tests/sparql/Makefile.am: added bound * rasqal/sparql_lexer.l ({QNAME}): If it starts _:, make a BLANK_LITERAL (sparql_token_print, sparql_token_free): Added BLANK_LITERAL support. * rasqal/sparql_parser.y: Added tokens BLANK_LITERAL ConstructPattern (rq23) BNode (rq23), TripleTemplate (rq23) and VarOrLiteralOrBNode VarOrURIOrBNode (ConstructClause): Now using ConstructPattern (ConstructPattern): Added from rq23, using TripleTemplate (TripleTemplate): Added from rq23, using VarOrURIOrBNode for subject and VarOrLiteralOrBNode for object. (VarOrURIOrBNode): Added, using BNode (VarOrLiteralOrBNode): Added, using BNode (BNode): Added from rq23 * rasqal/rasqal_expr.c (rasqal_free_expression, rasqal_expression_evaluate, rasqal_expression_print_op): Added RASQAL_EXPR_BOUND support. * rasqal/rasqal.h: Added RASQAL_EXPR_BOUND * rasqal/sparql_parser.y: Updates from http://www.w3.org/2001/sw/DataAccess/rq23/ $Revision: 1.187 $ of $Date: 2005/02/01 10:56:24 $ Added tokens BASE LOAD BOUND Renumbered some of comments to rq23 above. (ReportFormat) Moved big () inside Query here (SelectClause, DescribeClause, ConstructClause): Note now in rq23 (AskClause): Added from rq23. (LoadClauseOpt): Added from rq23. (LimitCaluseOpt): Added from rq23. (PatternElementForms OPTIONAL GraphPattern1): Mark the graph pattern as optional in the flags. (BaseDeclOpt): Added from rq23. (UnaryExpression): Call BuiltinExpression (BuiltinExpression): Added from rq23 just with BOUND * rasqal/sparql_lexer.l: Added OPTIONAL, BASE, LOAD and BOUND tokens and keywords * librdf/rdf_query_rasqal.c (librdf_query_rasqal_query_results_update_statement): Handle empty rstatement right away. (librdf_query_rasqal_results_as_stream): If no statements at all, return NULL. * librdf/rdf_query_rasqal.c: (librdf_query_rasqal_query_results_next_statement) Remove unused vars. * utils/rdfproc.c: Handle bindings, boolean and RDF graph query results. * librdf/rdf_query_rasqal.c (librdf_query_rasqal_query_results_update_statement): Return 0 * librdf/rdf_query_rasqal.c: Protect all query results from NULL pointers. (librdf_query_rasqal_query_results_end_of_stream, librdf_query_rasqal_query_results_update_statement, librdf_query_rasqal_query_results_next_statement, librdf_query_rasqal_query_results_get_statement librdf_query_rasqal_query_results_finished): Added, implementing RDF graph query results. (librdf_query_rasqal_results_as_stream): Updated to use the above. 2005-01-31 Dave Beckett * Redland.i: Added librdf_query_results_is_bindings, librdf_query_results_is_boolean, librdf_query_results_is_graph, and librdf_query_results_get_boolean * librdf/rdf_query_rasqal.c (librdf_query_rasqal_results_is_bindings, librdf_query_rasqal_results_is_boolean, librdf_query_rasqal_results_is_graph, librdf_query_rasqal_results_get_boolean): Added, calling rasqal. (librdf_query_rasqal_results_as_stream): Added, not implemented. * librdf/rdf_query_results.c (librdf_query_results_as_stream): Moved to end to match new query results. (librdf_query_results_is_bindings, librdf_query_results_is_boolean, librdf_query_results_is_graph, librdf_query_results_get_boolean, librdf_query_results_as_stream): Added. * librdf/rdf_query.h: Added results_is_bindings, results_is_boolean, results_is_grpah and results_get_boolean factory methods. Added prototypes for librdf_query_results_is_bindings, librdf_query_results_is_boolean, librdf_query_results_is_graph and librdf_query_results_get_boolean * rasqal/rasqal_query.c (rasqal_query_execute): Init ask_result. (rasqal_free_query_results, rasqal_query_results_is_bindings, rasqal_query_results_is_boolean, rasqal_query_results_is_graph): Docs. (rasqal_query_results_next, rasqal_query_results_get_triple, rasqal_query_results_next_triple): C style. (rasqal_query_results_get_triple): FIXME about bnodeids is done. (rasqal_query_results_get_boolean): Docs and implement by getting first result and storing if it worked. * rasqal/rasqal_internal.h: Added ask_result to rasqal_query. * rasqal/tests/sparql/syntax/Makefile.am: Added ask0.rq * rasqal/tests/sparql/syntax/ask0.rq: ASK test 2005-01-30 Dave Beckett * librdf/rdf_query.c: docs * librdf/rdf_query.c (main): C99 * rasqal/rasqal_engine.c (rasqal_engine_assign_variables): C99 * librdf/rdf_storage_sqlite.c: Casts for C++ * librdf/rdf_query_rasqal.c (rasqal_redland_bind_match): Casts for C++ and calculate, return the matched parts. Updated untested origin code. (librdf_query_rasqal_execute): Remove code for rasqal < 0.9.4 fixes. * rasqal/rasqal_xsd_datatypes.c: Casts for C++ * rasqal/rasqal_redland.c (rasqal_redland_bind_match): Updated untested redland origin code. * rasqal/rasqal_query.c: Casts for C++ * rasqal/rasqal_engine.c (rasqal_graph_pattern_get_next_match): int parts * rasqal/librasqal.3: Updates for API changes to 2005-01-30 2005-01-29 Dave Beckett * rasqal/roqet.1: Document -f/--format. Reference -o xml spec * rasqal/roqet.c: Note that -o xml writes the SPARQL xml format. * rasqal/rasqal_engine.c (rasqal_engine_assign_variables): variables_declared_in is now an array of integer (triple) column numbers not pointers to graph patterns. (rasqal_reset_triple_meta): Return number of variables that were set to NULL. (rasqal_graph_pattern_init): Update to compare triple column numbers, not graph patterns for defining vars. (rasqal_query_build_declared_in): Update for variables_declared_in changed. (rasqal_graph_pattern_get_next_match): Adjust new_bindings_count by number of variables reset by rasqal_reset_triple_meta. Only run the bind_match factory method if there are triple parts to bind. If it is run, adjust the new_bindings_count when variables are set. (rasqal_engine_do_optional_step): If there were new bindings, return a result otherwise continue searching. (rasqal_engine_get_next_result): Reset new_bindings_count on entry. * rasqal/rasqal_internal.h: rasqal_query: variables_declared_in is now an array of integer column numbers. Added new_bindings_count * rasqal/rasqal_query.c (rasqal_free_query): tidy free of variables_declared_in, now an intarray. 2005-01-28 Dave Beckett * rasqal/roqet.c: Add -f / --format to set output syntax format for graph results. * rasqal/roqet.c: Update for rasqal_query_results_get_triple returning a shared raptor_statement. Use a raptor_serializer to format it. * rasqal/rasqal_query.c (rasqal_free_query): Free rasqal_triple allocated. (rasqal_prefix_id): Prefix a blank node id with 'r''_' (rasqal_query_results_get_triple): Return a shared raptor_statement. (rasqal_query_results_next_triple): Free the internal rasqal_triple before moving on. * rasqal/rasqal_internal.h: Added rasqal_triple internal to rasqal_query * rasqal/rasqal.h: Changed rasqal_query_results_get_triple to return raptor_statement * rasqal/rasqal_internal.h: Added raptor_statement to rasqal_query 2005-01-27 Dave Beckett * rasqal/tests/rdql/testsuite/check-rdql, rasqal/tests/sparql/check-sparql (run_test): don't delete test output files here, let main do it. * rasqal/roqet.c: Free returned triple result * rasqal/roqet.c: Tidy the query result messages * rasqal/roqet.c (main): Format bindings, triples and boolean results. * rasqal/rasqal_query.c (rasqal_query_execute): Init current_triple_result. (rasqal_query_results_is_bindings, rasqal_query_results_is_boolean, rasqal_query_results_is_graph): Added to test query result formats. (rasqal_query_results_get_count, rasqal_query_results_next, rasqal_query_results_finished, rasqal_query_results_get_bindings, rasqal_query_results_get_binding_value, rasqal_query_results_get_binding_name, rasqal_query_results_get_binding_value_by_name, rasqal_query_results_get_bindings_count): Fail if result type is not bindings. (rasqal_query_results_get_triple): Added, to get the current triple from a graph result. (rasqal_query_results_next_triple): Added, to move to the next triple in a graph result. (rasqal_query_results_get_boolean): Added, always false for now. * rasqal/rasqal_literal.c (rasqal_literal_as_node): Handle variable values, convert the variable result. * rasqal/rasqal_internal.h: Added current_triple_result to rasqal_query * rasqal/rasqal.h: Added rasqal_query_results_is_bindings, rasqal_query_results_is_boolean, rasqal_query_results_get_boolean, rasqal_query_results_is_graph, rasqal_query_results_get_triple and rasqal_query_results_next_triple * rasqal/rasqal_engine.c (rasqal_engine_assign_variables): Build construct triples when CONSTRUCT * is given * rasqal/rasqal_expr.c (rasqal_new_triple_from_triple): Added copy constructor * rasqal/rasqal.h: Added rasqal_new_triple_from_triple * rasqal/tests/sparql/syntax/Makefile.am, rasqal/tests/sparql/syntax/construct1.rq, rasqal/tests/sparql/syntax/construct0.rq: CONSTRUCT syntax 2005-01-26 Dave Beckett * raptor/rapper.1: mention what RSS tag soup can do * raptor/turtle_parser.y, raptor/n3_parser.y: Rename raptor_new_triple/raptor_free_triple to have n3/turtle in the name. * raptor/raptor_internal.h, raptor/raptor_general.c, raptor/n3_parser.y, raptor/n3_lexer.l, raptor/n3_common.h, raptor/configure.ac, raptor/Makefile.am: Update Notation3 code with later Turtle improvements. Built it with maintainer mode only. * raptor/turtle_lexer.l (turtle_copy_token): Renamed from copy_token (turtle_copy_string_token): Renamed from copy_string_token. (main): filename moved here from global! 2005-01-24 Dave Beckett * raptor/raptor_rss.c (raptor_rss_emit_item): Do not emit an items property, that's only done by raptor_rss_emit_connection. * rasqal/rasqal_expr.c (rasqal_new_function_expression): Added to create a function call expression. (rasqal_free_expression, rasqal_expression_print): Handle RASQAL_EXPR_FUNCTION. * rasqal/rasqal.h: Added name, args fields to rasqal_expression Added rasqal_new_function_expression * rasqal/Makefile.am: Added rasqal_xsd_datatypes_test * rasqal/rasqal_xsd_datatypes.c: Rasqal XSD datatypes 2005-01-22 Dave Beckett * raptor/raptor_rss.c: Added RSS1.1 namespace http://inamidst.com/rss1.1/ (raptor_rss_parser_processNode): Turn Channel into RSS type channel. (raptor_rss_emit_type_triple, raptor_rss_emit_enclosure, raptor_rss_emit_item, raptor_rss_emit_connection, raptor_rss_emit): Add error return value and stop if there is no identifier. (raptor_rss_emit): Stop if channel or any item has no identifier. (raptor_rss_parse_chunk): Pass on failures from above to user. (raptor_rss10_build_xml_names): Replace RSS1.1 namespace with RSS1.0 (raptor_rss10_emit_item): Add item_type arg and use it to only emit items for the channel. 2005-01-21 Dave Beckett * raptor/raptor.h: Added const to src arg of raptor_ntriples_string_as_utf8_string. * rasqal/tests/rdql/testsuite/Makefile.am: S-03, S-04, S-05 work * rasqal/sparql_lexer.l (PREFIX): Allow \ (NAME): Allow \ ({NAME}, {PREFIX}, {QNAME}) Terminate when a name is not created. (sparql_copy_name, sparql_copy_qname): Use rasqal_escaped_name_to_utf8_string to turn the escaped name into just UTF-8, then check it is a legal XML name. * rasqal/rdql_lexer.l (PREFIX): Allow \ (NAME): Allow \ (<*>{NAME}, {QNAME}, <{QNAME}>) Terminate when a name is not created. (rdql_copy_name, rdql_copy_qname): Use rasqal_escaped_name_to_utf8_string to turn the escaped name into just UTF-8, then check it is a legal XML name. * rasqal/rasqal_internal.h: Added prototype for rasqal_escaped_name_to_utf8_string * rasqal/rasqal_general.c (rasqal_escaped_name_to_utf8_string): Added to turn a UTF-8 and/or \u-escaped name as a UTF-8 string. Intended as a lexer helper function. A combination of raptor_ntriples_string_as_utf8_string and raptor_ntriples_term with the parsing part stripped out, and just \u, \U allowed, always allowing UTF-8 and working just on full strings. * raptor/libraptor.3: Deprecate raptor_ntriples_string_as_utf8_string * raptor/raptor.h: Deprecate raptor_ntriples_string_as_utf8_string - rather too internal to be useful, since it only works with a parser. * raptor/ntriples_parse.c (raptor_ntriples_term_valid): Remove rdf_parser arg; only for a fatal error - just die. (raptor_ntriples_term): Make start a const arg. When copying UTF8 bytes, move on the correct number of bytes in src and dest. Update use of raptor_ntriples_term_valid. (raptor_ntriples_string_as_utf8_string, raptor_ntriples_parse_line): Update uses of raptor_ntriples_term_valid. 2005-01-18 Dave Beckett * rasqal/tests/rdql/testsuite/Makefile.am: Remove S-02 from expected failures now that the formatting matches the expected N-Triples escaped output. * rasqal/rasqal_literal.c (rasqal_literal_print): Print string as N-Triples-escaped using raptor_print_ntriples_string. 2005-01-17 Dave Beckett * raptor/raptor_general.c (raptor_statement_part_as_counted_string): Declare language_len to NULL, uri_string as unsigned char*. 2005-01-16 Dave Beckett * raptor/raptor_rss.c (raptor_rss10_emit_item): Copy original base_uri each time, a raptor_new_xml_element is made and don't lose the original reference. * raptor/raptor_xml_writer.c (main): Copy original base_uri each time, don't lose the original reference. * rasqal/rasqal_query.c (rasqal_query_results_write): Copy original base_uri each time, don't lose the original reference. * rasqal/rasqal_query.c (rasqal_query_results_write): Handle RASQAL_LITERAL_BLANK. Doh! * rasqal/win32_rasqal_config.h, rasqal/configure.ac: Bumped version to 0.9.6 * rasqal/Makefile.am: Add @RASQAL_EXTERNAL_LIBS@ $(MEM_LIBS) to all *_LDADD It seems to help mysterious shared library linking problems on Solaris. * rasqal/Makefile.am: Remove AM_LDFLAGS, libtool works that out from the LIBADD for librasqal and adds it into the .la and uses it from there. * rasqal/Makefile.am: Make the tests using automake rules rather than hand-crafted compile and link rules which were tricky to maintain. Added EXTRA_PROGRAMS for the tests. * rasqal/rasqal_query_test.c: Handle rdql or sparql tests * rasqal/rasqal_query_test.c: (main) Handle no rdql available with an warning and exit 0 2005-01-15 Dave Beckett * rasqal/rasqal_literal.c (rasqal_literal_compare): Move declarations to start of block. * rasqal/librasqal.3: Updates for 0.9.5 * rasqal/configure.ac: Require raptor 1.4.4 * raptor/raptor_general.c (raptor_statement_part_as_counted_string): Initialise language_len, uri_string used in some cases to prevent gcc warnings. * raptor/win32_raptor_config.h, raptor/configure.ac: Bumped version to 1.4.5 * raptor/Makefile.am: Add ChangeLog.2 ChangeLog.3 ChangeLog.4 * raptor/raptor_rss.c (raptor_rss10_emit_item): Portability - declare rdf_Seq* variables at start of block. * rasqal/rasqal_redland.c, rasqal/rasqal_raptor.c, rasqal/rasqal_engine.c: Casts for C++ * rasqal/sparql_parser.y (URIList): Copy the URI before freeing the rasqal_literal. 2005-01-14 Dave Beckett * Redland.i: Added librdf_model_contains_context * rasqal/tests/sparql/part1/dawg-result-004.n3, rasqal/tests/sparql/part1/manifest.n3, rasqal/tests/sparql/part1/dawg-query-004: Import dawg-query-004 dawg-result-004.n3 * librdf/rdf_model.h: Added librdf_model_contains_context * librdf/rdf_model.c (librdf_model_contains_context): Added, to find a context node in a model. (main): Added test. 2005-01-13 Dave Beckett * raptor/win32_raptor_config.h: win32 build update (patch from Dave Viner) * raptor/win32/Makefile.am: Added rapepr.dsp * raptor/win32/rapper.dsp, raptor/win32/raptor.dsp, raptor/win32/raptor.dsw, raptor/win32/raptortest.dsp: win32 build update (patch from Dave Viner) * raptor/win32_raptor_config.h: RAPTOR_INTERNAL should be defined in the build configuration * rasqal/win32_rasqal_config.h: RASQAL_INTERNAL should be defined in the build configuration * librdf/win32_rdf_config.h: Do not define REDLAND_INTERNAL at all. LIBRDF_INTERNAL should be defined in the build configuration * librdf/librdf.h: Use LIBRDF_INTERNAL not REDLAND_INTERNAL 2005-01-12 Dave Beckett * raptor/raptor_rss.c: Recognise old RSS 0.9 namespace and handle it as rss 1.0. * rasqal/sparql_lexer.l: Updated to use yyterminate() when an error is reported, either in the lexer or in a failing function called. Deleted use of ERROR_TOKEN. Mention SPARQL in all the error and warning messages. * rasqal/rdql_lexer.l: Updated to use yyterminate() when an error is reported, either in the lexer or in a failing function called. Deleted use of ERROR_TOKEN. Mention RDQL in all the error and warning messages. * rasqal/sparql_parser.y: Delete ERROR_TOKEN (PatternElementForms): Add SPARQL to warning message. (sparql_parse): Add SPARQL to error message. * rasqal/rdql_parser.y: Delete ERROR_TOKEN * Redland.i: Export librdf_query_results_to_file and librdf_query_results_to_string * rasqal/rasqal_expr.c (rasqal_expression_evaluate): For STR_MATCH, STR_NMATCH ensure the literal returned from the lhs expression evaluation is always freed. 2005-01-11 Dave Beckett * rasqal/rdql_parser.y (rdql_parse): set parsing debug flag before starting parse when RASQAL_DEBUG > 2 * librdf/rdf_serializer.c (main): Update latest raptor 1.4.3+ style serialised rdf/xml length. * librdf/rdf_serializer.c (librdf_serializer_serialize_model_to_file_handle): Require FILE* to be not null. * librdf/rdf_query_rasqal.c (rasqal_redland_bind_match): Update return to add parts arg, return. (librdf_query_rasqal_results_to_counted_string): Added to implement query results as string factory method, via Rasqal. (librdf_query_rasqal_results_to_file_handle): Added to implement query results to a file handle factory method, via Rasqal. * librdf/rdf_query_results.c (librdf_query_results_to_counted_string, librdf_query_results_to_string): Added to write formatted query results as a syntax in a string (via Rasqal). (librdf_query_results_to_file_handle, librdf_query_results_to_file): Added to write formatted query results as a syntax to a file or already open FILE* handle (via Rasqal) * librdf/rdf_query.c (main): Add query results to string test. * librdf/rdf_query.h: Added results_to_counted_string, results_to_file_handle to librdf_query_factory. Added prototypes for librdf_query_results_to_counted_string, librdf_query_results_to_string, librdf_query_results_to_file_handle and librdf_query_results_to_file to public api. * rasqal/rasqal_engine.c (rasqal_engine_do_optional_step): Handle an all optional query and finish all results when first optional finishes. * rasqal/rasqal_query.c (rasqal_query_results_write): Handle NULL base_uri, pass it on the XML writer. * rasqal/tests/sparql/examples/ex2-4a.rq: Kill the , between SELECT vars * rasqal/rasqal_xml.c: Removed, not used 2005-01-10 Dave Beckett * rasqal/rasqal_raptor.c (rasqal_raptor_finish_triples_match): Free any literals copied into the triple used for comparing matches. * rasqal/rasqal_raptor.c (rasqal_raptor_bind_match): Reformatting. (rasqal_raptor_new_triples_match): Set unbound triple matches literal values as shared pointers, not copies of literals. * rasqal/rasqal_redland.c (rasqal_redland_bind_match): Update return value. * rasqal/rasqal_engine.c (rasqal_free_graph_pattern): Zap triple_meta pointer when done. * rasqal/sparql_lexer.l, rasqal/rdql_lexer.l (.): Recover state after an error in a regex. * rasqal/rasqal_engine.c (rasqal_graph_pattern_order): Sort using pointers in data, not array pointers. * rasqal/rasqal_query.c (rasqal_free_query): Delete ordered_triples tidy. (rasqal_query_print): Delete ordered_triples tidy. * rasqal/rasqal_engine.c: (rasqal_query_order_triples_score, rasqal_query_order_triples): Deleted - no longer used. * rasqal/rasqal_internal.h: Deleted unused ordered_triples field from rasqal_query. 2005-01-09 Dave Beckett * rasqal/tests/sparql/part1/Makefile.am: All tests pass, empty EXPECTED_SPARQL_CORRECT_FAILURES * rasqal/rasqal_internal.h: Added max_optional_graph_pattern to query. * rasqal/rasqal_engine.c (rasqal_engine_do_step): Set gp->matched flag here (rasqal_engine_do_optional_step): Set gp->matched flag (rasqal_engine_get_next_result): Do not set gp->matched flag here. For an optional step, if no bound values were returned ensure search continues. * rasqal/rasqal_engine.c: Add a few more debug messages. * rasqal/rasqal_engine.c: delete a #if 1 * rasqal/rasqal_engine.c (rasqal_engine_move_to_graph_pattern): Use max_optional_graph_patterns to walk through combinations of optional graph patterns. (rasqal_engine_do_optional_step): CHeck against max_optional_graph_patterns limit and lower it when backtracking. (rasqal_engine_get_next_result): Count # returned values and continue searching when=0. This is a fixup hack, not a final solution. * rasqal/rasqal_engine.c (rasqal_engine_move_to_graph_pattern): Take a delta since only ever moving by +1 or -1. When there are no optionals, just move. When backtracking optionals, re-init the finished graph pattern. (rasqal_engine_do_step, rasqal_engine_do_optional_step): Update calls to above. 2005-01-08 Dave Beckett * rasqal/rasqal_engine.c (rasqal_reset_triple_meta): Added. (rasqal_free_graph_pattern, rasqal_graph_pattern_get_next_match): Call new rasqal_reset_triple_meta (rasqal_engine_do_optional_step): Comment out duff test * rasqal/rasqal_engine.c: messages * rasqal/rasqal_engine.c (rasqal_engine_do_optional_step): Copy tidying * rasqal/rasqal_engine.c (rasqal_engine_get_next_result): Debug messages. * rasqal/rasqal_engine.c (rasqal_engine_check_constraint): Added, from body of rasqal_engine_get_next_result. (rasqal_engine_do_step): Now just for mandatory graph patterns rasqal_engine_do_optional_step): Added, just for optional graph patterns. (rasqal_engine_get_next_result): Call rasqal_engine_do_step or rasqal_engine_do_optional_step depending on graph pattern optional flag. * rasqal/rasqal_engine.c (rasqal_engine_do_step): Added, from body of rasqal_engine_get_next_result (rasqal_engine_get_next_result): Smaller, see above. * rasqal/rasqal_engine.c: Added rasqal_engine_step and use in (rasqal_engine_get_next_result): Replace step=X; break with step=X; continue to let the loop do the work * rasqal/rasqal_engine.c: Added rasqal_engine_step and use in rasqal_engine_get_next_result * rasqal/rasqal_engine.c (rasqal_engine_move_to_graph_pattern): No need for return * rasqal/rasqal_engine.c (rasqal_engine_get_next_result): Init all matched flags to 0 at start. * rasqal/rasqal_engine.c: Comment out not-used triple ordering code. (rasqal_triples_match_bind_match): Add parts arg and pass on to factory bind_match method. (rasqal_new_graph_pattern_from_triples): Add query arg at start. Init query, finished, matches_returned. (rasqal_new_graph_pattern_from_sequence): Add query arg at start. Init query, finished, matches_returned. (rasqal_free_graph_pattern): Free variables matching the parts. (rasqal_graph_pattern_init): Initialise the triple meta parts depending on the variables_declared_in information. (rasqal_query_build_declared_in): Added to mark which in graph pattern variables are first declared in the query so that they are never bound multiple times. Also warns of selected but never used variables. (rasqal_graph_pattern_get_next_match): After a triple match ends, free variables matching the parts only. (rasqal_engine_prepare): Disable ordering triples. Call rasqal_query_build_declared_in. (rasqal_engine_move_to_graph_pattern): Helper added for: (rasqal_engine_get_next_result): Many changes trying to get optionals working. * rasqal/rasqal_internal.h: Add query, finished, matches fields to graph_pattern. Add query arg to start of rasqal_new_graph_pattern_from_triples and rasqal_new_graph_pattern_from_sequence Add variables_declared_in array field, optional_graph_pattern_matches_count field to query. * rasqal/rasqal_redland.c (rasqal_redland_bind_match): Take parts argument and use to just bind those parts of the triple. * rasqal/rasqal_raptor.c (rasqal_raptor_bind_match): Take parts argument and use to just bind those parts of the triple. * rasqal/rdql_parser.y, rasqal/sparql_parser.y: Add query arg at start of rasqal_new_graph_pattern_from_triples and rasqal_new_graph_pattern_from_sequence calls. * rasqal/rasqal.h: Added triple parts to rasqal_triple_meta. * rasqal/rasqal_query.c (rasqal_free_query): Tidy query->variables_declared_in. 2005-01-06 Dave Beckett * rasqal/rasqal.h: Added rasqal_triple_parts rasqal_triples_match factory method bind_match now takes and returns rasqal_triple_parts, returns 0 on failure * librdf/rdf_query_rasqal.c, rasqal/rasqal_redland.c, rasqal/rasqal_raptor.c, rasqal/rasqal_engine.c, rasqal/rasqal.h: Invert return value of rasqal_triples_match factory method bind_match. Now returns 0 on failure. * rasqal/rasqal_engine.c (rasqal_engine_get_next_result): Handle failed constraint by moving to next match. * rasqal/tests/sparql/part1/dawg-data-01.n3, rasqal/tests/sparql/part1/dawg-result-003.n3: to * rasqal/tests/sparql/check-sparql: Remove =NULL from roqet output to handle optionals * rasqal/rasqal_query.c (rasqal_new_query): Init gp->optional_graph_pattern. * rasqal/rasqal_internal.h: Add finished, matches, optional_graph_pattern to rasqal_graph_pattern Add optional_graph_pattern to rasqal_query. * rasqal/rasqal_engine.c (rasqal_new_graph_pattern_from_triples): Init gp->optional_graph_pattern. (rasqal_graph_pattern_init): Init optional_graph_pattern, finished and matches. (rasqal_graph_pattern_order): Added, to sort graph_patterns in a query into mandatory first, optional last. (rasqal_engine_execute_init): Sort graph_patterns using raptor_sequence_sort and above helper Initialise query->optional_graph_pattern to the index of the first optional graph_pattern. (rasqal_engine_get_next_result): Many changes on the way to getting optionals working. Track what patterns have ended with the finished flag, and count matches to determine when nothing matched. 2005-01-05 Dave Beckett * librdf/rdf_storage_sqlite.c: Implement get_contexts. (librdf_storage_sqlite_get_next_context_common, librdf_storage_sqlite_get_contexts_is_end, librdf_storage_sqlite_get_contexts_next_method, librdf_storage_sqlite_get_contexts_get_method, librdf_storage_sqlite_get_contexts_finished, librdf_storage_sqlite_get_contexts): Implement, based on find_statements technique. No special database schema support for contexts at present. 2005-01-04 Dave Beckett * raptor/raptor_serialize.c: (raptor_rdfxml_serialize_start, raptor_rdfxml_serialize_statement): Only copy non-NULL base URIs * raptor/raptor_rss.c: (raptor_rss10_move_statements, raptor_rss10_store_statement, raptor_rss10_build_xml_names, raptor_rss10_emit_item):Handle predicates of type RAPTOR_IDENTIFIER_TYPE_RESOURCE as well as type RAPTOR_IDENTIFIER_TYPE_PREDICATE * raptor/raptor_general.c (raptor_free_statement): Free predicate URIs that were RAPTOR_IDENTIFIER_TYPE_RESOURCE * raptor/raptor_uri.c (raptor_uri_to_relative_counted_uri_string): Handle no path in base URI (main): Add test for that and test for no path in both. * raptor/raptor_uri.c (raptor_uri_to_relative_counted_uri_string): Handle no path in reference URI (main): Add test for that * rasqal/rasqal_query.c (rasqal_new_query): Init sources sequence always. (rasqal_query_add_source): No need to init sources sequence here. * rasqal/sparql_parser.y (WhereClauseOpt): Don't overwrite query->graph_patterns sequence, append if necessary. * rasqal/sparql_parser.y (FromClauseOpt): Don't overwrite query->sources sequence, append if necessary. * rasqal/rdql_parser.y (Query): Don't overwrite query->sources sequence, append if necessary. (TriplePattern): Append to query->triples sequence, don't overwrite it. 2005-01-03 Dave Beckett * rasqal/roqet.c (main): Declare query_string as void* to prevent type punning warning. * rasqal/sparql_lexer.l, rasqal/roqet.c, rasqal/rdql_lexer.l, rasqal/rasqal_query.c: casts for c++ * raptor/win32_raptor_config.h, raptor/configure.ac: Bumped version to 1.4.4 * raptor/raptor_rdfxml.c (raptor_xml_start_element_handler): Updates for unsigned char* string namespace URI strings. * raptor/raptor_namespace.c: Turn namespace URI string constants into unsigned char* strings. * raptor/raptor_identifier.c (raptor_identifier_print): Casts for printing rdf:XMLLiteral URI string constant. * raptor/raptor_general.c: Turn rdf:XMLLiteral URI string constant into a unsigned char* string. (raptor_print_statement, raptor_print_statement_part_as_ntriples): Casts for printing above constants. * raptor/raptor_uri.c (raptor_default_new_uri_for_rdf_concept): Use RDF namespace URI string constants. * raptor/Makefile.am: Link libraptor.la for URI tests, to get the namespace URI string constants. * raptor/raptor.h: Turn namespace URI string constants into unsigned char* strings. Change namespace URI defines into uses of the constants. * raptor/rdfdump.c (main): Init parser_feature and serializer_feature to -1 to avoid compiler warnings. * raptor/raptor_rss.c (raptor_rss10_serialize_statement): Init item to NULL to avoid a compiler warning. * raptor/rdfdump.c, raptor/raptor_uri.c, raptor/raptor_serialize.c, raptor/raptor_rss.c, raptor/raptor_parse.c: Casts for c++ * raptor/raptor.h: remove old comment re xml writer 2005-01-02 Dave Beckett * raptor/rdfdump.c: set serializer features before starting to serialize * raptor/rdfdump.c: Actually set parser feature values again. Set strings for parser or serializer string feature values. * raptor/raptor_general.c: 2005 copyrights * raptor/rapper.1: No simple output format anymore * raptor/rapper.1: Added RSS 1.0 ref 2005-01-01 Dave Beckett * raptor/rapper.1: Update for new parser, serializers, xmlns syntax * raptor/raptor_serialize.c (raptor_serializer_set_feature_string): Docs, and return values for integer value features (raptor_serializer_get_feature_string): Return a new string for the start uri if set. * raptor/raptor_parse.c (raptor_parser_set_feature_string): Docs, and return values for integer value features * raptor/libraptor.3, raptor/raptor.h: Added raptor_uri_to_counted_string and raptor_uri_to_string * raptor/raptor_uri.c (raptor_uri_to_counted_string,raptor_uri_to_string): Added. * raptor/raptor_feature.c: doc * raptor/libraptor.3: changelog edit - cluster 1.4.3 entries by class * raptor/libraptor.3: Added raptor_parser_get_feature_string, raptor_parser_set_feature_string, raptor_serializer_set_feature_string, raptor_serializer_get_feature_string, raptor_feature_value_type, raptor_namespaces_find_namespace_by_uri * raptor/raptor_serialize.c, raptor/raptor_general.c: Use raptor_rdf_namespace_uri and raptor_rdf_namespace_uri_len to replace some constants. * raptor/raptor_serialize.c (raptor_rdfxml_serialize_statement): Handle ordinal subject and objects. * raptor/raptor_serialize.c: Add XML Writer to raptor_rdfxml_serializer_context, delete depth. (raptor_rdfxml_serialize_init): Delete depth stuff. (raptor_rdfxml_serialize_terminate): Tidy up xml writer, namespaces and rdf:RDF element. (raptor_rdfxml_serialize_declare_namespace): Don't copy uri, prefixes since raptor_new_namesapce_from_uri copies them anyway. (raptor_rdfxml_serialize_start): Convert to use xml writer. (raptor_rdfxml_serialize_write_xml_attribute): Deleted. (raptor_rdfxml_serialize_statement, raptor_rdfxml_serialize_end): Convert to use xml writer. * raptor/raptor_xml_writer.c (raptor_xml_writer_empty_element): Ensure namespace declarations are removed at end of element. * raptor/raptor.h: Added raptor_namespaces_find_namespace_by_uri * raptor/raptor_namespace.c (raptor_namespaces_find_namespace_by_uri): Added. * raptor/libraptor.3, raptor/raptor_sax2.c, raptor/raptor_rss.c, raptor/raptor.h: raptor_xml_declare_namespace renamed to raptor_xml_element_declare_namespace * raptor/raptor_rss.c (raptor_rss10_build_xml_names): Use raptor_xml_declare_namespace * raptor/raptor_rss.c: 9raptor_rss10_build_xml_names): Use raptor_xml_declare_namespace * raptor/raptor_sax2.c, raptor/raptor.h: raptor_sax2_declare_namespace renamed to raptor_xml_declare_namespace * raptor/raptor_serialize.c (raptor_new_serializer): Default to emitting relative URIs * raptor/raptor_serialize.c (raptor_rdfxml_serialize_ok_xml_name): Deleted. (raptor_rdfxml_serialize_statement): Replace use of raptor_rdfxml_serialize_ok_xml_name with raptor_xml_name_check for XML 1.0 names. * raptor/raptor_sax2.c, raptor/raptor_rdfxml.c, raptor/raptor.h, raptor/libraptor.3: Rename raptor_xml_element_get_element to raptor_xml_element_get_name * rasqal/roqet.c (roqet_xml_print_xml_attribute): Deleted (roqet_query_results_print_as_xml): Replaced with call to rasqal_query_results_write. (main): Set error and fatal_error handlers for query. Remove xml format warning. * rasqal/rasqal_query.c (rasqal_query_results_write): Added docs. Declare own namespace stack and free up elements. * rasqal/rasqal.h: Added rasqal_query_results_write * raptor/raptor_rss.c: Added rss:image and rss:textinput properties * raptor/raptor_rss.c (raptor_rss10_store_statement): Don't lose statements that are about a known type node, but of unknown predicate. (raptor_rss10_serialize_end): Add more debug info on remaining statements. * raptor/raptor_rdfxml.c (raptor_start_element_grammar): Update raptor_new_xml_writer call. * raptor/raptor.h: raptor_new_xml_writer gets nstack parameter. raptor_xml_writer_start_namespace_full deleted * raptor/libraptor.3: raptor_new_xml_writer gets nstack param. raptor_xml_writer_start_namespace_full gone * raptor/raptor_general.c (raptor_free_statement): Don't free null pointers. redland-1.0.17/RELEASE.html0000644000175000017500000036733312257575706012137 00000000000000 Redland librdf RDF API Library - Release Notes

Redland librdf RDF API Library - Release Notes

Redland 1.0.17 changes

Issues Fixed:

  • 0000529: MySql storage error on initial creation
  • 0000540: configure: remove obsolete --with-xml-parser/--with-openssl-digests
  • 0000541: configure pkg-config checks not overridable
  • 0000542: win32_rdf_config.h doesn't work on MSVC2008
  • 0000543: assertion in rasqal_query_results_next_triple called from librdf_query_rasqal_query_results_next_statement

Concept class changes

Added rdf:HTML and rdf:langString from RDF 1.1.

Storage class changes

Update deprecated MySQL engine type syntax. Patch from olberger on github.

Configuration and build fixes

Make configure restore CPPFLAGS after virtuoso test. Helps portabilty and Debian hardening.

Fixes to Win32 builds with MSVC2008 from Michael Stahl.

Internal fixes

Several alignment and error path fixes from clang and llvm.

Fix rasqal_query_results_next_triple() call with NULL. Patch from Michael Stahl.

Redland 1.0.16 changes

Issues Fixed:

  • 0000443: "1"^^xsd:boolean does not evaluate as true
  • 0000460: librdf error - storages already registered
  • 0000497: "1"^^xsd:boolean and "true"^^xsd:boolean are not true
  • 0000518: Blank node parsing error
  • 0000519: SPARQL query-related methods crash on certain literals

General changes

Requires Raptor 2.0.7 or newer

Model class changes

librdf_model_contains_statement() now returns > 0 only for invalid statements according to the API contract. NULL statements are considered invalid. Fixes Issue #0000489

Node class changes

All the constructors now normalize the nodes (Raptor terms) so that equality is a cheap pointer comparison. Fixes Issue #0000443.

Query class changes

librdf_query_results_get_binding_value() and librdf_query_results_get_binding_name() now fail when called with negative offsets.

Serializer class changes

Serializing (using Raptor) now sets the statement graph field to make serializing to N-Quads work.

Storage class changes

Loading the same storage multiple times no longer gives a runtime error.

librdf_storage_contains_statement() now returns > 0 only for invalid statements according to the API contract. Uses librdf_statement_is_complete() for testing statement validity.

hashes storage: Make matching a statement work when using graph names (redland contexts). Fixes Issue #0000515

mysql storage: Defaulted storage configuration host to 'localhost' if it is not given. Opening a store with missing configuration now reports the required keys.

postgres storage: Fixed a bad malloc result test during query allocation that probably caused librdf_model_find_statements() to fail. Fix from 'zoggy' on github - thanks. Made loading triples from a stream to postgresql actually work via librdf_model_add_statements(). Defaulted storage configuration host to 'localhost' if it is not given. Opening a store with missing configuration now reports the required keys.

Unicode module changes

Added librdf_latin1_to_utf8_2() with size_t args. Deprecates librdf_latin1_to_utf8().

Added librdf_utf8_to_latin1_2() with size_t args and new default arg for replacing out of range characters. Deprecates librdf_utf8_to_latin1().

World class changes

Added librdf_world_set_raptor_init_handler() and librdf_world_set_rasqal_init_handler() methods to set handlers for configuring internal raptor and rasqal after they have been constructed but before they are initialized; before raptor_world_open() or rasqal_world_open() are run, respectively. Added new typedefs librdf_raptor_init_handler and librdf_rasqal_init_handler for the handlers.

Other API changes

Added librdf_license_string and librdf_home_url_string static strings to public API following Raptor and Rasqal naming convention.

Other changes

No longer gives an error when the same storage module is attempted to be loaded more than once. This is a harmless error and can be generated by installations that include the shared library storage module in a '.so' file and the '.la' file associated with it. Fixes Issue #0000460

Multiple fixes for newer GCC warnings.

Multiple internal fixes for signed int conversions especially around size_t and allocation.

Removed old debugging memory allocation options --with-dmalloc for dmalloc and --with-memory-signing for internal signing of memory blocks. Valgrind and static analyzers replace this.

Multiple portability fixes for building out of the source tree. Out of source tree 'make check' and 'make dist' should both work. Thanks to Daniel Richard G. for the patches.

Multiple internal error path cleanup issues and int/size_t issues found via clang static analyzer.

configure now looks for Oracle DB (aka Sleepycat DB aka Berkeley DB) 5.3

autogen.sh now supports the NOCONFIGURE variable like Lib{XML2,XSLT}, aborts the run if an progrma fails and creates the NEWS if it does not exist to aid building from GIT and 'make dist'.

Redland 1.0.15 changes

Issues Fixed:

  • 0000461: librdf error - query language vsparql already registered
  • 0000468: xlc on AIX configure tests for both HAVE_BDB_OPEN_7_ARGS and HAVE_BDB_OPEN_6_ARGS pass
  • 0000475: Freeing a counted_string returned by redland on a modern Windows system crashes
  • 0000478: Object returned from librdf_stream_get_object must be copied, but may not copiable
  • 0000483: Documentation of librdf_parser_get_namespaces_seen_count return is incorrect
  • 0000485: No rule to make target `-lltdl', needed by `librdf.la'. Stop.

General changes

Added new API functions librdf_alloc_memory(), librdf_calloc_memory() and librdf_free_memory() to allow freeing memory allocated inside librdf shared library, such as on windows with DLLs. (Lauri Aalto) Fixes Issue #0000475

Hash class changes

Export librdf_new_hash() to the public API.

BDB Hash now uses the newer 7 args open form in preference to the 6 args form. (Peter O'Gorman / pogma). Fixes Issue #0000468

Statement class changes

Reverted librdf_new_statement_from_statement() to the pre-raptor_term deep copy contract for the function. (Lauri Aalto) Fixes Issue #0000478

Added librdf_new_statement_from_statement2() providing a shallow copy of statement which was the post-raptor_term semantics of librdf_new_statement_from_statement(). (Lauri Aalto) Fixes Issue #0000478

Storage class changes

Virtuoso storage:

  • Added switch for VIRTUOSO_DV_TIMESTAMP_OBJ.
  • Prevent virtuoso query being registered twice in non-modular build Fixes Issue #0000461.

Other changes

Fixed the parser test to actually test 3 parsers rather than a non-deterministic number. Emits warnings when parser constructor fails since a syntax may not be supported.

Set up the libltdl build dependencies and linking flags properly. Fixes Issue #0000485

Portability changes were made to rdfproc for windows.

Add the REDLAND_CALLBACK_STDCALL attribute macro in the serializer log handler for windows.

Multiple librdf and rdfproc(1) changes to allocate and free memory using librdf_alloc_memory, librdf_calloc_memory and librdf_free_memory to ensure memory is allocated correctly across libraries (DLLs). (Lauri Aalto).

Several code style changes were made.

Redland 1.0.14 Changes

Rasqal minimum version is now 0.9.25 for the new rasqal_world_get_query_language_description() function.

Issues Fixed:

  • Issue #0000375: Add functionality to parse from iostream (or similar)
  • Issue #0000418: SQLite driver adds duplicate statements if a conext is given.
  • Issue #0000432: Seg fault when getting a blank node after parsing RDF
  • Issue #0000447: fatal error: rdf_types.h: No such file or directory

Hash Class Changes

BDB Hash (name 'bdb'): Add checks for Oracle Berkeley DB 5.1, 5.0 and 4.9 and updated configure messages with the new name. The 5.x storage has the same API but has a new on-disk format that will require a use of the db-upgrade(1) utility in the utils directory.

Fixed librdf_hash_get_as_boolean() 'false' string fixed to actually be a False value.

Node Class Changes

librdf_node_write() is defined to now always write N-Triples format.

Blank node ID generation and mapping from parsing is now consistently made across Redland librdf rather than relying on some Raptor defaults. Fixes Issue #0000432

Fixed URI reference leak in librdf_new_node_from_uri_local_name() and librdf_new_node_from_normalised_uri_string() constructors.

Parser Class Changes

Do not report programmer errors via logging, just runtime errors.

Added librdf_parser_parse_iostream_as_stream() and librdf_parser_parse_iostream_into_model() from patch by Norman Gray with style fixes by Lauri Aalto. Thanks. Fixes Issue #0000375

Query Class Changes

Added librdf_query_language_get_description() to return the full description of of the query language. Deprecates librdf_query_languages_enumerate()

Statement Class Changes

Restored librdf_statement_decode_parts() to the public ABI/API which was accidently removed. It has been deprecated for librdf_statement_decode2() for some time and now always fails.

Storage Class Changes

Storage Hashes (name 'hashes'): Fixed a reference leak and shared values issue when cloning a storage. The BDB hash type (current default) was updated for Oracle DB 5.1; see above.

Storage SQLite (name 'sqlite'): Do not add duplicate statements if a context is given. Fixes Issue #0000418. Fixed a librdf_node reference leak when serializing model with context nodes.

UTF8 Module

Made functions that were already declared in a public header file and documentation into part of the API.

Added but deprecated for Raptor equivalents (they are wrappers for them):

  int librdf_unicode_char_to_utf8(librdf_unichar c,
    unsigned char *output, int length);

  int librdf_utf8_to_unicode_char(librdf_unichar *output,
    const unsigned char *input, int length);

Added:

  unsigned char* librdf_utf8_to_latin1(const unsigned char *input,
    int length, int *output_length);

  unsigned char* librdf_latin1_to_utf8(const unsigned char *input,
    int length, int *output_length);

  void librdf_utf8_print(const unsigned char *input, int length,
    FILE *stream);

Other Changes

The internal Redland librdf AVL Tree implementation was removed and the 'trees' storage changed to use the AVL Tree implementation in Raptor (raptor_avltree) which is newer and has bug fixes beyond the Redland librdf version.

Redland librdf was ran through the LLVM clang static code analyzer and several issues fixed, mostly in unused variables and values computed that were needed but also included a few use of uninitialized variables especially in error cases. one problem fixed was in librdf_world_set_feature() to actually set the value for the genid base and genid counter features (LIBRDF_WORLD_FEATURE_GENID_BASE and LIBRDF_WORLD_FEATURE_GENID_COUNTER respectively)

configure now tries harder to find the Oracle Berkeley DB library using Debian multiarch directories if present. This is yet another heuristic and rather a hack. For a consistent approach the --with-bdb, --with-bdb-lib, --with-bdb-include and --with-bdb-dbname options to configure should be used.

Use raptor.h header from Raptor V2.

Removed Raptor V1 support code as librdf no longer supports Raptor V1.

Updated RPM spec file to make Redland librdf package require Raptor V2 (raptor2 package) and Rasqal (rasqal package).

Add sanity checking when initialising Raptor so that there are always parsers and serializers, or something went very wrong and librdf will not work, so return an error.

Removed internal cache module that no code used, didn't seem to entirely work and was never in the public API.

Now configure generates the (untested) win32_rdf_config.h for (untested) WIN32 builds.

Redland 1.0.13 Changes

Raptor minimum version is now 2.0.0. Raptor V1 support was removed.

Rasqal minimum version is now 0.9.22. Removed use of deprecated Rasqal functions that were conditioned on older rasqal versions.

Issues Fixed:

Node class changes

Mark librdf_node_to_string() and librdf_node_to_counted_string() as deprecated.

Parser class changes

librdf_new_parser() now logs failure to find a parser for the given name, type and/or uri rather than just returning NULL.

Added librdf_parser_get_description() deprecating librdf_parser_enumerate(). Fixes Issue #0000325

Query results class changes

Added (librdf_query_results_formats_get_description() deprecating librdf_query_results_formats_enumerate().

Removed toy 'triples' query language. Use 'sparql' instead.

Serializer class changes

librdf_new_serializer() now log failure to find a serializer by the given name, type and/or uri rather than just returning NULL.

Added librdf_serializer_get_description() deprecating librdf_serializer_enumerate(). Fixes Issue #0000325

The graph name is now provided to Raptor serializers so that they can write out quads, if supported. At present this works with the 'nquads' serializer.

Storage class changes

librdf_new_storage(), librdf_new_storage_with_options() now log failure to find storage by the given name rather than just returning NULL.

Other changes

Add new generated version defines to librdf.h: LIBRDF_VERSION, LIBRDF_VERSION_STRING, LIBRDF_VERSION_MAJOR, LIBRDF_VERSION_MAJOR LIBRDF_VERSION_MINOR and LIBRDF_VERSION_DECIMAL (already in earlier versions).

Removed all code in user build of library that calls abort() and replaced with an error log, then failure.

Redland 1.0.12 Changes

The main changes in this release are:

  • Enable librdf.h to be used as the top-level header in addition to redland.h
  • Fix linking issues when building with GNU ld with DT_NEEDED disabled

Issues Fixed:

General changes

The main header file for Redland librdf is redland.h but some applications used librdf.h direct, which no longer works in 1.0.11 since some Rasqal symbols were needed. librdf.h now includes the raptor and rasqal headers and redland.h is a simple wrapper around librdf.h

Redland librdf now links with symbols in libraries used indirectly (only Raptor) to help systems that use GNU ld with a different linking model to previous versions. This is quite technical and hard to understand but see Fedora's change in implicit DSO linking and Understanding the (Proposed) Change to DSO Linking that were introduced in Fedora Core 13 released in February 2010. Redland librdf was packed with patches to fix this, which are now merged into the sources.

Stream Class changes

Added librdf_stream_get_context2() returning a librdf_node* deprecating librdf_stream_get_context() that returns a void pointer. Fixes Issue #0000392.

SWIG Bindings Interface

Export librdf_statement_is_complete to bindings languages. Fixes Issue #0000329

Configuration changes

Rasqal minimum version has been 0.9.19 for some time but is now enforced in configure.

Updated configure to work with newer autoconf that enforces AC_LANG_SOURCE.

Other changes

Updated examples to build with Raptor V2 also.

The node and statement destructors for the Raptor V2 build now allow NULL pointers like the Raptor V1 versions. Related to Issue #0000391 which had already been fixed for other classes.

Redland 1.0.11 Changes

The main changes in this release are:

  • Virtuoso storage backend querying now fully works
  • Support building with Raptor V2 API as well as Raptor V1 API. The Raptor V2 API is only used if --enable-raptor2 is given to configure.
  • Several new convenience APIs were added
  • Several APIs were deprecated for better APIs calls

Issues Fixed:

  • Issue #0000124: Node, Statement and Model to_string should use N3 syntax
  • Issue #0000284: Added storage and query interface support for Virtuoso QUAD store
  • Issue #0000321: librdf_free_node after librdf_iterator_get_object in rdfproc
  • Issue #0000322: rdfproc uses rasqal_ functions instead of librdf_ in option parsing
  • Issue #0000334: rdfproc chatters unmercifully; hard to use in scripts
  • Issue #0000338: librdf_query_results_to_counted_string cannot format a query result if the format name has no URI (csv, tsv)
  • Issue #0000341: undefined symbol error from virtuoso storage .so
  • Issue #0000344: It is hard to use table, csv, tsv results formats
  • Issue #0000350: Redland Tree Storage crashes when loading two specific, valid, RDFMXL files
  • Issue #0000363: Add method to the public API to allow enumeration of the query factories
  • Issue #0000366: SELECTing list of named graphs doesn't return any results
  • Issue #0000371: SPARQL queries in rdfproc using Virtuoso don't work
  • Issue #0000380: SPARQL queries using Virtuoso do not work
  • Issue #0000382: simple graph query returns no results
  • Issue #0000383: rdfproc -n does not always make the store empty

Raptor V2 API support

This release adds support for building with Raptor V2 API as an alternate to the Raptor V1 API. When built with Raptor V2 , librdf uses the Raptor V2 URI, Term and Statement to fully implement the librdf equivalents. Specifically when this is enabled the following are typedefed as equivalent:

  • librdf_uri = raptor_uri
  • librdf_node = raptor_term
  • librdf_statement = raptor_statement

Configuration and build changes

Added --enable-raptor2 to enable librdf to build with Raptor V2 API. This requires a rasqal built with Raptor V2 API (with the --enable-raptor2 argument to Rasqal's configure). The librdf configure will check that Rasqal was built this way and only enable Raptor V2 API support if it will work.

The minimum Raptor version is now 1.4.19 (or Raptor V2 beta 1.9.0+)

Tests now use the in-memory storage if the BDB (Sleepycat DB) storage is not available.

Updated to prevent an error when used with autoconf 2.68+

Hash Class Changes

Exposed librdf_hash_from_string() function to public API for converting from a string to a librdf_hash object. This is useful for building storage options.

Added librdf_hash_to_string() function for converting a librdf_hash back ito a string, intended to be the opposite of librdf_string_to_hash() and takes a filter arg to help hide arguments such as 'password'.

Log Class Changes

Added a LIBRDF_FROM_RAPTOR log facility.

Model Class Changes

Added librdf_model_write() deprecating librdf_model_print() debug routine.

Node Class Changes

Added librdf_new_node_from_counted_uri_string() to make an RDF node from a URI string and length avoiding a strlen().

Added librdf_node_get_counted_blank_identifier() to return ID with length.

Added librdf_new_node_from_counted_blank_identifier() with counted ID string.

Added librdf_node_new_static_node_iterator() with world arg added deprecating librdf_node_static_iterator_create() without it.

librdf_node_write() added to write a redland node to an iostream, formatted as N-Triples.

Adjusted librdf_node_print() to use librdf_node_write(). If anyone was relying on this unsupported debug format, this changes the result. Fixes Issue#0000124

Deprecate librdf_node_to_string(), librdf_node_to_counted_string() for librdf_node_write() since these were really only meant for internal use.

Adjusted librdf_node_to_string(), librdf_node_to_counted_string() to use construct an iostream to a string and use librdf_node_write() to create the strings. Thus the format is now an N-Triples term rather than the older debug format. These functions are still for debugging and deprecated for librdf_node_write().

Query Class Changes

Fix rasqal query engine integration to allow querying over the Redland graph names (context URIs) and binding variables to the names. Fixes Issue #000382.

Fix query engine to prevent runtime warning for models with no contexts (graphs) when using GRAPH in a query.

Added librdf_query_languages_enumerate() function to list supported query languages.

Made the Virtuoso storage engine (name 'virtuoso') use the internal Rasqal query results formatting API rather than an internal copy of a few query result formatters.

Query Results Class Changes

Added librdf_new_query_results_formatter2() with name, mime type and fomrat URI args deprecating librdf_new_query_results_formatter() and librdf_new_query_results_formatter_by_mime_type() with a mixture.

Altered all query result formatters to all take format name, mime_type and uri args. Added librdf_query_results_to_counted_string2(), librdf_query_results_to_string2(), librdf_query_results_to_file_handle2(), librdf_query_results_to_file2() deprecating the functions without the 2 suffix.

Serializer Class Changes

librdf_serializer_serialize_stream_to_iostream() and librdf_serializer_serialize_model_to_iostream() now document their ownership transfer of the raptor_iostream object. Fixes Issue #0000372

Statement Class Changes

Added librdf_statement_encode2(), librdf_statement_encode_parts2(), librdf_statement_decode2() taking a world arg, deprecating those without the 2 suffx and no world arg.

Added librdf_statement_write() using librdf_node_write() to format the statement as N-Triples.

Adjusted librdf_statement_to_string() to use librdf_statement_write() to write statement in N-Triples format rather than the previous format.

Stream Class Changes

Added librdf_stream_write() deprecating librdf_stream_print() debug routine.

Storage Class Changes

librdf_storage_context_remove_statement() now checks that statement is non-NULL and allows NULL context. Now matches function spec.

Storage Postgresql (name 'postgresql'). Fix the contains-statement method as called by librdf_storage_contains_statement() to work using patch from Andrew Malton - thanks.

Storage Trees (name 'trees'). Fix the crash bug when comparing nodes one of which has a language and the other doesn't. Issue #0000350.

Storage Virtuoso (name 'virtuoso'). Fix to use the internal Rasqal query formatting API to allow returning any result format. This is not using a very efficient mechanism since it results in about 3 copies of the result set: in librasqa;, librdf and virtuoso but it works and does not duplicate code. Update the storage to support newer Virtuoso versions such as recent ODBC extensions. Added support for SQL_DESC_COL_LITERAL_LANG SQL_DESC_COL_LITERAL_TYPE and SQL_DESC_COL_BOX_FLAGS from Virtuoso ODBC Implementation - Virtuoso ODBC RDF Extensions for SPASQL. Tested with Virtuoso 5.0.13 open source edition.

URI Class Changes

Added librdf_new_uri2() taking a counted URI string argument, avoiding strlen()s.

World Class Changes

Export librdf_world_set_raptor() and librdf_world_get_raptor() to get/set the raptor world. These are only used when librdf is built with Raptor V2.

Internal changes

struct librdf_query_factory_s methods new_results_formatter and new_results_formatter_by_mime_type are replaced by one new_results_formatter method that takes name, mime type and format URI args. It also gains a new_results_formatter2 factory method for query results formatting. The only implementor of this factory is the internal Rasqal query results formatter.

Language Bindings (SWIG) changes

Exposed several functions (some new) that make sense to higher-level libraries bound to librdf via SWIG:

  • librdf_hash_from_string() to build a hash from a string; useful for encoding storage options.
  • librdf_hash_to_string() to turn a hash into a string; useful for decoding storage options.
  • librdf_model_add_typed_literal_statement() to add a typed literal statement direct to a graph.
  • librdf_new_node_from_normalised_uri_string() to create a URI node.
  • librdf_new_node_from_uri_local_name() to create a URI node
  • librdf_node_get_li_ordinal() to get the 1 from a rdf:_1 predicate node.
  • librdf_parser_check_name() for checking parser names.
  • librdf_query_results_is_syntax() to check if query result is a syntax.
  • librdf_query_results_to_file2() supplementing the deprecated librdf_query_results_to_file()
  • librdf_query_results_to_string2() supplementing the deprecated librdf_query_results_to_string()
  • librdf_serializer_check_name() for checking serializer names.
  • librdf_serializer_serialize_stream_to_file() to go along with it's pair that serializes a model to a file.
  • librdf_serializer_serialize_stream_to_string() to go along with the pair that serializes a model to string.
  • librdf_world_set_logger() to set for logging callbacks.

Other changes

rdfproc(1) utility now send non-result information messages to stderr, indented to make this more useful for scripting. It also gains '-q' (--quiet) and '-V' options (--verbose) to control this output - entirely removing it (quiet) or being more verbose. That is '-q -v' is equivalent to the default verbosity. Change based on patch by Norman Gray in issue - thanks! Fixes Issue #0000334

rdfproc(1) utility now fails with error when using -n (make a new storage) to a read only operation such as a query. Fixes Issue #0000383.

Switched to GIT source control.

Added HACKING.md documenting code style.

Added examples/example8.c to show how to serializer query results to strings when queries return either variable bindings or triples forms.

Redland 1.0.10 Changes

The main changes in this release are:

Added a Virtuoso storage by Patrick van Kleef
Support Rasqal 0.9.17 API
Fix compiling against sqlite 3.6.17 or newer
Fix modular storage dynamic loading linking problems.

Building requires installed Raptor (1.4.17 or newer) and Rasqal (0.9.16 or newer) libraries, preferably with pkg-config to provide the compile/link details.

Issues Fixed:

  • Issue #0000302: Modular storages fail to load from any other library or language binding (drobilla)
  • Issue #0000304: librdf_storage_trees_remove_statement returns wrong value (I think)
  • Issue #0000311: Incorrect literal comparison in tree structure
  • Issue #0000315: cannot compile library on linux 2.6.31
  • Issue #0000317: rdf_init_test fails if threads are enables

Configuration and build changes

Default to environment LIBS, CPPFLAGS, LDFLAGS in configure to address Gentoo issue 267405

Make redland-src-config work for external raptor and rasqal again. This is for the maintainers only.

Put modular build libltdl includes and libs into INTERNAL macros

Parser Class Changes

librdf_parser_check_name() added to check if a parser name is valid:

  int librdf_parser_check_name(librdf_world* world, const char *name);

Query Class Changes

Support Rasqal 0.9.17 API changes including versioned triple factory and triple sources, RASQAL_LITERAL_UDT user-defined datatype literals. Use rasqal_literal_get_rdf_term_type when available or fall back to internal version.

Serializer Class Changes

librdf_serializer_check_name() added to check if a serializer name is valid:

  int librdf_serializer_check_name(librdf_world* world, const char *name);

Storage Class Changes

Update storage module link dependencies so that they depend on librdf library to prevent unresolved symbol errors.

More validation of storage module names.

Storages 'file' and 'uri'. These get new storage option format with a name value to set the on disk / remote URI) syntax format. For the both storages it has to be a legal parser name and for the file storage it has to be a legal serializer name too. This pretty much limits the values to ntriples, rdfxml and turtle for the file storage (depending on how raptor is built).

Storage 'postgresql'. Replace deprecated PQescapeString with PQescapeStringConn that takes a PGconn connection handle and when encoding takes into consideration any connection properties such as character encodings in force.

Storage 'sqlite'. Change define SQLITE_API to REDLAND_SQLITE_API to allow redland to compile with sqlite 3.6.17 or newer where the SQLITE_API macro is defined. Thanks to Samuli Suominen for the report and fix.

Storage 'virtuoso'. Added a Virtuoso storage patch from Issue#0000284 by Patrick van Kleef with some parts omitted for passing through SPARQL queries that used rasqal internals.

Other changes

Export the list helper class to the public API, primarily for use by external storage modules.

rdfproc utility: for the 'parse' command, get the warning count from the warning_count_node, not the (just freed) error_count_node.

Fix totally bogus memset in librdf_cache_set_common() that zeroed junk on the stack rather than the memory expected.

Redland 1.0.9 Changes

The main changes in this release are:

Made storages modular by default - separate dynamically loaded modules discovered from presence in the PREFIX/lib/redland directory. or from the directory defined in the REDLAND_MODULE_PATH environment variable directory.

Building requires installed Raptor (1.4.18 or newer) and Rasqal libraries.

Issues Fixed:

General Changes

Developer builds from Subversion now require libtool 2.2.0 or newer to libtoolize from configure.ac.

configure now discovers Berkeley DB 4.7

configure options --with-raptor=internal and --with-rasqal=internal were removed.

Removed openssl digest support - not used much and an extra large dependency. MD5 and SHA1 remain builtin.

Statement Class Changes

Fix to librdf_statement_encode_parts() for buffer overrun error that could occur with certain size buffers. Patch from Lou Sakey - thanks.

Storage Class Changes

Made the redland storage module API librdf_storage_factory public. What was called the storage context is now less confusingly called the storage instance.

Moved iterator and stream get_method flags to public API as new enums since they are used by the storage modules API.

Moved librdf_log() and librdf_log_simple() into public API to allow external storage modules to log messages.

More checks for failure during storage instance allocation.

postgresql storage: Fixes for "Numerous leaks, potential NULL pointer use, and dropped postgresql errors and buffer overruns in the postgresql storage module" based on patches in Issue #0000286.

sqlite storage: Fixes to prevent deadlocks with BEGIN IMMEDIATE instead of the default BEGIN DEFERRED. No longer writes to the sqlite database when just querying. Several other fixes.

trees storage: Several fixes.

Other Changes

Multiple Win32 build fixes based on patches from Lou Sakey - thanks.

Added librdf_parser_guess_name2() to SWIG API.

Internal Changes

Added LRU cache for internal use.

Several autogen.sh updates for libltdl.

Use libtool's libltdl to dynamially load storage modules. Will link in a copy from sources if not present in the system from libtool.

Internal raptor and rasqal sources removed - now use pkg-config(1) to find external libraries to compile and link to.

Fixes for AVL Tree: update parent pointers when deleting - patch from Aymeric Barthe - thanks.

Added internal support for upcoming Raptor V2 API. Not yet enabled. Added librdf_world_get_raptor() and librdf_world_set_raptor() methods. Added librdf_parser_guess_name2() with librdf_world parameter and deprecated librdf_parser_guess_name() without it.

Wrapped deprecated functions with REDLAND_DISABLE_DEPRECATED blocks.

Redland 1.0.8 Changes

The main changes in this release are:

Updated to use Rasqal 0.9.16 (Rasqal 0.9.16 release notes) from 0.9.15. NOTE: Rasqal's ABI and API changed so Redland 1.0.8 requires 0.9.16 or newer.

Updated to use Raptor 1.4.18 (Raptor 1.4.18 release notes) from 1.4.16.

Added a new in-memory indexed storage 'trees' using AVL Trees

Issues Fixed:

  • 0000256: mysql reconnect not working (MySQL v5 only?)

NOTE: The next release of redland will NOT include raptor and rasqal in the tarball, they will be separate download dependencies.

NOTE: In the next release of redland, the redland-config utility that provides the compile and link args will be deprecated, generate a warning when run and will turn into a wrapper for pkg-config redland ... It will be removed in a future release.

General Changes

configure was updated to ensure that redland 1.0.8+ will work with rasqal 0.9.16 to 0.9.99 only.

Parser Class Changes

librdf_parser_set_feature() now handles setting feature values as strings or integers, depending on the required type (although Raptor will handle this too).

Added librdf_parser_parse_file_handle_as_stream() and librdf_parser_parse_file_handle_into_model() helper methods.

Serializer Class Changes

librdf_serializer_set_feature() now handles setting feature values as strings or integers, depending on the required type (although Raptor will handle this too).

Storage Class Changes

Added a new in-memory storage named "trees" by Dave Robillard that uses AVLTrees internally for faster indexed triple store/querying. This is an alpha quality storage since it is brand new and it may be changed in future.

Other Changes

LIBRDF_URI_RDF_MS, LIBRDF_URI_RDF_SCHEMA public API macros changed definition to pass in a world parameter.

Added librdf_get_concept_ms_namespace() and librdf_get_concept_schema_namespace() to make the concept macros above work.

Added an rss2atom example program.

Update configure to use autoconf 2.5.x AC_CHECK_TYPES for testing byte, u32 and u64.

Fixes for resilence under low memory and allocation failures.

Internal Changes

Applied some updates from running the Linux 'sparse' utility.

Allow get_context method calls in stream/iterator map functions. Originally reported on redland-dev 6 May 2008 by John Fieber.

The storage method librdf_storage_find_statements_in_context() now uses the storage factory method find_statements_in_context if it exists, instead of always using the find_statements factory method and filtering.

Redland 1.0.7 Changes

The main changes in this release are:

Updated to use Rasqal 0.9.15 (Rasqal 0.9.15 release notes) from 0.9.14. NOTE: Rasqal's API will change in 0.9.16 so Redland 1.0.7 requires 0.9.15 exactly - no newer, no older.

Updated to use Raptor 1.4.16 (Raptor 1.4.16 release notes) from 1.4.15.

Added modular storage backends. When --enable-modular is given to configure, all the storage major backends are compiled as dynamically loadable modules. The memory, file and uri storages are always available. This is not enabled by default as it is a new feature.

Issues Fixed:

  • 0000187: "rdf_query_results.c", line 630: void function cannot return value
  • 0000189: librdf_uri_is_file_uri: wrong return value
  • 0000203: API declarations for Symbian portability
  • 0000205: Memory leak in rdf_query_rasqal.c
  • 0000209: Null dereference + assertion failures in minimal librdf setup-cleanup
  • 0000213: Multiple instances of world object make trouble
  • 0000215: librdf_new_node_from_typed_counted_literal() does not respect parameter lengths
  • 0000218: librdf_query_execute does not assert model parameter
  • 0000229: Segmentation fault when invoking librdf_new_model_from_model()
  • 0000230: on Gentoo/FreeBSD redland fails compilation due to a missing #define pthread.h
  • 0000234: autogen.sh $dir quoting
  • 0000235: $(EXEEXT) in tests
  • 0000236: EOL issues when building svn version on cygwin

General Changes

configure was updated to ensure that redland 1.0.7 will work with rasqal 0.9.15 only due to the future API change coming in the next rasqal version.

Make lots of writable static data truly constant especially from writable static data from rdf_concepts. This causes a SOURCE COMPATIBILITY BREAK: the rdf_concepts.h public API node and uri macros now require a librdf_world* parameter.

Parser Class Changes

Added librdf_parser_set_uri_filter() and librdf_parser_get_uri_filter() to set and get parser URI filters, passed on into raptor.

Storage Class Changes

Several SQLite storage improvements and fixes were made:

  • Added transaction support
  • Handle SQL errors more gracefully
  • the contains_statement method now works with a blank subject node.
  • Resource allocation and low mwmory fixes

URI Class Changes

Added librdf_uri_compare() to compare uri objects rather than rely on stringifying them and comparing the strings.

Internal and Other Changes

Many low memory and error path, resource leak fixes for parsers, streams, module factory construction and module initialising.

librdf_serializer_set_namespace() now allows NULL uri and prefix to be given.

librdf_storage_mysql_transaction_commit() now terminates if there is no work to commit.

autogen.sh version comparsion was fixed so that 1.10 is seen as newer than 1.9.

Redland 1.0.6 Changes

The main changes in this release are:

Updated to use Rasqal 0.9.14 (Rasqal 0.9.14 release notes) from 0.9.13.

Updated to use Raptor 1.4.15 (Raptor 1.4.15 release notes) from 1.4.13.

Plus a new transactions API for changes to the graph, implemented and tested for MySQL.

Added a new query results formatter class to turn a query results object into a syntax.

Model Class Changes

Added a model transaction API:

  • librdf_model_transaction_start() to begin the transaction
  • librdf_model_transaction_start_with_handle() to begin it using an existing connection pointer (such as a MySQL connection)
  • librdf_model_transaction_commit() to commit the changes
  • librdf_model_transaction_rollback() to abort them (automatic if not commited before a close)
  • librdf_model_transaction_get_handle() to get a handle associated with a connection.

Fixes Issue #0000038

Implemented the Transaction API for MySQL (tested) and PostgreSQL (not tested).

Invert test in librdf_model_add_submodel(). Fixes Issue#0000175

Parser Class Changes

Added librdf_parser_guess_name() to guess a parser name from content, similar to how a parser is constructed from content.

Added functions to return the namespaces declared during a parse: librdf_parser_get_namespaces_seen_count() to return the number seen, librdf_parser_get_namespaces_seen_prefix() to get the prefix string and librdf_parser_get_namespaces_seen_uri() to get the librdf_uri*.

Query and Query Results Class Changes

Added a new Query Results Formatter class building librdf_query_results_formatter* objects to turn a query results into a syntax such as SPARQL query results formats, JSON. New functions:

  • Constructors: librdf_new_query_results_formatter() and librdf_new_query_results_formatter_by_mime_type().
  • Destructor: librdf_free_query_results_formatter()
  • Method: librdf_query_results_formatter_write() to write the query results to an iostream.
  • Helper functions: librdf_query_results_formats_check() and librdf_query_results_formats_enumerate()

Added librdf_query_results_is_syntax() to check if a query result is a syntax, and not any of the other possibilities - bindings, boolean or graph.

Serializer Class Changes

Default to serializer named "rdfxml" if no name is given to ensure another rdfxml serializer such as XMP is not returned.

Storage Class Changes

The MySQL storage implements the transaction API. It batches up all the pending insertions and aggregates them so that any set of triple writes during the transaction sequence are all done at one point, with 4 INSERTs only.

Added a supporting functions librdf_hash_interpret_template() to interpolate variables into strings using a librdf_hash of key/values.

The MySQL storage now takes an optional storage option 'layout' that can choose between the v1 and v2 SQL schemas (only the table type has changed). The SQL fragments are described in Turtle files that are installed and read on startup.

Configuration and Build Changes

Packagers note: two new files are installed into PREFIX/lib/redland for the MySQL schemas. Without them installed, the MySQL storage will not work.

Removed the configure script option --enable-parsers since Raptor is always required and always used inside Redland whether or not any parsers were configured.

Use pkg-config Libs.private in redland.pc for internal dynamically linked libraries.

redland-config gains an --private-libs option to hold private libraries moved from --libs which now only contains -L and a -lrdf.

Added a building utility touch-mtime.pl to handle touch -r which does not work on SunOS. Fixes Issue #0000159

Other Changes

Added librdf_world_open() for every public API constructor or function that mentions librdf_world* and could have failed to run librdf_world_open() after librdf_new_world(). This makes librdf_world_open() entirely optional. Fixes Issue #0000173

rdfproc gains an --transactions / -T option for enabling transactions on the command line and an --results / -r option to set the query results formatter name.

Do not throw away the rasqal node type information now, it is needed later on in FILTER comparisons. Fixes Issue #0000153

Fix reference count problem in storages that caused connections to fail to free in MySQL. Fixes #0000150

Fix reference count / memory leak in file storage.

Redland 1.0.5 Changes

The main changes in this release are:

Updated to use Rasqal 0.9.13 (Rasqal 0.9.13 release notes) from 0.9.12.

Updated to use Raptor 1.4.13 (Raptor 1.4.13 release notes) from 1.4.9.

Plus several API additions and many bug fixes.

Configuration and Build Changes

configure now removes un-necessary tests for C++ or F77++ compilers that libtool stupidly insists on. Add lots of gcc -W flags when they are supported and in maintainer mode.

Made configure --with-threads work. Fixes Issue #0000125

Model Class Changes

Methods librdf_model_add, librdf_model_add_statement, librdf_model_add_typed_literal_statement, librdf_model_add_string_literal_statement and librdf_model_contains_statement now enforce only allowing legal RDF triples.

Added librdf_model_enumerate to list all the model implementations - currently just one, a model over a storage.

Node Class Changes

The node class can now encode and decode long literals with length >65535 using new encoding type 'N'.

Added new constructor librdf_new_node_from_typed_counted_literal to build a typed node with a counted literal string.

Parser Class Changes

Changes to allow NULL base uris in parsing methods, but to fail if it is omitted but required. Applies to librdf_parser_parse_as_stream, librdf_parser_parse_into_model, librdf_parser_parse_string_as_stream, librdf_parser_parse_string_into_model, librdf_parser_parse_counted_string_as_stream and librdf_parser_parse_counted_string_into_model

Added librdf_parser_get_accept_header to get the Accept header that would be sent with a parser HTTP fetch of content.

Query Class Changes

Graph names in SPARQL now connect up to redland context nodes to allow SPARQL GRAPH to work.

Serializer Class Changes

Added new methods to serialize librdf_streams of triples rather than just librdf_model: librdf_serializer_serialize_stream_to_file_handle, librdf_serializer_serialize_stream_to_file, librdf_serializer_serialize_stream_to_string, librdf_serializer_serialize_stream_to_counted_string and librdf_serializer_serialize_stream_to_iostream. Fixes Issue #0000092

Storage Class Changes

Methods librdf_storage_add_statement, librdf_storage_add_statements and librdf_storage_contains_statement now enforce only allowing legal RDF triples.

The Memory storage now supports deleting while iterating or streaming the storage.

The PostgreSQL storage now accepts option 'database' like MySQL and other Redland relational databases in addition to the existing option it accepted, 'dbname'.

SQLite storage fixes:

Fix crash in librdf_model_context_remove_statements Fixes Issue #0000103

Wrap all sqlite_FREE calls on error messages so that they are only called with SQLITE API v2. Fixes Issue #0000105

Check for no language or no datatype when they are NULL in librdf_storage_sqlite_literal_helper. Fixes Issue #0000136

Store pending queries while the database is locked doing a SELECT and do them once the select is done. Such as deleting triples during a find or serialise. Fixes Issue #0000139

SQLite storage now has a 'synchronous' storage option which takes values 'off', 'normal' or 'full' allowing access to the sqlite pragma to control when commits are synchronised to file.

Other changes

rdfproc now allows the base URI for parsing to be set to null with - and adjust messages to handle this.

Added some more const fixes to heuristics. Fixes Issue #0000107

Autodocs for librdf_new_node_from_blank_identifier. Fixes Issue #0000114

If librdf_storage_sqlite_statement_operator_helper fails, free the stringbuffer. Fixes Issue #0000116

Do not read from stream when parsing returns a NULL pointer. Fixes Issue #0000130

Fix debug call in librdf_query_register_factory, librdf_storage_hashes_add_remove_statement and librdf_storage_hashes_contains_statement Fixes Issue #0000132

Added rss2ical.c example to turn RSS/Atom 1.0 feeds into iCalendar using raptor, redland and SPARQL.

Many minor fixes and changes due to adding lots of -W flags and using gcc4.

SWIG Bindings Interface

Fixed typo to declare librdf_query_results_get_binding_value to return a new object.

Export new function librdf_parser_get_accept_header

Export version strings and integer constants for raptor: (raptor_version_string, raptor_version_major, raptor_version_minor, raptor_version_release, raptor_version_decimal) and rasqal (rasqal_version_string, rasqal_version_major, rasqal_version_minor, rasqal_version_release, rasqal_version_decimal)

Redland 1.0.4 Changes

The main changes in this release are:

Updated to use Rasqal 0.9.12 (Rasqal 0.9.12 release notes) to update to SPARQL 2006-04-06 for JSON results

Updated to use Raptor 1.4.9 (Raptor 1.4.9 release notes)

Plus fixing some crash bugs in parsing and serializing.

Configuration and Build Changes

Now using Subversion for version control and the Redland installation instructions explain how to get Redland from Subversion.

Win32 fixes and VC build files updates from John Barstow.

Let configure find BDB 4.4

Node Class Changes

librdf_new_node_from_literal and librdf_new_node_from_typed_literal now accept empty strings as an alternative to a NULL language pointer.

Parser Class Changes

Add one more place where it needed handling old and new raptor statement predicate values RAPTOR_IDENTIFIER_TYPE_RESOURCE and RAPTOR_IDENTIFIER_TYPE_PREDICATE.

Fixed a bad uses of flose() causing a crash in parsing a file or from a FILE* file handle when run under newer glibcs.

Serializer Class Changes

Fixed a bad uses of flose() causing a crash in serializing to a file when run under newer glibcs.

Storage Class Changes

Introduced a UINT64_T_FMT to handle formatting a 64-bit unsigned int in storages as %llu is not portable.

Redland 1.0.3 Changes

The main changes in this release are:

Updated to use Rasqal 0.9.11 (Rasqal 0.9.11 release notes) to update to SPARQL 2005-11-23

Updated to use Raptor 1.4.8 (Raptor 1.4.8 release notes)

A large source re-arrangement was performed for raptor and rasqal inside redland. All C sources and headers that build the libraries were moved to the src dir, general documentation in the doc dir and utilities in the utils dir for each sub-library.

Version Control change: Redland will be switching to use Subversion for version control after the 1.0.3 release. Please check the Redland Subversion site for the latest status or the online Redland installation notes for the redland specific subversion installation information.

A new PostgreSQL storage backend was added contributed by Shi Wenzhong based on the MySQL storage backend. Fixes issue #0000046

Configuration Changes

The autogen.sh script for building from CVS was revamped to be more modular.

configure now takes an --enable-gtk-doc option to enable building of the documentation using the gtk-doc utility. It is by default enabled only if the utility is available.

Documentation Changes

The GNOME gtk-doc program is now used to automatically extract documentation from source comments into reference documentation. This is then merged with templates and additional documentation to provide a reference manual for redland as XML document which is turned into HTML along with GNOME devhelp support.

Portability Changes

Some win32 build fixes were made.

World Class Changes

librdf_world_get_genid() was changed to include the process ID in the generated blank ID. Fixes Issue #0000037 (patch from Marc Powell).

Node Class changes

librdf_node_encode(): Give an error when a node cannot be encoded due to string data being too long.

Serializer Class changes

Added librdf_serializer_serialize_model_to_iostream(), not exposed in the SWIG bindings.

Storage Class Changes

Added a PostgreSQL storage backend contributed by Shi Wenzhong based on the MySQL storage backend. Fixes Issue #0000046

Other Changes

Deprecated librdf_files_temporary_file_name().

Deleted some function prototypes defined in headers but never had code: librdf_node_init(), librdf_iterator_finished(), librdf_storage_get() and librdf_world_set_uris_hash()

Added examples/example7.c to read from an RDF/XML file, add a triple and write it back.

Redland 1.0.2 Changes

The changes in this release are:

  • Fix a crash when querying or searching with the model find_statements method and getting no results
  • Update to use Rasqal 0.9.10 (Rasqal 0.9.10 release notes) to provide query results sorting such as SPARQL ORDER BY and some SPARQL syntax updates.
  • Update to use Raptor 1.4.7 (Raptor 1.4.7 release notes) to fix some crashes in the RSS tag soup parser and serializer.

Redland 1.0.1 Changes

The main changes in this release are to update to use Rasqal 0.9.9 (Rasqal 0.9.9 release notes) to provide improved SPARQL query support for the revised syntax Raptor 1.4.6 (Raptor 1.4.6 release notes) to provide a new GRDDL parser as well as updated RSS enclosures support with the RSS tag soup parser and RSS 1.0 serializer.

The digest and hash classes now expose public API constructors, destructors and methods via their header files.

Configuration changes

Added --with-memory-signing to check when memory is allocated / freed across Redland libraries.

Portability Fixes

Added Win32 portability fixes and build configuration (John Barstow)

Binding API changes

The following changes were made to the bindings API as exported by the SWIG interface file Redland.i:

The digest class was added: constructor librdf_new_digest, destructor librdf_free_digest and methods librdf_digest_init, librdf_digest_update, librdf_digest_update_string, librdf_digest_final and librdf_digest_to_string,.

The hash class was added as selected functions: constructors librdf_new_hash_from_string and librdf_new_hash_from_array_of_strings and destructor librdf_free_hash.

The query class methods librdf_query_get_limit, librdf_query_set_limit, librdf_query_get_offset and librdf_query_set_offset were added.

Functions were added for accessing parts of structured log messages as librdf_log_message objects: librdf_log_message_code, librdf_log_message_level, librdf_log_message_facility, librdf_log_message_message, librdf_log_message_locator and Raptor raptor_locator objects: raptor_locator_line, raptor_locator_column, raptor_locator_byte, raptor_locator_file and raptor_locator_uri.

Digest Class changes

This class was added to the public API in this release adding constructor librdf_new_digest, destructor librdf_free_digest and methods librdf_digest_init, librdf_digest_update, librdf_digest_update_string, librdf_digest_final, librdf_digest_get_digest, librdf_digest_get_digest_length, librdf_digest_to_string and librdf_digest_print

Hash Class changes

This class was added to the public API in this release adding constructors librdf_new_hash_from_string, librdf_new_hash_from_array_of_strings and librdf_new_hash_from_hash; destructor librdf_free_hash; and methods librdf_hash_get, librdf_hash_get_as_boolean, librdf_hash_get_as_long, librdf_hash_get_del, librdf_hash_put_strings, librdf_hash_print, librdf_hash_print_keys and librdf_hash_print_values.

Iterator Class changes

Added a librdf_new_empty_iterator helper to make an always-empty iterator.

Log Class changes

Added LIBRDF_FROM_MEMORY facility.

Model Class changes

All methods returning an librdf_iterator or librdf_stream now return an empty iterator/stream rather than NULL when returning an empty result sequence. Errors are still returned as NULL.

Node Class changes

Removed unused LIBRDF_NODE_TYPE_RESERVED1 (#3) from librdf_node_type enum.

Query Class changes

Update to use Rasqal 0.9.9 API. Redland 1.0.1 will not build with older Rasqal releases.

The query API gains methods librdf_query_get_limit, librdf_query_set_limit, librdf_query_get_offset and librdf_query_set_offset for setting and getting query result limit (max results) and offsets (result to start from).

Fixed some across-library memory allocation/frees between redland and rasqal that caused problems on win32. Requires rasqal 0.9.9 or newer.

Stream Class changes

Added a librdf_new_empty_strea helper to make an always-empty strea.

Storage Class changes

The MySQL store now uses a portable method across endiannesses to create a 64bit key. This fixes Issue #0000023 (Morten Frederiksen)

NOTE: This matches the algorithm used for little-endian systems but big-endian stores will need to serialize the store before upgrading and reload afterwards.

The MySQL store now uses connection pooling to prevent making a new connection to the database for each request. Fixes Issue #0000027 (Morten Frederiksen)

The SQLite store now does not skip items with the factory methods for serializing, finding statements, serializing contexts and getting context statements. Fixes Issue #0000006

All store methods that return an librdf_iterator or librdf_stream now return an empty iterator/stream rather than NULL when returning an empty result sequence. Errors are still returned as NULL.

Other changes

Added REDLAND_INLINE macro, which can be overridden if inline is not wanted.

Redland 1.0.0 Changes

This is Redland 1.0.0.

The main changes in this release are to update to use Rasqal 0.9.6 to provide improved SPARQL query support for optionals, CONSTRUCT, ASK, builtins, Raptor 1.4.4 to provide better serializing to RDF/XML and RSS 1.0 and better RSS tag soup parsing and a new experimental SQLite storage supporting SQLite V2 and V3 libraries.

Configuration changes

The storages compiled into redland can be individually selected with the --enable-storages=LIST configure option.

The default for --with-dmalloc is now no. Reason: valgrind.

Portability Fixes

Removed configure altering the search PATH - which was a bad idea as it makes the configure environment different from the user's.

Added /opt/local to the BerkeleyDB / SleepycatDB search path to help darwinports.

To help Redland built as an OSX Framework with ObjectiveC, Redland public headers can be put in a different directory structure if LIBRDF_OBJC_FRAMEWORK is defined in the build environment. In this case the headers are found in a subdirectory Redland. This only applies to the public Redland header files that #include other public header files - redland.h including librdf.h, librdf.h including several rdf_*.h files and Rasqal's rasqal.h including raptor.h. (Patch from René Puls)

rdfproc RDF processor utility program changes

Added a size command calling librdf_model_size.

Model Class changes

Added librdf_model_contains_context to find a context node in a model.

The librdf_model_sync now returns a success or failure int.

Parser Class Changes

Updated to Raptor 1.4.4 providing an updated RSS tag soup parser with fixes for RSS 0.9, RSS.1.1 and Atom.

The constructor now finds the correct parser when given NULL arguments for mime type or type URI.

Query Class changes

Update to Rasqal 0.9.5 providing improved SPARQL support: new optionals handling, CONSTRUCT to make RDF graphs, formatting of query results in the SPARQL XML format along with many other improvements and fixes.

Added base_uri argument to librdf_new_query

Added librdf_query_results_to_counted_string, librdf_query_results_to_string, librdf_query_results_to_file_handle and librdf_query_results_to_file to get the results of a query written to a syntax using Rasqal's rasqal_query_results_write and Raptor's XML writer API.

Added boolean returning methods: librdf_query_results_is_bindings, librdf_query_results_is_boolean, librdf_query_results_is_graph for testing result formats and librdf_query_results_get_boolean to get a boolean result back.

Serializer Class changes

Updated to Raptor 1.4.4 providing a new XML writer API, an improved RDF/XML serializer allowing user namespace declarations and relative URIs, a new RSS 1.0 serializer.

The serializers now respect any user-declared namespaces done with librdf_serializer_set_namespace by passing it on to the Raptor serializer with raptor_serialize_set_namespace. At present only the Raptor RDF/XML serializer uses these user-declared namespace hints.

The constructor now finds the correct serializer when given NULL arguments for mime type or type URI.

Storage Class changes

The storages compiled into redland can be individually selected with the --enable-storages=LIST configure option.

SQLite Storage. A new experimental storage supporting SQLite V2 and V3 libraries.

MySQL storage. Return failure early if the connection failed rather than try to continue opening the storage.

MySQL storage. Only use mysql_real_escape_string if a connection was made. Do not try to free resources such as the mysql DB connection owned by iterators after an error, let librdf_free_iterator tidy up. (Patch from Morten Frederiksen)

URI Class changes

Handle resolving against a base URI with an omitted path.

Other changes

Removed librdf_concept_labels - never used or exported.

Redland 0.9.19 Changes

This is Redland 1.0 Release Candidate 2.

Redland's License was changed from LGPL 2.1/MPL 1.1 to LGPL 2.1/Apache 2

The main changes in this release are to update to use Rasqal 0.9.5 to provide initial SPARQL query support and to use Raptor 1.4.2 to provide serializing to RDF/XML and N-Triples.

rdfproc RDF processor utility program changes

Updated to allow an optional base URI for the serialize command and to handle the three forms of query results - bindings, graph or boolean.

Model Class changes

Added librdf_model_to_string and librdf_model_to_counted_string to serialize a model to a string using the Serializer class functionality. Exported librdf_model_to_string to the language bindings.

Query Class changes

Now requires Rasqal 0.9.5 which provides initial support for the SPARQL Query Language for RDF, W3C Working Draft, 12 October 2004 from the W3C RDF Data Access Working Group (DAWG).

Serializer Class changes

Pass on errors and warnings via the existing Redland logging mechanism. Previously they all went to stderr, the default.

Switched to use Raptor 1.4 series serializing classes so now provides RDF/XML and N-Triples serializing and will gain any fugure serializing formats as Raptor adds them.

Using the Raptor support, the serializers can now serialize to strings in addition to the existing serializing to FILE* and files. This is performed by the new methods: librdf_serializer_serialize_model_to_file_handle (deprecating librdf_serializer_serialize_model), librdf_serializer_serialize_model_to_string and librdf_serializer_serialize_model_to_counted_string. Exported librdf_serializer_serialize_model_to_string to the language bindings.

Storage Class changes

librdf_storage_context_add_statement and librdf_storage_context_add_statements - With a NULL context, call the non-context method as documented.

Fixed bogus '+' in get_contexts method in the mysql storage.

World Class changes

librdf_world_get_feature now returns a librdf_node*, librdf_world_set_feature takes a librdf_node* value. Export these to the language bindings.

Redland 0.9.18 Changes

Revert the statement class usage counting - it broke things.

Redland 0.9.17 Changes

This is Redland 1.0 Release Candidate 1.

The main changes in this release are the addition of the Query and Query Results classes, and the removal of the language bindings into the new Redland Bindings package.

The interface between the Redland library and Redland Bindings when done via swig is by the swig interface file Redland.i which is now installed in /usr/share/redland/Redland.i.

Portability changes

Several patches for building Redland natively on Win32 were provided by Jose Kahan. These included adding an win32_rdf_config.h hard-coded config for Win32, using that in the all the C source files and adding an REDLAND_STATIC define to help statically linking Win32 builds of Redland.

Configuration changes

Redland 0.9.17 requires Raptor 1.3.2 and Rasqal 0.9.1. Installed versions are used if available by default, otherwise the copies in the source tree will be used. The --with-raptor= and --with-rasqal= configure options with values internal or system can be used to select when both are available.

Removed all the language binding-specific configuration code including options such as --with-perl that are now used by Redland Bindings.

Packaging changes

Updated the RPM spec file to remove building of the redland-perl and redland-python RPMs which are now made in the redland-bindings package.

Added -lrdf to the pkgconfig redland.pc file (Curtis Hovey)

Redland requires automake 1.7 and autoconf 2.54 to build from CVS.

Query and Query Result Classes

The Query (librdf_query) and Query Results (librdf_query_results) classes are new in Redland 0.9.17. They provide RDF query support with RDQL using Rasqal 0.9.1, which is now included in the Redland distribution.

The Query class has the following functions and methods:

  • librdf_new_query (constructor)
  • librdf_new_query_from_query (constructor)
  • librdf_new_query_from_factory (factory constructor)
  • librdf_free_query (destructor)
  • librdf_query_execute

The Query Results class has the following methods:

  • librdf_query_results_as_stream
  • librdf_query_results_get_count
  • librdf_query_results_next
  • librdf_query_results_finished
  • librdf_query_results_get_bindings
  • librdf_query_results_get_binding_value
  • librdf_query_results_get_binding_name
  • librdf_query_results_get_binding_value_by_name
  • librdf_query_results_get_bindings_count
  • librdf_free_query_results (destructor)

A new example example5.c was created to demonstrate using the query classes.

New Logging API

An enhanced logging API was added to provide enhanced information from log messages, error and warnings such as from parsing. The new world method librdf_world_set_logger allows setting of the log handler callback which gives a librdf_log_message. Parts of this the structure can be read by using the following new accessors methods:

  • librdf_log_message_code
  • librdf_log_message_level
  • librdf_log_message_facility
  • librdf_log_message_message
  • librdf_log_message_locator

The locator returns an raptor_locator that gives the line, column, byte offset, URI and/or filename of the message. Raptor 1.3.2+ provides accessor methods for that structure that are described in libraptor.3.

Model Class changes

Check that duplicate statements are not added to models with the librdf_model_add_statement and librdf_model_add_statements methods. The methods for adding statements with a context do not check.

Added librdf_model_query_execute method to execute a librdf_query against a model, returning an librdf_query_results

Added librdf_model_load method that uses Raptor parser guessing to load content from a URI into a model.

The contexts methods now give a run time warning if called when the model does not support contexts or the are not enabled. The methods affected are:

  • librdf_model_context_add_statement
  • librdf_model_context_add_statements
  • librdf_model_context_as_stream
  • librdf_model_context_remove_statement
  • librdf_model_context_remove_statements
  • librdf_model_context_serialize
  • librdf_model_find_statements_in_context
  • librdf_model_get_contexts

Fixed a memory leak inside librdf_model_find_statements_in_context.

Node Class changes

Fix assert bug in librdf_node_get_blank_identifier that caused it to always fail.

A bug was fixed in librdf_node_get_li_ordinal to not always fail, returning -1

Parser Class changes

Deprecated methods librdf_parser_set_error and librdf_parser_set_warning which never worked. The new logging API works correctly with this code.

Storage Class changes

Where possible, check that duplicate statements are not added to stores with the librdf_storage_add_statement and librdf_storage_add_statements methods. The methods for adding statements with a context do not check.

The "mysql" storage was updated by Morten Frederiksen to revise the schema and to add two new features, controlled by new boolean storage options:

  1. bulk: whether model/storage method add_statements should be optimized, until a model/storage sync operation
  2. merge: whether to maintain a table with merged models

Context methods will now give a run time warning if called and contexts are not supported or enabled. The methods affected are:

  • librdf_storage_context_add_statement
  • librdf_storage_context_remove_statement
  • librdf_storage_context_serialise
  • librdf_storage_get_contexts

Fixed a memory leak inside librdf_storage_find_statements_in_context.

A bug was fixed in method librdf_storage_node_stream_to_node_create to allow the second node parameter to be NULL, so that methods librdf_storage_get_arcs_out and librdf_storage_get_arcs_in that can use it to work.

Redland 0.9.16 Changes

A small but important fix to make the installed C headers work correctly again. The rdf_uri.h file had #include rdf_digest.h which is an internal header and not installed. This required removing two functions from the public API that returned librdf_digest*, but neither of them could be used since rdf_digest.h was not shipped.

Patched librdf.h and raptor.h to #include stdio.h so that the empty program #include <redland.h> main() {} now works (ditto for raptor).

Redland 0.9.15 Changes

This version of Redland updates to use Raptor 1.2.0 (raptor news) along with the new syntax Turtle Terse RDF Triple Language.

Three new storage modules were added:

  1. MySQL store written by Morten Frederiksen supporting the entire storage API include full contexts support.
  2. AKT Triplestore using MySQL inside 3store
  3. File and URI-backed in-memory store - read/write file, read only URI.

The details of these modules are explained in much greater detail in the storage modules overview including the features that they support.

The runtime is now compiled with assertions to check for illegal use of NULL pointers in arguments, these will give warning messages (which can be disabled with --disable-assert-messages). The storage and model classes now track when open iterator and streams are operating on them and will not release resources until all the open iterators and streams are finished.

URI and Literal string type changes

There are many changes are to properly use and return UTF-8 strings as unsigned char* for URIs (looking forward to Internationalized Resource Identifiers, IRIs emerging) and for RDF literal strings, plus other fixes to work better with C++ correcting the use of const. Redland and Raptor now both compile cleanly with g++ 3.2, 3.3 and all warnings enabled.

rdfproc RDF processor utility program changes

rdfproc was extensively updated and it can now more easily work with any type of Redland store and has better support for working with contexts. The detailed changes are as follows:

  • Added an -s TYPE option to specify a storage type
  • Added an -t option for giving storage options
  • Added an -p option to read the value of storage option password from standard input, to prevent exposing it as a parameter.
  • The default of creating a new store was replaced; -n enables truncation or overwriting (the write=yes storage option).
  • Now recognises _:abc as blank node arguments.
  • Parsing now return counts of errors and warnings if possible.
  • The parse-stream command can take an optional context node
  • Added a contexts command, to list the contexts in a model.
  • Added support for environment variables RDFPROC_STORAGE_OPTIONS and RDFPROC_STORAGE_TYPE to provide default storage options (-t) and type (-s)
  • Help message updated and correctly lists supported parsers

Configuration changes

Redland 0.9.15 requires Raptor 1.2.0 either installed otherwise the copy in the source tree will be installed.

--with-mysql=CONFIG added to point to the mysql_config program for the MySQL backing store

--with-threestore added to enable the AKT Triplestore

--disable-assert added to disable compiling run-time assertions.

--disable-assert-messages added to disable compiling run-time assertion messages.

Packaging changes

A redland-python RPM package is now provided and the default RPM packaging now provides the MySQL store, in addition to the in-memory and BDB previously packaged. The new file and uri stores are also available. The full list of store modules is described further in the storage modules overview.

Model Class changes

Methods librdf_model_add_string_literal_statement and librdf_model_add_typed_literal_statement now take a const unsigned char* string. Method librdf_model_query_string now takes a const unsigned char* string query.

New methods were added librdf_model_find_statements_in_context to search for a statement matching only in a particular context, librdf_model_find_statements_with_options to allow options with searching (none used at present), and librdf_model_get_contexts to list the context nodes in a graph.

Methods librdf_model_get_feature, librdf_model_set_feature were modified to take and return librdf_node* values.

Node Class changes

Constructors librdf_new_node_from_uri_string, librdf_new_node_from_uri_local_name and librdf_new_node_from_normalised_uri_string now take a const unsigned char* string URI string. Constructors librdf_new_node_from_literal and librdf_new_node_from_typed_literal now take a const unsigned char* string RDF literal. Constructor librdf_new_node_from_blank_identifier now takes a const unsigned char* string blank node identifier.

Methods librdf_node_get_literal_value, librdf_node_get_literal_value_as_counted_string and librdf_node_get_blank_identifier now return a const unsigned char* string RDF literal, blank node identifier

(Debugging methods librdf_node_to_string and librdf_node_to_counted_stringwhere changed to return a const unsigned char* string)

Parser Class changes

Added methods librdf_parser_parse_counted_string_as_stream and librdf_parser_parse_counted_string_into_model for parsing a string with a given length rather than a C NUL-terminated string.

Methods librdf_parser_parse_string_as_stream and librdf_parser_parse_string_into_model now take a const unsigned char* string syntax buffer.

Methods librdf_parser_get_feature and librdf_parser_set_feature were modified to take and return librdf_node* values.

Query Class changes

Constructor librdf_new_query now takes a const unsigned char* string query.

Serializer Class changes

Added methods librdf_serializer_get_feature and librdf_serializer_set_feature taking and returning librdf_node* values like the methods for the model and parser classes.

Statement Class changes

The statement objects are now usage counted like most other objects so they are cheap to copy. No user-API level changes are needed.

(Debugging method librdf_statement_to_string now returns a const unsigned char* string)

URI Class changes

Constructors librdf_new_uri, librdf_new_uri_from_uri_local_name, librdf_new_uri_normalised_to_base and librdf_new_uri_relative_to_base. now take a const unsigned char* string URI string.

Methods librdf_uri_as_string, librdf_uri_as_counted_string, librdf_uri_to_string and librdf_uri_to_counted_string now return a const unsigned char* string URI string.

Java API Changes

Updated to match API changes above. Fixes for OSX 10.3

Perl API changes

Updated to match API changes above. Fixes for perl 5.8.1 and later which changed how MakeMaker installed. Let perl install the files rather than try to force it based on the prefix argument to configure. Make Parser method parse_string_into_model call the correct Redland function. Added OSX Java directories to JDK search path.

PHP API Changes

Updated to match API changes above. Redland is now started up and shutdown once in the PHP module code and does not need to called directly.

Python API changes

Updated to match API changes above. Fix Node literal_values to work with datatype URIs. Export the NS class. Added a FileStorage class for the storage type file. Removed use of the python Distutils which was often getting the linking wrong.

Ruby API changes

Updated to match API changes above.

Tcl API changes

Updated to match API changes above.

Other changes

Redland now ships with both portable MD5 as well as (new in 0.9.15) SHA1 digest implementations used if neither is available via an optimised library.

Redland 0.9.14 Changes

This version of Redland is an update mostly to synchronise with the Raptor version 1.0.0 (RDF/XML and N-Triples parser) - see Raptor NEWS for the changes since 0.9.12.

New in this version is the rdfproc utility which allows command line creation of redland stores, parsing of syntaxes and manipulation of the model.

Configuration changes

Added --with-raptor to either choose the system or internal raptor library. If omittted, redland will guess and choose either the system one, if new enough or the internal one (always present).

Hash Class changes

Added a librdf_hash_put_strings helper method to put a pair of string values into a hash. Useful for making model or storage options.

Node Class changes

Resource (URI) / literal / blank nodes are now interned on construction so there is only one object for each distinct librdf_node object. This reduces memory and makes copying cheaper at the cost of an increase in construction cost. Copying nodes is very common, since not only is it done for nodes but any time a statement is used or returned. This interning was already done for the URI class but the change required librdf_node to be made immutable, which was done in 0.9.13.

Storage Class changes

Added librdf_storage_context_as_stream deprecating librdf_storage_context_serialise to be consistent with the *as_stream method name changes to model.

Added librdf_new_storage_with_options taking an librdf_hash* of options rather than the string of librdf_new_storage.

Added new optional storage factory methods context_add_statements and context_remove_statements. If omitted, the storage class implements them with context_add_statement and context_remove_statement.

Stream and Iterator Classes changes

Optimised the stream and iterator internals to do less factory method calls when looking for new items or the end of stream/iterator. This should make them slightly faster.

Miscellaneous changes

Renamed Redland statics to be librdf_* rather than redland_*. Added a one-line librdf_short_copyright_string.

Perl API Changes

Fixed the broken use of UNIVERSAL::isa

Redland 0.9.13 Changes

This version of Redland is a major update to 0.9.12 changing the node class. librdf_node objects are now immutable once created, higher-level language APIs no longer have deal with sharing or copying internals, some additional API support for parsing content from strings.

This includes the stable and complete version 0.9.12 of the Raptor parser which supports all of the revised RDF/XML syntax.

Initial work was added on an ECMA CLI interface using the C# ("C sharp") language.

Blank nodes generated by parsing the syntaxes are now generated more unique (not guaranteed) based on the Redland startup time and a serial number.

The Perl, Python and Java APIs now always return new nodes and statements removing the need to consider sharing at this level. This means that the following operation is legal in Perl, Python and Java:

# perl
$n=RDF::Redland::Node->from_uri("http://example.org/foo");
$s=new RDF::Redland::Statement($n, $n, $n);
$model->add($s);

# python
n=RDF.Uri("http://example.org/foo")
s=RDF.Statement(n, n, n) # n is used as a resource RDF.Node here
model.add_statement(s)

Configuration

Several improvements were made to the building and configuring including a better attempt to find matching Sleepycat/Berkeley DB header and library files (and support BDB up to 4.1), searching for installed Java JDKs and Tcl headers. Each of the language interfaces can be individually enabled to be build, tested and installed with the main C library.

Node Class changes

The librdf_node class was modifed to make objects immutable once constructed, they cannot be modified. The following set methods were consequently removed.

  • librdf_node_set_blank_identifier
  • librdf_node_set_li_ordinal
  • librdf_node_set_literal_value
  • librdf_node_set_type
  • librdf_node_set_typed_literal_value
  • librdf_node_set_uri

The following utility methods were added (covering all the librdf_node_get_type values):

  • librdf_node_is_blank - return non-0 if the node is a blank node
  • librdf_node_is_literal - return non-0 if the node is a literal
  • librdf_node_is_resource - return non-0 if the node is a URI

(These are reflected into the same methods on the Perl, Python and Java node classes)

LIBRDF_NODE_TYPE_LI as returned by librdf_node_get_type was deleted, it was never used.

To support datatyped literals, the following method was added:

  • librdf_node_get_literal_value_datatype_uri - get the typed literal datatype URI of the literal node

Model Class changes

Added ibrdf_model_sync to sync the model to the backing store.

Added librdf_model_as_stream and librdf_model_context_as_stream to replace librdf_model_context_serialise and librdf_model_context_serialize respectively. This was done both to reduce the confusion with the librdf_serializer class and the mixture of US/UK spelling of that word. The old functions will remain for now.

Parser Class changes

Added librdf_parser_parse_string_as_stream and librdf_parser_parse_string_into_model to allow parsing content from strings.

Statement Class changes

Added librdf_statement_is_complete to test if a statement has all the subject, predicate and object fields assigned. Partial statements cannot be added to a model but can be used in matching statement queries with librdf_model_find_statements.

Storage Class changes

Added librdf_storage_sync to sync the backing store. (This is slightly internal to Redland, you should not be calling this directly)

Perl Interface Changes

Updated to make the object constructors less verbose and to allow Redland URI objects and native perl URIs to be used in place of Redland Nodes where convienent (such as in making Statements). All existing code should work but can be shortened. A new --with-perl configure argument to enable the perl interface.

Python API changes

A major update to use Python 2.2+ idioms and features by Edd Dumbill with help from Matt Biddulph for unit tests. A new --with-python configure argument to enable the python interface. Edd wrote the following change log.

General changes

  • Removed string exceptions and replaced with RedlandError ones
  • Where underlying Redland C objects were unexpectedly null, raise exceptions rather than returning None, "" or [] as appropriate.
  • Raise exceptions if Redland C constructors fail in Python constructors.
  • Did quite a lot of documentation updating, where possible demonstrating preferred Pythonic usages.
  • Added more unit tests to test changed functionality.

RDF.Node class

  • Constructor now accepts Uri to make a resource/property node, or a string to make a string literal
  • Removed usage of node_type() in favour of is_resource(), is_blank() etc methods.
  • DEPRECATED get_blank_identifier() etc. methods in favour of node.blank_identifier etc properties. Raise exception if properties inconsistent with the node type are requested.

RDF.Statement class

  • No need to name subject, predicate, object in constructor any more. Uris or string literals accepted in place of nodes in constructor argument.
  • __getattr__ method deleted, using new-style property() for subject, predicate, object

RDF.Model class

  • Deleted get_*_iterator methods
  • Renamed sources() to get_sources(), targets() to get_targets(), arcs() to get_predicates(). Retained old method names as aliases.
  • Added get_sources_context(), get_targets_context(), get_predicates_context() which return (node, context) tuples.
  • Amended get_source(), get_sources() etc methods so that Uri and string literals were acceptable as shortcut types for nodes.
  • Added find_statements_context() which returns (statement, context) tuples.
  • Renamed context_remove_statements() to remove_statements_with_context(). Retained old method name as an alias.
  • Added __delitem__ method so del[statement] and del[statement, context] work.
  • Added append() method so append(statement) and append(statement, context) work. Suggest that append() is used in preference to add_statement() for Python idiomatic usage.
  • DEPRECATED serialise() in favour of as_stream().
  • Added as_stream_context() to serialise (statement, context) tuples.
  • Exception raised if len() is attempted on model with a non-countable storage.
  • DEPRECATED Model.add(), Model.add_typed_literal_statement() usages: now that constructing Statements is easier, it's incongruous to have these in the model. Additionally it saves reproducing various bits of error checking that properly belong in the Node() constructor.
  • Implemented __contains__() so "if statement in model" and "if (statement, context) in model" work as expected using the more efficient Redland C methods where possible.

RDF.Stream class

  • DEPRECATED Stream.context_iter(). Use in preference the _context variants of the appropriate Model methods. This leads to fewer lines of code.

RDF.Uri class

  • Amended constructor so strings or Uri instances can be passed as the first argument, without named parameters being required, and the right thing still happen.

Java Interface Changes

Additions for the new API calls as outlined above (such as model/storage sync, parsing from strings etc.). New configure argument --with-jdk to pick the JDK in order to find the JNI headers. See the java API page for details.

PHP, Ruby and Tcl Interfaces Changes

Updates in configuring and building these interfaces and new --with-php, --with-ruby and --with-tcl configure arguments. See the corresponding API pages and installation documentation for details. Tcl now tries to guess the includes directories.

Internal changes and fixes

  • Added Sleepycat/BDB 4.0 and 4.1 support - the open API changed again
  • Split the librdf_model class into model interface (librdf_model) and implementation class (librdf_model_storage).
  • Removed the old and outdated repat RDF parser.
  • Removed the very old expat XML parser from the sources; much newer or expat or libxml2 are very widespread.
  • Added simple thread support from patches by Seth Ladd with configuration option --with-threads that locks key shared classes to allow separate threads to work in the same memory space. The current locked classes are URI and World.
  • Deleting statements in the in-memory store now works.
  • Getting the context of iterators returned from in-memory sources, targets, arcs now works.

Redland 0.9.12 Changes

This version of Redland is a major update to 0.9.11 incorporating a much more improved, complete and stable version 0.9.7 of the Raptor parser and a significant new feature, contexts. The high-level language APIs received some updates and the start of two new languages APIs were added: Ruby and PHP.

Several incompatible API changes were made in this release that effect the C interface and all the higher level language APIs. These were made to support contexts and to fix some inconsistencies in the interface about object ownership.

The persistent storage format was changed to support RDF typed literals and this requires an upgrade of any existing Berkeley/Sleepycat DB stores created by Redland 0.9.11 or earlier. A utility redland-db-upgrade is provided that will create an updated store from an existing one.

A Perl script utils/update-api-0912.pl can help automate the API changes as far as possible or warn about those that cannot be automatically updated.

New Feature - Contexts

This feature allows a Node to be given whenever a statement is added to a model which can can be retrieved from any model query that returns answers as an Iterator of Nodes or a Stream of Statements. Both of these classes gained a new method get_context that returns the original Node that was given when the statement corresponding to the answer was added to the model.

The context node can also be used to add and remove sets of statements to/from a model, and each statement with a given context node can be listed as a stream of statements.

Adding this feature required substantial internal changes to these two classes and the internal storage apis and implementations along with moderate code changes at the application level, which are described below.

This feature can be used for the following (not an exhaustive list):

  • Enable true graph merging / updating / demerging - identify the subgraphs with context nodes.
  • Statement Identity - add each statement with a different context node
  • Statement Provenance - use the context node as the subject of other statements about the statement that is returned.

Iterator Class Changes

The Iterator get_next method was split into get_object always returning a pointer to a shared object and the next method to advance the iterator. The get_object method is generally called current in the higher level language APIs.

(Iterator and Stream now have consistent method names; they may be merged in future.)

The get_object method now always returns a pointer to a shared object. If this object is needed outside the scope of an iteration, it must be copied, which for Nodes is the copy constructor librdf_new_node_from_node.

C example for Redland 0.9.11 and earlier:

  while(!librdf_iterator_end(iterator)) {
    node=(librdf_node*)librdf_iterator_get_next(iterator);
    /* do something with the node */
  }

Redland 0.9.12:

  while(!librdf_iterator_end(iterator)) {
    node=(librdf_node*)librdf_iterator_get_object(iterator);
    /* do something with the node */
    librdf_iterator_next(iterator);
  }

A new method get_context was added returning a Node for the context of the original Statement that generated the Iterator Node.

C Iterator context example:

  while(!librdf_iterator_end(iterator)) {
    node=(librdf_node*)librdf_iterator_get_object(iterator);
    context_node=(librdf_node*)librdf_iterator_get_context(iterator);
    /* do something with the node and its context */
    librdf_iterator_next(iterator);
  }

Model Class Changes

The Model add_statement method no longer takes ownership of the passed in statement object. The caller now retains ownership and can reuse the statement several times and has responsibility for freeing it if need be (when it isn't shared).

C example for Redland 0.9.11 and earlier:

  librdf_model_add_statement(model, statement);

Redland 0.9.12:

  librdf_model_add_statement(model, statement);
  librdf_free_statement(statement);

C streaming statement example for Redland 0.9.11 and earlier:

  while(!librdf_stream_end(stream)) {
    librdf_statement *statement=librdf_stream_next(stream); 
    /* This statement is new, so could be added directly */
    librdf_model_add_statement(model, statement);
  }

Redland 0.9.12:

  while(!librdf_stream_end(stream)) {
    librdf_statement *statement=librdf_stream_get_object(stream); 
    /* This statement is now shared so can still be just added */
    librdf_model_add_statement(model, statement);
  }

librdf_model_add_string_literal_statement lost the xml_space argument.

A new method was added to add a Statement with an RDF datatyped literals object:

  int librdf_model_add_typed_literal_statement(librdf_model* model,
     librdf_node* subject, 
     librdf_node* predicate, 
     char* string, char *xml_language, librdf_uri *datatype_uri);

This should be used in preference to librdf_model_add_string_literal_statement which remains in the API as a wrapper around the above.

New methods were added to add, remove and list Statements to contexts.

  /* Add a single statement to the model with context */
  int librdf_model_context_add_statement(librdf_model* model,
    librdf_node* context, librdf_statement* statement);

  /* Add all statements on the stream to the model with context */
  int librdf_model_context_add_statements(librdf_model* model, 
    librdf_node* context, librdf_stream* stream);

  /* Remove a single statement from the model with the given context */
  int librdf_model_context_remove_statement(librdf_model* model, 
    librdf_node* context, librdf_statement* statement);

  /* Remove all statements from the model with given context */
  int librdf_model_context_remove_statements(librdf_model* model, 
    librdf_node* context);

  /* List all statements in the model with the given context */
  librdf_stream* librdf_model_context_serialize(librdf_model* model, 
    librdf_node* context);

Node Class Changes

The Node class gained a new constructor:

  librdf_node* librdf_new_node_from_typed_literal(
    librdf_world *world,
    const char *string,
    const char *xml_language, 
    librdf_uri* datatype_uri);

that should be used in preference to librdf_new_node_from_literal which remains in the API as a wrapper around the above.

librdf_node_new_nodefrom_literal lost the xml_space argument.

Parser Class Changes

The Parser class has an updated Raptor parser version 0.9.7 - parsers named raptor for RDF/XML (MIME Type application/rdf+xml) and ntriples for N-Triples. See the Raptor NEWS for the detailed changes since 0.9.5 in the last release of Redland.

The Java SiRPAC parsers sirpac-stanford, sirpac-w3c and the W3C LibWWW parser libwww have been removed. Raptor replaces them.

Serializer Class Changes

The Serializer class gained a new method:

  int librdf_serializer_serialize_model_to_file(
    librdf_serializer* serializer,
    const char *name,
    librdf_uri* base_uri, 
    librdf_model* model);

This writes the serialized model to a filename (rather than a file handle as done by librdf_serializer_serialize_model) which is easier to use from higher level language APIs until a cross-language I/O abstraction is available.

The class gained an RDF/XML serializer that can be called either by the name rdfxml or the MIME Type application/rdf+xml. The examples in each language have been updated to demonstrate using this.

Storage Class Changes

The built in storage factories (memory, hashes) now both support contexts. These are enabled by adding the storage option contexts='yes' to the options string. The hashes storage additionally supports indexing predicates as an extra hash which can be enabled with index-predicates='yes'. This makes triple queries of the form (subject unknown, predicate known, object unknown) fast.

C Example of creating a 0.9.12 storage that does contexts using on-disk Berkeley/Sleepycat DB:

   storage=librdf_new_storage(world,
     "hashes", 
      name,
     "hash-type='bdb',write='yes',new='yes',contexts='yes'");

Stream Class Changes

The Stream next method was split into get_object always returning a pointer to a shared Statement and the next method to advance the iterator. The get_object method is generally called current in the higher level language APIs.

(Iterator and Stream now have consistent method names; they may be merged in future.)

C example for Redland 0.9.11 and earlier:

  while(!librdf_stream_end(stream)) {
    statement=(librdf_statement*)librdf_stream_next(stream);
    /* do something with the statement */
  }

Redland 0.9.12:

  while(!librdf_stream_end(stream)) {
    statement=(librdf_statement*)librdf_stream_get_object(stream);
    /* do something with the statement */
    librdf_stream_next(stream);
  }

A new method get_context was added returning a Node for the context of the Statement.

C Stream context example:

  while(!librdf_stream_end(stream)) {
    statement=(librdf_statement*)librdf_stream_get_object(stream);
    context_node=(librdf_node*)librdf_stream_get_context(iterator);
    /* do something with the statement and its context node */
    librdf_stream_next(stream);
  }

Perl Interface Changes

The Perl interface moved to the RDF::Redland package (the RDF namespace was deprecated in 0.9.11).

The interface was updated to receive Redland error and warning messages callbacks. These can be set using the RDF::Redland::set_error_handler and RDF::Redland::set_warning_handler subroutines taking a subroutine argument. They are called with a single scalar argument which is the Redland message.

The interface was updated to match the Interator and Stream changes described above.

Perl iterator example for Redland 0.9.11 and earlier:

  while(!$iterator->end) {
    my $node=$iterator->next;
    # do something with the node
  }

Redland 0.9.12:

  while(!$iterator->end) {
    my $node=$iterator->current;
    # do something with the node
    $iterator->next;
  }

Perl stream example for Redland 0.9.11 and earlier:

  while(!$stream->end) {
    my $statement=$stream->next;
    # do something with the statement
  }

Redland 0.9.12:

  while(!$stream->end) {
    my $statement=$stream->current;
    # do something with the statement
    $stream->next;
  }

Perl example of using the Serializer class:

  # Use any rdf/xml parser that is available
  my $serializer=new RDF::Redland::Serializer("rdfxml");
  $serializer->serialize_model_to_file("output.rdf", $uri, $model);

Python API Changes

The Python interface gained pydoc comments, along with an HTML derived version.

The interface was updated to receive Redland error and warning messages callbacks as python exceptions. These can be caught using the standard python try {} catch {} blocks.

The interface was updated to match the Interator and Stream changes described above.

Python iterator example for Redland 0.9.11 and earlier:

  while not iterator.end():
    node=iterator.next()
    # do something with the node

Redland 0.9.12:

  while not iterator.end():
    node=iterator.current()
    # do something with the node
    iterator.next()

Python stream example for Redland 0.9.11 and earlier:

  while not stream.end():
    statement=stream.next()
    # do something with the statement

Redland 0.9.12:

  while not stream.end():
    statement=stream.current()
    # do something with the statement
    stream.next()

Python example of using the Serializer class:

  # Use any rdf/xml parser that is available
  serializer=RDF.Serializer()
  serializer.serialize_model_to_file("output.rdf", model)

Java Interface Changes

The Java classes were updated to have a finished() method that the user can call to cleanup objects replacing the rather useless Java finalize() method that gives no guarantees to when it is called.

The Java API is still experimental and may change further.

Redland 0.9.1 - Redland 0.9.11 Changes

Release notes for 0.9.11 and earlier are in the NEWS page or ChangeLog


Copyright (C) 2000-2013 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

redland-1.0.17/LICENSE.html0000644000175000017500000000721212071146235012105 00000000000000 Redland librdf RDF API Library - License

Redland librdf RDF API Library - License

This package is Free Software available under any one of the specified licenses below. All the licenses below are alternatives and if you select one license, that one alone applies.

1. The GNU Lesser General Public License (LGPL) Version 2.1 or any newer version

See http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html or COPYING.LIB for the full license text.


Copyright (C) 2000-2012 David Beckett
Copyright (C) 2000-2005 University of Bristol. All Rights Reserved.

This package is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License Version 2.1 as published by the Free Software Foundation or any newer version.

This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License Version 2.1 for more details.

You should have received a copy of the GNU Lesser General Public License Version 2.1 along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


2. GNU General Public License (GPL) V2 or any newer version

Under Term 3 of the LGPL Version 2.1, you may choose to license the entire package under the GPL. If that option is chosen, then this package is licensed under the terms of the GPL Version 2 or alternatively, any newer version of the GPL. See COPYING for the full GPL license text.

3. The Apache License V2.0 or any newer version

See http://www.apache.org/licenses/LICENSE-2.0 or LICENSE-2.0.txt for the full ASL 2.0 license text.

Copyright (C) 2000-2012 David Beckett
Copyright (C) 2000-2005 University of Bristol.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

The NOTICE file contains the notices that must be applied according to section 4(d) of the Apache License, Version 2.0.


Copyright (C) 2000-2013 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

redland-1.0.17/ChangeLog.30000644000175000017500000032427411171007723012060 000000000000002002-12-28 Dave Beckett * Redland.i: Added model methods for add/remove/serialize contexts. * examples/example4.c: Updated to test contexts (not enabled by default) and print out context nodes of results (always, when they are present). * Redland.i, python/RDF.py, perl/lib/RDF/Redland/Stream.pm, perl/lib/RDF/Redland/Iterator.pm, java/org/librdf/redland/Stream.java, java/org/librdf/redland/Iterator.java: Updated Stream, Iterator classes with context methods returning a Node * librdf/rdf_storage_list.c: All experimental group methods now context. List now always stores a small struct instead of a statement (less conditional code at a small overhead of alloc/dealloc). (librdf_storage_list_init): Use contexts on user option ("contexts"). (librdf_storage_list_node_equals): Added for comparing the list node structs. * librdf/rdf_storage_hashes.c: All experimental group methods now context. (librdf_storage_get_hash_description_by_name): Now used, returning a librdf_hash_descriptor. (librdf_storage_hashes_register): Added, for registering the hashes more dynamically. (librdf_storage_hashes_init_common): Use librdf_storage_hashes_register to index predicates, contexts on user option ("index-predicates", "contexts"). Use librdf_statement_encode_parts and librdf_statement_decode_parts to de/en-code with context node if necessary. (librdf_storage_hashes_serialise*): Hold knowledge if current deserialized statement is fresh and only do once on demand. * librdf/rdf_model.c: All experimental group methods now context. (librdf_model_print): Docs (librdf_model_add_statements): Does not free stream at end of work. (main): Demo updated to use context+nodes (not group+uris) * librdf/rdf_model.h, librdf/rdf_storage.c, librdf/rdf_storage.h: All experimental group methods now context. * librdf/rdf_stream.c (librdf_stream_print): Docs. Prints contexts of statements if there are any. * librdf/rdf_statement.c (librdf_statement_print): Docs (librdf_statement_encode): Update for changed librdf_statement_encode_parts. (librdf_statement_encode_parts): Takes context node arg. (librdf_statement_decode): Uses librdf_statement_decode_parts. (librdf_statement_decode_parts): New, takes context node arg. * librdf/rdf_statement.h: Prototype for librdf_statement_decode_parts Statement ID, FLAGS parts gone (were never used) * librdf/rdf_node.c (librdf_node_print): Docs 2002-12-22 Dave Beckett * raptor/raptor_uri.c: (main) Try test again with /etc - surely that is least likely to be a symlink? * raptor/tests/Makefile.am: check-bad-rdf: turn off bourne shell exiting while running tests expected to fail. * raptor/tests/Makefile.am: Set baseuri from test file basename; ensure no dirs are in the base URI * Makefile.am: Added acconfig.h to dist - some automake versions don't do this automatically such as 1.4-p5 which comes with Redhat 7.3 * java/org/librdf/redland/Makefile.am, java/Makefile.am: coreJNI.java is not for dist * perl/test.pl: test.pl now t/*.t * librdf/Makefile.am: No need for ex1.rdf ex2.rdf in deps * librdf/Makefile.am, librdf/ex1.rdf, librdf/ex2.rdf: Remove test files; generated from strings in rdf_model.c (main) when needed * librdf/rdf_model.c (main): Create test files from string content here rather than rely on ex1.rdf and ex2.rdf being present. * librdf/rdf_parser_repat.c, librdf/rdf_parser_raptor.c: Don't declare extern errno, the optional errno.h header does that. * librdf/rdf_parser_repat.c, librdf/rdf_parser_raptor.c: Include errno.h if present to get the write definition. * configure.in: check for errno.h (again?) * perl/Makefile.am: Fix for 5.8 install 2002-12-21 Dave Beckett * raptor/configure.ac: Removed just for now 2002-12-20 Dave Beckett * raptor/NEWS.html: tweak * raptor/configure.in: Bumped version to 0.9.8 * raptor/NEWS.html: date * raptor/raptor.spec.in: Updated for 0.9.7 release 2002-12-19 Dave Beckett * raptor/INSTALL.html, raptor/README.html, raptor/NEWS.html: Updated for 0.9.7 release * raptor/acconfig.h: Seems like PACKAGE and VERSION are not needed here, and later autoconfs generate headers that moan. * raptor/raptor_parse.c, raptor/raptor_general.c: castings * raptor/raptor.h: Indent CPP directives after column 1 # for lame C compiler * raptor/tests/Makefile.am: test(1) string equality is = not == * docs/stylesheet.css: Remove some of the boxes in sidebar; turn category header to white on blue. 2002-12-18 Dave Beckett * raptor/autogen.sh: Delete autom4te too * raptor/configure.ac: auto-configure source for newer autoconfs 2002-12-16 Dave Beckett * raptor/raptor_uri.c (main): Use /bin to test, seems more likely to be around on more posix systems such as OSX * raptor/raptor_parse.c (raptor_generate_statement): Handle NULL reified being passed. (raptor_process_property_attributes): Property attributes are never reified explicitly but may be in a bag. (raptor_start_element_grammar,raptor_end_element_grammar): Turn bad uses of bag:ID into errors not warnings. * raptor/tests/Makefile.am: Added more bag:ID checks (44-45) and errors (bad 05-09) Make test failures stop the 'make check'. * raptor/tests/bad-05.rdf, raptor/tests/bad-06.rdf, raptor/tests/bad-07.rdf, raptor/tests/bad-08.rdf, raptor/tests/bad-09.rdf, raptor/tests/ex-48.rdf, raptor/tests/ex-49.rdf, raptor/tests/ex-50.rdf, raptor/tests/ex-46.rdf, raptor/tests/ex-47.rdf, raptor/tests/ex-48.out, raptor/tests/ex-49.out, raptor/tests/ex-50.out, raptor/tests/ex-46.out, raptor/tests/ex-47.out: Turned rdf:bagID property element checks into errors * raptor/raptor_parse.c: Add rdf:bagID checks - only allow it in the two cases it is in the grammar - on a node element and an empty property element. Otherwise emit warnings since there is no error test case yet. * raptor/tests/ex-50.out, raptor/tests/ex-50.rdf, raptor/tests/ex-44.out, raptor/tests/ex-45.out, raptor/tests/ex-46.out, raptor/tests/ex-47.out, raptor/tests/ex-48.out, raptor/tests/ex-49.out, raptor/tests/ex-44.rdf, raptor/tests/ex-45.rdf, raptor/tests/ex-46.rdf, raptor/tests/ex-47.rdf, raptor/tests/ex-48.rdf, raptor/tests/ex-49.rdf: Checking rdf:bagID ignored on other property element cases * raptor/raptor_parse.c (raptor_generate_statement): Handles generating a reified statement ID for use with bagID and then reiifying the statement too. * raptor/tests/Makefile.am: Add ex-43 * raptor/tests/ex-43.out, raptor/tests/ex-43.rdf: Test rdf:bagID when property elements need generated reified ID * raptor/raptor_parse.c (raptor_generate_statement): Gain bag_element argument, use it throughout to indicate the element to find the rdf:bagID if any. (raptor_start_element_grammar): Generate _:bagid rdf:type rdf:Bag when rdf:bagID appears on node element. * raptor/tests/ex-42.out: Correct for actual output order 2002-12-15 Dave Beckett * raptor/tests/ex-03.rdf, raptor/tests/ex-03.out: correct this now that rdf:bagID support begins to work * raptor/tests/Makefile.am: Added ex-42 * raptor/tests/ex-42.out, raptor/tests/ex-42.rdf: rdf:bagID * raptor/tests/bad-04.rdf: Check rdf:ID and rdf:bagID with same value fails * raptor/tests/bad-02.rdf: Duplicate rdf:ID names * raptor/raptor_parse.c: Make debug less chatty about cdata, unless RAPTOR_DEBUG_CDATA defined. * raptor/raptor_parse.c (raptor_record_ID): Added, notes rdf:ID and rdf:bagID values, checks for duplicates (per in-scope base-URI). (raptor_free_ID_list): Added, frees structure above. (raptor_xml_start_element_handler): Handle xml:base using raptor_new_uri_for_xmlbase to strip/fix parts that aren't used. (raptor_start_element_grammar): Check for illegal rdf:ID, rdf:bagID and rdf:nodeID using raptor_valid_xml_ID. Check for duplicate rdf:ID and rdf:bagID values using raptor_record_ID. Only allow parsetype "Literal", "Resource" and "Collection", not case-equivalents. Check for and forbid property attributes on a literal property elemnent. * raptor/Makefile.am: Added raptor_utf8.c * raptor/raptor_internal.h: Export less from raptor_utf8.c * raptor/raptor_general.c (raptor_valid_xml_ID): Use raptor_unicode_is_namestartchar and raptor_unicode_is_namechar. * raptor/raptor_utf8.c: Raptor UTF-8 and Unicode support * raptor/tests/bad-03.rdf: Check rdf:ID and rdf:bagID values * raptor/tests/Makefile.am: Added bad-02 to bad-04 * raptor/raptor_uri.c (raptor_uri_construct): Internal; constructs a uri-ref string from the parts. (raptor_new_uri_for_xmlbase): Ad (raptor_uri_resolve_uri_reference): Copy reference path across when reference URI has one. Work for path components that are >1 letter long. (raptor_new_uri_for_xmlbase): Added, makes a new uri from an existing one, suitable for xml:base (no fragment, query; path must be present). (main): Make test cases use example.org. Add checks for the above bugs. * raptor/raptor.h: Added prototype for raptor_new_uri_for_xmlbase * raptor/ntriples_parse.c: raptor_ntriples_unicode_char_to_utf8 now raptor_unicode_char_to_utf8 raptor_ntriples_utf8_to_unicode_char now raptor_unicode_utf8_to_unicode_char (raptor_print_ntriples_string): Allow no delimiter. * raptor/raptor_internal.h: Added prototypes for raptor_valid_xml_ID Added prototypes for raptor_unicode_is_* methods. The ntriples_* utf8/unicode methods are now raptor_unicode_* * raptor/raptor_general.c (raptor_print_statement_as_ntriples): N-Triples escape URIs (for IRI compatibility). (raptor_validate_xml_ID): Added, checks that the syntax of attributes matching xml:ID are correct matching http://www.w3.org/TR/REC-xml-names/#NT-NCName * raptor/rdfdump.c: Exit 1 on error, 2 on warnings. * raptor/README.html: Words 2002-12-13 Dave Beckett * raptor/tests/ex-41.rdf, raptor/tests/ex-41.out: Add rdf:datatype test with xml:lang * raptor/raptor_parse.c: Don't care state about numbers * raptor/raptor_parse.c (raptor_xml_end_element_handler): Don't check for unbalanced XML; the XML parsers do that * raptor/raptor_parse.c: Update parser states to match http://www.w3.org/TR/rdf-syntax-grammar/ names. Fix comments to also match. rdf_syntax_terms_info - added to describe forbidden nodeEl, propEl, propAttr (raptor_forbidden_nodeElement_name, raptor_forbidden_propertyElement_name): Added, using above * raptor/rdfdump.c: Exit with code 2 if there were warnings. * raptor/raptor_parse.c: Zap xml:lang attr 2002-12-12 Dave Beckett * java/Makefile.am: die, extra ; * php/Makefile.am: _ not - * perl/lib/RDF/Redland.pm (DESTROY): call librdf_perl_world_finish at exit. * php/Makefile.am: Tidy clean * docs/php.html: Updated for current state (not working yet). * php/test.php, php/Makefile.am: PHP updates. Still not working yet. * php/php.ini: testing php.ini config * docs/ruby.html, docs/tcl.html: Updated, tested * tcl/example.tcl: fix stream typo * tcl/test.tcl: comment out non-working serializer test * python/example.py: fix arg * python/example.py: Added serializer code * docs/python.html: updated example output * tcl/Makefile.am: tidy clean * python/RDF.py: consistency things * python/RDF.py: Added yet more pydoc * python/RDF.py: Added more pydoc * docs/python.html: Reference, link ot pydoc/RDF.html * docs/fix-python-xhtml: Fix exceptions.html * docs/Makefile.am: Added pydoc and pydoc/RDF.html * docs/fix-python-xhtml: Fix pydoc output to be xhtml * docs/fix-pod-xhtml: minor changes * docs/python.html: Added RDFLib.net * python/example.py: Fixed for stream updates * docs/python.html: Added Serializer class * docs/perl.html: moved serializer around * docs/perl.html: Updated example output * docs/perl.html: Added Serializer class * docs/Makefile.am: Added perl POD Serializer * perl/example.pl: Tidy, add serializer example. * perl/Makefile.am: clean test-out.rdf * librdf/rdf_storage_hashes.c (librdf_storage_hashes_find_map): Don't free filtered shared statement, just return NULL. * docs/java.html: Updated. Added Serializer. * java/Makefile.am: More javac fixes * java/example.java: Tidy up * java/Makefile.am: Build redland-java.jar for tests and -classpath to use it. * java/test2.java: Replaced finalize() method with finished() that apps should call to release resources since Java never guarantees it is. * java/skeleton.java: Added Serializer * java/org/librdf/redland/World.java, java/org/librdf/redland/URI.java, java/org/librdf/redland/Stream.java, java/org/librdf/redland/Storage.java, java/org/librdf/redland/Statement.java, java/org/librdf/redland/Serializer.java, java/org/librdf/redland/Parser.java, java/org/librdf/redland/Node.java, java/org/librdf/redland/Model.java, java/org/librdf/redland/Iterator.java: Replaced finalize() method with finished() that apps should call to release resources since Java never guarantees it is. * java/test1.java: free uri after finishing with it * java/Makefile.am: Added lots of bodges to get around SWIG 1.3.15+ broken Java API. sed editing of the generated files to remove the stupid coreJNI class. * java/org/librdf/redland/Model.java (add - literal): Use librdf_model_add_typed_literal_statement * java/org/librdf/redland/Stream.java: Updated for stream changes * java/org/librdf/redland/Iterator.java: Updated for iterator changes 2002-12-11 Dave Beckett * python/RDF.py: Big update, lots of new docucomments, encouraged by pydoc. * python/Makefile.am: Added build target for RDF.html; should work if pydoc is around. * perl/lib/RDF/Redland/Model.pm (add_typed_literal_statement): Replacing add_string_literal_statement. * perl/Makefile.am: test.pl now in t/* tests dir. * configure.in: Added perl/t dir * Redland.i: Added librdf_model_add_typed_literal_statement to replace librdf_model_add_string_literal_statement * librdf/rdf_model.h, librdf/rdf_model.c: Added librdf_model_add_typed_literal_statement * perl/lib/RDF/Redland/Node.pm: Updated node types * python/test/test.py: add some more output messages * python/Makefile.am: tidy cleanfiles * Redland.i: Discovered the %newobject directive; use it to free() returned malloc() memory from the *_to_string methods. * perl/t/test1.t: Test updates, fixes. * perl/t/Makefile.am, perl/t/test1.t, perl/t/test2.t, perl/t/test3.t: perl test ftest.pl split into t/test1-3.t 2002-12-10 Dave Beckett * python/test/test.py: test Serializer class * python/Makefile.am: Add clean for serializer output * python/RDF.py: Serializer class fix * raptor/configure.in: Added raptor-config * redland-src-config.in: Call raptor/raptor-src-config * raptor/Makefile.am: Added raptor-src-config * raptor/raptor-src-config.in: raptor-src-config source * librdf/rdf_storage_hashes.c (librdf_storage_hashes_serialise_get_statement): Clear shared statement in context before decoding into it. (librdf_storage_hashes_node_iterator_get_method): Clear appropriate node/nodes of shared statement before decoding into it. For p2so case, use statement2 in context as shared statement result. (librdf_storage_hashes_node_iterator_finished): Tidy up shared statements or predicate from p2so statement2. (librdf_storage_hashes_node_iterator_create) Copy query nodes, initialise statement2 for p2so case. (librdf_storage_hashes_group_serialise_get_statement): Clear shared statement before decoding into it. * configure.in, acconfig.h, librdf/rdf_hash.c, librdf/rdf_hash_gdbm.c, librdf/rdf_hash_gdbm.h, librdf/Makefile.am: GDBM dead * examples/example1.c: Revert to memory storage for test * examples/example4.c: Do free statements added, used in queries. Don't free nodes returned from sources/targets/arcs * librdf/rdf_storage_list.c (librdf_storage_list_group_serialise_get_statement): clear statement of any previous nodes before overwriting. * librdf/rdf_statement.c (librdf_statement_decode): Revert freeing overwritten nodes; some code relies on this for shared nodes. Use librdf_statement_clear before to ensure this. * librdf/rdf_storage_list.c: Use librdf_stream_map_free_context_handler for calling librdf_stream_set_map * librdf/rdf_stream.h: Added librdf_stream_map_free_context_handler typedef * librdf/rdf_serializer.h: Added librdf_serializer_serialize_model_to_file * librdf/rdf_storage_hashes.c (librdf_storage_hashes_init_common): Added 'index-predicates=' config to turn on p2so index. (librdf_storage_get_hash_description_by_name): Comment out, unused for now. * examples/example1.c (main): Free added statement * examples/example1.c (main): Don't free shared node returned by iterator * librdf/rdf_storage_list.c (librdf_storage_list_find_map): Don't free statement on discard, just return NULL. * java/org/librdf/redland/Makefile.am: Added Serializer.java * java/org/librdf/redland/Serializer.java: Java Serializer class * python/RDF.py: Added Serializer class (not tested) * perl/lib/RDF/Redland/Serializer.pm: call librdf_serializer_serialize_model_to_file properly * python/RDF.py: When building sequences from iterated nodes, copy them. * perl/lib/RDF/Redland/Serializer.pm: method serialize_model now serialize_model_to_file * Redland.i: Replaced librdf_serializer_serialize_model with more suitable method librdf_serializer_serialize_model_to_file * librdf/rdf_serializer.c (librdf_serializer_serialize_model_to_file): Added - more suitable for calling from other langs than something with a FILE* arg. * librdf/PrintConsumer.java, librdf/PrintParser.java: Removed java wrapper parsers * librdf/rdf_parser.h, librdf/rdf_parser.c, librdf/Makefile.am, docs/api.sgml.in, docs/Makefile.am, configure.in, acconfig.h: Deleted old parsers: libwww, java sirpac-stanford, java sirpac-w3c * librdf/rdf_query.h: Include rdf_query_triples.h internally * librdf/rdf_node.h: Added librdf_node_static_iterator_create * librdf/rdf_hash.c: doc fix * librdf/Makefile.am: added rdf_stream_test rdf_iterator_test * librdf/rdf_stream.c (librdf_stream_from_node_iterator*): Changed implementation; copy the prototype statement, ensuring no problems if it goes away. (main): Added, testing librdf_new_stream_from_node_iterator using librdf_node_static_iterator_create to make a simple node iterator. * librdf/rdf_iterator.c (main): Added, testing general iterator features using librdf_node_static_iterator_create * librdf/rdf_node.c (librdf_node_static_iterator_is_end, librdf_node_static_iterator_next_method, librdf_node_static_iterator_get_method, librdf_node_static_iterator_finished, librdf_node_static_iterator_create): Added, to create an iterator over a static array of nodes. Mostly intended for testing iterator code. (main): style tweaks. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_find_statements): Copy the passed in statement and use librdf_stream_set_map free map context argument to free it when the stream is closed. * librdf/rdf_storage_list.c (librdf_storage_list_find_statements): Copy the passed in statement and use librdf_stream_set_map free map context argument to free it when the stream is closed. * librdf/rdf_stream.c (librdf_free_stream): Use free map context method if present argument (librdf_stream_set_map): Added a free map context method argument * librdf/rdf_stream.h: librdf_stream_set_map gains a free context method argument 2002-12-09 Dave Beckett * perl/lib/RDF/Redland/RSS.pm (properties_with_ns_prefix): Updated pod * librdf/rdf_statement.c (librdf_statement_init): Zap s,p,o pointers (librdf_statement_set_subject, librdf_statement_set_predicate, librdf_statement_set_object): Revert; don't free old pointers, some code is using this to update shared pointers. * librdf/rdf_hash.c (librdf_hash_keys_iterator_get_method): Return something for the GET_OBJECT method, so that librdf_iterator_update_current_element works OK * Redland.i: Add some prototypes. * librdf/rdf_statement.h, librdf/rdf_statement.c, librdf/rdf_node.h, librdf/rdf_node.c, librdf/librdf.h: librdf_statement is no longer a type of librdf_node. This implementation issue was never visible or used in the public API. * librdf/rdf_statement.c: (librdf_statement_set_subject, librdf_statement_set_predicate, librdf_statement_set_object): Free any existing node before setting. * perl/serialize.pl: More playing, still incomplete. 2002-12-08 Dave Beckett * librdf/rdf_storage_hashes.c (librdf_storage_hashes_add_remove_statement): Remove librdf_free_statement from here; wrong place. (librdf_storage_hashes_add_statements): Do not statement copy before add_statement method. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_serialise_finished): Clear static statement. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_add_remove_statement): Free passed in statement 2002-12-04 Dave Beckett * librdf/rdf_storage_list.c: (librdf_storage_list_group_serialise_finished) Use librdf_statement_clear to empty static statment. * librdf/rdf_statement.c (librdf_statement_clear): Added, for clearing static statements of nodes. (librdf_statement_decode): Check/remove existing nodes before overwriting them. * librdf/rdf_statement.h: Added librdf_statement_clear * raptor/raptor_parse.c (raptor_xml_start_element_handler): Save away the element attributes in an allocated array, restore the pointers later. This allows the XML parser to free them correctly. (raptor_xml_end_element_handler): Call raptor_free_qname again to tidy up. (raptor_init_parser_rdfxml): Initialise libxml2 explicitly (raptor_terminate_parser_rdfxml): Added, cleaning up libxml2. * raptor/raptor_libxml.c (raptor_libxml_endDocument): free the libxml2 Doc that is created but never freed by the SAX methods. * raptor/raptor_internal.h, raptor/raptor_general.c: Added raptor_terminate_parser_rdfxml() for closing rdfxml parser factory. * librdf/rdf_stream.c, librdf/rdf_iterator.c: Use is_finished and current fields to track when finished/empty. Rename iterator/stream *get_next_mapped* to *update_current* element/statement * librdf/rdf_storage.c (librdf_storage_stream_to_node_iterator_get_method): Do not touch fields in shared statement from stream. * librdf/rdf_statement.c: Fix comment. * librdf/rdf_storage_list.c (librdf_storage_list_group_serialise_get_statement): Use iterator (hash) value to decode context correctly. * librdf/rdf_hash.c (librdf_hash_get_all_iterator_get_method): Return something for get_object to enable general iterator to work 2002-12-03 Dave Beckett * raptor/raptor_libxml.c (raptor_libxml_internalSubset,raptor_libxml_externalSubset): No return value. * raptor/raptor.h: Update prototype for unsigned char arg. * raptor/raptor_parse.c: Yet more casts, for expat XML_Char as char* * raptor/raptor_uri.c (raptor_free_uri): There is no return value * raptor/raptor_uri.c, raptor/raptor_qname.c, raptor/raptor_parse.c, raptor/raptor_namespace.c, raptor/raptor_general.c, raptor/raptor.h, raptor/ntriples_parse.c: More unsigned char to char fixes, other castings enough to make g++ happy. * raptor/raptor_parse.c, raptor/raptor_qname.c, raptor/raptor_namespace.c, raptor/raptor_general.c, raptor/raptor_internal.h: Use unsigned char for UTF-8 strings rather than char (That means all XML names, content, buffers) * raptor/raptor_parse.c: Delete HAVE_XML_SetNamespaceDeclHandler - never used Don't merge expat XML_Char (char) and libxml2 xmlChar (unsigned char). Work with unsigned char always. * raptor/raptor_internal.h: Don't merge expat XML_Char (char) and libxml2 xmlChar (unsigned char). Work with unsigned char always. * raptor/configure.in, raptor/acconfig.h: Delete HAVE_XML_SetNamespaceDeclHandler - never used * raptor/raptor_parse.c (raptor_element_has_property_attributes): Unused rdf_parser arg zapped. * raptor/raptor_parse.c (raptor_xml_parse_chunk_): Don't assign a negative number to size_t len, it is probably unsigned. * raptor/raptor_parse.c (raptor_free_element): Use raptor_free_uri on datatype URI * raptor/raptor_parse.c, raptor/raptor.h: Removed trailing ','s in enums 2002-12-02 Dave Beckett * librdf/rdf_utf8.c: Updates for Unicode 3.2 UTF-8 encoding; forbid ranges and encodings that aren't used or allowed. * raptor/ntriples_parse.c (raptor_ntriples_string): sscanf format lx 2002-11-27 Dave Beckett * raptor/INSTALL.html: Now works with old libxml 2.3.5 (released 2001-03-23) * raptor/raptor_libxml.c (raptor_libxml_init): Use RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED to see if libxml xmlSAXHandler has an initialized field * raptor/configure.in: Check libxml xmlSAXHandler has initialized field defining RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED if so * raptor/acconfig.h: Added RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED * raptor/INSTALL.html: Updated supported versions 2002-11-26 Dave Beckett * librdf/rdf_utf8.c, librdf/rdf_uri.c, librdf/rdf_stream.c, librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage.c, librdf/rdf_statement.c, librdf/rdf_serializer_rdfxml.c, librdf/rdf_serializer_raptor.c, librdf/rdf_serializer.c, librdf/rdf_query_triples.c, librdf/rdf_query.c, librdf/rdf_parser_sirpac.c, librdf/rdf_parser_repat.c, librdf/rdf_parser_raptor.c, librdf/rdf_parser_libwww.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_model.c, librdf/rdf_memory.c, librdf/rdf_list.c, librdf/rdf_iterator.c, librdf/rdf_init.c, librdf/librdf.h, configure.in, raptor/win32_config.h, raptor/configure.in, raptor/rdfdump.c, raptor/raptor_uri.c, raptor/raptor_parse.c, raptor/raptor_libxml.c, raptor/raptor_general.c, raptor/ntriples_parse.c: stdarg.h is now a required header. * raptor/configure.in, configure.in: Added --with-xml2-config to set location of libxml xml2-config program. * librdf/rdf_serializer_rdfxml.c: Fix broken comment * librdf/rdf_serializer_rdfxml.c: Documentation. Added some. (rdf_serializer_rdfxml_ok_xml_name): Correct the check. 2002-11-25 Dave Beckett * librdf/rdf_serializer.h: Added librdf_serializer_rdfxml_constructor * librdf/rdf_serializer.c: Use librdf_serializer_rdfxml_constructor * librdf/rdf_serializer_rdfxml.c: s/stream/handle/ for file handles (rdf_serializer_rdfxml_print_as_xml_content): Added to print XML-escaped element content (rdf_serializer_rdfxml_print_as_xml_attribute): Added to print XML-escaped attribute content (rdf_serializer_rdfxml_print_xml_attribute): Added to print attribute plus escaped content. (librdf_serializer_print_statement_as_rdfxml): Use above to properly handle attributes and element content. * librdf/Makefile.am: Added rdf_serializer_rdfxml.c * librdf/rdf_serializer_rdfxml.c: Dumb RDF/XML Serializer * INSTALL.html: Tested with BDB 4.1.24 * acconfig.h, configure.in, librdf/rdf_hash_bdb.c (librdf_hash_bdb_open): Updated to handle BDB V4.1 DB->open which now has 7 arguments. 2002-11-24 Dave Beckett * raptor/raptor_parse.c (raptor_xml_start_element_handler): Don't free raptor_free_qname(element_name) here, raptor_free_element does it. * perl/lib/Makefile.am, perl/lib/RDF.pm: RDF.pm removed as promised 2002-11-21 Dave Beckett * librdf/rdf_parser_libwww.c: parse into model always works * librdf/rdf_parser_libwww.c: Updated for stream method changes. * ruby/example.rb, tcl/test.tcl, tcl/example.tcl, python/test/test.py, python/example.py, python/RDF.py, perl/lib/RDF/Redland/Stream.pm, perl/lib/RDF/Redland/Model.pm, perl/lib/RDF/Redland/Iterator.pm: Updated for stream and iterator method changes. * perl/test.pl, perl/serialize.pl, perl/example.pl, examples/example4.c, examples/example1.c: Updated for stream method changes. * Redland.i: Updated for stream method changes. Added librdf_node_set_typed_literal_value Added librdf_stream_get_object, split from librdf_stream_next * librdf/rdf_parser_repat.c: Updated for stream method changes. * librdf/rdf_parser_raptor.c: Updated for stream method changes. (librdf_parser_raptor_get_next_statement): Call Raptor using new raptor_parse_chunk API allowing better handling of large content. (librdf_parser_raptor_destructor): Added, to tidy up raptor on module close. * librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage.h, librdf/rdf_storage.c: Updated for stream method changes. * librdf/rdf_parser.h: Added librdf_parser_raptor_destructor * librdf/rdf_parser.c (librdf_finish_parser): Call librdf_parser_raptor_destructor on module close. * librdf/rdf_serializer_raptor.c (librdf_serializer_print_statement_as_ntriple): Updated for N-Triples language changes, XML Literal (librdf_serializer_raptor_serialize_model): Updated for stream method changes. * librdf/rdf_serializer.c (librdf_get_serializer_factory): Fix call to librdf_uri_equals. * librdf/rdf_model.c: (librdf_model_add_statements_group, librdf_model_remove_statements_group) Updated for stream method changes. * librdf/rdf_stream.c: Stream changed to more cursor-like, matching Iterator class. (librdf_new_stream): Updated args - next_method and get_method (librdf_free_stream): Updated for renamed method. (librdf_stream_get_next_mapped_statement, librdf_stream_end,librdf_stream_next): Updated for new methods. (librdf_stream_get_object): Added (librdf_stream_get_context): Added (librdf_new_stream_from_node_iterator, librdf_stream_from_node_iterator_next_statement, librdf_stream_from_node_iterator_get_statement): Added / updated for stream changes. Use a static statement instead of creating new ones on each call. (librdf_stream_print): Updated for stream method changes. * librdf/rdf_stream.h: Stream changed to more cursor-like, matching Iterator class. Split get_next method into get/next methods. Added librdf_stream_get_object, librdf_stream_get_context * librdf/rdf_iterator.h: iterator structure - is_end now is_end_method, finished now finished_method * librdf/rdf_iterator.c (librdf_new_iterator,librdf_free_iterator): Parameter and structure renamings; use is_end_method instead of is_end * librdf/rdf_uri.c (librdf_uri_equals): Added defensive check, any NULL parameters is failure. * librdf/rdf_statement.c (librdf_statement_init): Added stronger usage instructions. * librdf/rdf_concepts.h, librdf/rdf_concepts.c: Added rdf:XMLLiteral * librdf/rdf_node.h: Remove is_wf_xml field, add datatype URI field to node structure Added prototypes for: librdf_new_node_from_typed_literal, librdf_node_get_literal_value_datatype_uri, librdf_node_set_typed_literal_value * librdf/rdf_node.c (librdf_node_set_typed_literal_value): Added (librdf_new_node_from_typed_literal): Added (librdf_node_get_literal_value_datatype_uri): Added Remove is_wf_xml field, add datatype URI field to node structure (librdf_node_equals): Updated for datatypes (librdf_node_encode, librdf_node_decode): Added datatyped node encoding 'M'. * raptor/configure.in: Make it use expat sources if this is part of Redland, ../expat dir exists and there is no installed expat system library * raptor/raptor_parse.c (raptor_xml_parse_chunk_): Only use the libxml2 bug workaround for small buffers for libxml2 versions lower than 2.4.25 * raptor/tests/Makefile.am: Report error status from standard rdf/xml tests, even if the answer was correct. * raptor/tests/ex-03.rdf: Remove aboutEach* and bare bagID 2002-11-20 Dave Beckett * php/test.php, php/example.php: Do nothing * php/Makefile.am: Run test (does nothing so far apart from import Redland) * docs/php.html: typo * docs/Makefile.am: Added php.html (no API in release though) * docs/php.html: PHP API doc 2002-11-19 Dave Beckett * raptor/tests/test.out, raptor/tests/test.nt, raptor/tests/ex-11.out, raptor/tests/ex-07.out, raptor/raptor_parse.c, raptor/raptor_general.c, raptor/ntriples_parse.c: rdfs:XMLLiteral now rdf:XMLLiteral Add rdf:nil to allowed rdf namespace terms * raptor/raptor_parse.c: More error/warnings rewordings * raptor/raptor_parse.c: Remove M&S from some comments, messages. Use RDF namespace. * raptor/raptor_parse.c: Improve warning about multiple object nodes for a property element. 2002-11-12 Dave Beckett * perl/lib/RDF/Redland/RSS.pm (inchannel): Delete; never part of RSS 1.0 2002-11-11 Dave Beckett * perl/lib/RDF/Makefile.am, perl/lib/RDF/Stream.pm, perl/lib/RDF/URI.pm, perl/lib/RDF/Model.pm, perl/lib/RDF/Node.pm, perl/lib/RDF/Parser.pm, perl/lib/RDF/RSS.pm, perl/lib/RDF/Statement.pm, perl/lib/RDF/Storage.pm, perl/lib/RDF/Iterator.pm: Removed old perl namespaced modules * Redland.i: Removed duplicate and clashing extern declarations. 2002-11-07 Dave Beckett * raptor/tests/test.out: typo * raptor/tests/test.nt: Remove xml"foo" tests, replacing with "foo"<...> form. 2002-11-06 Dave Beckett * raptor/tests/test.out, raptor/tests/ex-11.out, raptor/tests/ex-07.out: Remove xml"foo" tests, replacing with "foo"<...> form. * raptor/raptor_general.c: Remove xml"foo" (stage 1). (raptor_print_statement_detailed): Output this as a datatyped literal. (raptor_print_statement_as_ntriples): Output the "foo"<..> datatype N-Triples form. * raptor/ntriples_parse.c: Remove xml"foo" (stage 1). Parsing it works but gives an error. Never output. (raptor_ntriples_generate_statement): Output "foo"<...> for xml literal. Remove is_xml argument. (raptor_ntriples_parse_line): For XML literal (old xml"foo"), parse, give an error and emit it in the datatype form. 2002-11-02 Dave Beckett * raptor/configure.in: Bumped version to 0.9.7 * raptor/raptor_parse.c: rdf_attr_info gains allowed_unprefixed_on_attribute to suppress warning. * raptor/libraptor.3: Updated for 0.9.6 * raptor/tests/test.out: minor fix * raptor/rdfdump.1: Add -a/--assume option. * raptor/raptor.h: Tweak uri factory method typedefs, prefix with raptor_ * raptor/raptor.h: raptor_start_parse_file: Made an internal method * raptor/raptor_general.c (raptor_start_parse_file): Made an internal method * raptor/tests/test.nt: minor fix * raptor/tests/test.out, raptor/tests/test.nt: Added tests for datatyped literals with/without language * raptor/ntriples_parse.c (raptor_ntriples_string): Added N-Triples datatype (^^) parsing. 2002-11-01 Dave Beckett * raptor/ntriples_parse.c (raptor_ntriples_generate_Statement): Added datatypes argument, will set the URI if the string is passed in. 2002-10-31 Dave Beckett * raptor/raptor_parse.c: Check for rdf:datatype on property/member elements * raptor/tests/Makefile.am: Added ex-41 * raptor/tests/ex-41.out, raptor/tests/ex-41.rdf: Added rdf:datatype tests * raptor/raptor_parse.c (raptor_free_element): Free xml:lang values * raptor/raptor_parse.c: alternatively, don't zap the pointer and let cleanup grab it. * raptor/raptor_parse.c: free rdf:about attribute value before discarding pointer. * raptor/raptor_general.c (raptor_parse_file): Always free filename. * raptor/raptor_uri.c (raptor_uri_filename_to_uri_string): Fix length of buffer for unix when file name is recalculated from getcwd(). * raptor/raptor_namespace.c (raptor_namespaces_free): Don't need non-NULL context to do freeing. * librdf/rdf_parser_raptor.c (librdf_parser_raptor_constructor): raptor_init(), not just URI class. * raptor/ntriples_parse.c: Update to handle xml"string"@lang format (and warn about older one) * raptor/ntriples_parse.c: Update to handle "string"@lang format (and warn about older one) * raptor/tests/test.out, raptor/tests/test.nt, raptor/tests/rdfs-namespace.out, raptor/tests/rdf-schema.out, raptor/tests/ex-29.out: Update to "string"@lang format. * raptor/raptor_general.c (raptor_print_statement_as_ntriples): Update to "string"@lang format. Add datatype URI. * raptor/rdfdump.c (main): Init uri_string variables * raptor/raptor_internal.h, raptor/ntriples_parse.c, raptor/raptor_namespace.c, raptor/raptor_parse.c, raptor/raptor_qname.c, raptor/raptor_uri.c, raptor/raptor_general.c, raptor/raptor_libxml.c: LIBRDF_ macros now RAPTOR_ * raptor/raptor_internal.h: Remove raptor_uri_init * librdf/rdf_parser_raptor.c: Update to new raptor API * raptor/raptor.h: Added raptor_uri_init * raptor/raptor_namespace.c: (main) Updates for initialising URI class in/outside redland * raptor/rdfdump.c: When RAPTOR_IN_REDLAND, include * raptor/rdfdump.c: Use raptor URI calls. Use raptor_init/raptor_finish - now required. * raptor/raptor_general.c (raptor_init): Now compulsory * raptor/raptor_parse.c, raptor/raptor_locator.c, raptor/raptor_namespace.c: macro RAPTOR_URI_AS_STRING -> raptor_uri_as_string * raptor/raptor_internal.h: Removed macro RAPTOR_URI_AS_STRING * raptor/raptor_general.c: macro RAPTOR_URI_AS_STRING -> raptor_uri_as_string * raptor/raptor.h: Added raptor_uri_as_string and uri class method * librdf/rdf_parser_raptor.c (librdf_raptor_uri_as_string): Added, registered for raptor uri class. * raptor/raptor_uri.c (raptor_default_uri_as_string): Added (raptor_uri_as_string): Added, using above for default class. (raptor_uri_init_default_handler): Register the above * raptor/raptor_general.c: Use RAPTOR_URI_AS_STRING for getting uri string to make a filename. * raptor/raptor_parse.c: Remove uses of IS_RDF_MS_CONCEPT with raptor_uri_equals. Define more concepts for rdf:RDF, rdf:Description and rdf:li * raptor/raptor_internal.h: remove IS_RDF_MS_CONCEPT * raptor/raptor_qname.c: macro RAPTOR_FREE_URI -> raptor_free_uri * raptor/raptor_internal.h: delete macros RAPTOR_FREE_URI, RAPTOR_URI_TO_FILENAME * raptor/raptor_general.c: macro RAPTOR_FREE_URI -> raptor_free_uri macro RAPTOR_URI_TO_FILENAME -> raptor_uri_uri_string_to_filename (only use) * raptor/ntriples_parse.c: macro RAPTOR_FREE_URI => raptor_free_uri * raptor/raptor_uri.c: Add some casts now raptor_uri is a typedef for void* * raptor/raptor_internal.h, raptor/raptor.h: Remove more RAPTOR_IN_REDLAND prototypes * raptor/ntriples.h: Remove more RAPTOR_IN_REDLAND * raptor/rdfdump.c: Remove more RAPTOR_IN_REDLAND and old API * raptor/raptor_parse.c: Re-add DAML Collection info to rdf_content_type_info table - just plain luck that this was working without it. Add concept URIs table to rdf_xml_parser structure. Change concepts macros to point to the parts of that table. Remove most of the RAPTOR_IN_REDLAND stuff, consequently. * raptor/raptor_namespace.c (raptor_namespaces_free): Handle being called when handler/context empty. * raptor/raptor_namespace.c: Use raptor_namespace struct raptor_namespace_stack field to get uri handler/context * raptor/raptor_internal.h: raptor_namespace: add raptor_namespace_stack field * raptor/raptor_general.c (raptor_start_parse): Use changed raptor_namespaces_init call. * raptor/raptor_namespace.c: Remove RAPTOR_REDLAND code and use uri_handlre/context args (raptor_namespaces_init): Now takes uri handler, context args. Initialises rdf/rdfs namespace URIs. (raptor_namespaces_free): Free rdf/rdfs namespace URIs. * raptor/raptor_general.c: Remove RAPTOR_REDLAND code Call raptor_namespaces_init with raptor URI handler, context * raptor/raptor_internal.h: Remove RAPTOR_REDLAND definitions and double prototypes. Added uri_handler, uri_context, rdf_ms_uri, rdf_schema_uri to raptor_namespace_stack. * raptor/ntriples_parse.c: Remove RAPTOR_REDLAND code * raptor/raptor_uri.c (raptor_uri_get_handler): Added * raptor/raptor.h: Added raptor-uri_get_handler. * raptor/raptor_uri.c: rename raptor_current_uri_* -> raptor_uri_current_* * librdf/rdf_parser_raptor.c: Added raptor uri factory initialisation calls, untested yet. * raptor/raptor_uri.c: Use raptor_current_uri_handler, raptor_current_uri_context throughout. 2002-10-30 Dave Beckett * raptor/raptor_uri.c (raptor_uri_set_handler): Added, initialising the static variables raptor_current_uri_handler, raptor_current_uri_context. raptor_init_uri_class -> raptor_uri_init * raptor/raptor_general.c, raptor/raptor_internal.h: raptor_init_uri_class -> raptor_uri_init * raptor/raptor.h: Added raptor_uri_set_handler * raptor/raptor_uri.c: raptor_copy_uri -> raptor_uri_copy (raptor_default_uri_copy): Added (raptor_init_uri_default_handler): Added to re-init the default uri class. (raptor_init_uri_class): To initialise the uri class with default handler * raptor/raptor_internal.h: Declare uri class init prototypes. * raptor/raptor_parse.c, raptor/raptor_general.c: raptor_copy_uri -> raptor_uri_copy * raptor/raptor.h: raptor_copy_uri -> raptor_uri_copy Added uri handler func definitions. Added raptor_uri_handler, using above funcs 2002-10-15 Dave Beckett * raptor/raptor_qname.c: Remove only RAPTOR_IN_REDLAND use - not required. * raptor/raptor_uri.c: Updated copyright * raptor/ntriples_parse.c: Removed raptor_make_uri; use raptor_new_uri_relative_to_base directly. * raptor/raptor.h: Removed raptor_new_uri_from_base_name prototype * raptor/raptor.h: Removed all raptor_make_uri prototypes. Added prototypes for raptor_new_uri_relative_to_base, raptor_new_uri_from_id, raptor_new_uri_from_base_name, raptor-new_uri_for_rdf_concept. * raptor/raptor_parse.c: RAPTOR_FREE_URI (macro) to raptor_free_uri (method) Removed raptor_make_uri; use raptor_new_uri_relative_to_base directly. Removed raptor_make_uri_from_id: use raptor_new_uri_from_id directly Use raptor_new_uri_for_rdf_concept * raptor/raptor_uri.c: Typo. Removed raptor_make_uri; use raptor_new_uri_relative_to_base directly. (raptor_default_new_uri_for_rdf_concept, raptor_new_uri_for_rdf_concept): Added to get URI of rdf:thing 2002-10-13 Dave Beckett * raptor/raptor_uri.c (raptor_default_new_uri_relative_to_base, raptor_new_uri_relative_to_base): Added (raptor_new_uri_from_id): Added, was make_uri_from_id (raptor_new_uri_from_base_name): Added, was make_uri_from_base_name * raptor/raptor.h: Added new uri methods, soon-to-be old make_uri_* ones * raptor/raptor_internal.h: Move uri calls to raptor.h * raptor/raptor_parse.c: Remove unused rdf_parser argument of raptor_make_uri_from_id calls. * raptor/raptor_uri.c (raptor_make_uri_from_id): Remove unused rdf_parser argument * raptor/raptor_uri.c: Start of skeleton code for URI class, along with default methods. (raptor_default_new_uri, raptor_new_uri): Added (raptor_default_new_uri_from_uri_local_name, raptor_new_uri_from_uri_local_name): Added (raptor_default_free_uri,raptor_free_uri): Added (raptor_default_uri_equals, raptor_uri_equals): Added (raptor_make_uri, raptor_make_uri_from_id, raptor_make_uri_from_base_name):Moved from raptor_general.c * raptor/raptor_general.c: Move raptor_make_uri, raptor_make_uri_from_id, raptor_make_uri_from_base_name to raptor_uri.c 2002-10-12 Dave Beckett * raptor/raptor_parse.c (raptor_xml_parse_terminate): Moved all of raptor_xml_parse_clean here, deleted it. * raptor/rdfdump.c: Updated to newest calling API - no special ntriples calls. * raptor/raptor_general.c, raptor/raptor.h: Tweak raptor_new_parser prototype. * raptor/libraptor.3: Updated to describe features * raptor/libraptor.3: Updated for shared parser core api * raptor/raptor_parse.c: Add raptor_xml_parser here - private struct. * raptor/raptor_internal.h: Moved raptor_xml_parser to private file. * raptor/raptor_general.c: Tidy raptor_new old api note. * raptor/ntriples.h: Updated ntriples parser to new registering API. * raptor/ntriples_parse.c: Converted to the new factory-based API. raptor_ntriples_parser_context (and struct version _s) now allocated by main parser code. Use raptor_parser for most methods and calls. (raptor_ntriples_parse_init, raptor_ntriples_parse_terminate): Added (raptor_ntriples_new): Replaced with wrapper around raptor_new_parser("ntriples"). (raptor_ntriples_free): Replaced with wrapper around raptor_free_parser (raptor_ntriples_set_error_handler, raptor_ntriples_set_fatal_error_handler, raptor_ntriples_set_statement_handler, raptor_ntriples_parser_error, raptor_ntriples_parser_fatal_error, raptor_ntriples_parse_file): Replaced with wrappers around general methods. (raptor_ntriples_parse_chunk): Renamed from raptor_ntriples_parse (raptor_ntriples_parse_start): Added from parts of old raptor_ntriples_parse_file. (raptor_ntriples_parser_register_factory): Added to register this with the main system. (raptor_init_parser_ntriples): Added to register this module. 2002-10-11 Dave Beckett * raptor/raptor_internal.h: Moved raptor_parser_s here, for use across the library. Lots of rearranging and reordering to move structs earlier. Added raptor_parser_factory_s and typedef. Added prototypes for factory registration calls. * raptor/raptor_parse.c: Now uses factory and parser-specific context. (raptor_xml_new, raptor_xml_free, raptor_xml_parse_init): Moved most code to raptor_new_parser, raptor_free_parser, raptor_start_parse (raptor_xml_parse_init_file): Gone. Renamed to match factory methods - raptor_xml_parse_terminate. (raptor_parse_file): Moved to raptor_general.c (raptor_xml_parser_register_factory): Added, for registering factory. (raptor_init_parser_rdfxml): Register parser type "rdfxml". * raptor/raptor_general.c: Added parser factory functions and use them via new API. (raptor_init, raptor_finish): Added to start/end raptor. (raptor_delete_parser_factories): Added, helper for cleanup. (raptor_parser_register_factory): Added, for registering parsers (raptor_get_parser_factory): Added, helper for finding a parser (raptor_new_parser): New constructor, uses factory and initialises only general parts of parser. (raptor_start_parse): New method to (re)initialise a particular parse. (raptor_start_parse_file): New method to start parsing from a filename. (raptor_parse_chunk): New method to parse content from memory. (raptor_free_parser): New destructor. (raptor_parse_file): Moved from raptor_parse.c and made general. (raptor_new): Old API constructor, now written over new constructor. (raptor_free): Old API destructor, now just calls new destructor. (raptor_set_world): Temporary redland support. * raptor/raptor_namespace.c (raptor_namespaces_free): Zap top of stack when done, so can work when called multiple times. * raptor/raptor.h: Added raptor_init(), raptor_finish() Deprecate raptor_new(), raptor_free(). Added raptor_new_praser(), raptor_free_parser(), raptor_start_parser(), raptor_start_parse_file(), raptor_parse_chunk() Temporarily use raptor_set_redland_world. 2002-10-10 Dave Beckett * raptor/Makefile.am: Added raptor_general.c * raptor/raptor.h: raptor_print_statement_detailed: Now public. * raptor/raptor_internal.h, raptor/raptor_parse.c, raptor/raptor_general.c: Split general parsing routines into raptor_general.c leaving the rdf/xml parsing specific parts in raptor_parse.c. The general raptor_parser structure moved to raptor_internal.h leaving a new raptor_xml_parser for raptor_parse.c [rdf/xml]. 2002-10-07 Dave Beckett * raptor/tests/test.html, raptor/tests/test.svg: Embedded rdf:RDF tests * raptor/raptor_general.c, raptor/raptor_parse.c: Call dummy (length calculating) vsnprintf call with a 1-byte buffer rather than NULL - OSX seems unhappy with that. Try to get rdf:RDF scanning working by adding at_grammar_start check rather than apply at all state unknown points. 2002-09-30 Dave Beckett * php/Makefile.am: PHP interface * configure.in, Makefile.am: Added php interface 2002-09-29 Dave Beckett * raptor/tests/Makefile.am: Split the checks into classes; ex-19.rdf is for when rdf is assumed since it ommits rdf:RDF, and hence is not really rdf/xml. * raptor/rdfdump.c: Added -a,--assume to set feature assume_is_rdf * raptor/raptor_general.c, raptor/raptor_parse.c: Added rdf:datatype built in. Literal datatype URI stored in containing property element. Added feature_assume_is_rdf to make rdf:RDF optional. (raptor_generate_statement): Add literal datatype URI argument. (raptor_xml_parse_chunk_): Return parser errors in initial XML_Parse correctly - check if it happens even if end of data. Similarly for libxml's xmlParseChunk. (raptor_set_feature): Added feature assume_is_rdf (raptor_print_statement_detailed): Added literal datatype URI printing. (raptor_process_property_attributes): Warn about unqualified (property) attributes, don't try to process them. (raptor_start_element_grammar): Added feature assume_is_rdf splitting scanning for rdf:RDF (feature scanning) and ignoring it (feature assume) * raptor/raptor_qname.c (raptor_new_qname): Don't die on non-namespaced XML; could be used in skipping or other processing. * raptor/raptor.h: added assume_is_feature datatypes built in raptor_print_ntriples_string now returns an int * raptor/LICENSE.html: Tidy intro, update dates * raptor/ntriples_parse.c: change anon->bnodeid Add ASCII rather than is* locale-tests and validate bnodeIDs with the macros (parse_ntriples_string): Check for invalid ASCII chars. Tidy error reporting for end of line. (raptor_ntriples_parse_line): Add validation of bnodeIDs (raptor_ntriples_parse_file): Comments (raptor_print_ntriples_string): Handle failure, add a return code * raptor/ntriples.h: change anon->bnodeid * raptor/configure.in: datatypes built in now * raptor/Makefile.am: Clean the test programs 2002-09-27 Dave Beckett * perl/Makefile.am: Updates to make swig re-run and build lib/RDF/Redland/CORE.pm when it is needed. * python/RDF.py: Check for == None as well as == "NULL" as return from SWIG methods. (Change to the SWIG calling convention in newer version) 2002-09-19 Dave Beckett * NEWS.html: Update old N-Triples link * raptor/Makefile.am: Restore rule to make librdf.la for when embedded in Redland * raptor/raptor_libxml.c (raptor_libxml_init): Enable handling of cdata blocks - by registering callback to raptor_xml_cdata_handler * raptor/tests/ex-40.out: Fix node * raptor/tests/Makefile.am: Added ex-40 * raptor/tests/ex-40.out, raptor/tests/ex-40.rdf: Check XML CDATA sections * raptor/Makefile.am: dist-hook added to copy pre-built README and NEWS to release * librdf/Makefile.am: Remove dist-hook, rpm, finish - not needed or usable any longer. 2002-09-18 Dave Beckett * raptor/raptor_namespace.c (raptor_namespace_new): Fix debug message to report no URI for namespace. * raptor/raptor_namespace.c (raptor_namespace_new): Make xmlns="" work when compiling inside Redland. 2002-09-17 Dave Beckett * examples/example1.c: Add another statement by hand so we get multiple statements and targets * librdf/rdf_storage.c (librdf_storage_stream_to_node_iterator_get_method): Handle being called before librdf_storage_stream_to_node_iterator_next_method and initialising statement. * librdf/rdf_storage_hashes.c (librdf_storage_hashes_serialise_next_statement, librdf_storage_hashes_group_serialise_next_statement): Move librdf_iterator_next call till after the data is fetched. * docs/api.sgml.in: minor rewordings * docs/kernel-doc: Updated to new linux version. Fix minor error reporting bug. * examples/example1.c: Fix subject to work with updated ../perl/dc.rdf * Redland.i: Added librdf_node_equals which was already being used by language interfaces! 2002-09-16 Dave Beckett * raptor/raptor_parse.c (raptor_xml_parse_chunk_): For libxml, don't pass in filename to xmlCreatePushParserCtxt, we may not always have one. For lbixml, return correctly from initial parsing. (raptor_xml_parse_chunk): Add docucomments. (raptor_parse_file): Terminate loop on end of file as well as error. * raptor/Makefile.am: Added REDLAND_LIBS to raptor_namespace_test to make it work inside redland 2002-09-12 Dave Beckett * raptor/raptor_parse.c (raptor_parse_file): Split into: raptor_xml_parse_init, raptor_xml_parse_init_file, raptor_xml_parse_clean and raptor_xml_parse_chunk to allow more flexible APIs. (raptor_xml_parse_chunk_): Added, doing the main work of raptor_xml_parse_chunk but without error checking. (raptor_xml_parse_handle_errors): Added to process errors from an XML parser during parsing. * raptor/raptor_namespace.c: Make it work inside redland too. Fix standalone tests inside redland. 2002-09-11 Dave Beckett * raptor/raptor_internal.h: Moved namespace and qname definitions and prototypes here from raptor_parse.c * raptor/Makefile.am: Added raptor_namespace.c raptor_qname.c * raptor/raptor_parse.c: Moved namespace code to raptor_namespace.c, qname code to raptor_qname.c and renamed raptor_ns_map, raptor_ns_na,e to match. * raptor/raptor_qname.c: Raptor XML qname * raptor/raptor_namespace.c: Raptor XML namespace classes 2002-09-06 Dave Beckett * repat/Makefile.am: Use REPAT_LIBS to link tests with an expat XML parser * configure.in: Added REPAT_LIBS to link internal repat tests with an expat XML parser (only) * librdf/rdf_digest_md5.c: Include rdf_types.h for u32 2002-09-05 Dave Beckett * python/Makefile.am: Use SWIG_PYTHON_ARGS * configure.in: Check for swig 1.3.14+ and add SWIG_PYTHON_ARGS=-noproxy * configure.in: Add warning if BDB library cannot be found in dir, then default to 'db' * autogen.sh: Remove config.cache before running new configure 2002-09-04 Dave Beckett * python/RDF.py: Add some defensive checks for __str__ calls on null nodes/statements 2002-09-03 Dave Beckett * autogen.sh: Fix swig check * python/test/test.py: test with raptor parser * autogen.sh: Require swig, min 1.3.10 * configure.in: SWIG 1.3.10 required; warn appropriately if pre-generated files are present, is OK but no generating possible. * autogen.sh: Move copying of local copies of config.guess, config.sub to after automake, libtool to ensure it overwrides. 2002-09-02 Dave Beckett * librdf/rdf_storage_hashes.c: Re-include some headers for internal prototypes 2002-09-01 Dave Beckett * raptor/raptor_parse.c: Use updated LIBRDF_RS URI names * librdf/rdf_concepts.h: Rename new syntax terms to be CONCEPT_RS (revised syntax) etc. Add URI terms too. * raptor/raptor_parse.c: Added rdf:parseType="Collection" after daml:collection code * raptor/tests/Makefile.am: Added test ex-39 for parseType Collection * raptor/tests/ex-39.out, raptor/tests/ex-39.rdf: rdf:parseType="Collection" test * librdf/rdf_concepts.h, librdf/rdf_concepts.c: Add new concepts rdf:nodeID, rdf:List, rdf:first, rdf:rest, rdf:nil * librdf/rdf_query.c: Include rdf_query.h and rdf_query_triples.h again for prototypes * librdf/rdf_storage.c: Include rdf_storage.h and rdf_storage_hashes.h again for prototypes * librdf/rdf_uri.h: librdf_uri_to_filename renamed from librdf_uri_as_filename. * librdf/rdf_uri.c (librdf_uri_to_filename): Renamed from librdf_uri_as_filename. * librdf/rdf_parser_repat.c (librdf_parser_repat_parse_file_as_stream): librdf_uri_as_filename now librdf_uri_to_filename. * librdf/rdf_parser.c (librdf_parser_parse_as_stream,librdf_parser_parse_into_model): filename not needed * librdf/rdf_hash_memory.c: Include rdf_hash_memory.h again for prototypes * raptor/raptor_parse.c: Change daml:Collection, daml:* comments to Collection, rdf:List etc. 2002-08-31 Dave Beckett * raptor/raptor_parse.c (raptor_end_element_grammar): Generate rdf:nodeID, store in id, not URI field. Rearrange three calls of raptor_process_property_attributes into one. * raptor/tests/Makefile.am: Use ECHO_N and ECHO_C to do portable echo without newline * raptor/configure.in: Pass on echo pre/postfix args needed for echoing without a newline * raptor/tests/Makefile.am: Instead of ignoring warnings, make make ignore exit codes from rdfdump * raptor/tests/Makefile.am: Ignore warnings (for now) in tests * raptor/tests/Makefile.am: Remove RDF_TEST_ANSWER_FILES - not used * raptor/raptor_parse.c (raptor_start_element_grammar): Don't copy URIs from daml:collection to the contained nodes. * raptor/tests/ex-34.out: Now correct. 2002-08-29 Dave Beckett * raptor/tests/Makefile.am: Added ex-38 * raptor/tests/ex-38.rdf, raptor/tests/ex-38.out: Test daml:Collection with rdf:ID * raptor/tests/ex-37.out: switch order again * raptor/raptor_parse.c (raptor_element_has_property_attributes): Check for rdf: properties too * raptor/tests/ex-37.out: Correct order, nodes in result * raptor/tests/ex-37.out, raptor/tests/ex-37.rdf: rdf:type attribute on empty property * raptor/tests/Makefile.am: Added ex-37 2002-08-28 Dave Beckett * raptor/tests/ex-13.nt: deleted * raptor/raptor_parse.c: Fixed empty daml:Collection handling * raptor/raptor_uri.c: Minor strcat/strcpy optimisation * raptor/tests/ex-34.rdf: Renamed nodes so prop2 goes with node2 etc. * raptor/tests/ex-34.out: renamed genids to more match output * raptor/tests/ex-35.out, raptor/tests/ex-35.rdf, raptor/tests/ex-36.out, raptor/tests/ex-36.rdf: Added more daml:Collection checks * raptor/tests/ex-24.out: output order changed, same triples * raptor/tests/Makefile.am: Added ex-35, ex-36 for more daml:Collection checks * raptor/tests/ex-12.out: output order changed, same triples 2002-08-22 Dave Beckett * raptor/raptor_parse.c: removed fn not used * raptor/raptor_parse.c: Update xml namespaces comment with NE05 errata * raptor/raptor_parse.c: Removed use of obsolete object_is_literal statement field Added rdf datatypes test code * raptor/ntriples_parse.c: Removed use of obsolete object_is_literal statement field * raptor/raptor.h: Add statement object datatype uri * raptor/configure.in: Add rdf datatypes test flag --enable-rdf-datatypes * raptor/acconfig.h: Add rdf datatypes test flag 2002-08-20 Dave Beckett * raptor/raptor_uri.c (raptor_uri_uri_string_to_filename): Freeing wrong things * raptor/ntriples_parse.c, raptor/raptor_parse.c, raptor/raptor_internal.h: Remove RAPTOR_URI_AS_FILENAME * raptor/raptor.h: Added raptor_uri_is_file_uri * raptor/configure.in: Added limits.h check * librdf/rdf_uri.c (librdf_uri_is_file_uri): Use raptor_uri_is_file_uri * raptor/raptor_internal.h: Added raptor_strncasecmp * raptor/raptor_uri.c (raptor_uri_is_file_uri): Added. * raptor/Makefile.am: Added strcasecmp_test * raptor/strcasecmp.c (raptor_strncasecmp): Added (assert_strcasecmp, assert_strncasecmp): Added for testing. (main) Added to run tests * raptor/raptor_uri.c: (raptor_uri_filename_to_uri_string); For unix filename "foo", get dir and name it "/dir/foo". (main): Check above works using /tmp dir - warn if can't chdir(/tmp) * raptor/raptor_internal.h: Replaced raptor_file_uri_to_filename with aptor_file_uri_to_filename * raptor/raptor_parse.c, raptor/ntriples_parse.c: Removed raptor_file_uri_to_filename * raptor/raptor_uri.c (raptor_uri_filename_to_uri_string, (raptor_uri_uri_string_to_filename): fix unix relative file file:foo and bad win32 authority check. (main): Check unix foo/file:foo works * raptor/raptor.h: Added raptor_uri_filename_to_uri_string and raptor_uri_uri_string_to_filename * raptor/raptor_uri.c (raptor_uri_filename_to_uri_string): Added for filename to file: URI for win32 and unix. (raptor_uri_uri_string_to_filename): Added for file: URI to filename for win32 and unix. (assert_filename_to_uri,assert_uri_to_filename): Added for regression testing. (main): Tests for win32 / unix filename / file:URIs 2002-08-19 Dave Beckett * perl/test.pl: Added tests for error and warning callbacks. * python/RDF.py: Added Python message callback support - generate raise on error or warnings. * Redland.i: Added Python message callback support. * raptor/INSTALL.html: Added some more xml library versions * raptor/raptor_parse.c: Remove a lot of raptor_update_document_locator calls and add them to the start of several functions. Replace some expat-specific stuff with general calls. * raptor/raptor_parse.c: Add raptor_update_document_locator calls before every parser error or warning. (raptor_expat_update_document_locator): Added. * raptor/raptor_internal.h: Export raptor_libxml_update_document_locator Export raptor_expat_update_document_locator Export raptor_update_document_locator * raptor/raptor_libxml.c (raptor_libxml_update_document_locator): Now not static. Remove column numbers - they seem to be total fiction. * raptor/raptor_locator.c (raptor_update_document_locator): Added. * perl/lib/RDF/Redland.pm: fix docs * perl/lib/RDF/Redland.pm: Move subroutines to documented package * docs/fix-pod-xhtml: Fix relative URIs * docs/perl.html: fix RDF::Redland link * perl/lib/RDF/Redland.pm: Call new librdf_perl_world_init method to init perl callbacks. (message): Added, to dispatch callbacks. (set_error_handler,set_warning_handler): Allow users to change handlers * librdf/rdf_utf8.c, librdf/rdf_uri.c, librdf/rdf_stream.c, librdf/rdf_storage_list.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage.c, librdf/rdf_statement.c, librdf/rdf_serializer_raptor.c, librdf/rdf_serializer.c, librdf/rdf_query_triples.c, librdf/rdf_query.c, librdf/rdf_parser_sirpac.c, librdf/rdf_parser_repat.c, librdf/rdf_parser_raptor.c, librdf/rdf_parser_libwww.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_memory.c, librdf/rdf_list.c, librdf/rdf_iterator.c, librdf/rdf_init.c, librdf/rdf_heuristics.c, librdf/rdf_hash_memory.c, librdf/rdf_hash_gdbm.c, librdf/rdf_hash_cursor.c, librdf/rdf_hash_bdb.c, librdf/rdf_hash.c, librdf/rdf_digest_openssl.c, librdf/rdf_digest_md5.c, librdf/rdf_digest.c: Tidying header files. stdarg.h required for all sources now. Remove rdf_*.h headers that are included by librdf.h * librdf/rdf_storage_hashes.c: revert default number hashes to 3 for now * librdf/Makefile.am: Always have compiled java class files in distribution. * raptor/raptor_parse.c (raptor_xml_cdata_handler): Allow to be ignored when there is no element (XML very damaged) * raptor/rdfdump.c: Tidy output formatting * raptor/raptor_libxml.c: Delete extra '\n' at end of XML parsing messages; that's up to the app to add. * raptor/raptor_parse.c: Removed some \n-s from warning/error messages * raptor/raptor_locator.c (raptor_format_locator): Don't count \0 in buffer size. * raptor/Makefile.am: Added raptor_locator.c * raptor/raptor.h: Added raptor_foramt_locator * raptor/raptor_locator.c: Raptor parsing locator functions * raptor/raptor_parse.c: Moved raptor_print_locator to raptor_locator.c * raptor/rdfdump.c: Updated for raptor error handlers passed on as strings, not va_list * raptor/ntriples_parse.c: raptor errors passed on as strings, not va_list (raptor_ntriples_parser_error, raptor_ntriples_parser_fatal_error): Turn va_list into a string. * raptor/raptor_parse.c: raptor errors passed on as strings, not va_list (raptor_parser_fatal_error_varargs, raptor_parser_error_varargs, raptor_parser_warning_varargs): Turn va_list into a string. * raptor/raptor.h: raptor errors passed on as strings, not va_list 2002-08-18 Dave Beckett * raptor/Makefile.am: Add LTLIBOBJS to raptor library, not rdfdump * raptor/configure.in: Set LIBOBJS and LTLIBOBJS * raptor/configure.in: Check for strcasecmp, stricmp or use compatibility version * raptor/raptor_internal.h: Define raptor_strcasecmp to library routine, or leave alone for compatibility function. * raptor/Makefile.am: Added @LIBOBJS@ and strcasecmp.c * raptor/strcasecmp.c: strcasecmp compatibility * raptor/raptor_parse.c: strcasecmp now raptor_strcasecmp, will be defined to right function * raptor/win32_config.h: Don't use macros for strcasecmp; now handled generally * raptor/Makefile.am: Added raptor_internal.h, win32_config.h to noinst headers Added raptor_win32.c * raptor/raptor_win32.c: Raptor WIN32 support functions * raptor/win32_config.h: Raptor WIN32 hard-coded config * raptor/rdfdump.c: Tidying up stdlib.h, dmalloc.h includes. Include win32_config.h #ifdef WIN32 * raptor/raptor_parse.c, raptor/raptor_uri.c: Tidying up stdlib.h, dmalloc.h includes. Removed stuff duplicated in raptor.h/raptor_internal.h Include win32_config.h #ifdef WIN32 * raptor/raptor_libxml.c: Tidying up stdlib.h, dmalloc.h includes. Include win32_config.h #ifdef WIN32 * raptor/ntriples_parse.c: Tidying up stdlib.h, dmalloc.h includes. Removed stuff duplicated in raptor.h/raptor_internal.h Include win32_config.h #ifdef WIN32 * raptor/raptor_internal.h: Moved libxml includes, defines and structs here. Declared extern function prototypes for libxml interface. * raptor/raptor_parse.c: Use errno.h, not extern int errno Moved most libxml code to new raptor_libxml.c Moved necessary includes, defines and structs to raptor_internal.h Some renaming of functions; raptor_libxml* for those related to libxml Some functions now not static. Added some necessary methods for accessing raptor_parser structure for libxml. (raptor_get_locator): Added; new public method. * raptor/raptor.h: Added raptor_get_locator * raptor/ntriples_parse.c: Use errno.h, not extern int errno * raptor/Makefile.am: Added raptor_libxml.c * raptor/raptor_uri.c: Use errno.h if present * raptor/raptor_libxml.c: Raptor libxml functions * raptor/raptor_parse.c: Added 12 wrapper functions for libxml handlers, passing on the right context to them, to enable handling of entities and resolving them. (raptor_xml_update_document_locator): Handle if in document subset Changed internal raptor fatal_error, error, warning functions to have varargs versions that libxml can use. (raptor_new): Initialise new libxml handler wrappers 2002-08-17 Dave Beckett * Redland.i (librdf_call_perl_message): Free malloced buffer, not argument * librdf/rdf_init.c, librdf/rdf_init.h: Make error/warning functions pass in a message (aka format string) * Redland.i (librdf_call_perl_message): Added to invoke PERL message handler subroutine RDF::Redland::World::message for error/warning message handling. (librdf_perl_error_handler): Added (librdf_perl_warning_handler): Added (librdf_perl_world_init): Added - to initialise above two routines (librdf_internal_test_error,librdf_internal_test_warning): Added for testing * librdf/Makefile.am: Added LIBRDF_XML_OBJS again * configure.in: More fixes trying to get expat linked in and working * examples/example4.c, examples/example3.c, examples/example2.c, examples/example1.c, librdf/rdf_utf8.c, librdf/rdf_uri.c, librdf/rdf_storage.c, librdf/rdf_statement.c, librdf/rdf_serializer_raptor.c, librdf/rdf_serializer.c, librdf/rdf_query.c, librdf/rdf_parser_sirpac.c, librdf/rdf_parser_raptor.c, librdf/rdf_parser.c, librdf/rdf_node.c, librdf/rdf_model.c, librdf/rdf_heuristics.c, librdf/rdf_hash.c, librdf/rdf_files.c, librdf/rdf_digest.c, librdf/rdf_concepts.c: Add stdarg.h to required headers. * librdf/rdf_init.c: API change: internal error/warning functions now pass va_list Add stdarg.h to headers. (librdf_world_set_error): API change. Passed in function takes va_list. (librdf_world_set_warning): API change. Passed in function takes va_list. * librdf/rdf_init.h: internal error/warning functions now pass va_list * librdf/Makefile.am: Added compiling java classes * Redland.i: delete I/O stuff not used * raptor/rdfdump.c: Set ntriples error handler * raptor/ntriples_parse.c: Added fatal/non-fatal error handlers/functions. (raptor_ntriples_set_error_handler): Added. (raptor_ntriples_string): Documented args; now returns failure status. (raptor_ntriples_parser_error): Added for non-fatal errors (bad lines). (raptor_ntriples_parser_fatal_error): Fix passing on va_list arguments. * raptor/ntriples.h: Added raptor_ntriples_set_error_handler 2002-08-16 Dave Beckett * perl/lib/RDF/Redland/Model.pm (sources,arcs,targets): Use new Iterator methods. 2002-08-13 Dave Beckett * perl/lib/RDF/Redland/Node.pm (blank_identifier): Added to get/set blank node ids * perl/serialize.pl: More stuff * expat/xmlparse/Makefile.am: Don't include CFLAGS twice * configure.in: Don't give error when no libdb name can be guessed Only link dmalloc if dmalloc.h is present (maintainer mode) * Redland.i: Added librdf_node set/get blank_identifier methods * raptor/configure.in: Add check for errno.h Only link dmalloc if dmalloc.h is present (maintainer mode) * raptor/ntriples_parse.c: Add use of errno.h if present * raptor/raptor_parse.c: Add use of errno.h if present Minor comments fix When rdf:Description seen, go straight to state DESCRIPTION rather than via OBJ 2002-08-11 Dave Beckett * INSTALL.html: Added --with-xml-parser docs * perl/test.pl: Replace iterator get_next method with get and next * perl/lib/RDF/Redland/Iterator.pm (next): Replaced with get, next methods * python/RDF.py: Change iterator methods from get to get/next 2002-08-07 Dave Beckett * raptor/raptor_parse.c: Added rdf:List, rdf:first, rdf:rest (not used yet) Added rdf:nodeID for bnodes as subject/objects like rdf:about/rdf:resource * raptor/raptor.h: Added RAPTOR_URI_SOURCE_BLANK_ID (for rdf:nodeID) 2002-08-04 Dave Beckett * librdf/rdf_hash.c (librdf_free_hash): Call librdf_hash_close() to cleanup, not factory close * configure.in: do test compare right; test a = b, not test a=b * Redland.i: Updated interface for changed iterator methods. librdf_iterator_get_next: deleted librdf_iterator_get_object, librdf_iterator_next: added * examples/example4.c, examples/example1.c: Updated for changed iterator methods. Replaced librdf_iterator_get_next call with librdf_iterator_get_object and librdf_iterator_next calls. * librdf/rdf_hash.c: (librdf_hash_get_all, librdf_hash_get_all_iterator_is_end, librdf_hash_get_all_iterator_next_method, librdf_hash_get_all_iterator_get_method, librdf_hash_keys, librdf_hash_keys_iterator_next_method, librdf_hash_keys_iterator_get_method, librdf_hash_print, librdf_hash_print_keys, librdf_hash_print_values, main): Updated for changed iterator methods. Replaced librdf_iterator_get_next call with librdf_iterator_get_object and librdf_iterator_next calls. * librdf/rdf_storage_hashes.c: (librdf_storage_hashes_serialise_next_statement, librdf_storage_hashes_node_iterator_next_method, librdf_storage_hashes_node_iterator_get_method, librdf_storage_hashes_node_iterator_create, librdf_storage_hashes_group_serialise_next_statement): Updated for changed iterator methods. Replaced librdf_iterator_get_next call with librdf_iterator_get_object and librdf_iterator_next calls. * librdf/rdf_storage.c: (librdf_storage_stream_to_node_iterator_next_method, librdf_storage_stream_to_node_iterator_get_method, librdf_storage_stream_to_node_iterator_finished): Updated for changed iterator methods. Replaced librdf_iterator_get_next call with librdf_iterator_get_object and librdf_iterator_next calls. * librdf/rdf_hash_memory.c: (librdf_hash_memory_clone,librdf_hash_memory_cursor_get, librdf_hash_memory_cursor_finish): Updated for changed iterator methods. Replaced librdf_iterator_get_next call with librdf_iterator_get_object and librdf_iterator_next calls. * librdf/rdf_model.c: (librdf_free_model,librdf_model_get_source,librdf_model_get_arc, librdf_model_get_target): Updated for changed iterator methods. Replaced librdf_iterator_get_next call with librdf_iterator_get_object and librdf_iterator_next calls. * librdf/rdf_hash_bdb.c: (librdf_hash_bdb_clone): Updated for changed iterator methods. Replaced librdf_iterator_get_next call with librdf_iterator_get_object and librdf_iterator_next calls. * librdf/rdf_hash_gdbm.c: (librdf_hash_gdbm_clone): Updated for changed iterator methods. Replaced librdf_iterator_get_next call with librdf_iterator_get_object and librdf_iterator_next calls. * librdf/rdf_stream.c: (librdf_stream_from_node_iterator_next_statement): Updated for changed iterator methods. Replaced librdf_iterator_get_next call with librdf_iterator_get_object and librdf_iterator_next calls. * librdf/rdf_storage_list.c: (librdf_storage_list_close, librdf_storage_list_serialise_next_statement, librdf_storage_list_group_serialise_next_statement) Updated for changed iterator methods. Replaced librdf_iterator_get_next call with librdf_iterator_get_object and librdf_iterator_next calls. * librdf/rdf_node.c: Deleted bogus comment. * librdf/rdf_list.c: Updated for iterator class change: get_next split into next_method, get_method * librdf/rdf_iterator.c: Updated iterator class for get_next split into get_object, next (librdf_iterator_get_next): Deleted - API CHANGE (librdf_iterator_get_object, librdf_iterator_get_context, librdf_iterator_get_key, librdf_iterator_get_value): Added, wrappers around function pointer iterator->get_method, with appropriate flags. * librdf/rdf_iterator.h: Iterator methods get_next split into get_object, next Added next_method, get_method function pointers to iterator structure. Defined flags for get_method - object, context, (hash)key, (hash)value librdf_iterator_get_next - DELETED - API CHANGE librdf_iterator_get_object, librdf_iterator_get_context, librdf_iterator_get_key, librdf_iterator_get_value: Added - API CHANGE * configure.in: Fix parser_modules with 'no' now working * configure.in: pick xml parser for raptor using $xml_parser from --with-xml-parser 2002-08-01 Dave Beckett * librdf/rdf_model.c: docucomment fix * docs/Makefile.am: added kernel-doc to the dist * docs/kernel-doc: Process C docucomments 2002-07-29 Dave Beckett * raptor/configure.in: default xml parser now libxml * raptor/INSTALL.html: Update --with-xml-parser docs * INSTALL.html: Added docs for extra BDB options to configure * ruby/Makefile.am: s/repat/raptor/ * ruby/example.rb: s/repat/raptor/ in instructions * ruby/Makefile.am: use mkdir -p for installdir 2002-07-28 Dave Beckett * docs/README.html: Update papers * raptor/autogen.sh: Fix use of srcdir/find * raptor/Makefile.am: Add -I's for compiling test programs * docs/Makefile.am: Fix #comment in rule (portability) * autogen.sh: Fix use of srcdir/find * redland-src-config.in: Quote libs, static-libs since they may have $s in them for make * configure.in: For perl path tests, use perl itself to print, rather than sourcing BDB config - added --with-bdb-li,include,dbname to specify more detailed BDB values. 2002-07-26 Dave Beckett * configure.in: Check for libxml function xmlCreatePushParserCtxt using the library from XML_CONFIG, not always -lxml * configure.in: Added AC_ARG_WITH for xml-parser, so is documented for passing it on to raptor * perl/serialize.pl: test pretty xml serializing code 2002-07-23 Dave Beckett * NEWS.html: Added XML Space change warning and pointer to script * librdf/rdf_model.c, librdf/rdf_statement.c, librdf/rdf_node.c: Update librdf_new_node_from_literal calls * configure.in, Makefile.am: Added aux dir * aux/Makefile.am: aux dir automakefile * aux/update-api-0912.pl: update api to 0.9.12 script * perl/test.pl, perl/example.pl: Update perl literal calls * perl/lib/RDF/Redland/Node.pm: Fix docs * ruby/Makefile.am: Fix cflags * java/Makefile.am: Append to (Linux? only) dynamic lib search path var LD_LIBRARY_PATH * tcl/Makefile.am: Fix cflags * tcl/test.tcl, python/RDF.py, perl/test.pl, examples/example2.c, examples/example4.c, examples/example3.c, librdf/rdf_model.c, librdf/rdf_parser_repat.c, librdf/rdf_parser_libwww.c, librdf/rdf_query_triples.c, librdf/rdf_parser_raptor.c, librdf/rdf_node.c: Update librdf_node_set_literal_value calls * java/org/librdf/redland/Model.java, java/org/librdf/redland/Node.java, python/RDF.py, perl/lib/RDF/Redland/Model.pm, perl/lib/RDF/Redland/Node.pm, Redland.i, librdf/rdf_model.h, librdf/rdf_model.c, librdf/rdf_node.c, librdf/rdf_node.h: zap former xml_space args entirely * python/RDF.py: Zap xml_space * Redland.i: zap xml_space 2002-07-22 Dave Beckett * librdf/rdf_storage_hashes.c: Remove more fixed things - first 4 hashes are used. Removed all LIBRDF_STORAGE_HASH_GROUPS and stub code - compiled in now Added indexes field to hash context for declaring indexes wanted Added all_statements_hash_index to hash context for hash to use to serialise the entire model, replacing ANY_OLD_HASH_INDEX (librdf_storage_get_hash_description_by_name): Added, not yet used (librdf_storage_hashes_init_common): Added indexes parameter Updated to handle all_statements_hash_index (librdf_storage_hashes_init): Create indexes parameter (librdf_storage_hashes_terminate): Delete indexes if seen. (librdf_storage_hashes_clone): Copy indexes field. * librdf/rdf_parser_repat.c: errno only on non-WIN32 * librdf/rdf_model.c (librdf_model_add_string_literal_statement): Remove all references to XML Space. Keep the arg around but ignore it. * librdf/rdf_model.h: Remove all references to XML Space. Keep the arg around but ignore it. * librdf/rdf_node.h: Remove all references to XML Space. Keep the arg around but ignore it. (Private) enum librdf_node_literal_xml_space removed Removed prototype for librdf_node_get_literal_value_xml_space * librdf/rdf_node.c: Remove all references to XML Space. Keep the arg around but ignore it. (librdf_new_node_from_literal,librdf_node_set_literal_value): xml_space arg now unused1 (librdf_node_get_literal_value_xml_space): Removed - API change (librdf_node_encode,librdf_node_decode): Removed xml space en/decoding. * librdf/rdf_storage_hashes.c: Removed static hash/hash_descriptor/names - now allocated from NUMBER_OF_HASHES in librdf_storage_hashes_init_common * librdf/librdf.h: Include stdlib.h before dmalloc.h when dmalloc is used * autogen.sh: zap ltconfig too - generated if needed. 2002-07-20 Dave Beckett * INSTALL.html: typo: sleepcat * INSTALL.html: Sleepycat DB 4.0.14 works * raptor/tests/Makefile.am: Added ex-34 * raptor/tests/ex-34.out, raptor/tests/ex-34.rdf: Test daml:collection lists with blank nodes * configure.in: Removed AC_PROG_RANLIB - obsoleted by AM_PROG_LIBTOOL Catch some LIBRDF_CFLAGS that should have been LIBRDF_CPPFLAGS * raptor/configure.in: Modify cflags to use redland srcdir not builddir * python/setup.py: Ignore -lraptor like -lrdf * python/Makefile.am: clean-python isn't good enough * perl/Makefile.PL: Use redland-src-config --static-libs * redland-src-config.in: added --static-libs * tcl/Makefile.am, ruby/Makefile.am, python/setup.py, perl/Makefile.PL, java/Makefile.am: Update for using ../redland-src-config * raptor/Makefile.am, Makefile.am: zap 'finish' stuff * redland-src-config.in: Link to .libs dirs for redland, raptor 2002-07-17 Dave Beckett * raptor/raptor_parse.c (raptor_end_element_grammar): Get rdf:ID working on empty propertyElt with rdf:parseType="Resource" * raptor/raptor_parse.c: Added reified raptor_identifier, changed code to use it for rdf:ID value Store rdf:bagID in bag raptor_identifier * raptor/raptor_parse.c (raptor_element_has_property_attributes): Created, returns true iff a property element has property attributes (raptor_start_element_grammar): For property elements, move handing property attributes to close of element, only then can the resource URI be known. (raptor_end_element_grammar): Update after above change. For property elements that are empty (empty literal), create a new blank node and hang the property attributes off that. * raptor/raptor_parse.c: Warn and continue when element content is seen inside a 2002-07-16 Dave Beckett * Makefile.am, configure.in: Moved redland-config to top dir * redland-config.in, librdf/redland-config.in: Moved to top dir * librdf/Makefile.am: Moved redland-config to top dir 2002-07-15 Dave Beckett * INSTALL.html: Update example4 example again, with line breaks * INSTALL.html: Update example4 example * raptor/tests/Makefile.am: make check sh stuff not echo * raptor/tests/Makefile.am: Add ex-33 * raptor/tests/ex-33.out, raptor/tests/ex-33.rdf: Check properties work off node generated by empty propertyElt 2002-07-14 Dave Beckett * INSTALL.html: Updated CVS instructions for source reorganisation * configure.in: Generate redland-src-config in top dir * Makefile.am: Added redland-src-config.in More rules to build various things in subdirs, not really working yet. * configure.in: Create abs_top_srcdir, abs_top_builddir subst vars Create redland-src-config * redland-src-config.in: Script to get flags for compiling against the source tree * raptor/Makefile.am: Add REDLAND_LIBS to rdfdump dependencies Add rule to build librdf.la if needed * python/RDF.py: Updates from Edd Dumbill: (class RedlandError): Added, an Exception class (class NodeTypeError): Added, an RedlandError exception class (node_type): Added package function to turn a node name to a Redland (node_type_name): Added package function to get the node name for a Redland node type (_get_uri): Now throw an NodeTypeError exception if node has no URI (is_resource): Added, returns true if node is a resource (is_literal): Added, returns true if node is a literal (class Storage, __init__): Raise exception if a null URI given to constructor. 2002-07-13 Dave Beckett * raptor/Makefile.am: Zap -static arg for rdfdump, seems to annoy libtool Pass on redland libs, cflags as necessary * raptor/ntriples.h: Change all LIBRDF_INTERNAL to RAPTOR_IN_REDLAND * raptor/rdfdump.c: Change all LIBRDF_INTERNAL to RAPTOR_IN_REDLAND Update to newest librdf world open/close calls * raptor/raptor_parse.c: Tidy - 2 includes of stdlib.h Change all LIBRDF_INTERNAL to RAPTOR_IN_REDLAND * raptor/raptor_internal.h: Lose all redland includes - for app code * raptor/raptor.h: Include librdf and uri headers when in Redland Change all LIBRDF_INTERNAL to RAPTOR_IN_REDLAND * raptor/configure.in: Define REDLAND_LIBS, REDLAND_CPPFLAGS for use when building in redland * librdf/Makefile.am: Add finish rules, not yet complete * librdf/rdf_uri.c, librdf/rdf_serializer_raptor.c, librdf/rdf_parser_raptor.c: Define RAPTOR_IN_REDLAND before including raptor headers * raptor/raptor_parse.c: Moved debugging stuff to raptor_internal.h Use updated raptor includes * raptor/rdfdump.c: Use updated raptor includes * raptor/raptor_uri.c: Don't include Redland rdf_config.h Use updated raptor includes * raptor/ntriples_parse.c: Use updated raptor includes * raptor/raptor.h: Removed all standard includes Moved URI stuff to raptor_internal.h except for typedef (needed for prototypes) * raptor/raptor_internal.h: Internal raptor definitions * raptor/Makefile.am: Added raptor_internal.h * raptor/configure.in: Fix raptor in redland check. * raptor/ntriples_parse.c, raptor/raptor_parse.c: don't include redland rdf_config.h - use ours * raptor/configure.in, raptor/acconfig.h: added RAPTOR_IN_REDLAND 2002-07-12 Dave Beckett * raptor/raptor.h: include stdarg.h here * raptor/tests/Makefile.am: Added ex-32 * raptor/tests/ex-32.out, raptor/tests/ex-32.rdf: Test property attributes with rdf:resource * raptor/raptor_parse.c (raptor_process_property_attributes): Pass in an optional identifier to use for the resource node. Use that to process property attributes along with rdf:resource, at the close of the (empty) propertyElt. * Redland.i: revert (im)mutable back to readonly/write 2002-07-11 Dave Beckett * raptor/raptor_uri.c (raptor_uri_resolve_uri_reference): Handle base URI without a path such as "http://example.org" * raptor/Makefile.am: Tidy test program args +$(DEFS) to add crucial -DHAVE_CONFIG_H * raptor/rdfdump.c (rdfdump_error_handler): Use va_list form (rdfdump_warning_handler): Use va_list form * raptor/raptor_parse.c (raptor_xml_start_element_handler): Warn about unqualified rdf: attributes * raptor/ntriples_parse.c (raptor_ntriples_parser_fatal_error): now passes on va_list * raptor/raptor.h: API change: raptor_message_handler callback now takes a va_list as final argument * raptor/rdfdump.c: Make warning/error messages neater * raptor/rdfdump.c: Added -w - ignore warnings (rdfdump_warning_handler): Added (rdfdump_error_handler): Added Count warnings, errors and exit with #errors, or 128+#warnings * raptor/raptor_parse.c: When a property has multiple objects, give an error and skip the rest of that element * raptor/tests/Makefile.am: Added bad-01.rdf * raptor/tests/bad-01.rdf: A property must have only one node value * raptor/rdfdump.c: (rdfdump_error_handler) Added. Exit 1 on an error, don't keep going * raptor/tests/Makefile.am: Fix bad test checking again 2002-07-10 Dave Beckett * raptor/Makefile.am: Added LOCAL_LIB_DIR for finish * raptor/Makefile.am: Fix args for compiling tests 2002-07-07 Dave Beckett * raptor/Makefile.am: Added finish target to install to lib Tidy up test program building * raptor/raptor_parse.c: Allow non-namespaced elements to be recognised and skipped 2002-07-05 Dave Beckett * debian/redland1.files: redland1 files * examples/Makefile.am: Make tidier and work when srcdir isn't builddir * librdf/Makefile.am: Use $(CPPFLAGS) for tests * configure.in: repat, raptor stuff should be internal flags * librdf/rdf_parser_repat.c: Return repat dir in include * librdf/redland-config.in: Use LIBRDF_ versions of macros now * librdf/rdf_parser_repat.c: No need for repat dir in include * repat/Makefile.am, librdf/Makefile.am, examples/Makefile.am, configure.in, Makefile.am: Update CPPFLAGS, LDFLAGS, LIBS to have external, internal versions and ones just for xml parsers (expat, libxml) used by internal RDF/XML parsers * repat/Makefile.am: Replace XML_OBJS with LIBRDF_XML_LIBS * librdf/Makefile.am: Replace XML_OBJS with LIBRDF_EXTRA_LIBS * Makefile.am: Add more subdirs, tidy * configure.in: Replace XML_OBJS with LIBRDF_EXTRA_LIBS and LIBRDF_XML_LIBS 2002-06-30 Dave Beckett * raptor/tests/Makefile.am: typo * raptor/Makefile.am: Added 'make deb' target * raptor/tests/rdf-schema.out, raptor/tests/rdfs-namespace.out: RDFS schema answers * raptor/tests/Makefile.am: Fix rdfs checks * raptor/tests/Makefile.am: Add two RDFS schema namespaces * raptor/tests/rdf-schema.rdf, raptor/tests/rdfs-namespace.rdf: RDFS schemas * raptor/raptor_parse.c: (raptor_parser_error) Make this default to exit(1) (raptor_start_element_grammar): Die when a second object is tried to be set for a statement * raptor/tests/Makefile.am: Check negative tests correctly * raptor/autogen.sh: Add libtoolize cleanup, check and run * raptor/configure.in: fix AC_OUTPUT * raptor/Makefile.am, raptor/configure.in: Added debian dir 2002-06-26 Dave Beckett * raptor/win32/README: win32 README * librdf/Makefile.am: zap more stuff not in this part of dist * librdf/Makefile.am: Changelog not here now * configure.in, Makefile.am: Updated for moved sources * librdf/Makefile.am: Updated for moved sources * examples/Makefile.am: Automakefile for examples * docs/Makefile.am: Updated for moved sources * autogen.sh: Remove raptor source hunting * Redland.i: Update for newer swigs Added commented-out typemaps for FILE* * raptor/autogen.sh: Added GNU config.* copy test * perl/MANIFEST: Added RDF::Redland::Serializer * perl/example.pl: Added (comment out) serializer test * perl/lib/RDF/Redland/Makefile.am: Added Serializer i/f * perl/lib/RDF/Redland/Serializer.pm: RDF::Redland::Serializer class * perl/lib/RDF/Redland.pm: Added RDF::Redland::Serializer * Redland.i: added serializer class, methods 2002-06-21 Dave Beckett * perl/update-perl-api.pl: Fix typo in use RDF:RSS; actually didn't matter, class thing later on fixed it. 2002-06-19 Dave Beckett * debian/scanpackages.override: Added libraptor overrides * autogen.sh: Import nearby fresh autoconf config.* files * docs/stylesheet.css: make catfonts 75% * docs/stylesheet.css: More CSS, like latest ILRT style 2002-06-14 Dave Beckett * raptor/tests/Makefile.am: Added bad test checking Added bad-00.rdf * raptor/tests/bad-00.rdf: Added bad test 00 * raptor/configure.in: Added raptor-config * raptor/libraptor.3, raptor/rdfdump.1: Raptor manual pages * raptor/Makefile.am: Added raptor-config Added manual pages Make rdfdump static only for maintainer * raptor/raptor-config.in: Raptor configuration script 2002-06-11 Dave Beckett * librdf/rdf_storage_hashes.c: typo * librdf/rdf_storage_hashes.c: Hack in indexing of predicate->(subject,object) - p2so Still using the table of indexes; needs fixing. (librdf_storage_hashes_serialise_common): Created from librdf_storage_hashes_serialise but with extra parameters to allow selecting just a particular key (node) and wanted values fields. (librdf_storage_hashes_serialise_next_statement): If there is a single node being searched for, just return the pre-allocated statement from the has iterator. (librdf_storage_hashes_find_statements): For p2so ONLY, use the p2so_index hash to get the s,o parts of the statement using librdf_storage_hashes_serialise_common (librdf_storage_hashes_node_iterator_get_next): For p2so, grab subject and object from the iterator statement and predicate from the user supplied one. Return a new statement from these. (librdf_storage_hashes_node_iterator_finished): Tidy up when there is a search node. (librdf_storage_hashes_node_iterator_create): For p2so, save the first search node for iterating the predicate hash. 2002-06-10 Dave Beckett * perl/lib/RDF/Redland/Node.pm, perl/lib/RDF/Redland/Model.pm, perl/lib/RDF/Redland/Iterator.pm: Remove deprecated methods * docs/Makefile.am: For maintainer, don't clean generated sgml, do that on distclean 2002-06-08 Dave Beckett * docs/python.html: Fix class names for 0.6 API * README.html: Update overview. model=>graph link inquery, serializer * README.html: Added ruby ---------------------------------------------------------------------- WARNING: Above here the source code was reorganised and the directories include both redland and raptor ---------------------------------------------------------------------- * configure.in: Bump version to 0.9.12 * Snapshotted redland_0_9_11 for 0.9.11 release * debian/changelog, NEWS.html: Updated for 0.9.11 release * rdf_hash_bdb.c (librdf_hash_bdb_delete_key_value): Handle BDB V2 that don't have DB_GET_BOTH * configure.in: Make expat parser check use NULL arg. Make libxml parser check look for xmlCreatePushParserCtxt (1.8.3 or later) * rdf_serializer.c: don't test for something not yet written. * debian/rules.in, debian/control: more dpkg work, still incomplete * perl/lib/RDF/Redland/Node.pm: Updated node types; restrict public ones to resource, literal, blank * perl/lib/RDF/Node.pm: Define some node type vars for legacy 2002-06-06 Dave Beckett * rdf_parser_repat.c (librdf_parser_repat_statement_handler): Added hack to make repat object resources that are blank node identifiers, appear as such rather than genid URIs. * perl/README.txt: Tidied. link to update script * perl/lib/RDF/Redland/Model.pm: (serialize) Added, synonym for serialise method * perl/MANIFEST: Added README.txt Removed duplicate * perl/Makefile.am: Added README.txt notes and update-perl-api.pl to dist * perl/README.txt: Perl API notes 2002-06-04 Dave Beckett * rdf_serializer.c: docucomment * Makefile.am: remove rdf_serializer_raptor.h * configure.in: Added raptor_uri.c to raptor sources. * autogen.sh: Add raptor_uri.c to symlink mess * rdf_uri.c (librdf_new_uri_relative_to_base): Use raptor_uri_resolve_uri_reference from raptor to do full relative URI resolving 2002-06-03 Dave Beckett * python/RDF.py: (Node) __hash__ - return hash based on string representation (Uri) __hash__ - return hash based on redland object (which is same for same URI) * rdf_node.c (librdf_node_equals): Fix type check to look at both nodes - was a NOP. 2002-06-01 Dave Beckett * docs/java.html: Added Sesame * docs/java.html: Updated references * rdf_list.h: Remove current iterator node field from internal list structure; list iterator context holds that now. * rdf_list.c: Make list have multiple iterators by using a librdf_list_iterator_context (librdf_list_get_iterator, librdf_list_iterator_is_end, librdf_list_iterator_get_next): Updated (librdf_list_iterator_finished): Added * rdf_node.c (librdf_new_node_from_node): Didn't work for blank nodes (librdf_node_equals): Implemented for blank nodes Test code: added tests for above * docs/python.html: Note API requires 2.2 (maybe 2.1) now * python/test/test.py, python/example.py: Changes for updated python 2.2+ API * python/RDF.py: Improved python API by Edd Dumbill. Requires python 2.2 Classes renamed e.g. RDF.node to RDF.Node (some) set/get methods use python __getattr__ and __setattr__ Remove all user reference to world object (RDF.Parser): parse_into_model method now has model as first argument 2002-05-29 Dave Beckett * java/test1.java, java/test2.java: Add node constructor test * java/org/librdf/redland/Node.java: Added some javadoc Amend constructor taking a string to also build blank nodes; added extra parameter. * perl/lib/RDF/Redland/Node.pm: Added constructor new_from_blank_identifier * Redland.i: Added librdf_new_node_from_blank_identifier * rdf_node.c (librdf_node_encode,librdf_node_decode): Encode/decode xml:lang values * docs/Makefile.am: Added serializer to api docs * docs/api.sgml.in: Added serializer sections * rdf_serializer.h: Added set_namespace factory method * rdf_serializer.c (librdf_serializer_set_namespace): Added to set namespace/prefix (hints) * rdf_parser_raptor.c: Pass xml language detail from raptor * example4.c: Only free serializer uri if allocated * rdf_parser_raptor.c (librdf_parser_raptor_make_node_from_anon): Deleted - use librdf_new_node_from_blank_identifier to make blank nodes * rdf_node.c (librdf_node_get_uri): Return a URI only for a resource (librdf_node_set_uri): Only work on resource nodes. (librdf_node_encode,librdf_node_decode): Store blank nodes too; encoded as type 'B' * rdf_parser_repat.c: Added blank node support * rdf_node.c (librdf_new_node_from_blank_identifier): Added to make blank node (librdf_node_set_blank_identifier): Take const identifier, only free old identifier if there was one Test code: added test for librdf_node_set_blank_identifier Die if any of the constructors fail. * rdf_node.h: Added prototype for librdf_new_node_from_blank_identifier * rdf_parser_raptor.c, rdf_parser_repat.c: Include stdlib.h for some prototypes. * rdf_query_triples.c: Comment out some unused vars 2002-05-28 Dave Beckett * example4.c: Added serialize command * rdf_serializer.c: (librdf_get_serializer_factory,librdf_get_serializer_factory): Default is MIME Type "application/rdf+xml" when all fields NULL (librdf_init_serializer): Invoke librdf_serializer_raptor_constructor always * rdf_serializer_raptor.c (librdf_serializer_raptor_serialize_model): Free statement from stream * rdf_init.c: Initialise/finish serializer class * rdf_node.h, rdf_node.c (librdf_node_set_blank_identifier): Zap old value, don't return it * Makefile.am: Added rdf_serializer_test to TESTS * Makefile.am: Added rdf_serializer_test * rdf_serializer_raptor.c (librdf_serializer_raptor_serialize_model): Remove unused var * rdf_stream.c, rdf_init.c: Added prototype to remove gcc warning about abort() * Makefile.am: Added serializer modules * librdf.h: Added serializer typedefs, headers * rdf_init.h: Added serializer list to world * rdf_serializer_raptor.c, rdf_serializer.c, rdf_serializer.h: RDF Serializer classes, factory * perl/lib/RDF/Redland/Parser.pm (new): Note that name is also optional and if all fields blank, gives an application/rdf+xml parser * rdf_parser.c (librdf_get_parser_factory,librdf_new_parser): Default to a parser for MIME Type application/rdf+xml if all fields are NULL * rdf_hash_memory.c: Added prototype to remove gcc warning about abort() * rdf_node.c: (librdf_new_node_from_node,librdf_free_node,librdf_node_to_string): Added blank node support (librdf_node_get_blank_identifier): Added to get blank node identifier (librdf_node_set_blank_identifier): Added to set blank node identifier to new value, returning old * rdf_node.h: Added blank node type; added to union, added prototype of methods to set/get 2002-05-23 Dave Beckett * rdf_query.c (main): Test code: Use a legal 'triples' query. Init/close uri module * rdf_query_triples.c (librdf_query_triples_terminate): Free nodes if created * rdf_query_triples.c (librdf_query_triples_find_next_term): Tidying code * docs/api.sgml.in, docs/Makefile.am: Add query, query_triples modules to the api docs * Makefile.am: Added query module - sources, headers and test * example4.c: Added "query" command - CMD_QUERY using the librdf_query object and methods. A whole lot of indenting too * librdf.h: Add query support - define librdf_query, librdf_query_factory; include rdf_query.h * rdf_init.c (librdf_free_world): Finish query module (librdf_world_open) Initialise query module * rdf_storage_hashes.c: Include string.h, stdlib.h for some system prototypes Exclude some hash groups prototypes when not used * rdf_storage.h: Added prototypes for librdf_storage_supports_query and librdf_storage_query * rdf_storage.c (librdf_storage_supports_query,librdf_storage_query): Added skeleton code * rdf_model.h: Added prototypes for librdf_model_query and librdf_model_query_string * rdf_model.c (librdf_model_query,librdf_model_query_string): Added * rdf_query.c, rdf_query.h, rdf_query_triples.c, rdf_query_triples.h: RDF Query modules 2002-05-15 Dave Beckett * rdf_hash_bdb.c (librdf_hash_bdb_delete_key_value): use DB_GET_BOTH rather than DB_SET when moving the cursor to ensure it deletes exact matches rather than just the first one that matches the (subject,predicate). Thanks to Chad House for finding and fixing this. 2002-05-07 Dave Beckett * configure.in: Check less libxml headers. Move libxml disable library into 'if libxml' section 2002-04-29 Dave Beckett * configure.in: test syntax * configure.in: Disable libxml if the library can be found but not the header files * docs/api.sgml.in: Fix SGML for DocBook 3.1 2002-04-27 Dave Beckett * python/test/test.py, perl/example.pl: Use any available rdf/xml parser * rdf_parser.c (librdf_get_parser_factory): Make name optional so can choose any rdf/xml parser. Handle NULL or empty string name. * python/RDF.py: Update API to get add more python standard bits such as __eq__ and __ne__ and generating python sequences (node): Remove equals method, added __eq__, __ne__ (model) Added sources, targets, arcs methods returning python sequences (iterator) Various changes to get it working (uri) Remove equals method, added __eq__, __ne__ Made method feature handle string uris * python/test/test.py: Expanded to print out model, parse into it, query model by statements and nodes and generally exercise most of the API techniques * python/setup.py: Make it a python script * README.html: Add ruby pointer Update date * redland.spec.in: Add manual pages Renamed perl modules. * docs/tcl.html: typo * configure.in: For XML_CONFIG use xml2-config, xml-config in order Updated header files to find for Raptor Make Raptor prioritise to use libxml Pick RAPTOR_XML_EXPAT/LIBXML for Raptor * acconfig.h: Added RAPTOR_XML_EXPAT/LIBXML to pick which XML parser for raptor * rdf_parser_raptor.c: Disable scanning for rdf:RDF feature - it doesn't work with raptor at present * INSTALL.html: Update words about autogen.sh Added ruby install link * docs/ruby.html: html 2002-04-26 Dave Beckett * docs/ruby.html: Link to Liber, RubyRDF * docs/Makefile.am: Added ruby.html * docs/ruby.html: Ruby Interface * ruby/example.rb: Use ARGV * ruby/Makefile.am: Call test/example program with args * ruby/example.rb: Added header. Fixed typo * ruby/example.rb: Filled in the example and it now works (had to hard code some arguments) * ruby/Makefile.am: install-ruby copies the Redland.so into probably the right place 2002-04-25 Dave Beckett * rdf_storage_hashes.c: Make the hash groups stuff optional unless LIBRDF_STORAGE_HASH_GROUPS defined * rdf_hash_bdb.c (librdf_hash_bdb_open): On bdb V3 open failure, emit an error even when not debugging. * perl/update-perl-api.pl: Update perl modules to 0.9.11 names * perl/lib/RDF/URI.pm, perl/lib/RDF/Stream.pm, perl/lib/RDF/Storage.pm, perl/lib/RDF/Statement.pm, perl/lib/RDF/RSS.pm, perl/lib/RDF/Parser.pm, perl/lib/RDF/Node.pm, perl/lib/RDF/Model.pm, perl/lib/RDF/Iterator.pm: End modules with 1; * debian/README.Debian: Updated a little * rdf_node.c (librdf_new_node_from_literal,librdf_node_set_literal_value): For xml_language string, allow empty string to be the same as NULL (for ruby) * rdf_parser.c (librdf_get_parser_factory): Allow mime_type string to matching on empty string as well as null string (for ruby) * configure.in: Set CPPFLAGS when looking for bdb, in order to find db.h * redland-config.in: Add @LDFLAGS@ to --libs line * configure.in: Get ruby_prefix from Ruby configuration variable archdir 2002-04-24 Dave Beckett * INSTALL.html: typo * INSTALL.html: Added CVS instructions; now working * autogen.sh: sh syntax * autogen.sh: Find and link in raptor sources when nearby * docs/Makefile.am: Try to fix missing redland.3 problem for non-maintainer 2002-04-23 Dave Beckett * rdf_utf8.c, rdf_uri.c, rdf_storage.c, rdf_statement.c, rdf_parser.c, rdf_node.c, rdf_model.c, rdf_digest.c, rdf_concepts.c: Include some more headers to get missing library prototypes * repat/rdfparse.c, repat/rdfdump.c: Tidy to fix compiler warnings; renamed some shadowed local variables and remove unused code. * librdf.h: rdf_heuristics.h is not meant to be public * ruby/test.rb: Redland Ruby API test program * ruby/Makefile.am: No README yet 2002-04-22 Dave Beckett * rdf_parser_sirpac.c, rdf_parser_repat.c, rdf_parser_raptor.c, rdf_parser_libwww.c: Added RDF/XML mime type to parser registrations * rdf_parser_raptor.c: Updated ntriples URI * python/README: Point to skeleton docs * python/RDF.py: Fixes for Python 2.2 due to change in __ meaning (not tested much) 2002-04-14 Dave Beckett * docs/redland.pod: Redland (librdf) library manual page 2002-04-03 Dave Beckett * ruby/Makefile.am, ruby/example.rb: Initial ruby stuff from danbri (not complete) * Makefile.am, configure.in: Updates for ruby (not working) 2002-03-07 Dave Beckett * docs/java.html, docs/tcl.html: Update footer * docs/python.html: Now tested with python 2.1 also Update footer * docs/fix-pod-xhtml: Updates for pod2html changing Handle perl module names changing, new POD dirs * docs/Makefile.am: Added redland.3 (made from redland.pod via pod2man) manual page Added redland.pod; mostly generated from source files. Add manual pages to distribution. 2002-02-12 Dave Beckett * docs/perl.html: Updates for new perl module names * perl/MANIFEST.SKIP, perl/MANIFEST: Updated for new files (old api and new) * perl/Makefile.PL: Updates for new perl module names Ghastly hacks to get ExtUtils::MakeMaker to use RDF::Redland::CORE * perl/Makefile.am: Updates for new perl module names Change to build SWIG outputs here and move the generated perl to the right place lower down the tree. * perl/test.pl, perl/rss-dump.pl, perl/example.pl: Updates for new perl module names * perl/lib/RDF/Redland/Makefile.am: Added CORE.pm (from SWIG) to distribution; clean it too. * perl/lib/RDF/Redland/URI.pm, perl/lib/RDF/Redland/Stream.pm, perl/lib/RDF/Redland/Storage.pm, perl/lib/RDF/Redland/Statement.pm, perl/lib/RDF/Redland/RSS.pm, perl/lib/RDF/Redland/Parser.pm, perl/lib/RDF/Redland/Node.pm, perl/lib/RDF/Redland/Model.pm, perl/lib/RDF/Redland/Iterator.pm, perl/lib/RDF/Redland.pm: Updates for new perl module names * perl/lib/RDF/URI.pm, perl/lib/RDF/Stream.pm, perl/lib/RDF/Storage.pm, perl/lib/RDF/Statement.pm, perl/lib/RDF/RSS.pm, perl/lib/RDF/Parser.pm, perl/lib/RDF/Node.pm, perl/lib/RDF/Model.pm, perl/lib/RDF/Makefile.am, perl/lib/RDF/Iterator.pm, perl/lib/RDF.pm: Trampoline modules for old->new perl APIs Contains warning with a promise that these files go away next version * configure.in: Pick up to 5 versions of python2, 4 of perl5 - groan. Added perl/lib/RDF/Redland dir 2002-01-02 Dave Beckett * perl/Makefile.PL: Pass -I and -L,-l flags to right config * Makefile.am: Added Makefile.PL to distribution * Makefile.PL: Fake MakeMaker Makefile.PL - top level Makefile.PL for Redland * perl/dc.rdf, ex2.rdf, ex1.rdf: Update to revised syntax redland-1.0.17/redland-config.in0000644000175000017500000000456611516540407013354 00000000000000#!/bin/sh # # Copyright (C) 2000-2009 David Beckett http://www.dajobe.org/ # Copyright (C) 2000-2004 University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # # PACKAGE=@PACKAGE@ PKGCONFIG=pkg-config usage() { cat<&2 fi args="" while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in # GNU standards require this --help|--usage) usage 0 ;; # Ignored options --libtool-libs|--prefix=*) echo "$0: $1 option ignored" 1>&2 ;; # Altered options --prefix) args="$args --variable=prefix"; ;; --swig) args="$args --variable=swig"; ;; --version) echo @VERSION@ exit 0 ;; --private-libs) args="$args --static --libs"; ;; --version-decimal) echo @LIBRDF_VERSION_DECIMAL@ exit 0 ;; # Other options are passed through *) args="$args $1" ;; esac shift done if $PKGCONFIG $PACKAGE --exists; then : # exists else echo "$0: $PKGCONFIG does not know about package $PACKAGE" exit 1 fi $PKGCONFIG $PACKAGE $args redland-1.0.17/scripts/0000755000175000017500000000000012257576340011714 500000000000000redland-1.0.17/scripts/Makefile.am0000644000175000017500000000157411666540751013677 00000000000000# -*- Mode: Makefile -*- # # Makefile.am - automake file for Redland librdf scripts # # Copyright (C) 2011, David Beckett http://www.dajobe.org/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # EXTRA_DIST= \ markdown-to-html.pl \ process-changes.pl \ touch-mtime.pl \ fix-gtkdoc-header.pl redland-1.0.17/scripts/Makefile.in0000644000175000017500000003307012257575714013710 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- Mode: Makefile -*- # # Makefile.am - automake file for Redland librdf scripts # # Copyright (C) 2011, David Beckett http://www.dajobe.org/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = scripts DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/rdf_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIGEST_OBJS = @DIGEST_OBJS@ DIGEST_SRCS = @DIGEST_SRCS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HASH_OBJS = @HASH_OBJS@ HASH_SRCS = @HASH_SRCS@ HAVE_RAPTOR2_API = @HAVE_RAPTOR2_API@ HTML_DIR = @HTML_DIR@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IODBC_CONFIG = @IODBC_CONFIG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBRDF_CPPFLAGS = @LIBRDF_CPPFLAGS@ LIBRDF_DIRECT_LIBS = @LIBRDF_DIRECT_LIBS@ LIBRDF_EXTERNAL_CPPFLAGS = @LIBRDF_EXTERNAL_CPPFLAGS@ LIBRDF_EXTERNAL_LIBS = @LIBRDF_EXTERNAL_LIBS@ LIBRDF_INTERNAL_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ LIBRDF_INTERNAL_DEPS = @LIBRDF_INTERNAL_DEPS@ LIBRDF_INTERNAL_LIBS = @LIBRDF_INTERNAL_LIBS@ LIBRDF_LDFLAGS = @LIBRDF_LDFLAGS@ LIBRDF_LIBTOOLLIBS = @LIBRDF_LIBTOOLLIBS@ LIBRDF_LIBTOOL_VERSION = @LIBRDF_LIBTOOL_VERSION@ LIBRDF_PKGCONFIG_PRIVATE_LIBS = @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ LIBRDF_VERSION_DECIMAL = @LIBRDF_VERSION_DECIMAL@ LIBRDF_VERSION_MAJOR = @LIBRDF_VERSION_MAJOR@ LIBRDF_VERSION_MINOR = @LIBRDF_VERSION_MINOR@ LIBRDF_VERSION_RELEASE = @LIBRDF_VERSION_RELEASE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEM = @MEM@ MEM_LIBS = @MEM_LIBS@ MKDIR_P = @MKDIR_P@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ODBC_CFLAGS = @ODBC_CFLAGS@ ODBC_LIBS = @ODBC_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSTGRESQL_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ POSTGRESQL_LIBS = @POSTGRESQL_LIBS@ RANLIB = @RANLIB@ RAPTOR2_CFLAGS = @RAPTOR2_CFLAGS@ RAPTOR2_LIBS = @RAPTOR2_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ RASQAL_CFLAGS = @RASQAL_CFLAGS@ RASQAL_LIBS = @RASQAL_LIBS@ RASQAL_MAX_VERSION = @RASQAL_MAX_VERSION@ RASQAL_MIN_VERSION = @RASQAL_MIN_VERSION@ RECHO = @RECHO@ RECHO_C = @RECHO_C@ RECHO_N = @RECHO_N@ REDLAND_MODULE_PATH = @REDLAND_MODULE_PATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TAR = @TAR@ TSTORE_CONFIG = @TSTORE_CONFIG@ TSTORE_CPPFLAGS = @TSTORE_CPPFLAGS@ TSTORE_LIBS = @TSTORE_LIBS@ VERSION = @VERSION@ VIRTUOSO_CPPFLAGS = @VIRTUOSO_CPPFLAGS@ VIRTUOSO_LIBS = @VIRTUOSO_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ markdown-to-html.pl \ process-changes.pl \ touch-mtime.pl \ fix-gtkdoc-header.pl all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: redland-1.0.17/scripts/fix-gtkdoc-header.pl0000644000175000017500000000237511666540751015465 00000000000000#!/usr/bin/perl -w # # Edit rdf_log.h so that gtk-doc is happy about it # # USAGE: # perl fix-gtkdoc-header.pl < rdf_log.h > filtered_rdf_log.h # # Copyright (C) 2011, David Beckett http://www.dajobe.org/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. while(<>) { # Remove calling convention macro s/REDLAND_CALLBACK_STDCALL *//; # Remove trailing macros s{REDLAND_PRINTF_FORMAT\(\d+, \d+\);}{;}; # gtk-doc hates const in some places s/const char\* const\* (\w+)/const char\* $1/; # and unsigned char s/const unsigned char \*(\w+)/const char \* $1/; # and unsigned char in a handler typedef s/typedef unsigned char\s*\*/typedef char \*/; print; } redland-1.0.17/scripts/touch-mtime.pl0000755000175000017500000000216411516410511014412 00000000000000#!/usr/bin/perl # #* touch-mtime.pl - Copy file modification times # # Copyright (C) 2007, David Beckett http://purl.org/net/dajobe/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # use File::Basename; use File::stat; my $usage="REFERENCE-FILE FILE\n"; my $program=basename $0; die "USAGE: $usage" if @ARGV != 2; my($ref,$file)=@ARGV; my $st; $st=stat($ref) or die "$program: No such reference file $ref - $!\n"; my $mtime=$st->mtime; $st=stat($file) or die "$program: No such file $file - $!\n"; utime $mtime, $mtime, $file; redland-1.0.17/scripts/process-changes.pl0000755000175000017500000005121512252470453015255 00000000000000#!/usr/bin/perl -w # # Format changes TSV file # # USAGE: # process-changes.pl [OPTIONS] CHANGES-TSV-FILE # # Copyright (C) 2010-2011, David Beckett http://www.dajobe.org/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # # Example of Format (9 fields): # OLD VERSIONtype | enum | OLD RETURNOLD NAMEOLD ARGSNEW VERSIONtype | enum | NEW RETURNNEW NAMENEW ARGSNOTES # # Functions # 0.9.21voidoldfunctionor-(args)0.9.22voidnewfunctionor-(args)NOTES # Types # 0.9.21typeoldtypenameor--0.9.22typenewtypeor--NOTES # Enums # 0.9.21enumoldenumvalueor--0.9.22enumnewenumvalueor--NOTES # use strict; use File::Basename; use IO::File; use Getopt::Long; use Pod::Usage; our $program = basename $0; our $nbsp = ' '; our $id_prefix = undef; sub print_start_chapter_as_docbook_xml($$$$) { my($fh, $id, $title, $intro_para)=@_; print $fh <<"EOT"; $title $intro_para EOT } sub print_end_chapter_as_docbook_xml($) { my($fh)=@_; print $fh <<"EOT"; EOT } sub print_docbook_xml($$$@) { my($fh, $id, $title, @list)=@_; print $fh <<"EOT";
$title EOT print $fh <<"EOT";
EOT } sub print_start_section_as_docbook_xml($$$) { my($fh, $id, $title)=@_; print $fh <<"EOT";
$title EOT } sub format_function_name_as_docbook_xml($) { my($name)=@_; my $escaped_name = $name; $escaped_name =~ s/_/-/g; return qq{$name}; } sub format_type_name_as_docbook_xml($) { my($name)=@_; my $escaped_name = $name; $escaped_name =~ s/_/-/g; if($escaped_name =~ /^[-A-Z0-9]+$/) { $escaped_name .= ":CAPS"; } return qq{$name}; } sub format_enum_name_as_docbook_xml($) { my($name)=@_; my $escaped_name = $name; $escaped_name =~ s/_/-/g; if($escaped_name =~ /^[-A-Z0-9]+$/) { $escaped_name .= ":CAPS"; } return qq{$name}; } sub format_fn_sig($$$$$) { my($format_name, $show_sig, $fn_return, $fn_name, $fn_args)=@_; my $formatted_name = $format_name ? format_function_name_as_docbook_xml($fn_name) : $fn_name; return $show_sig ? $fn_return . " " . $formatted_name . $fn_args : $formatted_name; } sub format_notes($$) { my($is_inline,$notes)=@_; if ($notes eq '') { return $is_inline ? '' : $nbsp; } $notes =~ s{#((?:raptor|librdf|rasqal)\w+)}{format_type_name_as_docbook_xml($1)}ge; $notes =~ s{#?((?:RAPTOR|LIBRDF|RASQAL)_\w+)}{format_enum_name_as_docbook_xml($1)}ge; $notes =~ s{((?:raptor|librdf|rasqal)_\w+?)\(}{format_function_name_as_docbook_xml($1)."("}ge; return $is_inline ? "- " . $notes : $notes; } sub print_functions_list_as_docbook_xml($$$$@) { my($fh, $title, $format_name, $show_sig, @list)=@_; return if !@list; print $fh <<"EOT"; Functions EOT print $fh " $title\n" if defined $title; # Sort by fn_name name @list = sort { $a->[1] cmp $b->[1] } @list; for my $item (@list) { my($fn_return, $fn_name, $fn_args, $notes) = @$item; my $formatted_fn = format_fn_sig($format_name, $show_sig, $fn_return, $fn_name, $fn_args); $notes = format_notes(1, $notes); print $fh " $formatted_fn $notes\n"; } print $fh <<"EOT"; EOT } sub format_type_sig($$) { my($format_name, $type_name)=@_; return $format_name ? format_type_name_as_docbook_xml($type_name) : $type_name; } sub format_enum_sig($$) { my($format_name, $enum_name)=@_; return $format_name ? format_enum_name_as_docbook_xml($enum_name) : $enum_name; } sub print_types_list_as_docbook_xml($$$$@) { my($fh, $title, $format_name, $show_sig, @list)=@_; return if !@list; print $fh <<"EOT"; Types EOT print $fh " $title\n" if defined $title; # Sort by type name @list = sort { $a->[0] cmp $b->[0] } @list; for my $item (@list) { my($type_name, $notes) = @$item; my $formatted_fn = format_type_sig($format_name, $type_name); $notes = format_notes(1, $notes); print $fh " $formatted_fn $notes\n"; } print $fh <<"EOT"; EOT } sub print_enums_list_as_docbook_xml($$$$@) { my($fh, $title, $format_name, $show_sig, @list)=@_; return if !@list; print $fh <<"EOT"; Enums EOT print $fh " $title\n" if defined $title; # Sort by format name @list = sort { $a->[0] cmp $b->[0] } @list; for my $item (@list) { my($enum_name, $notes) = @$item; my $formatted_fn = format_enum_sig($format_name, $enum_name); $notes = format_notes(1, $notes); print $fh " $formatted_fn $notes\n"; } print $fh <<"EOT"; EOT } sub print_renamed_functions_as_docbook_xml($$$$@) { my($fh, $title, $old_function_header, $new_function_header, @list)=@_; return if !@list; print $fh <<"EOT"; EOT print $fh " \n" if defined $title; # Sort by from name @list = sort { $a->[0] cmp $b->[0] } @list; print $fh <<"EOT"; EOT for my $item (@list) { my($from, $to, $notes) = @$item; my $formatted_name = format_function_name_as_docbook_xml($to); $notes = format_notes(0, $notes); print $fh " \n \n \n"; } print $fh <<"EOT";
$title
$old_function_header $new_function_header Notes
$from $formatted_name $notes
EOT } sub print_changed_functions_as_docbook_xml($$$$@) { my($fh, $title, $old_function_header, $new_function_header, @list)=@_; return if !@list; print $fh <<"EOT"; EOT print $fh " \n" if defined $title; print $fh <<"EOT"; EOT for my $item (@list) { my($old_fn_return, $old_fn_name, $old_fn_args, $new_fn_return, $new_fn_name, $new_fn_args, $notes) = @$item; my $old_formatted_fn = format_fn_sig(0, 1, $old_fn_return, $old_fn_name, $old_fn_args); my $new_formatted_fn = format_fn_sig(1, 1, $new_fn_return, $new_fn_name, $new_fn_args); $notes = format_notes(0, $notes); print $fh " \n \n \n"; } print $fh <<"EOT";
$title
$old_function_header $new_function_header Notes
$old_formatted_fn $new_formatted_fn $notes
EOT } sub print_end_section_as_docbook_xml($) { my($fh)=@_; print $fh <<"EOT";
EOT } sub print_changed_types_as_docbook_xml($$$$@) { my($fh, $title, $old_type_header, $new_type_header, @list)=@_; return if !@list; print $fh <<"EOT"; EOT print $fh " \n" if defined $title; # Sort by old type name @list = sort { $a->[0] cmp $b->[0] } @list; print $fh <<"EOT"; EOT for my $item (@list) { my($old_type_name, $new_type_name, $notes) = @$item; my $old_formatted_type = format_type_sig(0, $old_type_name); my $new_formatted_type = format_type_sig(1, $new_type_name); $notes = format_notes(0, $notes); print $fh " \n \n \n"; } print $fh <<"EOT";
$title
$old_type_header $new_type_header Notes
$old_formatted_type $new_formatted_type $notes
EOT } sub print_renamed_enums_as_docbook_xml($$$$@) { my($fh, $title, $old_enum_header, $new_enum_header, @list)=@_; return if !@list; print $fh <<"EOT"; EOT print $fh " \n" if defined $title; # Sort by from name @list = sort { $a->[0] cmp $b->[0] } @list; print $fh <<"EOT"; EOT for my $item (@list) { my($from, $to, $notes) = @$item; my $formatted_name = format_enum_name_as_docbook_xml($to); $notes = format_notes(0, $notes); print $fh " \n \n \n"; } print $fh <<"EOT";
$title
$old_enum_header $new_enum_header Notes
$from $formatted_name $notes
EOT } sub print_deletes_as_perl_script($$@) { my($out_fh, $title, @names) = @_; print $out_fh "\n# $title\n"; for my $entry (@names) { my($name,$note)=@$entry; $note ||= ''; print $out_fh qq{s|^(.*$name.*)\$|/\\* WARNING: $name - deleted. $note \\*/ \$1|g;\n}; } } sub print_renames_as_perl_script($$$@) { my($out_fh, $title, $is_function, @names) = @_; print $out_fh "\n# $title\n"; for my $entry (@names) { my($from, $to, $note)=@$entry; $note ||= ''; my $suffix = ($is_function ? '\\(' : ''); print $out_fh qq{s|$from$suffix|$to$suffix|g;\n}; } } sub print_changes_as_perl_script($$@) { my($out_fh, $title, @names) = @_; print $out_fh "\n# $title\n"; for my $entry (@names) { my($from, $to, $note)=@$entry; $note ||= ''; print $out_fh qq{s|^(.*)($from)(.*)\$|/\\* WARNING: $from. $note \\*/ \$\{1\}$to\$\{3\}|g;\n}; } } sub print_statement_field_renames_as_perl_script($) { my($out_fh)=@_; # These are tricky / tedious to deal with entirely by hand but # the replacement for subject and object can only be determined by a person my(%statement_field_maps) = ( 'subject' => 'subject.value.uri or subject.value.blank.string /* WARNING: must choose one */', 'subject_type' => 'subject.type', 'predicate' => 'predicate.value.uri', 'predicate_type' => 'predicate.type', 'object' => 'object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */', 'object_type' => 'object.type', 'object_literal_datatype' => 'object.value.literal.datatype', 'object_literal_language' => 'object.value.literal.language' ); print $out_fh "\n# Replace statement fields with term fields.\n"; while(my($old,$new) = each %statement_field_maps) { print $out_fh qq{s|->$old|->$new|g;\n}; } print $out_fh "\n"; } sub to_id($) { my $id=shift; $id =~ s/\W/-/g; $id =~ s/\-+/-/g; $id =~ s/^\-//; $id =~ s/\-$//; return $id; } # main my $docbook_xml_file = undef; my $upgrade_script_file = undef; my $usage = undef; GetOptions( 'docbook-xml=s' => \$docbook_xml_file, 'upgrade-script=s' => \$upgrade_script_file, 'package=s' => \$id_prefix, 'help|h|?' => \$usage ) || pod2usage(2); pod2usage(-verbose => 2) if $usage; # Arguments our($package, $file) = @ARGV; $id_prefix ||= $package; # Read in data our $expected_n_fields = 9; # "$old-$new" versions in order our(@version_pairs); # and seen our(%version_pairs_seen); # Hashes keyed by $version_pair. Value is array of descriptive # arrays specific to each type my(%new_functions); my(%deleted_functions); my(%renamed_functions); my(%changed_functions); my(%new_types); my(%deleted_types); my(%changed_types); my(%new_enums); my(%deleted_enums); my(%renamed_enums); open(IN, "<$file") or die "$program: Cannot read $file - $!\n"; while() { chomp; next if /^#/; my(@fields)=split(/\t/); die "$program: Bad line $.: $_\n" unless scalar(@fields) == $expected_n_fields; if($fields[1] eq 'type') { my($old_ver, $dummy1, $old_name, $old_args, $new_ver, $dummy2, $new_name, $new_args,$notes)=@fields; my $version_pair = $old_ver."-".$new_ver; if(!$version_pairs_seen{$version_pair}) { push(@version_pairs, [$old_ver, $new_ver]); $version_pairs_seen{$version_pair} = 1; } $notes = '' if $notes eq '-'; if($old_name eq '-') { push(@{$new_types{$version_pair}}, [$new_name, $notes]); } elsif($new_name eq '-') { push(@{$deleted_types{$version_pair}}, [$old_name, $notes]); } elsif(($old_name eq $new_name) && $notes eq '') { # same } else { # renamed and maybe something else changed - in the notes push(@{$changed_types{$version_pair}}, [$old_name, $new_name, $notes]); } } elsif($fields[1] eq 'enum') { my($old_ver, $dummy1, $old_name, $old_args, $new_ver, $dummy2, $new_name, $new_args,$notes)=@fields; my $version_pair = $old_ver."-".$new_ver; if(!$version_pairs_seen{$version_pair}) { push(@version_pairs, [$old_ver, $new_ver]); $version_pairs_seen{$version_pair} = 1; } $notes = '' if $notes eq '-'; if($old_name eq '-') { push(@{$new_enums{$version_pair}}, [$new_name, $notes]); } elsif($new_name eq '-') { push(@{$deleted_enums{$version_pair}}, [$old_name, $notes]); } elsif(($old_name eq $new_name) && $notes eq '') { # same } else { push(@{$renamed_enums{$version_pair}}, [$old_name, $new_name, $notes]); } } else { my($old_ver, $old_return, $old_name, $old_args, $new_ver, $new_return, $new_name, $new_args,$notes)=@fields; my $version_pair = $old_ver."-".$new_ver; if(!$version_pairs_seen{$version_pair}) { push(@version_pairs, [$old_ver, $new_ver]); $version_pairs_seen{$version_pair} = 1; } $notes = '' if $notes eq '-'; if($old_name eq '-') { push(@{$new_functions{$version_pair}}, [$new_return, $new_name, $new_args, $notes]); } elsif($new_name eq '-') { push(@{$deleted_functions{$version_pair}}, [$old_return, $old_name, $old_args, $notes]); } elsif($old_return eq $new_return && $old_name eq $new_name && $old_args eq $new_args) { # same } elsif($old_return eq $new_return && $old_name ne $new_name && $old_args eq $new_args) { # renamed but nothing else changed push(@{$renamed_functions{$version_pair}}, [$old_name, $new_name, $notes]); } else { # something changed - args and/or return push(@{$changed_functions{$version_pair}}, [$old_return, $old_name, $old_args, $new_return, $new_name, $new_args, $notes]); } } } close(IN); sub version_for_sort($) { map { sprintf("%02d", $_) } split(/\./, $_[0]); } # Write Docbook XML output if(defined $docbook_xml_file) { my $out_fh = new IO::File; $out_fh->open(">$docbook_xml_file"); our $intro_title = "API Changes"; our $intro_para = <<"EOT"; This chapter describes the API changes for $package. EOT print_start_chapter_as_docbook_xml($out_fh, $id_prefix.'-changes', $intro_title, $intro_para); print_start_section_as_docbook_xml($out_fh, $id_prefix.'-changes-intro', "Introduction"); print $out_fh <<"EOT"; The following sections describe the changes in the API between versions including additions, deletions, renames (retaining the same number of parameters, types and return value type) and more complex changes to functions, types and enums. EOT print_end_section_as_docbook_xml($out_fh); # Sort by new version, newest first for my $vp (sort { version_for_sort($b->[1]) cmp version_for_sort($a->[1]) } @version_pairs) { my($old_version, $new_version)= @$vp; my $id = to_id($old_version) . "-to-" . to_id($new_version); my $version_pair = $old_version."-".$new_version; print_start_section_as_docbook_xml($out_fh, $id_prefix.'-changes-'.$id, "Changes between $package $old_version and $new_version"); my(@f, @t, @e); @f = @{$new_functions{$version_pair} || []}; @t = @{$new_types{$version_pair} || []}; @e = @{$new_enums{$version_pair} || []}; if(@f || @t || @e) { print_start_section_as_docbook_xml($out_fh, $id_prefix.'-changes-new-'.$id, "New functions, types and enums"); print_functions_list_as_docbook_xml($out_fh, undef, 1, 1, @f); print_types_list_as_docbook_xml($out_fh, undef, 1, 1, @t); print_enums_list_as_docbook_xml($out_fh, undef, 1, 1, @e); print_end_section_as_docbook_xml($out_fh); } @f = @{$deleted_functions{$version_pair} || []}; @t = @{$deleted_types{$version_pair} || []}; @e = @{$deleted_enums{$version_pair} || []}; if(@f || @t || @e) { print_start_section_as_docbook_xml($out_fh, $id_prefix.'-changes-deleted-'.$id, "Deleted functions, types and enums"); print_functions_list_as_docbook_xml($out_fh, undef, 0, 0, @f); print_types_list_as_docbook_xml($out_fh, undef, 0, 1, @t); print_enums_list_as_docbook_xml($out_fh, undef, 0, 1, @e); print_end_section_as_docbook_xml($out_fh); } @f = @{$renamed_functions{$version_pair} || []}; @e = @{$renamed_enums{$version_pair} || []}; if(@f || @e) { print_start_section_as_docbook_xml($out_fh, $id_prefix.'-changes-renamed-'.$id, "Renamed function and enums"); print_renamed_functions_as_docbook_xml($out_fh, undef, "$old_version function", "$new_version function", @f); print_renamed_enums_as_docbook_xml($out_fh, undef, "$old_version enum", "$new_version enum", @e); print_end_section_as_docbook_xml($out_fh); } @f = @{$changed_functions{$version_pair} || []}; @t = @{$changed_types{$version_pair} || []}; if(@f || @t) { print_start_section_as_docbook_xml($out_fh, $id_prefix.'-changes-changed-'.$id, "Changed functions and types"); print_changed_functions_as_docbook_xml($out_fh, undef, "$old_version function", "$new_version function", @f); print_changed_types_as_docbook_xml($out_fh, undef, "$old_version type", "$new_version type", @t); print_end_section_as_docbook_xml($out_fh); } print_end_section_as_docbook_xml($out_fh); } # end pair of old/new versions print_end_chapter_as_docbook_xml($out_fh); $out_fh->close; } # Write Upgrade script output if(defined $upgrade_script_file) { my $out_fh = new IO::File; $out_fh->open(">$upgrade_script_file"); print $out_fh "#!/usr/bin/perl -pi~\n"; for my $vp (@version_pairs) { my($old_version, $new_version)= @$vp; my $version_pair = $old_version."-".$new_version; print $out_fh "# Perl script to upgrade $package $old_version to $new_version\n\n"; print_statement_field_renames_as_perl_script($out_fh); my(@f, @t, @e); @f = @{$deleted_functions{$version_pair} || []}; @t = @{$deleted_types{$version_pair} || []}; @e = @{$deleted_enums{$version_pair} || []}; print_deletes_as_perl_script($out_fh, 'Deleted functions', (map { [ $_->[1], $_->[3] ] } @f)); print_deletes_as_perl_script($out_fh, 'Deleted types', @t); print_deletes_as_perl_script($out_fh, 'Deleted enums', @e); @f = @{$renamed_functions{$version_pair} || []}; @e = @{$renamed_enums{$version_pair} || []}; print_renames_as_perl_script($out_fh, 'Renamed functions', 1, @f); print_renames_as_perl_script($out_fh, 'Renamed enums', 0, @e); @f = @{$changed_functions{$version_pair} || []}; @t = @{$changed_types{$version_pair} || []}; print_changes_as_perl_script($out_fh, 'Changed functions', (map { [ $_->[1], $_->[4], $_->[6] ] } @f)); print_changes_as_perl_script($out_fh, 'Changed types', @t); } # end of version pair loop $out_fh->close; } exit 0; __END__ =head1 NAME process-changes - turn changes TSV into files =head1 SYNOPSIS process-changes [options] PACKAGE-NAME TSV-FILE =head1 OPTIONS =over 8 =item B<--help> Give command help summary. =item B<--docbook-xml> DOCBOOK-XML Set the output docbook XML file =item B<--upgrade-script> UPGRADE-SCRIPT-PL Set the output perl script to upgrade the function and type names where possible. =back =head1 DESCRIPTION Turn a package's changes TSV file into docbook XML. =cut redland-1.0.17/scripts/markdown-to-html.pl0000755000175000017500000000302111516410511015354 00000000000000#!/usr/bin/perl -w # # Convert 'markdown' program output to legal XHTML that redland # website building scripts can deal with # # use strict; use File::Basename; our $program = basename $0; our $MARKDOWN=$ENV{'MARKDOWN'} || 'markdown'; die "USAGE: $program: INPUT-MD OUTPUT-HTML\n" unless @ARGV == 2; my($input,$output)=@ARGV; die "$program: $input not found - $!\n" unless -r $input; open(IN, "$MARKDOWN $input |") or die "$program: pipe from $MARKDOWN $input failed - $\n"; open(OUT, ">$output") or die "$program: Cannot create $output - $\n"; my $title; while() { # Use first H1 to trigger head and title if(!defined $title && m%

([^<]+) Redland RDF Application Framework - $title HEADER } # Fix markdown's removal of whitespace before first code line # Assumes all code indents with 2 initial spaces s%
(.*)$%
\n  $1%;

  print OUT "  $_";
}
close(IN);

print OUT <<"FOOTER";

Copyright (C) 2010 Dave Beckett

FOOTER close(OUT); exit 0; redland-1.0.17/demos/0000755000175000017500000000000012257576340011334 500000000000000redland-1.0.17/demos/Makefile.am0000644000175000017500000000007310674751745013315 00000000000000EXTRA_DIST=demo.pl ntriples.pl parser-tests.pl rss-show.pl redland-1.0.17/demos/Makefile.in0000644000175000017500000003136112257575714013331 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = demos DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/rdf_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIGEST_OBJS = @DIGEST_OBJS@ DIGEST_SRCS = @DIGEST_SRCS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HASH_OBJS = @HASH_OBJS@ HASH_SRCS = @HASH_SRCS@ HAVE_RAPTOR2_API = @HAVE_RAPTOR2_API@ HTML_DIR = @HTML_DIR@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IODBC_CONFIG = @IODBC_CONFIG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBRDF_CPPFLAGS = @LIBRDF_CPPFLAGS@ LIBRDF_DIRECT_LIBS = @LIBRDF_DIRECT_LIBS@ LIBRDF_EXTERNAL_CPPFLAGS = @LIBRDF_EXTERNAL_CPPFLAGS@ LIBRDF_EXTERNAL_LIBS = @LIBRDF_EXTERNAL_LIBS@ LIBRDF_INTERNAL_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ LIBRDF_INTERNAL_DEPS = @LIBRDF_INTERNAL_DEPS@ LIBRDF_INTERNAL_LIBS = @LIBRDF_INTERNAL_LIBS@ LIBRDF_LDFLAGS = @LIBRDF_LDFLAGS@ LIBRDF_LIBTOOLLIBS = @LIBRDF_LIBTOOLLIBS@ LIBRDF_LIBTOOL_VERSION = @LIBRDF_LIBTOOL_VERSION@ LIBRDF_PKGCONFIG_PRIVATE_LIBS = @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ LIBRDF_VERSION_DECIMAL = @LIBRDF_VERSION_DECIMAL@ LIBRDF_VERSION_MAJOR = @LIBRDF_VERSION_MAJOR@ LIBRDF_VERSION_MINOR = @LIBRDF_VERSION_MINOR@ LIBRDF_VERSION_RELEASE = @LIBRDF_VERSION_RELEASE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEM = @MEM@ MEM_LIBS = @MEM_LIBS@ MKDIR_P = @MKDIR_P@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ODBC_CFLAGS = @ODBC_CFLAGS@ ODBC_LIBS = @ODBC_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSTGRESQL_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ POSTGRESQL_LIBS = @POSTGRESQL_LIBS@ RANLIB = @RANLIB@ RAPTOR2_CFLAGS = @RAPTOR2_CFLAGS@ RAPTOR2_LIBS = @RAPTOR2_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ RASQAL_CFLAGS = @RASQAL_CFLAGS@ RASQAL_LIBS = @RASQAL_LIBS@ RASQAL_MAX_VERSION = @RASQAL_MAX_VERSION@ RASQAL_MIN_VERSION = @RASQAL_MIN_VERSION@ RECHO = @RECHO@ RECHO_C = @RECHO_C@ RECHO_N = @RECHO_N@ REDLAND_MODULE_PATH = @REDLAND_MODULE_PATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TAR = @TAR@ TSTORE_CONFIG = @TSTORE_CONFIG@ TSTORE_CPPFLAGS = @TSTORE_CPPFLAGS@ TSTORE_LIBS = @TSTORE_LIBS@ VERSION = @VERSION@ VIRTUOSO_CPPFLAGS = @VIRTUOSO_CPPFLAGS@ VIRTUOSO_LIBS = @VIRTUOSO_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = demo.pl ntriples.pl parser-tests.pl rss-show.pl all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu demos/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu demos/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: redland-1.0.17/demos/parser-tests.pl0000644000175000017500000006777711032336130014252 00000000000000#!/usr/bin/perl -Tw # # parser-tests.pl - Redland OLD RDF Parser Tests Web Interface # # Copyright (C) 2001-2004, David Beckett http://www.dajobe.org/ # Copyright (C) 2001-2004, University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # # # CHANGE THIS FOR YOUR CONFIGURATION $::ROOT_DIR='/somewhere'; use strict; # Helps with broken web requests (missing headers) $ENV{'Content-Length'}||=0; # Tainting, dontcha know $ENV{'PATH'}="/bin:/usr/bin:/usr/local/bin"; # PT # Standard perl modules use CGI; use LWP::Simple; use URI::URL; use HTML::Entities; use Sys::Hostname; # Configuration my $RDF_NAMESPACE="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; my $RDFS_NAMESPACE="http://www.w3.org/2000/01/rdf-schema#"; my $DC_NAMESPACE="http://purl.org/dc/elements/1.1/"; my $PT_NAMESPACE="http://www.ilrt.bristol.ac.uk/discovery/2001/03/parser-tests/schema#"; my $RDF_TESTS_ROOT_URI='http://www.w3.org/2000/10/rdf-tests/'; my $PT_TEST_URI_STRING=$PT_NAMESPACE."test"; my $PT_TESTRESULT_URI_STRING=$PT_NAMESPACE."testResult"; my $PT_PARSER_PREDICATE= RDF::Redland::Node->new_from_uri_string($PT_NAMESPACE."parser"); my $PT_TEST_RESOURCE= RDF::Redland::Node->new_from_uri_string($PT_TEST_URI_STRING); my $PT_TESTRESULT_PREDICATE= RDF::Redland::Node->new_from_uri_string($PT_TESTRESULT_URI_STRING); my $PT_STATEMENTS_PREDICATE= RDF::Redland::Node->new_from_uri_string($PT_NAMESPACE."statements"); my $PT_OUTPUT_PREDICATE= RDF::Redland::Node->new_from_uri_string($PT_NAMESPACE."output"); my $PT_ERROR_PREDICATE= RDF::Redland::Node->new_from_uri_string($PT_NAMESPACE."error"); my $PT_EXPECTEDRESULT_PREDICATE= RDF::Redland::Node->new_from_uri_string($PT_NAMESPACE."expectedResult"); my $RDF_TYPE_PREDICATE= RDF::Redland::Node->new_from_uri_string($RDF_NAMESPACE."type"); my $RDFS_LABEL_PREDICATE= RDF::Redland::Node->new_from_uri_string($RDFS_NAMESPACE."label"); my $DC_DESCRIPTION_PREDICATE=RDF::Redland::Node->new_from_uri_string($DC_NAMESPACE."description"); my $DC_TITLE_PREDICATE=RDF::Redland::Node->new_from_uri_string($DC_NAMESPACE."title"); my $GOOD_COLOUR='#00ff00'; # green; my $WARN_COLOUR='#ffff00'; # yellow; my $BAD_COLOUR='#ff0000'; # red my(@commands)=qw(compare-all list-tests show-test-detail list-parsers show-parser-detail ); # removed: compare my(%command_labels)=('compare' =>'Compare two parsers (NOT IMPL)', 'compare-all' =>'Compare all parsers', 'list-tests' =>'List all known tests', 'show-test-detail' =>'Show test detail', 'list-parsers' =>'List all known parsers', 'show-parser-detail' =>'Show parser detail', 'upload' =>'Upload RDF/XML model'); my $working_parser='raptor'; my $default_command='compare-all'; my $tmp_dir="$::ROOT_DIR/tmp"; my $db_dir="$::ROOT_DIR/db"; my $db='pt'; my $log_file="$::ROOT_DIR/logs/parser-tests.log"; # Redland perl modules use RDF::Redland; ###################################################################### # Subroutines sub log_action ($$;$) { my($host, $message, $now)=@_; $host ||= '-'; $now ||= time; return unless open (LOG, ">>$log_file"); my($sec,$min,$hour,$mday,$mon,$year)=gmtime $now; my $date=sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",1900+$year,$mon+1,$mday,$hour,$min,$sec); print LOG "$host $date $message\n"; close(LOG); } sub end_page($) { my $q=shift; print <<'EOT';

The source code of this demonstration is available in the Redland distribution as demos/parser-tests.pl or from the Redland website

EOT print qq{
\n\n\n\n\n}; } sub format_literal ($) { my $string=shift; return 'UNDEFINED' if !$string; encode_entities($string, "&<>\200-\377"); $string; } sub format_url($;$$) { my($url,$label,$title)=@_; $label ||=$url; $title=$title ? qq{ title="$title"} : ''; qq{$label}; } sub upload_rdf($$$$$$) { my($host,$q,$model,$storage,$uri_string,$chatty)=@_; my $temp_file="$tmp_dir/pt-$$.rdf"; my $rc=getstore($uri_string, $temp_file); if(!is_success($rc)) { print "\n\n

Failed to read URI $uri_string - HTTP error $rc

\n"; end_page($q); exit 0; } my $source_uri=new URI::URL("file:$temp_file"); my $parser=new RDF::Redland::Parser($working_parser); if(!$parser) { log_action($host, "Failed to create RDF/XML parser $working_parser"); print "\n\n

Sorry - failed to create RDF/XML parser $working_parser. This problem has been logged.

\n"; end_page($q); #unlink $temp_file if $temp_file; exit 0; } my $redland_base_uri=new RDF::Redland::URI $uri_string; my $redland_source_uri=new RDF::Redland::URI $source_uri; my $uri_label='URI '.format_url($uri_string); log_action($host, "Parsing URI $uri_string with parser $working_parser"); my $stream=$parser->parse_as_stream($redland_source_uri, $redland_base_uri); if(!$stream || $stream->end) { print "\n\n

$uri_label failed to parse as RDF/XML into model via stream with $working_parser parser

\n"; end_page($q); #unlink $temp_file if $temp_file; exit 0; } my $count=0; my $new_tests_count=0; while(!$stream->end) { my $statement=$stream->current; $model->add_statement($statement); # Found ?--[pt:test]->[uri] if($statement->predicate->equals($PT_TEST_RESOURCE)) { my $statement2=RDF::Redland::Statement->new_from_nodes(RDF::Redland::Node->new_from_node($statement->object), RDF::Redland::Node->new_from_node($RDF_TYPE_PREDICATE), RDF::Redland::Node->new_from_node($PT_TEST_RESOURCE)); if(!$model->contains_statement($statement2)) { $new_tests_count++; $model->add_statement($statement2); } } $count++; $stream->next; } $stream=undef; print "\n\n

$uri_label parsed as RDF/XML via stream with $working_parser parser OK creating $count statements.

\n" if $chatty; print "\n\n

Found $new_tests_count new tests.

\n" if ($chatty && $new_tests_count); #unlink $temp_file if $temp_file; $count; } ###################################################################### my $q = new CGI; # CGI parameter paranoia my $val; my $uri_string; $val=$q->param('uri'); if(defined $val && $val =~ /^([ -~]+)$/) { $uri_string=$1; } else { $uri_string=''; } my $parser1_string; $val=$q->param('parser1'); if(defined $val && $val =~ /^([-0-9a-z]+)$/) { $parser1_string=$1; } else { $parser1_string=undef; } my $parser2_string; $val=$q->param('parser2'); if(defined $val && $val =~ /^([-0-9a-z]+)$/) { $parser2_string=$1; } else { $parser2_string=undef; } my $command; $val=$q->param('command'); if(defined $val && $val =~ /^([-a-z]+)$/) { $command=$1; } else { $command=undef; } my $empty=(!$uri_string && !$parser1_string && !$parser2_string && !$command); # End of parameter decoding # Used in logging my $host=$q->remote_host; if($host eq hostname) { push(@commands, 'upload', 'init'); } if($command) { if($uri_string) { log_action($host, "Command $command URI $uri_string"); } else { log_action($host, "Command $command"); } } ###################################################################### # Emit content print $q->header(-type => 'text/html', -charset => 'iso-8859-1') unless ($command && $command eq 'init'); my $write='no'; my $new=''; if($command) { if($command eq 'init') { $write='yes'; $new=qq{new='yes' }; } elsif($command eq 'upload') { $write='yes'; } } my $storage=new RDF::Redland::Storage("hashes", $db, "${new}write='$write',hash-type='bdb',dir='$db_dir'"); my $model; if($storage) { $model=new RDF::Redland::Model($storage, ""); } if(!$storage || !$model) { log_action($host, "Failed to open database $db"); print "\n\n

Sorry - failed to open RDF database. This problem has been recorded.

\n"; end_page($q); exit 0; } if($command && $command eq 'init') { my(@init_content_uris)=( 'http://www.ilrt.bristol.ac.uk/discovery/swsw/pt/inputs/expected.rdf', # Schemas: $PT_NAMESPACE, 'http://www.ilrt.bristol.ac.uk/discovery/swsw/pt/inputs/dces.rdfs', $RDFS_NAMESPACE, # Parser Data: 'http://www.ilrt.bristol.ac.uk/discovery/swsw/pt/inputs/parsers/libwww.rdf', 'http://www.ilrt.bristol.ac.uk/discovery/swsw/pt/inputs/parsers/raptor.rdf', 'http://www.ilrt.bristol.ac.uk/discovery/swsw/pt/inputs/parsers/sirpac-stanford.rdf', 'http://www.ilrt.bristol.ac.uk/discovery/swsw/pt/inputs/parsers/sirpac-w3c.rdf', 'http://zoe.mathematik.uni-osnabrueck.de/RDF/cara.rdf', 'http://www.ilrt.bristol.ac.uk/discovery/swsw/pt/inputs/parsers/arp.rdf', 'http://www.ilrt.bristol.ac.uk/discovery/swsw/pt/inputs/parsers/cwm.rdf', 'http://www.ilrt.bristol.ac.uk/discovery/swsw/pt/inputs/parsers/rdfstore.rdf', ); my $parser=new RDF::Redland::Parser($working_parser); if(!$parser) { print "Sorry - failed to create RDF/XML parser $working_parser.\n"; exit 0; } my $temp_file="$tmp_dir/pt-$$.rdf"; my $source_uri=new URI::URL("file:$temp_file"); my $redland_source_uri=new RDF::Redland::URI $source_uri; for my $init_content_uri_string (@init_content_uris) { print "$init_content_uri_string: Adding content\n"; my $count=upload_rdf($host, $q, $model, $storage, $init_content_uri_string, 0); print "$init_content_uri_string: added $count statements\n"; } # end for my $init_content_uri_string $model=undef; $storage=undef; print "Initialisation complete\n"; exit 0; } # end for command init # Find parser nodes i.e. ?--[rdf:node]-->[pt:parser] my(@parser_nodes)=$model->sources($RDF_TYPE_PREDICATE, $PT_PARSER_PREDICATE); my(@parsers); my(%parser_descs); { for my $node (@parser_nodes) { my $label=$model->target($node, $RDFS_LABEL_PREDICATE)->literal_value_as_latin1; my $title=$model->target($node, $DC_TITLE_PREDICATE)->literal_value_as_latin1; if(!$label || !$title) { log_action('', "Parser with node URI ".$node->uri->as_string." has no label and description - ignoring"); next; } push(@parsers, $label); $parser_descs{$label}=$title; } } ###################################################################### # Always print header print <<"EOT"; RDF Parser Tests

RDF Parser Tests

This is a web service allowing you to compare RDF/XML Parsers against each other operating on test content and uses a simple schema for describing the tests and expected output.

INSTRUCTIONS: Choose a command from the menu and submit the form. The default command 'Compare all parsers' is a good starting place - i.e. just submit the form.

You can browse the individual parser results as RDF/XML files or the expected results (VERY tentative). The tests are all from the W3C RDF samples and miscellaneous tests page.

This is an all RDF system written using Redland and the Perl interface. You can even look at the raw statements (read only) if you want rather than the slightly cooked statements presented here.


EOT # use q->url() to get URL of this script without any query parameters # since we are using a POST here and don't want them added to the # submission URL. my $action_url=$q->url(-absolute=>1); print $q->start_form(-method=>'GET', -action => $action_url),"\n"; @commands=qw(upload) if !@parsers; print "\n\n

Command \n"; print $q->popup_menu(-name=>'command', -values=>\@commands, -default=>$default_command, -labels=>\%command_labels); print "

URI (of test or parser)
\n"; print $q->textfield(-name=>'uri', -default=>'', -size=>80, -maxlength=>1024); # if(@parsers) { # print "\n\n

RDF Parsers when comparing (not implemented yet): "; # print $q->popup_menu(-name=>'parser1', # -values=>\@parsers, # -default=>$parsers[0], # -labels=>\%parser_descs); # print "and"; # print $q->popup_menu(-name=>'parser2', # -values=>\@parsers, # -default=>$parsers[0], # -labels=>\%parser_descs); # } print "

\n\n

"; print $q->submit('Go'); print "

\n\n"; print $q->endform,"\n\n"; print <<"EOT";

Note: the values in the Expected column of tests is a combination of when the most of the parsers agreed and a visual inspection. None of these numbers have been properly validated.

Key: Test match versus expected result:

Failed
Succeeded
Succeeded but emitted warning
EOT # Any parameters? if($empty) { end_page($q); exit 0; } print "
\n"; ###################################################################### # Validate me $q->delete('Go'); if($command && !grep($_ eq $command, @commands)) { print "\n\n

No such command '$command'

\n"; $command=undef; } if(!$command) { end_page($q); exit 0; } if($command =~ /compare/) { if($parser1_string && !grep($_ eq $parser1_string, @parsers)) { print "\n\n

No such parser '$parser1_string' - valid list are @parsers

\n"; $parser1_string=$parsers[0]; } if($parser2_string && !grep($_ eq $parser2_string, @parsers)) { print "\n\n

No such parser '$parser2_string' - valid list are @parsers

\n"; $parser2_string=$parsers[0]; } } my $uri=''; if($uri_string) { eval "\$uri=new URI::URL(q{$uri_string});"; if($@ || !$uri) { print "\n\n

URI ".format_url($uri)." is not a legal URI (according to perl)

\n"; end_page($q); exit 0; } if(!$uri->scheme || $uri->scheme ne 'http') { print "\n\n

Cannot use URI $uri_string - must be a web http URI.

\n"; end_page($q); exit 0; } } $parser1_string ||= $parsers[0]; $parser2_string ||= $parsers[0]; ###################################################################### my $temp_file; if($command eq 'upload') { upload_rdf($host, $q, $model, $storage, $uri_string,1); end_page($q); exit 0; } # end if command upload if($command eq 'list-tests') { $q->param('command', 'show-test-detail'); # HACK - makes generated page / URIs large otherwise $q->delete('parser1'); $q->delete('parser2'); print <<"EOT";
EOT my $test_count=0; for my $test_node ($model->sources($RDF_TYPE_PREDICATE, $PT_TEST_RESOURCE)) { my $test_uri=$test_node->uri->as_string; $q->param('uri', $test_uri); my $details_uri=$q->self_url; my $label=$model->target($test_node, $RDFS_LABEL_PREDICATE); $label=$label ? $label->literal_value_as_latin1 : $test_uri; print qq{\n}; $test_count++; } print <<"EOT";
Source Details
}.format_url($test_uri,$label).qq{ }.format_url($details_uri,"Details").qq{

Found $test_count tests.

EOT end_page($q); exit 0; } # end command list-tests if($command eq 'show-test-detail') { print qq{

Properties of test }.format_url($uri_string).":
\n"; print <<"EOT";

EOT my $test_node=RDF::Redland::Node->new_from_uri_string($uri_string); my $statement=RDF::Redland::Statement->new_from_nodes(RDF::Redland::Node->new_from_node($test_node), undef, undef); my $stream=$model->find_statements($statement); my $property_count=0; while(!$stream->end) { my $statement2=$stream->current; my $predicate_uri_string=$statement2->predicate->uri->as_string; my $value=$statement2->object; my $label=$model->target($statement2->predicate, $RDFS_LABEL_PREDICATE); $label=$label ? $label->literal_value_as_latin1 : undef; $label=format_url($predicate_uri_string, $label); print "\n"; $property_count++; $stream->next; } $stream=undef; print <<"EOT";
Property Value
$label "; if($value->type == $RDF::Redland::Node::Type_Resource) { print format_url($value->uri->as_string); } else { print format_literal($value->literal_value_as_latin1); # probably literal } print "

Found $property_count properties.

EOT print <<"EOT";

Results per parser:

EOT # Now find the results per-parser $q->param('command', 'show-parser-detail'); # HACK - makes generated page / URIs large otherwise $q->delete('parser1'); $q->delete('parser2'); my $expected_node=$model->target($test_node, $PT_EXPECTEDRESULT_PREDICATE); my $expected_string=$expected_node ? $expected_node->literal_value_as_latin1 : '-'; my $parsers_count=0; for my $testresult_node ($model->sources($PT_TEST_RESOURCE, $test_node)) { # Go up again to parser my $parser_node=$model->source($PT_TESTRESULT_PREDICATE, $testresult_node); my $statements_node=$model->target($testresult_node, $PT_STATEMENTS_PREDICATE); my $output_node=$model->target($testresult_node, $PT_OUTPUT_PREDICATE); my $error_node=$model->target($testresult_node, $PT_ERROR_PREDICATE); my $statements_string=$statements_node ? $statements_node->literal_value_as_latin1 : '-'; my $output_string=$output_node ? $output_node->literal_value_as_latin1 : '-'; my $error_string=$error_node ? $error_node->literal_value_as_latin1 : '-'; $q->param('uri', $parser_node->uri->as_string); my $parser_title=$model->target($parser_node, $DC_TITLE_PREDICATE)->literal_value_as_latin1; my $parser_details=$q->self_url; my $colour_attrs=''; if($error_string ne '-' || $expected_string ne '-') { my $cell_colour; if($error_string ne '-') { $cell_colour=$BAD_COLOUR; } elsif ($expected_string =~ /^\d+$/ && $statements_string eq $expected_string) { $cell_colour=($output_string eq '-') ? $GOOD_COLOUR: $WARN_COLOUR; } elsif ($expected_string eq 'Error' && $error_string ne '-') { $cell_colour=($output_string eq '-') ? $GOOD_COLOUR: $WARN_COLOUR; } else { $cell_colour=$BAD_COLOUR; } $colour_attrs=qq{ bgcolor="$cell_colour"}; } print qq{\n}; $parsers_count++; } print <<"EOT";
Parser Expected Statements Output Errors
}.format_url($parser_details,$parser_title).qq{ $expected_string $statements_string $output_string $error_string

Found test results for $parsers_count RDF parsers.

EOT print <<"EOT"; EOT end_page($q); exit 0; } # end command show-test-detail if($command eq 'list-parsers') { $q->param('command', 'show-parser-detail'); # HACK - makes generated page / URIs large otherwise $q->delete('uri'); $q->delete('parser2'); print <<"EOT";
EOT my $parser_count=0; for my $parser_node (@parser_nodes) { my $parser_uri=$parser_node->uri->as_string; my $desc=$model->target($parser_node, $DC_DESCRIPTION_PREDICATE)->literal_value_as_latin1; $q->param('uri', $parser_uri); my $details_uri=$q->self_url; my $label=$model->target($parser_node, $RDFS_LABEL_PREDICATE); $label=$label ? $label->literal_value_as_latin1 : $parser_uri; print qq{\n}; $parser_count++; } print <<"EOT";
Identifier Description Details
}.format_url($parser_uri,$label).qq{ $desc }.format_url($details_uri,"Details").qq{

Found $parser_count RDF parsers.

EOT end_page($q); exit 0; } # end command list-parsers if($command eq 'show-parser-detail') { print qq{

Properties of RDF parser }.format_url($uri_string).qq{:
\n}; print <<"EOT";

EOT my $parser_node=RDF::Redland::Node->new_from_uri_string($uri_string); my $statement=RDF::Redland::Statement->new_from_nodes($parser_node, undef, undef); my $stream=$model->find_statements($statement); my $property_count=0; my $test_results_count=0; my(@testresult_nodes); for(;!$stream->end; $stream->next) { my $statement2=$stream->current; if ($statement2->predicate->equals($PT_TESTRESULT_PREDICATE)) { $test_results_count++; push(@testresult_nodes, RDF::Redland::Node->new_from_node($statement2->object)); next; } my $predicate_uri_string=$statement2->predicate->uri->as_string; my $value=$statement2->object; my $label=$model->target($statement2->predicate, $RDFS_LABEL_PREDICATE); $label=$label ? $label->literal_value_as_latin1 : undef; $label=format_url($predicate_uri_string, $label); print "\n"; $property_count++; } $stream=undef; print <<"EOT";
Property Value
$label "; if($value->type == $RDF::Redland::Node::Type_Resource) { print format_url($value->uri->as_string); } else { print format_literal($value->literal_value_as_latin1); # probably literal } print "

Found $property_count properties.

EOT $q->param('command', 'show-test-detail'); # HACK - makes generated page / URIs large otherwise $q->delete('parser1'); $q->delete('parser2'); my $test_count=0; for my $testresult_node (@testresult_nodes) { my $test_node=$model->target($testresult_node, $PT_TEST_RESOURCE); my $statements_node=$model->target($testresult_node, $PT_STATEMENTS_PREDICATE); my $output_node=$model->target($testresult_node, $PT_OUTPUT_PREDICATE); my $error_node=$model->target($testresult_node, $PT_ERROR_PREDICATE); my $expected_node=$model->target($test_node, $PT_EXPECTEDRESULT_PREDICATE); my $statements_string=$statements_node ? $statements_node->literal_value_as_latin1 : '-'; my $output_string=$output_node ? $output_node->literal_value_as_latin1 : '-'; my $error_string=$error_node ? $error_node->literal_value_as_latin1 : '-'; my $expected_string=$expected_node ? ($expected_node->literal_value_as_latin1 || '-') : '-'; my $test_uri=$test_node->uri->as_string; $q->param('uri', $test_uri); my $details_uri=$q->self_url; my $colour_attrs=''; if($error_string ne '-' || $expected_string ne '-') { my $cell_colour; if($error_string ne '-') { $cell_colour=$BAD_COLOUR; } elsif ($expected_string =~ /^\d+$/ && $statements_string eq $expected_string) { $cell_colour=($output_string eq '-') ? $GOOD_COLOUR: $WARN_COLOUR; } elsif ($expected_string eq 'Error' && $error_string ne '-') { $cell_colour=($output_string eq '-') ? $GOOD_COLOUR: $WARN_COLOUR; } else { $cell_colour=$BAD_COLOUR; } $colour_attrs=qq{ bgcolor="$cell_colour"}; } my $label=$model->target($test_node, $RDFS_LABEL_PREDICATE); $label=$label ? $label->literal_value_as_latin1 : $test_uri; print qq{\n}; $test_count++; } # end for my testresult_node print <<"EOT";
Source Details Expected Statements Output Errors
}.format_url($test_uri,$label).qq{ }.format_url($details_uri,"Details").qq{ $expected_string $statements_string $output_string $error_string

Found $test_count test results.

EOT print <<"EOT"; EOT end_page($q); exit 0; } # end command show-parser-detail if($command eq 'compare-all') { print <<"EOT";
EOT print qq{ }; $q->param('command', 'show-parser-detail'); # HACK - makes generated page / URIs large otherwise $q->delete('parser1'); $q->delete('parser2'); my $parsers_count=0; for my $parser_node (@parser_nodes) { my $parser_uri=$parser_node->uri->as_string; my $title=$model->target($parser_node, $DC_TITLE_PREDICATE)->literal_value_as_latin1; $q->param('uri', $parser_uri); my $parser_details=$q->self_url; print qq{ }; $parsers_count++; } print qq{\n}; $q->param('command', 'show-test-detail'); my $test_count=0; for my $test_node ($model->sources($RDF_TYPE_PREDICATE, $PT_TEST_RESOURCE)) { my $test_uri=$test_node->uri->as_string; my $expected_node=$model->target($test_node, $PT_EXPECTEDRESULT_PREDICATE); my $expected_string=$expected_node ? ($expected_node->literal_value_as_latin1 || '-') : '-'; $q->param('uri', $test_uri); my $details_uri=$q->self_url; my $label=$model->target($test_node, $RDFS_LABEL_PREDICATE); $label=$label ? $label->literal_value_as_latin1 : ("".format_url($test_uri,$label).""); print qq{}; # Now find the results per-parser my(@testresult_nodes)=$model->sources($PT_TEST_RESOURCE, $test_node); # Sort them by the column order my(@testresult_nodes_sorted); for my $parser_node (@parser_nodes) { my $found=0; for my $testresult_node (@testresult_nodes) { my $testresult_parser_node=$model->source($PT_TESTRESULT_PREDICATE, $testresult_node); if($testresult_parser_node->equals($parser_node)) { push(@testresult_nodes_sorted, $testresult_node); $found=1; last; } } push(@testresult_nodes_sorted, undef) if !$found; } @testresult_nodes=(); for my $testresult_node (@testresult_nodes_sorted) { if(!$testresult_node) { print qq{}; next; } # Go up again to parser my $parser_node=$model->source($PT_TESTRESULT_PREDICATE, $testresult_node); my $statements_node=$model->target($testresult_node, $PT_STATEMENTS_PREDICATE); my $output_node=$model->target($testresult_node, $PT_OUTPUT_PREDICATE); my $error_node=$model->target($testresult_node, $PT_ERROR_PREDICATE); my $summary=''; if($error_node) { $summary='Error'; } elsif($statements_node) { $summary=$statements_node->literal_value_as_latin1; } if($error_node || $expected_string ne '-') { my $cell_colour; if($error_node && $expected_string eq 'Error') { $cell_colour=$GOOD_COLOUR; } elsif ($summary ne $expected_string) { $cell_colour=$BAD_COLOUR; } elsif ($output_node) { $cell_colour=$WARN_COLOUR; } else { $cell_colour=$GOOD_COLOUR; } print qq{}; } else { print qq{}; } } # end for my testresult_node (per parser) print qq{\n}; $test_count++; } # end for my test_node print <<"EOT";
Test Details Expected}.format_url($parser_details, $title).qq{
}.format_url($test_uri,$label).qq{ }.format_url($details_uri,"Details").qq{ $expected_stringMissing$summary$summary

Found $test_count test results for $parsers_count RDF parsers.

EOT print <<"EOT"; EOT end_page($q); exit 0; } # end command compare-all redland-1.0.17/demos/rss-show.pl0000644000175000017500000004616511032336130013367 00000000000000#!/usr/bin/perl -Tw # # rss-view.pl - Redland CGI RSS validator and viewer demo # # Copyright (C) 2000-2004, David Beckett http://www.dajobe.org/ # Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # # # CHANGE THIS FOR YOUR CONFIGURATION $::ROOT_DIR='/somewhere'; use strict; # Helps with broken web requests (missing headers) $ENV{'Content-Length'}||=0; # Tainting, dontcha know $ENV{'PATH'}="/bin:/usr/bin:/usr/local/bin:$::ROOT_DIR/bin/"; delete $ENV{'BASH_ENV'}; # Standard perl modules use CGI; use LWP::Simple; use URI::URL; # Configuration my $tmp_dir="$::ROOT_DIR/tmp"; my $log_file="$::ROOT_DIR/logs/rss.log"; my $max_error_size=100; my $max_warning_size=100; my(@parameters)=qw(uri box soup); # Used for deleting databases my @suffixes=qw(po2s so2p sp2o); my(%namespaces)=( # Built in modules 'Dublin Core' => 'http://purl.org/dc/elements/1.1/', 'Syndication' => 'http://purl.org/rss/1.0/modules/syndication/', # Proposed modules from http://purl.org/rss/1.0/modules/proposed/ 'Changed Page' => 'http://my.theinfo.org/changed/1.0/rss/', 'RSS 0.91' => 'http://purl.org/rss/1.0/modules/rss091#', 'Threading' => 'http://purl.org/rss/1.0/modules/threading/', 'Taxonomy' => 'http://purl.org/rss/1.0/modules/taxonomy/', 'Events' => 'http://purl.org/rss/1.0/modules/event/', 'Content' => 'http://purl.org/rss/1.0/modules/content/', 'Creative Commons' => 'http://web.resource.org/cc/', 'Admin' => 'http://webns.net/mvcb/', 'Annotate' => 'http://purl.org/rss/1.0/modules/annotate/', # Other modules 'Dublin Core Terms' => 'http://purl.org/dc/terms/', 'Slash' => 'http://slashcode.com/rss/1.0/modules/Slash/', ); # Specify order for consistency. Note: must match keys %namespaces my(@namespace_order)=( 'Dublin Core', 'Dublin Core Terms', 'Syndication', 'Content', 'Creative Commons', 'Changed Page', 'Admin', 'RSS 0.91', 'Threading', 'Taxonomy', 'Events', 'Slash' ); my $rss_spec_url='http://purl.org/rss/1.0/spec'; my $content_encoded_uri=$namespaces{Content}."encoded"; my(%demo_rss_feeds)=( # Put your favourite RSS 1.0 feeds here 'W3C Semantic Web News' => 'http://www.w3.org/2001/sw/Overview.rss', ); my(@demo_rss_feeds_order)=sort {lc $a cmp lc $b} keys %demo_rss_feeds; # Redland perl modules use RDF::Redland; use RDF::Redland::RSS; ###################################################################### # Subroutines sub log_action ($$;$) { my($host, $message, $now)=@_; $now ||= time; return unless open (LOG, ">>$log_file"); my($sec,$min,$hour,$mday,$mon,$year)=gmtime $now; my $date=sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",1900+$year,$mon+1,$mday,$hour,$min,$sec); print LOG "$host $date $message\n"; close(LOG); } sub end_page($) { my $q=shift; print <<"EOT";

About the validator

This was written using Redland and the RDF::Redland::RSS Perl interface, interpreting the RSS 1.0 content as RDF using the Raptor RDF parser.

The source code of this demonstration is available in the Redland distribution as demos/rss-show.pl or from the Redland website

EOT print qq{
\n\n\n\n}; } sub format_term ($) { my($node)=@_; my $type=$node->type; if($type == $RDF::Redland::Node::Type_Resource) { my $uri=$node->uri->as_string; return qq{$uri}; } elsif ($type == $RDF::Redland::Node::Type_Blank) { my $id=$node->blank_identifier; return qq{BNodeID $id}; } my $string=$node->literal_value; return "UNDEFINED" if !defined $string; # No need for HTML::Entities here for four things $string =~ s/\&/\&/g; $string =~ s//\>/g; $string =~ s/"/\"/g; #" $string; } sub format_attribute ($) { my $string=shift; return 'UNDEFINED' if !$string; # No need for HTML::Entities here for four things $string =~ s/\&/\&/g; $string =~ s//\>/g; $string =~ s/"/\"/g; #" $string; } ###################################################################### my $q = new CGI; # CGI parameter paranoia my $val; my $uri_string; $val=$q->param('uri'); if(defined $val && $val =~ /^([ -~]+)$/) { $uri_string=$1; } else { $uri_string=''; } my $box; $val=$q->param('box'); if(defined $val && $val eq 'yes') { $box='yes'; } else { $box='no'; } my $soup; $val=$q->param('soup'); if(defined $val) { $soup=1 if $val eq 'yes'; } my $empty=(!$uri_string); # Zap remaining parameters $q->delete_all; #$q->delete(@parameters, 'Go'); # End of parameter decoding # Used in logging my $host=$q->remote_host; ###################################################################### # Emit content print $q->header(-type => 'text/html', -charset=>'utf-8'); # Always print header print <<"EOT"; Redland RSS 1.0 Validator and Viewer

Redland RSS 1.0 Validator and Viewer

Enter the address of an RSS 1.0 feed into the following form and it will be validated and formatted for display. EOT # Restore values $q->delete_all; #$q->delete(@parameters); $q->param('uri', $uri_string) if $uri_string; $q->param('box', $box); # use q->url() to get URL of this script without any query parameters # since we are using a POST here and don't want them added to the # submission URL. my $action_url="/".$q->url(-relative=>1); print $q->start_form(-name => 'myform', -method=>'GET', -action => $action_url),"\n"; print "

RSS 1.0 content URI: "; print $q->textfield(-name=>'uri', -default=>'', -size=>60, -maxlength=>1024); print ' ', $q->submit('Go'); print "

\n\n

Format results in a simple box? "; my $y=$q->popup_menu(-name=>'box', -values=>['yes','no'], -default=>'no'); # XHTML fixup $y =~ s/selected /selected="selected" /; print $y; print "

\n\n"; print $q->endform,"\n\n"; print <<"EOT";

Data Privacy: IP addresses and RSS 1.0 content URIs are logged and may be used for testing.

EOT if($empty) { print <<"EOT";

Public RSS 1.0 feeds

There are many public RSS 1.0 feeds, here are a sample of some that can be used with this validator.

EOT my $height = int(@demo_rss_feeds_order/2+1); print qq{\n\n\n
\n}; my $hcount=0; for my $feed_label (@demo_rss_feeds_order) { my $feed_uri=$demo_rss_feeds{$feed_label}; #$feed_uri =~ s/\&/\&/g; $q->delete_all; #$q->delete(@parameters); $q->param('uri', $feed_uri); $q->param('box', 'no'); my $feed_cgi_uri=$q->self_url; #$feed_cgi_uri =~ s/\&/\&/g; $q->param('box', 'yes'); my $box_feed_cgi_uri=$q->self_url; #$box_feed_cgi_uri =~ s/\&/\&/g; print qq{$feed_label (In a box) RDF
\n}; $hcount++; if($hcount >= $height) { $hcount=0; print qq{
\n} } } while($hcount <= $height) { $hcount++; print qq{ 
\n} } print qq{
\n\n}; print <<"EOT";

(Want to use the RDF PNG Icon? Follow the previous link for terms of use.)

EOT print <<"EOT";

You can find other feeds in various places such as the Meerkat, News Is Free and Syndic8 RSS aggregrators. You can make them yourself with online tools such as RSS-xpress (which also has a list of RSS 1.0 feeds) or RSSup.

EOT } # Any parameters? if($empty) { end_page($q); exit 0; } ###################################################################### print "

Results of RSS 1.0 Validation

\n"; # Validate me my $storage=new RDF::Redland::Storage("hashes", 'dummy', "new='yes',write='yes',hash-type='memory',dir='.'"); my $model; if($storage) { $model=new RDF::Redland::Model($storage, ""); } if(!$storage && !$model) { print "\n\n

Failed to create RDF Database - sorry!

\n"; end_page($q); exit 0; } my $uri; eval "\$uri=new URI::URL(q{$uri_string});" if $uri_string; if($@ || !$uri) { print qq{\n\n

URI $uri_string is not a legal URI (according to perl)

\n}; end_page($q); exit 0; } if(!$uri->scheme || $uri->scheme ne 'http') { print "\n\n

Cannot use URI $uri_string - must be a web http URI.

\n"; end_page($q); exit 0; } my $source_uri=new URI::URL $uri; my(@errors)=(); RDF::Redland::set_error_handler(sub { my $msg=shift; push(@errors, $msg); }); my(@warnings)=(); RDF::Redland::set_warning_handler(sub { my $msg=shift; push(@warnings, $msg); }); # Must fetch and copy to temp file my $temp_file; if(1) { # parser_just_file_uris $temp_file="$tmp_dir/rss-demo-$$.rss"; my $rc=getstore($uri_string, $temp_file); if(!is_success($rc)) { print "\n\n

Failed to read URI $uri_string - HTTP error $rc

\n"; end_page($q); exit 0; } if(open(IN, $temp_file)) { my $content=join('', ); close(IN); if ($content =~ m%rss version.*(0.9\d+)%mi) { print "\n\n

The URI you submitted contained RSS $1 content not RSS 1.0. This demonstration deals with RSS 1.0 only - see above.

\n"; end_page($q); exit 0; } } $source_uri=new URI::URL("file:$temp_file"); } my $parser_name=$soup ? 'rss-tag-soup' : 'raptor'; my $parser_label=$soup ? 'RSS Tag Soup' : 'RDF/XML'; my $parser=new RDF::Redland::Parser($parser_name); if(!$parser) { log_action($host,"Failed to create $parser_name parser", time); print "\n\n

Failed to create Raptor $parser_label parser.

\n"; end_page($q); unlink $temp_file if $temp_file; exit 0; } my $redland_base_uri=new RDF::Redland::URI $uri; my $redland_source_uri=new RDF::Redland::URI $source_uri; log_action($host,"Parsing RSS URI $uri with Raptor", time); my $stream=$parser->parse_as_stream($redland_source_uri, $redland_base_uri); if(!$stream || $stream->end) { print "\n\n

URI \"$uri\" failed to parse RSS 1.0 URI $uri as $parser_label with Raptor.

\n"; } my $count=0; if($stream && !$stream->end) { while(!$stream->end) { my $statement=$stream->current; $model->add_statement($statement); $statement=undef; $count++; $statement=$stream->next; } } $stream=undef; if(@errors) { print "

Errors

\n\n

"; my $error_count=1; for my $error (@errors) { $error =~ s/URI $uri_string:/line /; $error =~ s/- Raptor error//; print $error,"
\n"; $error_count++; if ($error_count > $max_error_size) { print "

\n\n

Remaining errors $error_count..",scalar(@errors)," truncated to limit page size"; last; } } print "

"; } if(@warnings) { print "

Warnings

\n\n

"; my $warning_count=0; for my $warning (@warnings) { $warning =~ s/URI $uri_string:/line /; $warning =~ s/- Raptor warning//; print $warning,"
\n"; $warning_count++; if ($warning_count > $max_warning_size) { print "

\n\n

Remaining warnings $warning_count..",scalar(@warnings)," truncated to limit page size"; last; } } print "

"; } if(!$count) { end_page($q); unlink $temp_file if $temp_file; exit 0; } print "

RSS 1.0 Content

\n"; print "\n\n

URI \"$uri\" parsed RSS 1.0 as $parser_label OK (creating $count triples)

\n"; #unlink $temp_file if $temp_file; #$RDF::Debug=1; my $rss=RDF::Redland::RSS->new_from_model($model); if(!$rss) { print "\n\n

Failed to create RDF::Redland::RSS object for URI $uri

\n"; end_page($q); unlink $temp_file if $temp_file; exit 0; } if($box eq 'yes') { my $html=$rss->as_xhtml(align=>"right", width=>320, frameColor=>"#000000", titleBarTextColor=>"#000000", titleBarColor=>"#ccccff", boxFillColor=>"#eeeeee", hspace=>15, vspace=>0); if($html) { print $html,qq{

}; } else { print "

Failed to format as XHTML\n

\n\n"; } end_page($q); exit 0; } sub format_url($) { my $url=shift; return "UNDEFINED" if !defined $url; qq{$url}; } my $content_encoded_property=RDF::Redland::Node->new_from_uri_string($content_encoded_uri); my $missing; for my $channel ($rss->channels) { $missing=qq{Missing. This is a required element of <rdf:RDF> - see RSS 1.0 section 5.3}; print "

Found channel with URI ",($channel->uri ? format_url($channel->uri->as_string) : $missing),"
\n"; print " Title: ",($channel->title ? format_term($channel->title) : $missing),"
\n"; print " Link: ",($channel->link ? format_url($channel->link->as_string) : $missing),"
\n"; print " Description: ",format_term($channel->description),"
\n" if $channel->description; print "

\n"; for my $ns_label (@namespace_order) { my $ns_prefix=$namespaces{$ns_label}; my(@props)=$channel->properties_with_ns_prefix($ns_prefix); if(@props) { print qq{

$ns_label properties:
\n}; for my $property (@props) { my $value=$channel->property($property); my $puri=$property->uri->as_string; my $puri_label=$puri; $puri_label =~ s%^$ns_prefix%%; next if $puri_label =~ m%/%; print qq{$puri_label : }; print format_term($value); # probably literal print "
\n"; } print "

\n\n"; } } my(@items)=$channel->items; if(!@items) { print qq{

Channel items Missing. <items> is a required element of <channel> - see RSS 1.0 section 5.3.5

\n\n}; end_page($q); exit 0; } print "

Found ",scalar(@items)," items in channel.

\n\n"; print "
    \n\n"; for my $item (@items) { $missing=qq{Missing. This is a required element of <item> - see RSS 1.0 section 5.5}; print "
  • Item with URI ",($item->uri ? format_url($item->uri->as_string) : $missing),"
    \n"; print " Title: ",($item->title ? format_term($item->title) : $missing),"
    \n"; print " Link: ",($item->link ? format_url($item->link->as_string) : $missing),"
    \n"; my $content_desc=$item->property($content_encoded_property); if($content_desc) { print " HTML Description (mod_content): [[",$content_desc->literal_value,"]]
    \n"; if(0) { # Now we have used that, remove it from the model my $cs=RDF::Redland::Statement->new_from_nodes(RDF::Redland::Node->new_from_node($item), RDF::Redland::Node->new_from_node($content_encoded_property), RDF::Redland::Node->new_from_node($content_desc)); $model->remove_statement($cs); } } # RSS 1.0 section 5.5 - description:optional print " Description: ",format_term($item->description),"
    \n" if $item->description; print "

    \n"; for my $ns_label (@namespace_order) { my $ns_prefix=$namespaces{$ns_label}; my(@props)=$item->properties_with_ns_prefix($ns_prefix); if(@props) { print qq{

    $ns_label properties:
    \n}; for my $property (@props) { my $value=$item->property($property); my $puri=$property->uri->as_string; my $puri_label=$puri; $puri_label =~ s%^$ns_prefix%%; next if $puri_label =~ m%/%; print qq{$puri_label : }; print format_term($value); print "
    \n"; } print "

    \n\n"; } } print "
  • \n"; } print "
\n\n"; my $image=$channel->image; if($image) { $missing=qq{Missing. This is a required element of <image> - see RSS 1.0 section 5.4}; print "

Image with URI ",($image->uri ? format_url($image->uri->as_string) : $missing),"
\n"; # RSS 1.0 section 5.4 - If present, nothing optional print " Title: ",($image->title ? format_term($image->title) : $missing),"
\n"; print " Link: ",($image->link ? format_url($image->link->as_string) : $missing),"
\n"; print " URL: ",($image->image_url ? format_url($image->image_url->as_string) : $missing),"
\n" if $image->image_url; print "

\n"; } my $textinput=$channel->textinput; if($textinput) { $missing=qq{Missing. This is a required element of <textinput> - see RSS 1.0 section 5.6}; my $t_uri=$textinput->uri; my $t_title=$textinput->title; my $t_link=$textinput->link; my $t_desc=$textinput->description; my $t_name=$textinput->name; print "

Textinput with URI ",($t_uri ? format_url($t_uri->as_string) : $missing),"
\n"; # RSS 1.0 section 5.6 - If present, nothing optional print " Title: ",($t_title ? format_term($t_title) : $missing),"
\n"; print " Link: ",($t_link ? format_url($t_link->as_string) : $missing),"
\n"; print " Description: ",($t_desc ? format_term($t_desc) : $missing),"
\n"; print " Name: ",($t_name ? format_term($t_name) : $missing),"
\n"; print "

\n"; if($t_uri && $t_title && $t_link && $t_desc && $t_name) { my $t_uri_string=$t_uri->as_string; my $t_name_string=$t_name->literal_value; my $t_desc_string=$t_desc->literal_value; my $t_title_string=$t_title->literal_value; print <<"EOT";

Formatted search form:

$t_title_string
$t_desc_string
EOT } else { print <<"EOT";

Not formatting search form since there are missing elements.

EOT } } } end_page($q); exit 0; redland-1.0.17/demos/ntriples.pl0000644000175000017500000002261011032336130013427 00000000000000#!/usr/bin/perl -Tw # # ntriples.pl - Redland N-Triples validator demo # # Copyright (C) 2002-2004, David Beckett http://www.dajobe.org/ # Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # # # CHANGE THIS FOR YOUR CONFIGURATION $::ROOT_DIR='/somewhere'; use strict; # Helps with broken web requests (missing headers) $ENV{'Content-Length'}||=0; # Tainting, dontcha know $ENV{'PATH'}="/bin:/usr/bin:/usr/local/bin:$::ROOT_DIR/bin/"; delete $ENV{'BASH_ENV'}; # Standard perl modules use CGI; use LWP::Simple; use URI::URL; # Configuration my $tmp_dir="$::ROOT_DIR/tmp"; my $log_file="$::ROOT_DIR/logs/ntriples.log"; my $max_stream_size=200; my $max_error_size=100; my(@parameters)=qw(uri); # Redland perl modules use RDF::Redland; use RDF::Redland::RSS; ###################################################################### # Subroutines sub log_action ($$;$) { my($host, $message, $now)=@_; $now ||= time; return unless open (LOG, ">>$log_file"); my($sec,$min,$hour,$mday,$mon,$year)=gmtime $now; my $date=sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",1900+$year,$mon+1,$mday,$hour,$min,$sec); print LOG "$host $date $message\n"; close(LOG); } sub end_page($) { my $q=shift; print <<"EOT";

About the validator

This was written using Redland and the RDF::Redland::Parser Perl interface to the Raptor N-Triples parser.

The source code of this demonstration is available in the Redland distribution as demos/ntriples.pl or from the Redland website

EOT print qq{
\n\n\n\n}; } sub format_body($) { my $string=shift; # No need for HTML::Entities here for three things $string =~ s/\&/\&/g; $string =~ s//\>/g; $string; } sub format_attr($) { my $string=format_body(shift); $string =~ s/"/\"/g; #" $string; } sub format_literal ($) { my($string)=@_; return 'UNDEFINED' if !defined $string; my $new_string=''; for my $c (split(//, $string)) { if(ord($c) <0x20 || ord($c) == 0x7e || $c eq '\\' || $c eq '"') { $new_string.=sprintf("\\x%02X",ord($c)); } else { $new_string.=$c; } } return format_body($new_string); } sub format_url($) { my $url=shift; my $a_url= format_attr($url); my $q_url= format_body($url); qq{$q_url}; } sub format_node ($) { my $node=shift; my $type=$node->type; if($type == $RDF::Redland::Node::Type_Resource) { my $uri=$node->uri->as_string; return qq{URI $uri}; } elsif ($type == $RDF::Redland::Node::Type_Literal) { my $str=format_literal($node->literal_value).'"'; my $is_xml=$node->literal_value_is_wf_xml; $str=$is_xml ? 'XML Literal: "'.$str : 'UTF-8 Literal: "'.$str; my $lang=$node->literal_value_language; $str.=" (Language: $lang)" if $lang; return $str; } elsif ($type == $RDF::Redland::Node::Type_Blank) { my $id=$node->blank_identifier; return qq{BNodeID $id}; } else { return $node->as_string; } } ###################################################################### my $q = new CGI; # CGI parameter paranoia my $val; my $uri_string; $val=$q->param('uri'); if(defined $val && $val =~ /^([ -~]+)$/) { $uri_string=$1; } else { $uri_string=''; } my $empty=(!$uri_string); # Zap remaining parameters $q->delete_all; # End of parameter decoding # Used in logging my $host=$q->remote_host; ###################################################################### # Emit content print $q->header(-type => 'text/html', -charset=>'utf-8'); # Always print header print <<"EOT"; Redland N-Triples Validator

Redland N-Triples Validator

Enter the address of N-Triples content into the following form and it will be validated and formatted for display. EOT # Restore values $q->delete_all; $q->param('uri', $uri_string) if $uri_string; # use q->url() to get URL of this script without any query parameters # since we are using a POST here and don't want them added to the # submission URL. my $action_url="/".$q->url(-relative=>1); print $q->start_form(-name => 'myform', -method=>'GET', -action => $action_url),"\n"; print "

N-Triples URI: "; print $q->textfield(-name=>'uri', -default=>'', -size=>60, -maxlength=>1024); print ' ', $q->submit('Go'); print "

\n\n"; print $q->endform,"\n\n"; print <<"EOT";

Data Privacy: IP addresses and content URIs are logged and may be used for testing.

EOT # Any parameters? if($empty) { print <<"EOT";

You might want to try this N-Triples test case from the RDF Core test suite: http://www.w3.org/2000/10/rdf-tests/rdfcore/ntriples/test.nt

EOT end_page($q); exit 0; } ###################################################################### print "

Results of N-Triples Validation

\n"; # Validate me my $uri; eval "\$uri=new URI::URL(q{$uri_string});" if $uri_string; if($@ || !$uri) { print qq{\n\n

URI $uri_string is not a legal URI (according to perl)

\n}; end_page($q); exit 0; } if(!$uri->scheme || $uri->scheme ne 'http') { print "\n\n

Cannot use URI $uri_string - must be a web http URI.

\n"; end_page($q); exit 0; } my $source_uri=new URI::URL $uri; # Must fetch and copy to temp file my $temp_file; $temp_file="$tmp_dir/rss-demo-$$.rss"; my $rc=getstore($uri_string, $temp_file); if(!is_success($rc)) { print "\n\n

Failed to read URI $uri_string - HTTP error $rc

\n"; end_page($q); exit 0; } if(open(IN, $temp_file)) { my $content=join('', ); close(IN); } $source_uri=new URI::URL("file:$temp_file"); my(@errors)=(); RDF::Redland::set_error_handler(sub { my $msg=shift; push(@errors, $msg); }); my $parser=new RDF::Redland::Parser("ntriples"); if(!$parser) { print "\n\n

Failed to create N-Triples parser.

\n"; end_page($q); unlink $temp_file if $temp_file; exit 0; } my $redland_base_uri=new RDF::Redland::URI $uri; my $redland_source_uri=new RDF::Redland::URI $source_uri; log_action($host,"Parsing N-Triples URI $uri", time); my $stream=$parser->parse_as_stream($redland_source_uri, $redland_base_uri); if(!$stream || $stream->end) { print "\n\n

URI \"$uri\" failed to parse URI $uri as N-Triples.

\n"; } my $count=0; if($stream && !$stream->end) { print "

Triples

\n"; print <<"EOT";
EOT for(; $stream && !$stream->end; $stream->next) { my $statement=$stream->current; my $subject=format_node($statement->subject); my $predicate=format_node($statement->predicate); my $object=format_node($statement->object); my $id=$count+1; print << "EOT"; EOT $count++; if ($count == $max_stream_size) { my $cur=$count+1; while(1) { $stream->next; last if $stream->end; $count++; } print << "EOT"; EOT last; } } print <<"EOT";
Count Subject Predicate Object
$id $subject $predicate $object
$cur...$countTruncated at $max_stream_size to limit table / page size

Note: \\xHH where HH are hexadecimal digits is used to indicate escaped characters such as \\, " or non-printable characters such as tabs and newlines.

EOT $stream=undef; } if(@errors) { print "

Errors

\n\n

"; my $error_count=1; for my $error (@errors) { $error =~ s/URI $uri_string:/line /; $error =~ s/- Raptor error//; print $error,"
\n"; $error_count++; if ($error_count > $max_error_size) { print "

\n\n

Remaining errors $error_count..",scalar(@errors)," truncated to limit page size"; last; } } print "

"; } if(!$count) { end_page($q); #unlink $temp_file if $temp_file; exit 0; } my $error_count=scalar(@errors); my $pl=($count != 1) ? 's' : ''; my $errorpl=($error_count != 1) ? 's' : ''; print "\n\n

URI \"$uri\" parsed as N-Triples giving $count triple$pl and $error_count error$errorpl

\n"; #unlink $temp_file if $temp_file; end_page($q); exit 0; redland-1.0.17/demos/demo.pl0000644000175000017500000004407111032336130012520 00000000000000#!/usr/bin/perl -Tw # # demo.pl - Redland CGI database and query demo Perl program # # Copyright (C) 2000-2004, David Beckett http://www.dajobe.org/ # Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # # # CHANGE THIS FOR YOUR CONFIGURATION $::ROOT_DIR='/somewhere'; use strict; # Helps with broken web requests (missing headers) $ENV{'Content-Length'}||=0; # Tainting, dontcha know $ENV{'PATH'}="/bin:/usr/bin:/usr/local/bin"; # Standard perl modules use CGI; use LWP::Simple; use URI::URL; # Configuration my(@commands)=qw(destroy query parse add print), my(%command_labels)=('destroy' =>'Delete database', 'query' =>'Find triples', 'add', =>'Add a triple', 'parse', =>'Parse RDF', 'print', =>'Print database'); my(%command_needs_write)=('destroy' =>1, 'query' =>0, 'add', =>1, 'parse', =>1, 'print', =>0); my(@parsers)=qw(raptor ntriples); my(%parser_labels)=('raptor' => 'RDF/XML', 'ntriples' => 'N-Triples' ); my(%parser_just_file_uris)=('raptor' => 1, 'ntriples' => 1 ); my $default_command='parse'; my $db_dir="$::ROOT_DIR/db"; my $tmp_dir="$::ROOT_DIR/tmp"; my $log_file="$::ROOT_DIR/logs/demo.log"; # Used for deleting databases my @suffixes=qw(po2s so2p sp2o); my $db_format="%s-%s.db"; # args: db suffix # 1: Use stream parsing (print as it goes) or # 0: parse into model (prints resulting model) my $use_parse_stream=1; my $max_stream_size=200; my(%namespaces)=( 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', 'rss' => 'http://purl.org/rss/1.0/', 'synd' => 'http://purl.org/rss/1.0/modules/syndication/', 'dc' => 'http://purl.org/dc/elements/1.1/', 'owl' => 'http://www.w3.org/2002/07/owl#', 'xsd' => 'http://www.w3.org/2001/XMLSchema#', ); # Redland perl modules use RDF::Redland; ###################################################################### # Subroutines sub log_action ($$$;$) { my($host, $db, $message, $now)=@_; $now ||= time; return unless open (LOG, ">>$log_file"); my($sec,$min,$hour,$mday,$mon,$year)=gmtime $now; my $date=sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",1900+$year,$mon+1,$mday,$hour,$min,$sec); print LOG "$host $date $db $message\n"; close(LOG); } sub end_page($) { my $q=shift; print <<'EOT';

The source code of this demonstration is available in the Redland distribution as demos/demo.pl or from the Redland website

EOT print qq{
\n\n\n\n\n\n}; } ###################################################################### # Main code my $q = new CGI; # CGI parameter paranoia my $val; my $db; $val=$q->param('db'); if(defined $val && $val =~ /^(\w+)$/) { $db=$1; } else { $db=undef; } my $command; $val=$q->param('command'); if(defined $val && $val =~ /^([a-z]+)$/) { $command=$1; } else { $command=undef; } my $statement_string; $val=($q->param('triple') || $q->param('statement')); if(defined $val && $val =~ /^([ -~]+)$/) { $statement_string=$1; } else { $statement_string=''; } my $uri_string; $val=$q->param('uri'); if(defined $val && $val =~ /^([ -~]+)$/) { $uri_string=$1; } else { $uri_string=undef; } my $parser_string; $val=$q->param('parser'); if(defined $val && $val =~ /^([a-z]+)$/) { $parser_string=$1; } else { $parser_string=undef; } my $rdf_content=undef; $val=$q->param('content'); # WARNING: pass through of all data if(defined $val) { $val=~ s/^\s*//; $val=~ s/\s*$//; if($val =~ /^(.+)$/s) { $rdf_content=$1; } } my $format_namespaces=''; $val=$q->param('format_namespaces'); if(defined $val) { $format_namespaces=($val eq 'yes'); } # End of parameter decoding # Used in logging my $host=$q->remote_host; ###################################################################### # Emit content print $q->header(-type => 'text/html', -charset=>'utf-8'); # Always print header print <<"EOT"; Redland RDF Database Demo

Redland RDF Database Demo

  1. Pick a database name
  2. Add some RDF triples to the database in one of these ways:

    1. Enter a triple by hand in the Triple field and use the Add a triple command.
    2. Enter some RDF/XML or N-Triples in the Content area and use the Parse RDF command.
    3. Give the URI of the RDF/XML or N-Triples on the web to parse in the URI field and use the Parse RDF command.
  3. Print the database - select the Print database command.
  4. Query the database - either click on the triples from the result of the previous command
  5. or enter a triple in the triple field and use the Find triples command to return matching triples
  6. Delete the database when you are done - thanks!

The syntax of triples is as follows. A triple about a resource is written as:

  [subject]--[predicate]-->[object]

and a triple with a string value is written as:

  [subject]--[predicate]-->"object"

When used as a query, replace any of the parts with ? to match anything e.g.: ?--?-->"foo" to return all triples which have the object string foo.


EOT # use q->url() to get URL of this script without any query parameters # since we are using a POST here and don't want them added to the # submission URL. my $action_url="/".$q->url(-relative=>1); print $q->start_form(-method=>'POST', -action => $action_url),"\n"; print "\n\n

Database name (required):\n"; print $q->textfield(-name=>'db', -default=>'', -size=>20, -maxlength=>20); print "\n\n with Command \n"; print $q->popup_menu(-name=>'command', -values=>\@commands, -default=>$default_command, -labels=>\%command_labels); print "\n\n

Triple (for Find and Add Triples commands):\n"; print $q->textfield(-name=>'triple', -default=>'', -size=>80); print "\n\n

RDF content syntax the Parse RDF command\n"; print $q->popup_menu(-name=>'parser', -values=>\@parsers, -default=>$parsers[0], -labels=>\%parser_labels); print "

    \n
  1. URI of RDF content (or URI of content pasted below)
    \n"; print $q->textfield(-name=>'uri', -default=>'', -size=>80, -maxlength=>1024); print "
  2. \n\n
  3. RDF/XML or N-Triples Content
    \n"; print $q->textarea(-name=>'content', -default=>'', -columns=>80, -rows=>10); print "
  4. \n\n
\n\n"; print "

Present RDF, RDFS, RSS, DC properties in namespace:qname form?\n"; print $q->popup_menu(-name=>'format_namespaces', -values=>['yes','no'], -default=>'no'); print "
(This can make the tables a lot narrower and easier to read)

\n\n"; print "\n\n

"; print $q->submit('Go'),"\n"; print "

\n"; print $q->endform,"\n"; # Any parameters? if(!$q->param) { end_page($q); exit 0; } print "
\n"; ###################################################################### # Validate me if(!$db) { print "\n\n

You must enter a database name.

\n"; end_page($q); exit 0; } if($command && !grep($_ eq $command, @commands)) { print "\n\n

No such command '$command'

\n"; $command=undef; } if(!$command) { end_page($q); exit 0; } if($parser_string && !grep($_ eq $parser_string, @parsers)) { print "\n\n

No such parser '$parser_string' - valid list are @parsers

\n"; $parser_string=''; } my $model=undef; my $storage=undef; my $db0="$db_dir/".sprintf($db_format, $db, $suffixes[0]); if(! -r $db0) { my $write=$command_needs_write{$command} ? 'yes' : 'no'; $storage=new RDF::Redland::Storage("hashes", $db, "new='yes',write='$write',hash-type='bdb',dir='$db_dir'"); if($storage) { $model=new RDF::Redland::Model($storage, ""); } if(!$storage && !$model) { log_action($host, $db, "Failed to create database"); print "\n\n

Sorry - failed to create RDF Database $db. This problem has been recorded.

\n"; end_page($q); exit 0; } log_action($host, $db, "Created new database"); } if($command eq 'destroy') { for my $suffix (@suffixes) { unlink "$db_dir/".sprintf($db_format, $db, $suffix); } log_action($host, $db, "Destroyed database"); print "\n\n

Destroyed RDF database $db OK.

\n"; end_page($q); exit 0; } # If model wasn't created/opened above, create and open now if(!$model) { # Remaining commands need an open database my $write=$command_needs_write{$command} ? 'yes' : 'no'; # Unless exists already and not writable $write='no' if -r $db0 && !-w $db0; $storage=new RDF::Redland::Storage("hashes", $db, "new='no',write='$write',hash-type='bdb',dir='$db_dir'"); if(!$storage) { log_action($host, $db, "Failed to open storage"); print "\n\n

Sorry - failed to open RDF Database $db. This problem has been recorded.

\n"; end_page($q); exit 0; } $model=new RDF::Redland::Model($storage, ""); if(!$model) { log_action($host, $db, "Failed to create model"); print "\n\n

Sorry - failed to open RDF Model for RDF Database $db. This problem has been recorded.

\n"; end_page($q); exit 0; } } my $statement=undef; my $stream=undef; if($command ne 'print' && $command ne 'parse') { if ($statement_string !~ m%^ (?: \? | \[[^]]+\]) \s*--\s* (?: \? | \[[^]]+\]) \s*--\>\s* (?: \? | [\["] [^]"]+ [\]"]) $%x) { # " print <<"EOT"; \n\n

Sorry, I do not understand the triple syntax; it should match that described above.

EOT end_page($q); exit 0; } my($subject_string,$predicate_string,$object_string)=(split(/-->?/, $statement_string, 3)); if($subject_string =~ m%^\[(.+)\]$%) { $subject_string=$1; } else { $subject_string='?'; } if($predicate_string =~ m%^\[(.+)\]$%) { $predicate_string=$1; } else { $predicate_string='?'; } my($delim1,$delim2); if($object_string =~ m%^([\["])(.+)([\]"])$%) { ($delim1,$object_string,$delim2)=($1,$2,$3); } else { $object_string='?'; } my $subject=($subject_string ne '?') ? RDF::Redland::Node->new_from_uri_string($subject_string) : undef; my $predicate=($predicate_string ne '?') ? RDF::Redland::Node->new_from_uri_string($predicate_string) : undef; my $object; if($object_string ne '?') { if($delim1 eq '[') { # Assumes delim2 eq ']' $object=RDF::Redland::Node->new_from_uri_string($object_string); } else { $object=RDF::Redland::Node->new_from_literal($object_string, "", 0, 0); } } else { $object=undef; } $statement=RDF::Redland::Statement->new_from_nodes($subject, $predicate, $object); if(!$statement) { print "\n\n

Failed to create RDF statement from nodes

\n"; end_page($q); exit 0; } # Now $statement is a RDF statement object if required } if($command eq 'add') { $model->add_statement($statement); print "\n\n

Added statement '$statement_string' to model

\n"; log_action($host, $db, "Added statement '$statement_string'"); end_page($q); exit 0; } my $temp_file; if($command eq 'print') { $stream=$model->as_stream; log_action($host, $db, "Printing database"); } elsif ($command eq 'query') { $stream=$model->find_statements($statement); log_action($host, $db, "Querying for statement '$statement_string'"); } else { my $uri; my $source_uri; my $uri_from_form=0; $parser_string ||= $parsers[0]; if($uri_string) { eval "\$uri=new URI::URL(q{$uri_string});"; if($@ || !$uri) { print "\n\n

URI \"$uri\" is not a legal URI (according to perl)

\n"; end_page($q); exit 0; } if(!$uri->scheme || $uri->scheme ne 'http') { print "\n\n

Cannot use URI $uri_string - must be a web http URI.

\n"; end_page($q); exit 0; } } if(defined $rdf_content) { # have content on web page, maybe with URI $temp_file="$tmp_dir/redland-demo-$$.rdf"; if(open(OUT, ">$temp_file")) { print OUT $rdf_content; close(OUT); } else { log_action($host, $db, "Failed to create $temp_file - $!"); print "\n\n

Sorry - cannot create temporary file for RDF content. This problem has been recorded.

\n"; end_page($q); exit 0; } $source_uri=new URI::URL("file:$temp_file"); if($uri) { # already validated above $uri=new URI::URL $uri; } else { $uri=new URI::URL("http://somewhere/"); } $uri_from_form=1; } elsif($uri_string) { # else have only URI $source_uri=new URI::URL $uri; # Must fetch and copy to temp file if($parser_just_file_uris{$parser_string}) { $temp_file="$tmp_dir/redland-demo-$$.rdf"; my $rc=getstore($uri_string, $temp_file); if(!is_success($rc)) { print "\n\n

Failed to read URI $uri_string - HTTP error $rc

\n"; end_page($q); exit 0; } $source_uri=new URI::URL("file:$temp_file"); } } else { # no content or URI print "\n\n

Must give a URI or RDF content for parse command

\n"; end_page($q); exit 0; } my $parser=new RDF::Redland::Parser($parser_string); if(!$parser) { log_action($host, $db, "Failed to create RDF parser $parser_string"); print "\n\n

Sorry - failed to create RDF parser $parser_string. This problem has been logged.

\n"; end_page($q); #unlink $temp_file if $temp_file; exit 0; } my $redland_base_uri=new RDF::Redland::URI $uri; my $redland_source_uri=new RDF::Redland::URI $source_uri; my $uri_label=$uri_from_form ? qq{RDF from form} : qq{URI "$uri"}; log_action($host, $db, "Parsing $uri_label with parser $parser_string"); if($use_parse_stream) { $stream=$parser->parse_as_stream($redland_source_uri, $redland_base_uri); if(!$stream || $stream->end) { print "\n\n

$uri_label failed to parse as RDF into model via stream with $parser_string parser

\n"; end_page($q); #unlink $temp_file if $temp_file; exit 0; } else { print "\n\n

$uri_label parsed as RDF into model via stream with $parser_string parser OK

\n"; } } else { $parser->parse_into_model($redland_source_uri, $redland_base_uri, $model); print "\n\n

$uri_label parsed as RDF into model with $parser_string parser OK

\n"; #unlink $temp_file if $temp_file; $stream=$model->as_stream; } } print <<"EOT";
EOT #$RDF::Debug=1; my $count=0; for(;!$stream->end ; $stream->next) { # Must use a new statement object here since $statement may be # used/shared by the model's find_statements method my $statement2=$stream->current; last if !$statement2; my $subject=$statement2->subject->as_string; my $predicate=$statement2->predicate->as_string; my $object=$statement2->object->as_string; my $subject_label=$subject; my $predicate_label=$predicate; my $object_label=$object; if($format_namespaces) { for my $label_ref (\$subject_label, \$predicate_label, \$object_label) { while(my($ns_prefix,$ns_uri)=each %namespaces) { $$label_ref =~ s%^\[${ns_uri}([^/]+)\]$%[${ns_prefix}:$1\]%; } } } $q->param('command', 'query'); $q->delete('content'); # HACK - makes generated URIs just too large $q->param('triple', "$subject--?-->?"); my $subject_query=$q->self_url; $q->param('triple', "?--$predicate-->?"); my $predicate_query=$q->self_url; if($object =~ /^\[(.+)\]$/) { $q->param('triple', "?--?-->[$1]"); } else { $object=qq{"$object"}; $q->param('triple', "?--?-->$object"); } my $object_string=$object_label; my $from_object=''; if($object =~ /^\[(.+)\]$/) { my $object_query=$q->self_url; $q->param('triple', "[$1]--?-->?"); $object_string=qq{$object_label}; $from_object=qq{Follow}; } else { $from_object=' '; } print << "EOT"; EOT $count++; if ($count >= $max_stream_size) { print << "EOT"; EOT last; } if($use_parse_stream) { if($command eq 'parse') { $model->add_statement($statement2); } } } # while if($use_parse_stream) { if($command eq 'parse') { #unlink $temp_file if $temp_file; } } print <<"EOT";
Subject Predicate Object Follow
Object
$subject_label $predicate_label $object_string $from_object
Truncated at $max_stream_size items - sorry, this is just a demonstration.
EOT my $pl=($count != 1) ? 's' : ''; print "\n\n

Found $count triple$pl

\n"; if($format_namespaces) { print "

Where the following namespace prefixes were used:

\n
"; for my $ns_prefix (sort keys %namespaces) { my $ns_uri=$namespaces{$ns_prefix}; print qq{
${ns_prefix}
\n
namespace ${ns_uri}
\n}; } print "\n
\n\n"; } end_page($q); exit 0; redland-1.0.17/ChangeLog.80000644000175000017500000011721711311353451012060 000000000000002007-12-28 Dave Beckett * NEWS.html, RELEASE.html, configure.ac, librdf/win32_rdf_config.h: Bump version to 1.0.8. Require rasqal 0.9.16 2007-12-24 Dave Beckett * Snapshotted redland_1_0_7 for 1.0.7 release (SVN 13317) 2007-12-23 Dave Beckett * docs/Makefile.am, docs/redland-chapter-storage-modules.xml, docs/redland-chapter-storage.xml, docs/redland-docs.xml: Renamed redland-chapter-storage.xml * docs/Makefile.am, docs/redland-chapter-storage.xml, docs/redland-docs.xml: Added redland-chapter-storage.xml * docs/storage.html: xhtml * docs/Makefile.am: Update CLEANFILES * docs/tmpl/concepts.sgml, docs/tmpl/parser.sgml, docs/tmpl/storage.sgml, docs/tmpl/uri.sgml: docs 2007-12-21 Lauri Aalto * librdf/rdf_stream.c: (librdf_stream_add_map) Clarified map function docs. 2007-12-20 Lauri Aalto * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_get_next_common, librdf_storage_sqlite_get_next_context_common): Make stream finished on alloc failure. * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_context_add_statement): Fix stringbuffer-related leaks introduced in a previous commit. * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_serialise, librdf_storage_sqlite_find_statements, librdf_storage_sqlite_context_serialise, librdf_storage_sqlite_get_contexts): Make sure sqlite is not passed in NULL sql string. Refactor freeing sql stringbuffers. * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_add_statements, librdf_storage_sqlite_contains_statement, librdf_storage_sqlite_serialise, librdf_storage_sqlite_context_add_statement, librdf_storage_sqlite_context_remove_statement, librdf_storage_sqlite_context_remove_statements, librdf_storage_sqlite_context_serialise): Check for stringbuffer alloc failures. * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_open): Check for errors/alloc failures and clean up as needed. * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_set_helper, librdf_storage_sqlite_get_helper, librdf_storage_sqlite_uri_helper, librdf_storage_sqlite_blank_helper, librdf_storage_sqlite_literal_helper): Resiliency fixes: check for alloc failures and clean up on error. * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_exec): Resiliency fixes: - Don't close the sqlite db on error, we are probably going to need it later and we don't want sqlite to segfault on NULL db. - Return an error if passed in a NULL request. - Memory leak fix: free the dynamically allocated error message string (if any) from v2 sqlite_exec() or v3 legacy support sqlite3_exec(). - Check for alloc failures. (- Fixed indent.) * librdf/rdf_storage_sqlite.c: (sqlite_string_escape) Check for alloc failure * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_init) Make sure options hash is always freed. * librdf/rdf_hash.c, librdf/rdf_iterator.c, librdf/rdf_list.c, librdf/rdf_node.c, librdf/rdf_storage.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_sqlite.c: Reverted librdf_new_iterator() context ownership changes from r12988 and r12989. Do not call finished method in librdf_new_iterator() if iterator allocation fails. Caller should discard the memory. Motivation: Make the API contract similar to librdf_new_stream() and do not break old code. 2007-12-18 Lauri Aalto * librdf/rdf_query_internal.h: Use RASQAL_H and not RASQAL_API to check whether rasqal.h has been included. RASQAL_API may be defined outside rasqal.h. 2007-12-17 Dave Beckett * librdf/redland.spec.in: updates to rpm config 2007-12-16 Dave Beckett * librdf/redland.spec.in: rasqal-devel fixes * configure.ac: sh * configure.ac, librdf/redland.pc.in, librdf/redland.spec.in: Added RASQAL_MAX_VERSION with 0.9.15 since rasqal API will change next time * librdf/rdf_parser.c: autodoc * librdf/rdf_concepts.c: autodoc * docs/redland-sections.txt: Add 11 funcs/handlers * docs/redland-sections.txt: Remove librdf_concept_ms_namespace_uri librdf_concept_schema_namespace_uri * librdf/rdf_iterator.h, librdf/rdf_stream.h: autodocs * librdf/Makefile.am: tweak cleanfiles * docs/tmpl/redland-unused.sgml, docs/tmpl/unused.sgml: docs * librdf/rdf_storage.c: (main): Just warn if a storage cannot be created - databases may not be running. * librdf/Makefile.am: Try using librdf_la_LDFLAGS rather than AM_LDFLAGS * configure.ac: Do not apply modular storage params to LIBRDF_LIBS twice * librdf/rdf_query_internal.h: Make this include work when rasqal.h has been included first - conditionalise defining rasqal_query_results_formatter typedef. 2007-12-12 Lauri Aalto * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_contains_statement): Added FIXME note about inserting new data when just testing for statement existence. * librdf/rdf_storage_sqlite.c: Added transaction support to sqlite storage. Run sqlite operations in a transaction unless one is already active. (librdf_storage_sqlite_context): Added in_transaction flag. (librdf_storage_sqlite_open, librdf_storage_sqlite_contains_statement, librdf_storage_sqlite_context_add_statement, librdf_storage_sqlite_query_flush): Use librdf_storage_sqlite_transaction_* functions for transactions. Roll back on errors, do not commit. (librdf_storage_sqlite_add_statements): Wrap operation in a transaction unless one is already active. (librdf_storage_sqlite_transaction_start, librdf_storage_sqlite_transaction_commit, librdf_storage_sqlite_transaction_rollback): Added new storage API implementation functions. (librdf_storage_sqlite_register_factory): Register transaction callbacks. * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_contains_statement): Bug fix: contains_statement() should also find statements with blank subject node. 2007-12-03 Lauri Aalto * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_serialise, librdf_storage_sqlite_find_statements, librdf_storage_sqlite_context_serialise): Fix crashes e.g. if sql compilation fails. scontext->storage needs to be initialized before calling librdf_storage_sqlite_*_finished(). 2007-11-29 Lauri Aalto * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_get_1int_callback): Avoid atoi(NULL) crashes. * librdf/rdf_query_internal.h: Declare rasqal_query_results_formatter - can now include librdf.h with LIBRDF_INTERNAL without including redland.h/rasqal.h. 2007-11-26 Dave Beckett * autogen.sh: fix to handle OSX using glibtoolize for libtoolize 2007-11-23 Lauri Aalto * librdf/rdf_storage_sqlite.c: Removed writable static data. * librdf/rdf_storage_sqlite.c: (librdf_storage_sqlite_init): Removed unused variable is_new. (librdf_storage_sqlite_open): On error, do not leave dangling context->db. 2007-11-22 Lauri Aalto * librdf/rdf_stream.c: indent tabs->spaces * librdf/rdf_query_internal.h: Revert r13241 - was not portable * librdf/rdf_query_internal.h: Forward declare rasqal_query_results_formatter - can now include librdf.h with LIBRDF_INTERNAL without including redland.h/rasqal.h. 2007-11-20 Lauri Aalto * librdf/rdf_digest.c: (librdf_get_digest_factory): Remove redundant code. Style & indent fixes. 2007-11-19 Lauri Aalto * librdf/rdf_log.h: comment punctuation * librdf/rdf_storage_list.c: (librdf_storage_list_find_statements): Lowmem leak fix: clean up and return NULL if librdf_stream_add_map() fails. * librdf/rdf_stream.c: (librdf_stream_update_current_statement): Lowmem leak fix: return end-of-stream if map iterator alloc fails. 2007-11-14 Dave Beckett * configure.ac: Require raptor 1.4.16 rasqal 0.9.15 2007-11-12 Lauri Aalto * librdf/rdf_parser_raptor.c: Make raptor_uri_handlers const. * librdf/rdf_concepts.c, librdf/rdf_concepts.h, librdf/rdf_init_internal.h, librdf/rdf_node.c: Remove writable static data from rdf_concepts - move variables to librdf_world struct. SOURCE COMPATIBILITY BREAK: rdf_concepts.h public API node/uri macros now require a librdf_world* parameter. (librdf_get_concept_resource_by_index, librdf_get_concept_resource_by_index): Added two new API functions required by rdf_concepts.h public API macros. (librdf_init_concepts_init, librdf_finish_concepts): Remove librdf_concepts_usage reference counting workaround - no longer needed. (librdf_new_node_from_literal, librdf_node_get_literal_value_is_wf_xml, librdf_node_decode): Pass world object pointer to rdf concepts macros. 2007-11-07 Lauri Aalto * librdf/rdf_concepts.c: Remove writable static data. Make const namespace strings const. 2007-11-06 Lauri Aalto * librdf/librdf.h: Allow REDLAND_API to be externally defined e.g. in a static config.h. Remove __SYMBIAN32__ case. * librdf/rdf_init.c: Remove writable static data. Allow flagging out old RDF_World stuff with NO_STATIC_DATA. * librdf/rdf_parser_raptor.c: Remove writable static bss. Make raptor_uri_handler const * librdf/rdf_parser_raptor.c, librdf/rdf_query_rasqal.c, librdf/rdf_serializer_raptor.c: Remove writable static bss. Make buffers stack-based. * librdf/rdf_statement.c: Remove writable static data. Make null_string pointer const. * librdf/rdf_log.c: Remove writable static data. Make log_level_names array const. 2007-10-31 Lauri Aalto * librdf/rdf_storage_internal.h: Remove duplicate declaration of librdf_init_storage_sqlite() * librdf/rdf_storage.c, librdf/rdf_storage.h, librdf/rdf_storage_internal.h: Make librdf_storage_add_reference() and librdf_storage_remove_reference() LIBRDF_API functions to enable calling from external storage modules on systems that require explicit function exports. 2007-10-25 Lauri Aalto * librdf/rdf_query_results.c: (librdf_query_results_to_counted_string): Do not leak string on errors. 2007-10-23 Lauri Aalto * librdf/rdf_node.c: (librdf_new_node_from_typed_counted_literal): Free xml_language copy on buffer alloc failure * librdf/rdf_node.c: (librdf_new_node_from_blank_identifier): On error, free identifier generated with librdf_world_get_genid(). No need to copy generated id. * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_generate_id_handler): Fix lowmem leaks - always free user_bnodeid, return NULL if hash_put fails. * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_generate_id_handler): Fix lowmem crash - do not put NULL value into hash * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_init): Check for bnode_hash alloc failure * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_namespace_handler): Check for alloc failure * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_context): Lowmem leak fix. Store pointer to the stream context to enable cleaning it up through the parser object. * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_parse_as_stream_common): Lowmem leak fixes. Store raptor_www pointer to parser context to allow resource cleanup from client code in case raptor_parse_chunk() fails in a lexer. * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_stream_context): base_uri is not needed for anything - raptor copies and stores base_uri as needed. * librdf/rdf_parser.c: (librdf_parser_guess_name): Do not call strlen() with NULL arg. * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_stream_context): source_uri is not needed for anything. * librdf/rdf_parser.c: indent tabs->spaces * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_parse_file_handle_as_stream, librdf_parser_raptor_parse_as_stream_common, librdf_parser_raptor_parse_into_model_common): Check for alloc failures 2007-10-22 Lauri Aalto * librdf/rdf_uri.c: (librdf_new_uri_from_uri_local_name): No need to calloc strings, use malloc instead. * librdf/rdf_digest.c, librdf/rdf_hash.c, librdf/rdf_model.c, librdf/rdf_parser.c, librdf/rdf_query.c, librdf/rdf_serializer.c, librdf/rdf_storage.c: (librdf_digest_register_factory, librdf_hash_register_factory, librdf_model_register_factory, librdf_parser_register_factory, librdf_query_register_factory, librdf_serializer_register_factory, librdf_storage_register_factory): No need to calloc strings, use malloc instead. * librdf/rdf_concepts.c: (librdf_finish_concepts): Prevent calling librdf_free_node() with NULL node. * librdf/rdf_digest.c, librdf/rdf_hash.c, librdf/rdf_model.c, librdf/rdf_parser.c, librdf/rdf_query.c, librdf/rdf_serializer.c, librdf/rdf_storage.c: (librdf_storage_register_factory, librdf_parser_register_factory, librdf_model_register_factory): Low-memory fixes: prevent calling the factory method on a stale factory if raptor_sequence_push() failed. (librdf_digest_register_factory, librdf_hash_register_factory, librdf_model_register_factory, librdf_parser_register_factory, librdf_query_register_factory, librdf_serializer_register_factory, librdf_storage_register_factory): Refactor all librdf_*_register_factory() functions to same style: - fail fast if factory already registered, alloc only if necessary - associate with librdf_world before calling the factory function to allow proper cleanup on factory failures - on error, use goto label for cleanup + oom reporting to make the code clearer and smaller - do not use intermediate local variables if they have no benefit * librdf/rdf_iterator.c, librdf/rdf_list.c, librdf/rdf_node.c, librdf/rdf_storage.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_sqlite.c: Prevent double deleting iterator context on error after r12988. (librdf_new_iterator): Document that ownership of context is taken. * librdf/rdf_iterator.c: (librdf_new_iterator): Free passed in context on alloc failure. Indent tabs->spaces. * utils/rdfproc.c: (commands): Fix warning about missing initializer * librdf/rdf_storage_file.c: (librdf_storage_file_init): Make sure options hash is always freed. * configure.ac: Set eol-style from native to LF - toolchain does not work with CRLF files. 2007-10-21 Lauri Aalto * librdf/rdf_init.c: Require ltdl.h only with MODULAR_LIBRDF. * librdf/rdf_hash.c: (librdf_hash_get_all_iterator_finished): Fix low memory crash - check for NULL context->key. 2007-10-20 Dave Beckett * librdf/rdf_init.c: 2007 * librdf/rdf_init_internal.h: (struct librdf_world_s): Add storage_modules and ltdl_opened always. Pad structure when not WITH_THREADS. Thus structure is always the same size. * librdf/rdf_storage.c: (librdf_storage_load_module): Renamed from librdf_load_storage_module * autogen.sh: Only add --ltdl to libtoolize_args if a configure program contains an AC_LIBLTDL_ macro. Allows this script to shared between librdf, raptor and rasqal. 2007-10-19 Dave Robillard * autogen.sh, configure.ac, librdf/Makefile.am, librdf/rdf_init.c, librdf/rdf_init_internal.h, librdf/rdf_storage.c, librdf/rdf_storage_sql_test.c: Modular (ie separate library) storage backends. (configure.ac): added --enable-modular. (librdf_load_storage_module): created. (librdf_init_storage): load modules, if --enable-modular is set. (librdf_finish_storage): close module if necessary. (rdf_storage_test): test all available storage backends. (librdf_new_world): initialise libltdl. (rdf_storage_sql_test): fix warning on 64-bit. 2007-10-19 Lauri Aalto * librdf/rdf_hash.c: (librdf_new_hash_from_hash): Do not use hash after deleting it. No need to free NULL identifier. * librdf/rdf_model.c: indent tab -> spaces * librdf/rdf_log.c, librdf/rdf_node.c: (librdf_free_node) Roll back NULL check change from r12427 - the code is no longer trying to free NULL nodes. Makes the function consistent with other librdf_free_* functions. 2007-10-18 Lauri Aalto * librdf/rdf_uri.c: (librdf_new_uri): Annotate uri string allocs as cstring and not librdf_uri. * librdf/rdf_storage_list.c: (librdf_storage_list_close): Remove unused variable. * librdf/rdf_storage_list.c: (librdf_storage_list_close): Low-memory memory leak fix. Freeing list items should not depend on being able to allocate an iterator. Replace list iterator with a pop loop. 2007-10-04 Lauri Aalto * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_new_statement_handler): Check for failures and log a fatal error if needed. Free statement if librdf_list_add fails. 2007-10-03 Lauri Aalto * librdf/rdf_stream.c: (librdf_stream_add_map): Free context immediately on error. * librdf/rdf_storage_list.c: (librdf_storage_list_find_statements): Free query statement if it is not added to the stream map. * librdf/rdf_storage_list.c: (librdf_storage_list_serialise) Free allocated stream context if returning an empty stream with no context. * librdf/rdf_list.c: (librdf_list_get_iterator): Free iterator context if librdf_new_iterator() fails. 2007-10-01 Lauri Aalto * librdf/rdf_model.c: (librdf_new_model_with_options): Use calloc instead of malloc for context. (main): rdf_model tests: Always run test_model_cloning (now it passes). (test_model_cloning): Fix copy-paste artifact when cloning a cloned model. * librdf/rdf_storage.c: (librdf_new_storage_from_storage): Set storage usage flag early to allow cleanup with librdf_free_storage(). * librdf/rdf_storage_hashes.c: (librdf_storage_hashes_init_common): Store name to context and take ownership. (librdf_storage_hashes_terminate): Free owned name string. (librdf_storage_hashes_init): Create a copy of the name string - init_common takes ownership of it. (librdf_storage_hashes_clone): Remove unused variable + fix comments. Fixes Issue #0000229 http://bugs.librdf.org/mantis/view.php?id=229 . 2007-09-29 Lauri Aalto * librdf/rdf_model.c: Added tests for librdf_new_model_from_model(). Tests fail and they are disabled by default. Related to Issue #0000229 http://bugs.librdf.org/mantis/view.php?id=229 * librdf/rdf_storage_hashes.c: (librdf_storage_hashes_clone) Only copy old context name if it is non-NULL. Store options hash in new_context so that clone of a clone could also be possible. Fixes Issue #0000229 http://bugs.librdf.org/mantis/view.php?id=229 but not all the additional issue in bug report notes. (librdf_storage_hashes_open): Do not destroy the options hash - it can be needed later if cloning the storage. * librdf/rdf_model.c: (librdf_new_model_from_model): Check factory clone() return value. Related to Issue #0000229 http://bugs.librdf.org/mantis/view.php?id=229 * librdf/rdf_heuristics.c: (librdf_heuristic_gen_name): Defensive code: assert non-NULL name parameter. 2007-09-27 Lauri Aalto * librdf/rdf_parser.c: (librdf_parser_register_factory): Check parsers sequence alloc failure. Push new parser to sequence before calling factory init - parser is cleaned up if factory init fails. (librdf_new_parser_from_factory): Check factory init return value and clean up on error. * librdf/rdf_list.c: (librdf_list_iterator_finished): No-op if iterator is NULL. * librdf/rdf_parser_raptor.c: (librdf_raptor_new_uri_for_rdf_concept): Check librdf_get_concept_by_name() return value. 2007-09-26 Dave Beckett * autogen.sh: autogen.sh with perl version grep script 2007-09-26 Lauri Aalto * librdf/rdf_serializer_raptor.c: (librdf_serializer_raptor_serialize_stream_to_counted_string, librdf_serializer_raptor_serialize_stream_to_iostream): Check librdf_serializer_raptor_serialize_statement() return value. * librdf, utils: Props: ignore .exes 2007-09-25 Lauri Aalto * librdf/rdf_serializer_raptor.c: (librdf_serializer_raptor_serialize_statement): Check for serialize_statement return code. Fix log messages: print -> serialize. 2007-09-24 Lauri Aalto * autogen.sh: Do not compare versions as decimal, e.g. automake 1.10 should be treated newer than 1.7. (update_prog_version) Convert [z.]x.y version strings to 100x+y. 2007-09-21 Lauri Aalto * librdf/rdf_concepts.c: librdf_concepts: Check for alloc failures and clean up on errors. Workaround for Issue #0000213 http://bugs.librdf.org/mantis/view.php?id=213 * librdf/rdf_serializer_raptor.c: (librdf_serializer_raptor_serialize_stream_to_file_handle): Clean up allocated resources on failure. * librdf/rdf_storage.c: rdf_storage: Check for alloc failures and clean up properly on failure. * librdf/rdf_serializer.c: rdf_serializer: Check for alloc failures and clean up properly on failure. * librdf/rdf_query_results.c: (librdf_query_results_to_counted_string): Fix compiler warning about type punning. * librdf/rdf_query_rasqal.c: rdf_query_rasqal: Check for alloc failures / return codes and clean up properly on failure. * librdf/rdf_query.c: rdf_query: Check for alloc failures and clean up properly on failure. * librdf/rdf_model.c: rdf_model: Check for alloc failures and clean up properly on failure. * librdf/rdf_node.c: (librdf_free_node) Hash deletion failure is not a fatal error. * librdf/rdf_serializer_raptor.c: (librdf_serializer_raptor_serialize_stream_to_counted_string) Fix compiler warning about type punning. * librdf/rdf_uri.c: (librdf_free_uri) Hash deletion failure is not a fatal error. (librdf_uri_compare) Fix typos in comments. * librdf/rdf_uri.c: (librdf_new_uri_from_uri_local_name) Indirect old_uri pointer only after making sure it's not NULL. * librdf/rdf_uri.c: (librdf_init_uri) Store uris_hash allocation status before potentially failing opening it. * librdf/rdf_hash.c: (librdf_new_hash_datum) Check for alloc failures. (librdf_new_hash_from_factory) Delete hash if factory init returns an error. * librdf/rdf_log.c: (librdf_log_simple) Do not abort() on fatal messages - leave it up to librdf_fatal() so it can free its buffers. (librdf_fatal) Ensure function never returns, even on alloc failure. * librdf/rdf_internal.h: rdf_internal.h: Allow LIBRDF_ASSERT_DIE to be externally defined e.g. in a makefile. * librdf/rdf_init.c: (librdf_new_world) Check for alloc failures * librdf/rdf_model_storage.c, librdf/rdf_stream.c: Fix typos in comments * librdf/rdf_hash_memory.c: Fix indent * Makefile.am, acinclude.m4, autogen.sh, data/Makefile.am, demos/Makefile.am, docs/Makefile.am, examples/Makefile.am, librdf/Makefile.am, librdf/win32/Makefile.am, utils/Makefile.am: Fix EOL issues when building svn version on cygwin. Partial fix to Issue #0000236 http://bugs.librdf.org/mantis/view.php?id=236 * librdf/Makefile.am: Added $(EXEEXT)s to Makefiles to fix "make clean" on cygwin. Partial fix to Issue #0000235 http://bugs.librdf.org/mantis/view.php?id=235 * autogen.sh: librdf autogen.sh $dir quoting. Partial fix to Issue #0000234 http://bugs.librdf.org/mantis/view.php?id=234 2007-09-16 Dave Beckett * Redland.i, librdf/rdf_parser_raptor.c, librdf/rdf_uri.c, librdf/rdf_uri.h: (librdf_uri_compare): Added. Used to implement librdf_raptor_uri_compare * librdf/rdf_parser_raptor.c: (struct librdf_raptor_uri_handler): Set URI Interface version to 2. 2007-09-15 Dave Robillard * librdf/rdf_parser_raptor.c: (librdf_raptor_uri_handler): Move raptor_uri_compare to end of struct to match raptor_uri_handler. * librdf/rdf_parser_raptor.c: (librdf_raptor_uri_compare): Avoid strcmp if URIs are equal. Fix string signedness warnings. * librdf/rdf_parser_raptor.c: (librdf_raptor_uri_compare): Overload raptor_uri_compare for librdf URIs. 2007-09-07 Dave Beckett * librdf/rdf_init_internal.h: Include pthread.h for use by struct Fixes Issue#0000230 http://bugs.librdf.org/mantis/view.php?id=230 2007-09-03 Dave Beckett * examples/rss2ical.c: Use \r\n line endings like the spec says. Hello 1998! 2007-08-26 Dave Beckett * docs/redland-docs.xml: add more boilerplate, copyrights 2007-08-24 Dave Beckett * librdf/rdf_query.c: (librdf_query_execute): Fix asset for model param. Fixes Issue#0000218 http://bugs.librdf.org/mantis/view.php?id=218 2007-08-22 Dave Beckett * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_relay_filter): Added to use in filtering URIs during a parse operation. (librdf_parser_raptor_parse_file_handle_as_stream, librdf_parser_raptor_parse_as_stream_common, librdf_parser_raptor_parse_into_model_common): Check URIs using raptor_parser_set_uri_filter to set a filter function. * librdf/rdf_parser.c: (librdf_parser_set_uri_filter): Added for setting a handler function to check URIs being parsed. (librdf_parser_get_uri_filter): Added for returning the current handler/data. * librdf/rdf_uri.h: Define librdf_uri_filter_func * librdf/rdf_parser.h: Added librdf_parser_set_uri_filter and librdf_parser_get_uri_filter * librdf/rdf_parser_internal.h: struct librdf_parser_s gains uri_filter_user_data and uri_filter 2007-08-18 Dave Beckett * librdf/rdf_node.c: (librdf_new_node_from_typed_counted_literal): Handle input value, xml_languge that are not necessarily NUL terminated, although they should be since they are C strings. Fixes Issue#0000215 http://bugs.librdf.org/mantis/view.php?id=215 * configure.ac: BDB is up to 4.6 now * librdf/Makefile.am, librdf/rdf_init.c, librdf/rdf_model.c, librdf/rdf_node.c, librdf/rdf_parser.c, librdf/rdf_serializer.c, librdf/rdf_storage.c, librdf/rdf_uri.c: Fix setup/cleanup issues if library is initialised and then closed. Added rdf_init_test test to run it. Fixes Issue#0000209 http://bugs.librdf.org/mantis/view.php?id=209 2007-08-17 Dave Beckett * librdf/rdf_query_rasqal.c: (librdf_query_rasqal_free_results_formatter): Free the librdf_query_results_formatter Fixes Issue#0000205 http://bugs.librdf.org/mantis/view.php?id=205 * librdf/librdf.h: Applied librdf part of symbian portability fix for Issue#0000203 http://bugs.librdf.org/mantis/view.php?id=203 2007-07-19 Dave Beckett * librdf/rdf_serializer.c: (librdf_serializer_set_namespace): Now with less typos * librdf/rdf_serializer.c: (librdf_serializer_set_namespace): Allow NULL uri and prefix to be given 2007-06-08 Dave Beckett * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_transaction_commit): Run librdf_storage_mysql_transaction_terminate if there is nothing to do. 2007-05-26 Dave Beckett * librdf/rdf_uri.c: (librdf_uri_is_file_uri): Correct return value docs. Fixes Issue#0000189 http://bugs.librdf.org/mantis/view.php?id=189 * librdf/librdf.h: Allow _declspec and __declspec Fixes Issue#0000188 http://bugs.librdf.org/mantis/view.php?id=188 2007-05-21 Dave Beckett * configure.ac: Add -Wformat-security 2007-05-09 Dave Beckett * librdf/rdf_query_results.c: (librdf_free_query_results_formatter): Do not try to return a value. Fixes Issue#0000187 http://bugs.librdf.org/mantis/view.php?id=187 * configure.ac: mysql_cflags - make sure -O match is after whitespace. Ditch trying to rip out linker junk from mysql_cflags 2007-05-06 Dave Beckett * librdf/rdf_hash.c: (librdf_hash_print, librdf_hash_print_keys, librdf_hash_print_values): Look at fwrite return value, it makes gcc happier. * NEWS.html, configure.ac, librdf/win32_rdf_config.h: Bump version to 1.0.7 2007-05-05 Dave Beckett * Snapshotted redland_1_0_6 for 1.0.6 release (SVN 12231) * librdf/redland.spec.in: Add /usr/share/redland/mysql-v1.ttl and /usr/share/redland/mysql-v2.ttl to redland package * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_namespace_handler): Do not store namespaces with null URIs. * Redland.i: Add librdf_parser_get_namespaces_seen_prefix, librdf_parser_get_namespaces_seen_uri and librdf_parser_get_namespaces_seen_count * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_namespace_handler): Handle NULL prefix, URIs 2007-05-04 Dave Beckett * librdf/rdf_parser_raptor.c: cast for C++ * librdf/rdf_parser_raptor.c: librdf_parser_raptor_stream_context gains nspace_prefixes and nspace_uris sequences for storing namespaces seen. (librdf_parser_raptor_terminate): Free sequences. (librdf_parser_raptor_namespace_handler): Save namespaces prefixes and URIs seen in the new sequences. (librdf_parser_raptor_parse_file_handle_as_stream, librdf_parser_raptor_parse_as_stream_common, librdf_parser_raptor_parse_into_model_common): Reset/initialise namespace prefix/uri sequences before starting parsing. (librdf_parser_raptor_get_namespaces_seen_prefix, librdf_parser_raptor_get_namespaces_seen_uri, librdf_parser_raptor_get_namespaces_seen_count): Added to get the namespaces returned during a parsing. (librdf_parser_raptor_register_factory): Register new functions above. * librdf/rdf_parser.c: (librdf_parser_get_namespaces_seen_prefix, librdf_parser_get_namespaces_seen_uri, librdf_parser_get_namespaces_seen_count): Added to get the namespaces returned during a parsing. * librdf/rdf_parser.h: Added prototypes for librdf_parser_get_namespaces_seen_prefix, librdf_parser_get_namespaces_seen_uri and librdf_parser_get_namespaces_seen_count * librdf/rdf_parser_internal.h: struct librdf_parser_factory_s gains factory methods const char* (*get_namespaces_seen_prefix)(void* context, int offset); librdf_uri* (*get_namespaces_seen_uri)(void* context, int offset); int (*get_namespaces_seen_count)(void* context); to get the namespaces seen during a parsing. * librdf/rdf_storage_mysql.c: (librdf_storage_mysql_transaction_commit): Commit statements in the sorted order, not reversed. Fix off-by-1. * librdf/rdf_storage_mysql.c: pending_row now has a set strings with lengths. (librdf_storage_mysql_context): pending_inserts is now an array of raptor_sequence* of pending_rows. (compare_pending_rows): Compare using ints not memcmp for human understandable order. Could go back to memcmp which would do different things based on the storage of u64 in memory (big, little endian) (free_pending-row): Added, now freeing strings too. (format_pending_row_sequence): Turn a sequence of pending rows for a table into the appropriate REPLACE INTO query. (librdf_storage_mysql_node_hash_common): Do not make query here, use new format_pending_row_sequence for immediate use, or queue it if in a transaction. (librdf_storage_mysql_transaction_start): init pending_inserts sequences. (librdf_storage_mysql_transaction_terminate): Free pending_inserts sequences. (librdf_storage_mysql_transaction_commit): Count pending_inserts sequences. sort the pending nodes rows before formatting with format_pending_row_sequence. 2007-05-02 Dave Beckett * librdf/rdf_storage_mysql.c: Batch up INSERTS to be 1 per table type. Replace INSERT INTO with REPLACE INTO for Resources, Literals, BNodes. Do nothing if there is no work to commit, not even start/commit. Table mysql_tables added to declare table names and fields. Lose all the SELECT HIGH_PRIORITY. (librdf_storage_mysql_node_hash_common): Renamed from librdf_storage_mysql_node_hash. (librdf_storage_mysql_get_node_hash, librdf_storage_mysql_store_node): Added as wrappers around the above. (librdf_storage_mysql_node_hash_common): Split into 'get hash' and 'add hash' sections. All queries are constructed with raptor_stringbuffer. When in transaction, save for later, otherwise execute here as before. Do not insert the same node twice in the same transaction. LATER: Need to remember this is inserted outside a transaction too to prevent un-necessary SELECTs. (librdf_storage_mysql_context_add_statement_helper): Use new function names. When in transactions, save away statements hash u64 arrays a raptor_sequence of pending_row objects otherwise execute as before. (librdf_storage_mysql_transaction_start): Initialise the new hashes for nodes, pending_inserts stringbuffers, pending_statements sequence. (librdf_storage_mysql_transaction_terminate): Added to tidy up the new fields added above when a transaction is done. (librdf_storage_mysql_transaction_commit): If there is no pending node or statement to add, end without connecting. Otherwise for each node table, do one REPLACE INTO and for the statement table, do one INSERT INTO. (librdf_storage_mysql_transaction_rollback): use new librdf_storage_mysql_transaction_terminate to tidy up. * configure.ac: Move mysql flag munging to one place * utils/Makefile.am: (AM_CPPFLAGS): Put internal flags first 2007-05-01 Dave Beckett * librdf/rdf_hash.c: casts for C++ * librdf/rdf_parser.c, librdf/rdf_parser_raptor.c, librdf/rdf_query_rasqal.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_sql.c: casts for C++ * librdf/rdf_hash.c: Casts for C++ * librdf/rdf_hash.c, librdf/rdf_hash.h: (librdf_hash_interpret_template): Do not use template as a function parameter name for C++ * FAQS.html, INSTALL.html, LICENSE.html, NEWS.html, README.html, RELEASE.html, TODO.html: HTML hello UTF-8 * redland-config.1: Document --private-libs and explain what it is under --libs too. * redland-config.in: Add --private-libs and move private libs to that from --libs * librdf/redland.pc.in: Use Libs.private for internal dynamically linked libraries 2007-04-30 Dave Beckett * librdf/rdf_model.c: (librdf_model_add_submodel): Invert test Fixes Issue#0000175 http://bugs.librdf.org/mantis/view.php?id=175 * librdf/rdf_iterator.c, librdf/rdf_statement.c, librdf/rdf_storage.c, librdf/rdf_stream.c, librdf/rdf_uri.c: (main): Init library with world only, not librdf_init_CLASS * librdf/rdf_concepts.c: (main): Self contained test. * librdf/rdf_digest.c, librdf/rdf_hash.c, librdf/rdf_node.c: (main): Init library with world only, not librdf_init_CLASS * docs/redland-docs.xml: sgml IDs * Makefile.am: touch-mtime.pl * docs/redland-sections.txt: Add librdf_parser_guess_name add librdf_query_results_is_syntax * Makefile.am, RELEASE.html, configure.ac, utils/Makefile.am, utils/touch-mtime.c, utils/touch-mtime.pl: Remove touch-mtime program, use perl touch-mtime.pl 2007-04-23 Dave Beckett * configure.ac: min raptor 1.4.15 * utils/rdfproc.c: Revert add_stream_count() and heuristics changes * librdf/rdf_model.c, librdf/rdf_serializer.c: Updates for rdf/xml output adding xml:base * NEWS.html, configure.ac, librdf/win32_rdf_config.h: Bump version to 1.0.6 * librdf/rdf_utf8.c: (main): Run quietly when successful 2007-04-22 Dave Beckett * librdf/rdf_query_triples.c: (librdf_query_triples_init): Init context->statement. * autogen.sh: Update autogen.sh 2007-03-20 Dave Beckett * librdf/rdf_parser.c: (librdf_parser_guess_name): Guess a parser name from content using raptor_guess_parser_name. * librdf/rdf_parser.h: Added librdf_parser_guess_name * Redland.i: Added librdf_parser_guess_name 2007-03-14 Dave Beckett * librdf/rdf_parser_raptor.c: (librdf_parser_raptor_parse_as_stream_common): Send the accept header appropriate for the raptor parser. 2007-02-25 Dave Beckett * librdf/rdf_init.c: (librdf_new_world): Document how you should call librdf_world_open after, although the library will now do it for you. * librdf/rdf_concepts.c, librdf/rdf_digest.c, librdf/rdf_hash.c, librdf/rdf_init.c, librdf/rdf_init_internal.h, librdf/rdf_iterator.c, librdf/rdf_list.c, librdf/rdf_model.c, librdf/rdf_model_storage.c, librdf/rdf_node.c, librdf/rdf_parser.c, librdf/rdf_parser_raptor.c, librdf/rdf_query.c, librdf/rdf_query_results.c, librdf/rdf_serializer.c, librdf/rdf_serializer_raptor.c, librdf/rdf_statement.c, librdf/rdf_storage.c, librdf/rdf_storage_file.c, librdf/rdf_storage_hashes.c, librdf/rdf_storage_list.c, librdf/rdf_storage_mysql.c, librdf/rdf_storage_postgresql.c, librdf/rdf_storage_sql.c, librdf/rdf_storage_sqlite.c, librdf/rdf_storage_tstore.c, librdf/rdf_stream.c, librdf/rdf_uri.c: Add librdf_world_open() for every public API constructor or function that mentions librdf_world* and could have failed to run librdf_world_open() after librdf_new_world(). Fixes Issue#0000173 http://bugs.librdf.org/mantis/view.php?id=173 * librdf/rdf_query.h: Added librdf_query_results_is_syntax prototype. 2007-02-17 Dave Beckett * utils/rdfproc.1: Document -r/--results for query results formatting. * utils/rdfproc.c: Added -r/--results option to set query results formatter name. * docs/tmpl/hash.sgml, docs/tmpl/model.sgml, docs/tmpl/query_results.sgml, docs/tmpl/storage.sgml: Update for new transactions functions * librdf/rdf_parser.c, librdf/rdf_parser_internal.h, librdf/win32_rdf_config.h: Remove HAVE_RAPTOR_RDF_PARSER - always present now * librdf/Makefile.am: rdf_parser_raptor.c is always compiled * configure.ac: Remove --enable-parsers - raptor is always required and always used, whatever this setting is. It is now passed onto raptor, if built internally, which *will* use it to configure the library contents. 2007-02-16 Dave Beckett * librdf/rdf_query_rasqal.c: (librdf_query_rasqal_results_to_counted_string, librdf_query_rasqal_results_to_file_handle): Removed old factory method impls (librdf_query_rasqal_results_is_syntax, librdf_query_rasqal_new_results_formatter, librdf_query_rasqal_new_results_formatter_by_mime_type, librdf_query_rasqal_free_results_formatter, librdf_query_rasqal_results_formatter_write): Added to implement new factory methods using rasqal_query_results_formatter (librdf_query_rasqal_constructor): Register all rasqal query results formats to be handled by this. * librdf/rdf_query_results.c: (librdf_query_results_to_counted_string, librdf_query_results_to_file_handle): Use query results formatter. (librdf_query_results_is_syntax): Added (librdf_new_query_results_formatter, librdf_new_query_results_formatter_by_mime_type, librdf_free_query_results_formatter, librdf_query_results_formatter_write): Added, based on new factory methods. 9librdf_query_results_formats_check, librdf_query_results_formats_enumerate): Added, calling rasqal directly. * librdf/rdf_query.h: Added prototypes for librdf_new_query_results_formatter, librdf_new_query_results_formatter_by_mime_type, librdf_free_query_results_formatter, librdf_query_results_formatter_write, librdf_query_results_formats_check and librdf_query_results_formats_enumerate * librdf/rdf_query_internal.h: Added librdf_query_results_formatter librdf_query_factory_s gains factory methods new_results_formatter, new_results_formatter_by_mime_type, free_results_formatter and results_formatter_write, results_is_syntax. lose factory methods results_to_counted_string and results_to_file_handle * librdf/librdf.h: Added librdf_query_results_formatter * librdf/rdf_query_rasqal.c: (rasqal_redland_bind_match): Allow binding a NULL graph 2007-02-09 Dave Beckett * librdf/rdf_serializer.c: (librdf_get_serializer_factory): Default to serializer named "rdfxml" if nothing given to ensure we don't get another rdfxml serializer such as XMP. * librdf/rdf_serializer.c: (librdf_get_serializer_factory): Fix negative test for uri inequality. * librdf/rdf_parser.c: (librdf_get_parser_factory): Fix negative test for uri inequality. 2007-01-26 Dave Beckett * Makefile.am: Revert touch -r change as it just creates a file called '-r' (reopen http://bugs.librdf.org/mantis/view.php?id=159) * Makefile.am: Reverse use of touch -r since it seems to fail on Solaris. Fixes http://bugs.librdf.org/mantis/view.php?id=159 2007-01-23 Dave Beckett * configure.ac: RASQAL_MIN_VERSION 0.9.14 * librdf/rdf_storage.c: (librdf_storage_node_stream_to_node_create): Allow copying NULL node1 and node2. redland-1.0.17/TODO.html0000644000175000017500000000125112071146235011565 00000000000000 Redland librdf RDF API Library - To Do List

Redland librdf RDF API Library - To Do list

Bugs and Features

Bugs should be reported at the Redland Issue Tracker.


Copyright (C) 2000-2013 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

redland-1.0.17/AUTHORS0000644000175000017500000000023511170507352011203 00000000000000Dave Beckett Morten Frederiksen - http://purl.org/net/morten/ (MySQL Store) Dave Robillard Lauri Aalto redland-1.0.17/LICENSE-2.0.txt0000644000175000017500000002613610375024366012270 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. redland-1.0.17/libltdl/0000755000175000017500000000000012257576340011653 500000000000000redland-1.0.17/libltdl/lt__alloc.c0000644000175000017500000000435512155164573013674 00000000000000/* lt__alloc.c -- internal memory management interface Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include #include "lt__alloc.h" static void alloc_die_default (void); void (*lt__alloc_die) (void) = alloc_die_default; /* Unless overridden, exit on memory failure. */ static void alloc_die_default (void) { fprintf (stderr, "Out of memory.\n"); exit (EXIT_FAILURE); } void * lt__malloc (size_t n) { void *mem; if (! (mem = malloc (n))) (*lt__alloc_die) (); return mem; } void * lt__zalloc (size_t n) { void *mem; if ((mem = lt__malloc (n))) memset (mem, 0, n); return mem; } void * lt__realloc (void *mem, size_t n) { if (! (mem = realloc (mem, n))) (*lt__alloc_die) (); return mem; } void * lt__memdup (void const *mem, size_t n) { void *newmem; if ((newmem = lt__malloc (n))) return memcpy (newmem, mem, n); return 0; } char * lt__strdup (const char *string) { return (char *) lt__memdup (string, strlen (string) +1); } redland-1.0.17/libltdl/argz.c0000644000175000017500000001341712155164573012706 00000000000000/* argz.c -- argz implementation for non-glibc systems Copyright (C) 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if defined(LTDL) && defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #include #include #include #include #include #include #include #define EOS_CHAR '\0' error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len) { size_t argz_len; char *argz; assert (pargz); assert (pargz_len); assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); /* If nothing needs to be appended, no more work is required. */ if (buf_len == 0) return 0; /* Ensure there is enough room to append BUF_LEN. */ argz_len = *pargz_len + buf_len; argz = (char *) realloc (*pargz, argz_len); if (!argz) return ENOMEM; /* Copy characters from BUF after terminating '\0' in ARGZ. */ memcpy (argz + *pargz_len, buf, buf_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } error_t argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len) { size_t argz_len; char *argz = 0; assert (str); assert (pargz); assert (pargz_len); /* Make a copy of STR, but replacing each occurrence of DELIM with '\0'. */ argz_len = 1+ strlen (str); if (argz_len) { const char *p; char *q; argz = (char *) malloc (argz_len); if (!argz) return ENOMEM; for (p = str, q = argz; *p != EOS_CHAR; ++p) { if (*p == delim) { /* Ignore leading delimiters, and fold consecutive delimiters in STR into a single '\0' in ARGZ. */ if ((q > argz) && (q[-1] != EOS_CHAR)) *q++ = EOS_CHAR; else --argz_len; } else *q++ = *p; } /* Copy terminating EOS_CHAR. */ *q = *p; } /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ if (!argz_len) argz = (free (argz), (char *) 0); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } error_t argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry) { assert (pargz); assert (pargz_len); assert (entry && *entry); /* No BEFORE address indicates ENTRY should be inserted after the current last element. */ if (!before) return argz_append (pargz, pargz_len, entry, 1+ strlen (entry)); /* This probably indicates a programmer error, but to preserve semantics, scan back to the start of an entry if BEFORE points into the middle of it. */ while ((before > *pargz) && (before[-1] != EOS_CHAR)) --before; { size_t entry_len = 1+ strlen (entry); size_t argz_len = *pargz_len + entry_len; size_t offset = before - *pargz; char *argz = (char *) realloc (*pargz, argz_len); if (!argz) return ENOMEM; /* Make BEFORE point to the equivalent offset in ARGZ that it used to have in *PARGZ incase realloc() moved the block. */ before = argz + offset; /* Move the ARGZ entries starting at BEFORE up into the new space at the end -- making room to copy ENTRY into the resulting gap. */ memmove (before + entry_len, before, *pargz_len - offset); memcpy (before, entry, entry_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; } return 0; } char * argz_next (char *argz, size_t argz_len, const char *entry) { assert ((argz && argz_len) || (!argz && !argz_len)); if (entry) { /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address within the ARGZ vector. */ assert ((!argz && !argz_len) || ((argz <= entry) && (entry < (argz + argz_len)))); /* Move to the char immediately after the terminating '\0' of ENTRY. */ entry = 1+ strchr (entry, EOS_CHAR); /* Return either the new ENTRY, or else NULL if ARGZ is exhausted. */ return (entry >= argz + argz_len) ? 0 : (char *) entry; } else { /* This should probably be flagged as a programmer error, since starting an argz_next loop with the iterator set to ARGZ is safer. To preserve semantics, handle the NULL case by returning the start of ARGZ (if any). */ if (argz_len > 0) return argz; else return 0; } } void argz_stringify (char *argz, size_t argz_len, int sep) { assert ((argz && argz_len) || (!argz && !argz_len)); if (sep) { --argz_len; /* don't stringify the terminating EOS */ while (--argz_len > 0) { if (argz[argz_len] == EOS_CHAR) argz[argz_len] = sep; } } } redland-1.0.17/libltdl/README0000644000175000017500000000126012155164573012450 00000000000000This is GNU libltdl, a system independent dlopen wrapper for GNU libtool. It supports the following dlopen interfaces: * dlopen (POSIX) * shl_load (HP-UX) * LoadLibrary (Win16 and Win32) * load_add_on (BeOS) * GNU DLD (emulates dynamic linking for static libraries) * dyld (darwin/Mac OS X) * libtool's dlpreopen -- Copyright (C) 1999, 2003, 2011 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 This file is part of GNU Libtool. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. redland-1.0.17/libltdl/ltdl.c0000644000175000017500000015367312155164573012713 00000000000000/* ltdl.c -- system independent dlopen wrapper Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_system.h" #include "lt_dlloader.h" /* --- MANIFEST CONSTANTS --- */ /* Standard libltdl search path environment variable name */ #undef LTDL_SEARCHPATH_VAR #define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" /* Standard libtool archive file extension. */ #undef LT_ARCHIVE_EXT #define LT_ARCHIVE_EXT ".la" /* max. filename length */ #if !defined(LT_FILENAME_MAX) # define LT_FILENAME_MAX 1024 #endif #if !defined(LT_LIBEXT) # define LT_LIBEXT "a" #endif #if !defined(LT_LIBPREFIX) # define LT_LIBPREFIX "lib" #endif /* This is the maximum symbol size that won't require malloc/free */ #undef LT_SYMBOL_LENGTH #define LT_SYMBOL_LENGTH 128 /* This accounts for the _LTX_ separator */ #undef LT_SYMBOL_OVERHEAD #define LT_SYMBOL_OVERHEAD 5 /* Various boolean flags can be stored in the flags field of an lt_dlhandle... */ #define LT_DLIS_RESIDENT(handle) ((handle)->info.is_resident) #define LT_DLIS_SYMGLOBAL(handle) ((handle)->info.is_symglobal) #define LT_DLIS_SYMLOCAL(handle) ((handle)->info.is_symlocal) static const char objdir[] = LT_OBJDIR; static const char archive_ext[] = LT_ARCHIVE_EXT; static const char libext[] = LT_LIBEXT; static const char libprefix[] = LT_LIBPREFIX; #if defined(LT_MODULE_EXT) static const char shlib_ext[] = LT_MODULE_EXT; #endif /* If the loadable module suffix is not the same as the linkable * shared library suffix, this will be defined. */ #if defined(LT_SHARED_EXT) static const char shared_ext[] = LT_SHARED_EXT; #endif #if defined(LT_DLSEARCH_PATH) static const char sys_dlsearch_path[] = LT_DLSEARCH_PATH; #endif /* --- DYNAMIC MODULE LOADING --- */ /* The type of a function used at each iteration of foreach_dirinpath(). */ typedef int foreach_callback_func (char *filename, void *data1, void *data2); /* foreachfile_callback itself calls a function of this type: */ typedef int file_worker_func (const char *filename, void *data); static int foreach_dirinpath (const char *search_path, const char *base_name, foreach_callback_func *func, void *data1, void *data2); static int find_file_callback (char *filename, void *data1, void *data2); static int find_handle_callback (char *filename, void *data, void *ignored); static int foreachfile_callback (char *filename, void *data1, void *data2); static int canonicalize_path (const char *path, char **pcanonical); static int argzize_path (const char *path, char **pargz, size_t *pargz_len); static FILE *find_file (const char *search_path, const char *base_name, char **pdir); static lt_dlhandle *find_handle (const char *search_path, const char *base_name, lt_dlhandle *handle, lt_dladvise advise); static int find_module (lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed, lt_dladvise advise); static int has_library_ext (const char *filename); static int load_deplibs (lt_dlhandle handle, char *deplibs); static int trim (char **dest, const char *str); static int try_dlopen (lt_dlhandle *handle, const char *filename, const char *ext, lt_dladvise advise); static int tryall_dlopen (lt_dlhandle *handle, const char *filename, lt_dladvise padvise, const lt_dlvtable *vtable); static int unload_deplibs (lt_dlhandle handle); static int lt_argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry); static int lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry); static int lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp); static int lt_dlpath_insertdir (char **ppath, char *before, const char *dir); static int list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len); static int file_not_found (void); #ifdef HAVE_LIBDLLOADER static int loader_init_callback (lt_dlhandle handle); #endif /* HAVE_LIBDLLOADER */ static int loader_init (lt_get_vtable *vtable_func, lt_user_data data); static char *user_search_path= 0; static lt_dlhandle handles = 0; static int initialized = 0; /* Our memory failure callback sets the error message to be passed back up to the client, so we must be careful to return from mallocation callers if allocation fails (as this callback returns!!). */ void lt__alloc_die_callback (void) { LT__SETERROR (NO_MEMORY); } #ifdef HAVE_LIBDLLOADER /* This function is called to initialise each preloaded module loader, and hook it into the list of loaders to be used when attempting to dlopen an application module. */ static int loader_init_callback (lt_dlhandle handle) { lt_get_vtable *vtable_func = (lt_get_vtable *) lt_dlsym (handle, "get_vtable"); return loader_init (vtable_func, 0); } #endif /* HAVE_LIBDLLOADER */ static int loader_init (lt_get_vtable *vtable_func, lt_user_data data) { const lt_dlvtable *vtable = 0; int errors = 0; if (vtable_func) { vtable = (*vtable_func) (data); } /* lt_dlloader_add will LT__SETERROR if it fails. */ errors += lt_dlloader_add (vtable); assert (errors || vtable); if ((!errors) && vtable->dlloader_init) { if ((*vtable->dlloader_init) (vtable->dlloader_data)) { LT__SETERROR (INIT_LOADER); ++errors; } } return errors; } /* Bootstrap the loader loading with the preopening loader. */ #define get_vtable preopen_LTX_get_vtable #define preloaded_symbols LT_CONC3(lt_, LTDLOPEN, _LTX_preloaded_symbols) LT_BEGIN_C_DECLS LT_SCOPE const lt_dlvtable * get_vtable (lt_user_data data); LT_END_C_DECLS #ifdef HAVE_LIBDLLOADER extern LT_DLSYM_CONST lt_dlsymlist preloaded_symbols[]; #endif /* Initialize libltdl. */ int lt_dlinit (void) { int errors = 0; /* Initialize only at first call. */ if (++initialized == 1) { lt__alloc_die = lt__alloc_die_callback; handles = 0; user_search_path = 0; /* empty search path */ /* First set up the statically loaded preload module loader, so we can use it to preopen the other loaders we linked in at compile time. */ errors += loader_init (get_vtable, 0); /* Now open all the preloaded module loaders, so the application can use _them_ to lt_dlopen its own modules. */ #ifdef HAVE_LIBDLLOADER if (!errors) { errors += lt_dlpreload (preloaded_symbols); } if (!errors) { errors += lt_dlpreload_open (LT_STR(LTDLOPEN), loader_init_callback); } #endif /* HAVE_LIBDLLOADER */ } #ifdef LT_DEBUG_LOADERS lt_dlloader_dump(); #endif return errors; } int lt_dlexit (void) { /* shut down libltdl */ lt_dlloader *loader = 0; lt_dlhandle handle = handles; int errors = 0; if (!initialized) { LT__SETERROR (SHUTDOWN); ++errors; goto done; } /* shut down only at last call. */ if (--initialized == 0) { int level; while (handles && LT_DLIS_RESIDENT (handles)) { handles = handles->next; } /* close all modules */ for (level = 1; handle; ++level) { lt_dlhandle cur = handles; int saw_nonresident = 0; while (cur) { lt_dlhandle tmp = cur; cur = cur->next; if (!LT_DLIS_RESIDENT (tmp)) { saw_nonresident = 1; if (tmp->info.ref_count <= level) { if (lt_dlclose (tmp)) { ++errors; } /* Make sure that the handle pointed to by 'cur' still exists. lt_dlclose recursively closes dependent libraries which removes them from the linked list. One of these might be the one pointed to by 'cur'. */ if (cur) { for (tmp = handles; tmp; tmp = tmp->next) if (tmp == cur) break; if (! tmp) cur = handles; } } } } /* done if only resident modules are left */ if (!saw_nonresident) break; } /* When removing loaders, we can only find out failure by testing the error string, so avoid a spurious one from an earlier failed command. */ if (!errors) LT__SETERRORSTR (0); /* close all loaders */ for (loader = (lt_dlloader *) lt_dlloader_next (NULL); loader;) { lt_dlloader *next = (lt_dlloader *) lt_dlloader_next (loader); lt_dlvtable *vtable = (lt_dlvtable *) lt_dlloader_get (loader); if ((vtable = lt_dlloader_remove ((char *) vtable->name))) { FREE (vtable); } else { /* ignore errors due to resident modules */ const char *err; LT__GETERROR (err); if (err) ++errors; } loader = next; } FREE(user_search_path); } done: return errors; } /* Try VTABLE or, if VTABLE is NULL, all available loaders for FILENAME. If the library is not successfully loaded, return non-zero. Otherwise, the dlhandle is stored at the address given in PHANDLE. */ static int tryall_dlopen (lt_dlhandle *phandle, const char *filename, lt_dladvise advise, const lt_dlvtable *vtable) { lt_dlhandle handle = handles; const char * saved_error = 0; int errors = 0; #ifdef LT_DEBUG_LOADERS fprintf (stderr, "tryall_dlopen (%s, %s)\n", filename ? filename : "(null)", vtable ? vtable->name : "(ALL)"); #endif LT__GETERROR (saved_error); /* check whether the module was already opened */ for (;handle; handle = handle->next) { if ((handle->info.filename == filename) /* dlopen self: 0 == 0 */ || (handle->info.filename && filename && streq (handle->info.filename, filename))) { break; } } if (handle) { ++handle->info.ref_count; *phandle = handle; goto done; } handle = *phandle; if (filename) { /* Comment out the check of file permissions using access. This call seems to always return -1 with error EACCES. */ /* We need to catch missing file errors early so that file_not_found() can detect what happened. if (access (filename, R_OK) != 0) { LT__SETERROR (FILE_NOT_FOUND); ++errors; goto done; } */ handle->info.filename = lt__strdup (filename); if (!handle->info.filename) { ++errors; goto done; } } else { handle->info.filename = 0; } { lt_dlloader loader = lt_dlloader_next (0); const lt_dlvtable *loader_vtable; do { if (vtable) loader_vtable = vtable; else loader_vtable = lt_dlloader_get (loader); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "Calling %s->module_open (%s)\n", (loader_vtable && loader_vtable->name) ? loader_vtable->name : "(null)", filename ? filename : "(null)"); #endif handle->module = (*loader_vtable->module_open) (loader_vtable->dlloader_data, filename, advise); #ifdef LT_DEBUG_LOADERS fprintf (stderr, " Result: %s\n", handle->module ? "Success" : "Failed"); #endif if (handle->module != 0) { if (advise) { handle->info.is_resident = advise->is_resident; handle->info.is_symglobal = advise->is_symglobal; handle->info.is_symlocal = advise->is_symlocal; } break; } } while (!vtable && (loader = lt_dlloader_next (loader))); /* If VTABLE was given but couldn't open the module, or VTABLE wasn't given but we exhausted all loaders without opening the module, bail out! */ if ((vtable && !handle->module) || (!vtable && !loader)) { FREE (handle->info.filename); ++errors; goto done; } handle->vtable = loader_vtable; } LT__SETERRORSTR (saved_error); done: return errors; } static int tryall_dlopen_module (lt_dlhandle *handle, const char *prefix, const char *dirname, const char *dlname, lt_dladvise advise) { int error = 0; char *filename = 0; size_t filename_len = 0; size_t dirname_len = LT_STRLEN (dirname); assert (handle); assert (dirname); assert (dlname); #if defined(LT_DIRSEP_CHAR) /* Only canonicalized names (i.e. with DIRSEP chars already converted) should make it into this function: */ assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); #endif if (dirname_len > 0) if (dirname[dirname_len -1] == '/') --dirname_len; filename_len = dirname_len + 1 + LT_STRLEN (dlname); /* Allocate memory, and combine DIRNAME and MODULENAME into it. The PREFIX (if any) is handled below. */ filename = MALLOC (char, filename_len + 1); if (!filename) return 1; sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); /* Now that we have combined DIRNAME and MODULENAME, if there is also a PREFIX to contend with, simply recurse with the arguments shuffled. Otherwise, attempt to open FILENAME as a module. */ if (prefix) { error += tryall_dlopen_module (handle, (const char *) 0, prefix, filename, advise); } else if (tryall_dlopen (handle, filename, advise, 0) != 0) { ++error; } FREE (filename); return error; } static int find_module (lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed, lt_dladvise advise) { /* Try to open the old library first; if it was dlpreopened, we want the preopened version of it, even if a dlopenable module is available. */ if (old_name && tryall_dlopen (handle, old_name, advise, lt_dlloader_find ("lt_preopen") ) == 0) { return 0; } /* Try to open the dynamic library. */ if (dlname) { /* try to open the installed module */ if (installed && libdir) { if (tryall_dlopen_module (handle, (const char *) 0, libdir, dlname, advise) == 0) return 0; } /* try to open the not-installed module */ if (!installed) { if (tryall_dlopen_module (handle, dir, objdir, dlname, advise) == 0) return 0; } /* maybe it was moved to another directory */ { if (dir && (tryall_dlopen_module (handle, (const char *) 0, dir, dlname, advise) == 0)) return 0; } } return 1; } static int canonicalize_path (const char *path, char **pcanonical) { char *canonical = 0; assert (path && *path); assert (pcanonical); canonical = MALLOC (char, 1+ LT_STRLEN (path)); if (!canonical) return 1; { size_t dest = 0; size_t src; for (src = 0; path[src] != LT_EOS_CHAR; ++src) { /* Path separators are not copied to the beginning or end of the destination, or if another separator would follow immediately. */ if (path[src] == LT_PATHSEP_CHAR) { if ((dest == 0) || (path[1+ src] == LT_PATHSEP_CHAR) || (path[1+ src] == LT_EOS_CHAR)) continue; } /* Anything other than a directory separator is copied verbatim. */ if ((path[src] != '/') #if defined(LT_DIRSEP_CHAR) && (path[src] != LT_DIRSEP_CHAR) #endif ) { canonical[dest++] = path[src]; } /* Directory separators are converted and copied only if they are not at the end of a path -- i.e. before a path separator or NULL terminator. */ else if ((path[1+ src] != LT_PATHSEP_CHAR) && (path[1+ src] != LT_EOS_CHAR) #if defined(LT_DIRSEP_CHAR) && (path[1+ src] != LT_DIRSEP_CHAR) #endif && (path[1+ src] != '/')) { canonical[dest++] = '/'; } } /* Add an end-of-string marker at the end. */ canonical[dest] = LT_EOS_CHAR; } /* Assign new value. */ *pcanonical = canonical; return 0; } static int argzize_path (const char *path, char **pargz, size_t *pargz_len) { error_t error; assert (path); assert (pargz); assert (pargz_len); if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) { switch (error) { case ENOMEM: LT__SETERROR (NO_MEMORY); break; default: LT__SETERROR (UNKNOWN); break; } return 1; } return 0; } /* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns non-zero or all elements are exhausted. If BASE_NAME is non-NULL, it is appended to each SEARCH_PATH element before FUNC is called. */ static int foreach_dirinpath (const char *search_path, const char *base_name, foreach_callback_func *func, void *data1, void *data2) { int result = 0; size_t filenamesize = 0; size_t lenbase = LT_STRLEN (base_name); size_t argz_len = 0; char *argz = 0; char *filename = 0; char *canonical = 0; if (!search_path || !*search_path) { LT__SETERROR (FILE_NOT_FOUND); goto cleanup; } if (canonicalize_path (search_path, &canonical) != 0) goto cleanup; if (argzize_path (canonical, &argz, &argz_len) != 0) goto cleanup; { char *dir_name = 0; while ((dir_name = argz_next (argz, argz_len, dir_name))) { size_t lendir = LT_STRLEN (dir_name); if (1+ lendir + lenbase >= filenamesize) { FREE (filename); filenamesize = 1+ lendir + 1+ lenbase; /* "/d" + '/' + "f" + '\0' */ filename = MALLOC (char, filenamesize); if (!filename) goto cleanup; } assert (filenamesize > lendir); strcpy (filename, dir_name); if (base_name && *base_name) { if (filename[lendir -1] != '/') filename[lendir++] = '/'; strcpy (filename +lendir, base_name); } if ((result = (*func) (filename, data1, data2))) { break; } } } cleanup: FREE (argz); FREE (canonical); FREE (filename); return result; } /* If FILEPATH can be opened, store the name of the directory component in DATA1, and the opened FILE* structure address in DATA2. Otherwise DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ static int find_file_callback (char *filename, void *data1, void *data2) { char **pdir = (char **) data1; FILE **pfile = (FILE **) data2; int is_done = 0; assert (filename && *filename); assert (pdir); assert (pfile); if ((*pfile = fopen (filename, LT_READTEXT_MODE))) { char *dirend = strrchr (filename, '/'); if (dirend > filename) *dirend = LT_EOS_CHAR; FREE (*pdir); *pdir = lt__strdup (filename); is_done = (*pdir == 0) ? -1 : 1; } return is_done; } static FILE * find_file (const char *search_path, const char *base_name, char **pdir) { FILE *file = 0; foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); return file; } static int find_handle_callback (char *filename, void *data, void *data2) { lt_dlhandle *phandle = (lt_dlhandle *) data; int notfound = access (filename, R_OK); lt_dladvise advise = (lt_dladvise) data2; /* Bail out if file cannot be read... */ if (notfound) return 0; /* Try to dlopen the file, but do not continue searching in any case. */ if (tryall_dlopen (phandle, filename, advise, 0) != 0) *phandle = 0; return 1; } /* If HANDLE was found return it, otherwise return 0. If HANDLE was found but could not be opened, *HANDLE will be set to 0. */ static lt_dlhandle * find_handle (const char *search_path, const char *base_name, lt_dlhandle *phandle, lt_dladvise advise) { if (!search_path) return 0; if (!foreach_dirinpath (search_path, base_name, find_handle_callback, phandle, advise)) return 0; return phandle; } #if !defined(LTDL_DLOPEN_DEPLIBS) static int load_deplibs (lt_dlhandle handle, char * LT__UNUSED deplibs) { handle->depcount = 0; return 0; } #else /* defined(LTDL_DLOPEN_DEPLIBS) */ static int load_deplibs (lt_dlhandle handle, char *deplibs) { char *p, *save_search_path = 0; int depcount = 0; int i; char **names = 0; int errors = 0; handle->depcount = 0; if (!deplibs) { return errors; } ++errors; if (user_search_path) { save_search_path = lt__strdup (user_search_path); if (!save_search_path) goto cleanup; } /* extract search paths and count deplibs */ p = deplibs; while (*p) { if (!isspace ((unsigned char) *p)) { char *end = p+1; while (*end && !isspace((unsigned char) *end)) { ++end; } if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0) { char save = *end; *end = 0; /* set a temporary string terminator */ if (lt_dladdsearchdir(p+2)) { goto cleanup; } *end = save; } else { ++depcount; } p = end; } else { ++p; } } if (!depcount) { errors = 0; goto cleanup; } names = MALLOC (char *, depcount); if (!names) goto cleanup; /* now only extract the actual deplibs */ depcount = 0; p = deplibs; while (*p) { if (isspace ((unsigned char) *p)) { ++p; } else { char *end = p+1; while (*end && !isspace ((unsigned char) *end)) { ++end; } if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0) { char *name; char save = *end; *end = 0; /* set a temporary string terminator */ if (strncmp(p, "-l", 2) == 0) { size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); name = MALLOC (char, 1+ name_len); if (name) sprintf (name, "lib%s", p+2); } else name = lt__strdup(p); if (!name) goto cleanup_names; names[depcount++] = name; *end = save; } p = end; } } /* load the deplibs (in reverse order) At this stage, don't worry if the deplibs do not load correctly, they may already be statically linked into the loading application for instance. There will be a more enlightening error message later on if the loaded module cannot resolve all of its symbols. */ if (depcount) { lt_dlhandle cur = handle; int j = 0; cur->deplibs = MALLOC (lt_dlhandle, depcount); if (!cur->deplibs) goto cleanup_names; for (i = 0; i < depcount; ++i) { cur->deplibs[j] = lt_dlopenext(names[depcount-1-i]); if (cur->deplibs[j]) { ++j; } } cur->depcount = j; /* Number of successfully loaded deplibs */ errors = 0; } cleanup_names: for (i = 0; i < depcount; ++i) { FREE (names[i]); } cleanup: FREE (names); /* restore the old search path */ if (save_search_path) { MEMREASSIGN (user_search_path, save_search_path); } return errors; } #endif /* defined(LTDL_DLOPEN_DEPLIBS) */ static int unload_deplibs (lt_dlhandle handle) { int i; int errors = 0; lt_dlhandle cur = handle; if (cur->depcount) { for (i = 0; i < cur->depcount; ++i) { if (!LT_DLIS_RESIDENT (cur->deplibs[i])) { errors += lt_dlclose (cur->deplibs[i]); } } FREE (cur->deplibs); } return errors; } static int trim (char **dest, const char *str) { /* remove the leading and trailing "'" from str and store the result in dest */ const char *end = strrchr (str, '\''); size_t len = LT_STRLEN (str); char *tmp; FREE (*dest); if (!end || end == str) return 1; if (len > 3 && str[0] == '\'') { tmp = MALLOC (char, end - str); if (!tmp) return 1; memcpy(tmp, &str[1], (end - str) - 1); tmp[(end - str) - 1] = LT_EOS_CHAR; *dest = tmp; } else { *dest = 0; } return 0; } /* Read the .la file FILE. */ static int parse_dotla_file(FILE *file, char **dlname, char **libdir, char **deplibs, char **old_name, int *installed) { int errors = 0; size_t line_len = LT_FILENAME_MAX; char * line = MALLOC (char, line_len); if (!line) { LT__SETERROR (FILE_NOT_FOUND); return 1; } while (!feof (file)) { line[line_len-2] = '\0'; if (!fgets (line, (int) line_len, file)) { break; } /* Handle the case where we occasionally need to read a line that is longer than the initial buffer size. Behave even if the file contains NUL bytes due to corruption. */ while (line[line_len-2] != '\0' && line[line_len-2] != '\n' && !feof (file)) { line = REALLOC (char, line, line_len *2); if (!line) { ++errors; goto cleanup; } line[line_len * 2 - 2] = '\0'; if (!fgets (&line[line_len -1], (int) line_len +1, file)) { break; } line_len *= 2; } if (line[0] == '\n' || line[0] == '#') { continue; } #undef STR_DLNAME #define STR_DLNAME "dlname=" if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) { errors += trim (dlname, &line[sizeof (STR_DLNAME) - 1]); } #undef STR_OLD_LIBRARY #define STR_OLD_LIBRARY "old_library=" else if (strncmp (line, STR_OLD_LIBRARY, sizeof (STR_OLD_LIBRARY) - 1) == 0) { errors += trim (old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); } /* Windows native tools do not understand the POSIX paths we store in libdir. */ #undef STR_LIBDIR #define STR_LIBDIR "libdir=" else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) { errors += trim (libdir, &line[sizeof(STR_LIBDIR) - 1]); #ifdef __WINDOWS__ /* Disallow following unix-style paths on MinGW. */ if (*libdir && (**libdir == '/' || **libdir == '\\')) **libdir = '\0'; #endif } #undef STR_DL_DEPLIBS #define STR_DL_DEPLIBS "dependency_libs=" else if (strncmp (line, STR_DL_DEPLIBS, sizeof (STR_DL_DEPLIBS) - 1) == 0) { errors += trim (deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); } else if (streq (line, "installed=yes\n")) { *installed = 1; } else if (streq (line, "installed=no\n")) { *installed = 0; } #undef STR_LIBRARY_NAMES #define STR_LIBRARY_NAMES "library_names=" else if (!*dlname && strncmp (line, STR_LIBRARY_NAMES, sizeof (STR_LIBRARY_NAMES) - 1) == 0) { char *last_libname; errors += trim (dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); if (!errors && *dlname && (last_libname = strrchr (*dlname, ' ')) != 0) { last_libname = lt__strdup (last_libname + 1); if (!last_libname) { ++errors; goto cleanup; } MEMREASSIGN (*dlname, last_libname); } } if (errors) break; } cleanup: FREE (line); return errors; } /* Try to open FILENAME as a module. */ static int try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext, lt_dladvise advise) { const char * saved_error = 0; char * archive_name = 0; char * canonical = 0; char * base_name = 0; char * dir = 0; char * name = 0; char * attempt = 0; int errors = 0; lt_dlhandle newhandle; assert (phandle); assert (*phandle == 0); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "try_dlopen (%s, %s)\n", filename ? filename : "(null)", ext ? ext : "(null)"); #endif LT__GETERROR (saved_error); /* dlopen self? */ if (!filename) { *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) return 1; newhandle = *phandle; /* lt_dlclose()ing yourself is very bad! Disallow it. */ newhandle->info.is_resident = 1; if (tryall_dlopen (&newhandle, 0, advise, 0) != 0) { FREE (*phandle); return 1; } goto register_handle; } assert (filename && *filename); if (ext) { attempt = MALLOC (char, LT_STRLEN (filename) + LT_STRLEN (ext) + 1); if (!attempt) return 1; sprintf(attempt, "%s%s", filename, ext); } else { attempt = lt__strdup (filename); if (!attempt) return 1; } /* Doing this immediately allows internal functions to safely assume only canonicalized paths are passed. */ if (canonicalize_path (attempt, &canonical) != 0) { ++errors; goto cleanup; } /* If the canonical module name is a path (relative or absolute) then split it into a directory part and a name part. */ base_name = strrchr (canonical, '/'); if (base_name) { size_t dirlen = (1+ base_name) - canonical; dir = MALLOC (char, 1+ dirlen); if (!dir) { ++errors; goto cleanup; } strncpy (dir, canonical, dirlen); dir[dirlen] = LT_EOS_CHAR; ++base_name; } else MEMREASSIGN (base_name, canonical); assert (base_name && *base_name); ext = strrchr (base_name, '.'); if (!ext) { ext = base_name + LT_STRLEN (base_name); } /* extract the module name from the file name */ name = MALLOC (char, ext - base_name + 1); if (!name) { ++errors; goto cleanup; } /* canonicalize the module name */ { int i; for (i = 0; i < ext - base_name; ++i) { if (isalnum ((unsigned char)(base_name[i]))) { name[i] = base_name[i]; } else { name[i] = '_'; } } name[ext - base_name] = LT_EOS_CHAR; } /* Before trawling through the filesystem in search of a module, check whether we are opening a preloaded module. */ if (!dir) { const lt_dlvtable *vtable = lt_dlloader_find ("lt_preopen"); if (vtable) { /* libprefix + name + "." + libext + NULL */ archive_name = MALLOC (char, strlen (libprefix) + LT_STRLEN (name) + strlen (libext) + 2); *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if ((*phandle == NULL) || (archive_name == NULL)) { ++errors; goto cleanup; } newhandle = *phandle; /* Preloaded modules are always named according to their old archive name. */ if (strncmp(name, "lib", 3) == 0) { sprintf (archive_name, "%s%s.%s", libprefix, name + 3, libext); } else { sprintf (archive_name, "%s.%s", name, libext); } if (tryall_dlopen (&newhandle, archive_name, advise, vtable) == 0) { goto register_handle; } /* If we're still here, there was no matching preloaded module, so put things back as we found them, and continue searching. */ FREE (*phandle); newhandle = NULL; } } /* If we are allowing only preloaded modules, and we didn't find anything yet, give up on the search here. */ if (advise && advise->try_preload_only) { goto cleanup; } /* Check whether we are opening a libtool module (.la extension). */ if (ext && streq (ext, archive_ext)) { /* this seems to be a libtool module */ FILE * file = 0; char * dlname = 0; char * old_name = 0; char * libdir = 0; char * deplibs = 0; /* if we can't find the installed flag, it is probably an installed libtool archive, produced with an old version of libtool */ int installed = 1; /* Now try to open the .la file. If there is no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if (!dir) { const char *search_path = user_search_path; if (search_path) file = find_file (user_search_path, base_name, &dir); if (!file) { search_path = getenv (LTDL_SEARCHPATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #if defined(LT_MODULE_PATH_VAR) if (!file) { search_path = getenv (LT_MODULE_PATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #endif #if defined(LT_DLSEARCH_PATH) if (!file && *sys_dlsearch_path) { file = find_file (sys_dlsearch_path, base_name, &dir); } #endif } else { file = fopen (attempt, LT_READTEXT_MODE); } /* If we didn't find the file by now, it really isn't there. Set the status flag, and bail out. */ if (!file) { LT__SETERROR (FILE_NOT_FOUND); ++errors; goto cleanup; } /* read the .la file */ if (parse_dotla_file(file, &dlname, &libdir, &deplibs, &old_name, &installed) != 0) ++errors; fclose (file); /* allocate the handle */ *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) ++errors; if (errors) { FREE (dlname); FREE (old_name); FREE (libdir); FREE (deplibs); FREE (*phandle); goto cleanup; } assert (*phandle); if (load_deplibs (*phandle, deplibs) == 0) { newhandle = *phandle; /* find_module may replace newhandle */ if (find_module (&newhandle, dir, libdir, dlname, old_name, installed, advise)) { unload_deplibs (*phandle); ++errors; } } else { ++errors; } FREE (dlname); FREE (old_name); FREE (libdir); FREE (deplibs); if (errors) { FREE (*phandle); goto cleanup; } if (*phandle != newhandle) { unload_deplibs (*phandle); } } else { /* not a libtool module */ *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) { ++errors; goto cleanup; } newhandle = *phandle; /* If the module has no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if ((dir || (!find_handle (user_search_path, base_name, &newhandle, advise) && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, &newhandle, advise) #if defined(LT_MODULE_PATH_VAR) && !find_handle (getenv (LT_MODULE_PATH_VAR), base_name, &newhandle, advise) #endif #if defined(LT_DLSEARCH_PATH) && !find_handle (sys_dlsearch_path, base_name, &newhandle, advise) #endif ))) { if (tryall_dlopen (&newhandle, attempt, advise, 0) != 0) { newhandle = NULL; } } if (!newhandle) { FREE (*phandle); ++errors; goto cleanup; } } register_handle: MEMREASSIGN (*phandle, newhandle); if ((*phandle)->info.ref_count == 0) { (*phandle)->info.ref_count = 1; MEMREASSIGN ((*phandle)->info.name, name); (*phandle)->next = handles; handles = *phandle; } LT__SETERRORSTR (saved_error); cleanup: FREE (dir); FREE (attempt); FREE (name); if (!canonical) /* was MEMREASSIGNed */ FREE (base_name); FREE (canonical); FREE (archive_name); return errors; } /* If the last error message stored was `FILE_NOT_FOUND', then return non-zero. */ static int file_not_found (void) { const char *error = 0; LT__GETERROR (error); if (error == LT__STRERROR (FILE_NOT_FOUND)) return 1; return 0; } /* Unless FILENAME already bears a suitable library extension, then return 0. */ static int has_library_ext (const char *filename) { const char * ext = 0; assert (filename); ext = strrchr (filename, '.'); if (ext && ((streq (ext, archive_ext)) #if defined(LT_MODULE_EXT) || (streq (ext, shlib_ext)) #endif #if defined(LT_SHARED_EXT) || (streq (ext, shared_ext)) #endif )) { return 1; } return 0; } /* Initialise and configure a user lt_dladvise opaque object. */ int lt_dladvise_init (lt_dladvise *padvise) { lt_dladvise advise = (lt_dladvise) lt__zalloc (sizeof (struct lt__advise)); *padvise = advise; return (advise ? 0 : 1); } int lt_dladvise_destroy (lt_dladvise *padvise) { if (padvise) FREE(*padvise); return 0; } int lt_dladvise_ext (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->try_ext = 1; return 0; } int lt_dladvise_resident (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_resident = 1; return 0; } int lt_dladvise_local (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_symlocal = 1; return 0; } int lt_dladvise_global (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_symglobal = 1; return 0; } int lt_dladvise_preload (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->try_preload_only = 1; return 0; } /* Libtool-1.5.x interface for loading a new module named FILENAME. */ lt_dlhandle lt_dlopen (const char *filename) { return lt_dlopenadvise (filename, NULL); } /* If FILENAME has an ARCHIVE_EXT or MODULE_EXT extension, try to open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, and if a file is still not found try again with MODULE_EXT appended instead. */ lt_dlhandle lt_dlopenext (const char *filename) { lt_dlhandle handle = 0; lt_dladvise advise; if (!lt_dladvise_init (&advise) && !lt_dladvise_ext (&advise)) handle = lt_dlopenadvise (filename, advise); lt_dladvise_destroy (&advise); return handle; } lt_dlhandle lt_dlopenadvise (const char *filename, lt_dladvise advise) { lt_dlhandle handle = 0; int errors = 0; const char * saved_error = 0; LT__GETERROR (saved_error); /* Can't have symbols hidden and visible at the same time! */ if (advise && advise->is_symlocal && advise->is_symglobal) { LT__SETERROR (CONFLICTING_FLAGS); return 0; } if (!filename || !advise || !advise->try_ext || has_library_ext (filename)) { /* Just incase we missed a code path in try_dlopen() that reports an error, but forgot to reset handle... */ if (try_dlopen (&handle, filename, NULL, advise) != 0) return 0; return handle; } else if (filename && *filename) { /* First try appending ARCHIVE_EXT. */ errors += try_dlopen (&handle, filename, archive_ext, advise); /* If we found FILENAME, stop searching -- whether we were able to load the file as a module or not. If the file exists but loading failed, it is better to return an error message here than to report FILE_NOT_FOUND when the alternatives (foo.so etc) are not in the module search path. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #if defined(LT_MODULE_EXT) /* Try appending SHLIB_EXT. */ LT__SETERRORSTR (saved_error); errors = try_dlopen (&handle, filename, shlib_ext, advise); /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #endif #if defined(LT_SHARED_EXT) /* Try appending SHARED_EXT. */ LT__SETERRORSTR (saved_error); errors = try_dlopen (&handle, filename, shared_ext, advise); /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #endif } /* Still here? Then we really did fail to locate any of the file names we tried. */ LT__SETERROR (FILE_NOT_FOUND); return 0; } static int lt_argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry) { error_t error; /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz, pargz_len, NULL, entry) failed with EINVAL. */ if (before) error = argz_insert (pargz, pargz_len, before, entry); else error = argz_append (pargz, pargz_len, entry, 1 + strlen (entry)); if (error) { switch (error) { case ENOMEM: LT__SETERROR (NO_MEMORY); break; default: LT__SETERROR (UNKNOWN); break; } return 1; } return 0; } static int lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry) { char *before = 0; assert (pargz); assert (pargz_len); assert (entry && *entry); if (*pargz) while ((before = argz_next (*pargz, *pargz_len, before))) { int cmp = strcmp (entry, before); if (cmp < 0) break; if (cmp == 0) return 0; /* No duplicates! */ } return lt_argz_insert (pargz, pargz_len, before, entry); } static int lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp) { char *buf = 0; size_t buf_len = 0; char *end = 0; size_t end_offset = 0; size_t dir_len = 0; int errors = 0; assert (pargz); assert (pargz_len); assert (dp); dir_len = LT_STRLEN (dirnam); end = dp->d_name + D_NAMLEN(dp); /* Ignore version numbers. */ { char *p; for (p = end; p -1 > dp->d_name; --p) if (strchr (".0123456789", p[-1]) == 0) break; if (*p == '.') end = p; } /* Ignore filename extension. */ { char *p; for (p = end -1; p > dp->d_name; --p) if (*p == '.') { end = p; break; } } /* Prepend the directory name. */ end_offset = end - dp->d_name; buf_len = dir_len + 1+ end_offset; buf = MALLOC (char, 1+ buf_len); if (!buf) return ++errors; assert (buf); strcpy (buf, dirnam); strcat (buf, "/"); strncat (buf, dp->d_name, end_offset); buf[buf_len] = LT_EOS_CHAR; /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) ++errors; FREE (buf); return errors; } static int list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len) { DIR *dirp = 0; int errors = 0; assert (dirnam && *dirnam); assert (pargz); assert (pargz_len); assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); dirp = opendir (dirnam); if (dirp) { struct dirent *dp = 0; while ((dp = readdir (dirp))) if (dp->d_name[0] != '.') if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) { ++errors; break; } closedir (dirp); } else ++errors; return errors; } /* If there are any files in DIRNAME, call the function passed in DATA1 (with the name of each file and DATA2 as arguments). */ static int foreachfile_callback (char *dirname, void *data1, void *data2) { file_worker_func *func = *(file_worker_func **) data1; int is_done = 0; char *argz = 0; size_t argz_len = 0; if (list_files_by_dir (dirname, &argz, &argz_len) != 0) goto cleanup; if (!argz) goto cleanup; { char *filename = 0; while ((filename = argz_next (argz, argz_len, filename))) if ((is_done = (*func) (filename, data2))) break; } cleanup: FREE (argz); return is_done; } /* Call FUNC for each unique extensionless file in SEARCH_PATH, along with DATA. The filenames passed to FUNC would be suitable for passing to lt_dlopenext. The extensions are stripped so that individual modules do not generate several entries (e.g. libfoo.la, libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, then the same directories that lt_dlopen would search are examined. */ int lt_dlforeachfile (const char *search_path, int (*func) (const char *filename, void *data), void *data) { int is_done = 0; file_worker_func **fpptr = &func; if (search_path) { /* If a specific path was passed, search only the directories listed in it. */ is_done = foreach_dirinpath (search_path, 0, foreachfile_callback, fpptr, data); } else { /* Otherwise search the default paths. */ is_done = foreach_dirinpath (user_search_path, 0, foreachfile_callback, fpptr, data); if (!is_done) { is_done = foreach_dirinpath (getenv(LTDL_SEARCHPATH_VAR), 0, foreachfile_callback, fpptr, data); } #if defined(LT_MODULE_PATH_VAR) if (!is_done) { is_done = foreach_dirinpath (getenv(LT_MODULE_PATH_VAR), 0, foreachfile_callback, fpptr, data); } #endif #if defined(LT_DLSEARCH_PATH) if (!is_done && *sys_dlsearch_path) { is_done = foreach_dirinpath (sys_dlsearch_path, 0, foreachfile_callback, fpptr, data); } #endif } return is_done; } int lt_dlclose (lt_dlhandle handle) { lt_dlhandle cur, last; int errors = 0; /* check whether the handle is valid */ last = cur = handles; while (cur && handle != cur) { last = cur; cur = cur->next; } if (!cur) { LT__SETERROR (INVALID_HANDLE); ++errors; goto done; } cur = handle; cur->info.ref_count--; /* Note that even with resident modules, we must track the ref_count correctly incase the user decides to reset the residency flag later (even though the API makes no provision for that at the moment). */ if (cur->info.ref_count <= 0 && !LT_DLIS_RESIDENT (cur)) { lt_user_data data = cur->vtable->dlloader_data; if (cur != handles) { last->next = cur->next; } else { handles = cur->next; } errors += cur->vtable->module_close (data, cur->module); errors += unload_deplibs (handle); /* It is up to the callers to free the data itself. */ FREE (cur->interface_data); FREE (cur->info.filename); FREE (cur->info.name); FREE (cur); goto done; } if (LT_DLIS_RESIDENT (handle)) { LT__SETERROR (CLOSE_RESIDENT_MODULE); ++errors; } done: return errors; } void * lt_dlsym (lt_dlhandle place, const char *symbol) { size_t lensym; char lsym[LT_SYMBOL_LENGTH]; char *sym; void *address; lt_user_data data; lt_dlhandle handle; if (!place) { LT__SETERROR (INVALID_HANDLE); return 0; } handle = place; if (!symbol) { LT__SETERROR (SYMBOL_NOT_FOUND); return 0; } lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->vtable->sym_prefix) + LT_STRLEN (handle->info.name); if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) { sym = lsym; } else { sym = MALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); if (!sym) { LT__SETERROR (BUFFER_OVERFLOW); return 0; } } data = handle->vtable->dlloader_data; if (handle->info.name) { const char *saved_error; LT__GETERROR (saved_error); /* this is a libtool module */ if (handle->vtable->sym_prefix) { strcpy(sym, handle->vtable->sym_prefix); strcat(sym, handle->info.name); } else { strcpy(sym, handle->info.name); } strcat(sym, "_LTX_"); strcat(sym, symbol); /* try "modulename_LTX_symbol" */ address = handle->vtable->find_sym (data, handle->module, sym); if (address) { if (sym != lsym) { FREE (sym); } return address; } LT__SETERRORSTR (saved_error); } /* otherwise try "symbol" */ if (handle->vtable->sym_prefix) { strcpy(sym, handle->vtable->sym_prefix); strcat(sym, symbol); } else { strcpy(sym, symbol); } address = handle->vtable->find_sym (data, handle->module, sym); if (sym != lsym) { FREE (sym); } return address; } const char * lt_dlerror (void) { const char *error; LT__GETERROR (error); LT__SETERRORSTR (0); return error; } static int lt_dlpath_insertdir (char **ppath, char *before, const char *dir) { int errors = 0; char *canonical = 0; char *argz = 0; size_t argz_len = 0; assert (ppath); assert (dir && *dir); if (canonicalize_path (dir, &canonical) != 0) { ++errors; goto cleanup; } assert (canonical && *canonical); /* If *PPATH is empty, set it to DIR. */ if (*ppath == 0) { assert (!before); /* BEFORE cannot be set without PPATH. */ assert (dir); /* Without DIR, don't call this function! */ *ppath = lt__strdup (dir); if (*ppath == 0) ++errors; goto cleanup; } assert (ppath && *ppath); if (argzize_path (*ppath, &argz, &argz_len) != 0) { ++errors; goto cleanup; } /* Convert BEFORE into an equivalent offset into ARGZ. This only works if *PPATH is already canonicalized, and hence does not change length with respect to ARGZ. We canonicalize each entry as it is added to the search path, and don't call this function with (uncanonicalized) user paths, so this is a fair assumption. */ if (before) { assert (*ppath <= before); assert ((int) (before - *ppath) <= (int) strlen (*ppath)); before = before - *ppath + argz; } if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) { ++errors; goto cleanup; } argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); MEMREASSIGN(*ppath, argz); cleanup: FREE (argz); FREE (canonical); return errors; } int lt_dladdsearchdir (const char *search_dir) { int errors = 0; if (search_dir && *search_dir) { if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) ++errors; } return errors; } int lt_dlinsertsearchdir (const char *before, const char *search_dir) { int errors = 0; if (before) { if ((before < user_search_path) || (before >= user_search_path + LT_STRLEN (user_search_path))) { LT__SETERROR (INVALID_POSITION); return 1; } } if (search_dir && *search_dir) { if (lt_dlpath_insertdir (&user_search_path, (char *) before, search_dir) != 0) { ++errors; } } return errors; } int lt_dlsetsearchpath (const char *search_path) { int errors = 0; FREE (user_search_path); if (!search_path || !LT_STRLEN (search_path)) { return errors; } if (canonicalize_path (search_path, &user_search_path) != 0) ++errors; return errors; } const char * lt_dlgetsearchpath (void) { const char *saved_path; saved_path = user_search_path; return saved_path; } int lt_dlmakeresident (lt_dlhandle handle) { int errors = 0; if (!handle) { LT__SETERROR (INVALID_HANDLE); ++errors; } else { handle->info.is_resident = 1; } return errors; } int lt_dlisresident (lt_dlhandle handle) { if (!handle) { LT__SETERROR (INVALID_HANDLE); return -1; } return LT_DLIS_RESIDENT (handle); } /* --- MODULE INFORMATION --- */ typedef struct { const char *id_string; lt_dlhandle_interface *iface; } lt__interface_id; lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface) { lt__interface_id *interface_id = (lt__interface_id *) lt__malloc (sizeof *interface_id); /* If lt__malloc fails, it will LT__SETERROR (NO_MEMORY), which can then be detected with lt_dlerror() if we return 0. */ if (interface_id) { interface_id->id_string = lt__strdup (id_string); if (!interface_id->id_string) FREE (interface_id); else interface_id->iface = iface; } return (lt_dlinterface_id) interface_id; } void lt_dlinterface_free (lt_dlinterface_id key) { lt__interface_id *interface_id = (lt__interface_id *)key; FREE (interface_id->id_string); FREE (interface_id); } void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data) { int n_elements = 0; void *stale = (void *) 0; lt_dlhandle cur = handle; int i; if (cur->interface_data) while (cur->interface_data[n_elements].key) ++n_elements; for (i = 0; i < n_elements; ++i) { if (cur->interface_data[i].key == key) { stale = cur->interface_data[i].data; break; } } /* Ensure that there is enough room in this handle's interface_data array to accept a new element (and an empty end marker). */ if (i == n_elements) { lt_interface_data *temp = REALLOC (lt_interface_data, cur->interface_data, 2+ n_elements); if (!temp) { stale = 0; goto done; } cur->interface_data = temp; /* We only need this if we needed to allocate a new interface_data. */ cur->interface_data[i].key = key; cur->interface_data[1+ i].key = 0; } cur->interface_data[i].data = data; done: return stale; } void * lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle) { void *result = (void *) 0; lt_dlhandle cur = handle; /* Locate the index of the element with a matching KEY. */ if (cur->interface_data) { int i; for (i = 0; cur->interface_data[i].key; ++i) { if (cur->interface_data[i].key == key) { result = cur->interface_data[i].data; break; } } } return result; } const lt_dlinfo * lt_dlgetinfo (lt_dlhandle handle) { if (!handle) { LT__SETERROR (INVALID_HANDLE); return 0; } return &(handle->info); } lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place) { lt_dlhandle handle = place; lt__interface_id *iterator = (lt__interface_id *) iface; assert (iface); /* iface is a required argument */ if (!handle) handle = handles; else handle = handle->next; /* advance while the interface check fails */ while (handle && iterator->iface && ((*iterator->iface) (handle, iterator->id_string) != 0)) { handle = handle->next; } return handle; } lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name) { lt_dlhandle handle = 0; assert (iface); /* iface is a required argument */ while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; if (cur && cur->info.name && streq (cur->info.name, module_name)) break; } return handle; } int lt_dlhandle_map (lt_dlinterface_id iface, int (*func) (lt_dlhandle handle, void *data), void *data) { lt__interface_id *iterator = (lt__interface_id *) iface; lt_dlhandle cur = handles; assert (iface); /* iface is a required argument */ while (cur) { int errorcode = 0; /* advance while the interface check fails */ while (cur && iterator->iface && ((*iterator->iface) (cur, iterator->id_string) != 0)) { cur = cur->next; } if ((errorcode = (*func) (cur, data)) != 0) return errorcode; } return 0; } redland-1.0.17/libltdl/Makefile.am0000644000175000017500000001210012155164573013617 00000000000000## Makefile.am -- Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. ## Written by Gary V. Vaughan, 2003 ## ## NOTE: The canonical source of this file is maintained with the ## GNU Libtool package. Report bugs to bug-libtool@gnu.org. ## ## GNU Libltdl is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (at your option) any later version. ## ## As a special exception to the GNU Lesser General Public License, ## if you distribute this file as part of a program or library that ## is built using GNU libtool, you may include this file under the ## same distribution terms that you use for the rest of that program. ## ## GNU Libltdl is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU Lesser General Public License for more details. ## ## You should have received a copy of the GNU LesserGeneral Public ## License along with GNU Libltdl; see the file COPYING.LIB. If not, a ## copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, ## or obtained by writing to the Free Software Foundation, Inc., ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ##### ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign AM_CPPFLAGS = AM_LDFLAGS = BUILT_SOURCES = include_HEADERS = noinst_LTLIBRARIES = lib_LTLIBRARIES = EXTRA_LTLIBRARIES = EXTRA_DIST = CLEANFILES = MOSTLYCLEANFILES = # -I$(srcdir) is needed for user that built libltdl with a sub-Automake # (not as a sub-package!) using 'nostdinc': AM_CPPFLAGS += -DLT_CONFIG_H='<$(LT_CONFIG_H)>' \ -DLTDL -I. -I$(srcdir) -Ilibltdl \ -I$(srcdir)/libltdl -I$(srcdir)/libltdl AM_LDFLAGS += -no-undefined LTDL_VERSION_INFO = -version-info 10:0:3 noinst_LTLIBRARIES += $(LT_DLLOADERS) if INSTALL_LTDL ltdlincludedir = $(includedir)/libltdl ltdlinclude_HEADERS = libltdl/lt_system.h \ libltdl/lt_error.h \ libltdl/lt_dlloader.h include_HEADERS += ltdl.h lib_LTLIBRARIES += libltdl.la endif if CONVENIENCE_LTDL noinst_LTLIBRARIES += libltdlc.la endif libltdl_la_SOURCES = libltdl/lt__alloc.h \ libltdl/lt__dirent.h \ libltdl/lt__glibc.h \ libltdl/lt__private.h \ libltdl/lt__strl.h \ libltdl/lt_dlloader.h \ libltdl/lt_error.h \ libltdl/lt_system.h \ libltdl/slist.h \ loaders/preopen.c \ lt__alloc.c \ lt_dlloader.c \ lt_error.c \ ltdl.c \ ltdl.h \ slist.c EXTRA_DIST += lt__dirent.c \ lt__strl.c libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(LTLIBOBJS) libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) libltdlc_la_DEPENDENCIES= $(libltdl_la_DEPENDENCIES) ## The loaders are preopened by libltdl, itself always built from ## pic-objects (either as a shared library, or a convenience library), ## so the loaders themselves must be made from pic-objects too. We ## use convenience libraries for that purpose: EXTRA_LTLIBRARIES += dlopen.la \ dld_link.la \ dyld.la \ load_add_on.la \ loadlibrary.la \ shl_load.la dlopen_la_SOURCES = loaders/dlopen.c dlopen_la_LDFLAGS = -module -avoid-version dlopen_la_LIBADD = $(LIBADD_DLOPEN) dld_link_la_SOURCES = loaders/dld_link.c dld_link_la_LDFLAGS = -module -avoid-version dld_link_la_LIBADD = -ldld dyld_la_SOURCES = loaders/dyld.c dyld_la_LDFLAGS = -module -avoid-version load_add_on_la_SOURCES = loaders/load_add_on.c load_add_on_la_LDFLAGS = -module -avoid-version loadlibrary_la_SOURCES = loaders/loadlibrary.c loadlibrary_la_LDFLAGS = -module -avoid-version shl_load_la_SOURCES = loaders/shl_load.c shl_load_la_LDFLAGS = -module -avoid-version shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) ## Make sure these will be cleaned even when they're not built by default: CLEANFILES += libltdl.la \ libltdlc.la \ libdlloader.la ## Automake-1.9.6 doesn't clean subdir AC_LIBOBJ compiled objects ## automatically: CLEANFILES += $(LIBOBJS) $(LTLIBOBJS) EXTRA_DIST += COPYING.LIB \ configure.ac \ Makefile.am \ aclocal.m4 \ Makefile.in \ configure \ config-h.in \ README ## --------------------------- ## ## Gnulib Makefile.am snippets ## ## --------------------------- ## BUILT_SOURCES += $(ARGZ_H) EXTRA_DIST += argz_.h \ argz.c # We need the following in order to create an when the system # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): $(ARGZ_H) argz.h: argz_.h $(mkinstalldirs) . cp $(srcdir)/argz_.h $@-t mv $@-t $@ MOSTLYCLEANFILES += argz.h \ argz.h-t redland-1.0.17/libltdl/COPYING.LIB0000644000175000017500000006365612155164573013251 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. ^L Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. ^L GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. ^L Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. ^L 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. ^L 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. ^L 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. ^L 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS ^L How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! redland-1.0.17/libltdl/Makefile.in0000644000175000017500000014715212155164573013650 00000000000000# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ##### VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_LTDL_TRUE@am__append_1 = ltdl.h @INSTALL_LTDL_TRUE@am__append_2 = libltdl.la @CONVENIENCE_LTDL_TRUE@am__append_3 = libltdlc.la subdir = . DIST_COMMON = README $(am__configure_deps) $(am__include_HEADERS_DIST) \ $(am__ltdlinclude_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config-h.in \ $(top_srcdir)/configure COPYING.LIB argz.c config/compile \ config/config.guess config/config.sub config/depcomp \ config/install-sh config/ltmain.sh \ config/missing lt__dirent.c lt__strl.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" \ "$(DESTDIR)$(ltdlincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) dld_link_la_DEPENDENCIES = am_dld_link_la_OBJECTS = dld_link.lo dld_link_la_OBJECTS = $(am_dld_link_la_OBJECTS) dld_link_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dld_link_la_LDFLAGS) $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = dlopen_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_dlopen_la_OBJECTS = dlopen.lo dlopen_la_OBJECTS = $(am_dlopen_la_OBJECTS) dlopen_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dlopen_la_LDFLAGS) $(LDFLAGS) -o $@ dyld_la_LIBADD = am_dyld_la_OBJECTS = dyld.lo dyld_la_OBJECTS = $(am_dyld_la_OBJECTS) dyld_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(dyld_la_LDFLAGS) \ $(LDFLAGS) -o $@ am_libltdl_la_OBJECTS = libltdl_la-preopen.lo libltdl_la-lt__alloc.lo \ libltdl_la-lt_dlloader.lo libltdl_la-lt_error.lo \ libltdl_la-ltdl.lo libltdl_la-slist.lo libltdl_la_OBJECTS = $(am_libltdl_la_OBJECTS) libltdl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdl_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_LTDL_TRUE@am_libltdl_la_rpath = -rpath $(libdir) am__objects_1 = libltdlc_la-preopen.lo libltdlc_la-lt__alloc.lo \ libltdlc_la-lt_dlloader.lo libltdlc_la-lt_error.lo \ libltdlc_la-ltdl.lo libltdlc_la-slist.lo am_libltdlc_la_OBJECTS = $(am__objects_1) libltdlc_la_OBJECTS = $(am_libltdlc_la_OBJECTS) libltdlc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdlc_la_LDFLAGS) $(LDFLAGS) -o $@ @CONVENIENCE_LTDL_TRUE@am_libltdlc_la_rpath = load_add_on_la_LIBADD = am_load_add_on_la_OBJECTS = load_add_on.lo load_add_on_la_OBJECTS = $(am_load_add_on_la_OBJECTS) load_add_on_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(load_add_on_la_LDFLAGS) $(LDFLAGS) -o $@ loadlibrary_la_LIBADD = am_loadlibrary_la_OBJECTS = loadlibrary.lo loadlibrary_la_OBJECTS = $(am_loadlibrary_la_OBJECTS) loadlibrary_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(loadlibrary_la_LDFLAGS) $(LDFLAGS) -o $@ shl_load_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_shl_load_la_OBJECTS = shl_load.lo shl_load_la_OBJECTS = $(am_shl_load_la_OBJECTS) shl_load_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(shl_load_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \ $(dyld_la_SOURCES) $(libltdl_la_SOURCES) \ $(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \ $(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES) DIST_SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \ $(dyld_la_SOURCES) $(libltdl_la_SOURCES) \ $(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \ $(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__include_HEADERS_DIST = ltdl.h am__ltdlinclude_HEADERS_DIST = libltdl/lt_system.h libltdl/lt_error.h \ libltdl/lt_dlloader.h HEADERS = $(include_HEADERS) $(ltdlinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign # -I$(srcdir) is needed for user that built libltdl with a sub-Automake # (not as a sub-package!) using 'nostdinc': AM_CPPFLAGS = -DLT_CONFIG_H='<$(LT_CONFIG_H)>' -DLTDL -I. -I$(srcdir) \ -Ilibltdl -I$(srcdir)/libltdl -I$(srcdir)/libltdl AM_LDFLAGS = -no-undefined BUILT_SOURCES = $(ARGZ_H) include_HEADERS = $(am__append_1) noinst_LTLIBRARIES = $(LT_DLLOADERS) $(am__append_3) lib_LTLIBRARIES = $(am__append_2) EXTRA_LTLIBRARIES = dlopen.la dld_link.la dyld.la load_add_on.la \ loadlibrary.la shl_load.la EXTRA_DIST = lt__dirent.c lt__strl.c COPYING.LIB configure.ac \ Makefile.am aclocal.m4 Makefile.in configure config-h.in \ README argz_.h argz.c CLEANFILES = libltdl.la libltdlc.la libdlloader.la $(LIBOBJS) \ $(LTLIBOBJS) MOSTLYCLEANFILES = argz.h argz.h-t LTDL_VERSION_INFO = -version-info 10:0:3 @INSTALL_LTDL_TRUE@ltdlincludedir = $(includedir)/libltdl @INSTALL_LTDL_TRUE@ltdlinclude_HEADERS = libltdl/lt_system.h \ @INSTALL_LTDL_TRUE@ libltdl/lt_error.h \ @INSTALL_LTDL_TRUE@ libltdl/lt_dlloader.h libltdl_la_SOURCES = libltdl/lt__alloc.h \ libltdl/lt__dirent.h \ libltdl/lt__glibc.h \ libltdl/lt__private.h \ libltdl/lt__strl.h \ libltdl/lt_dlloader.h \ libltdl/lt_error.h \ libltdl/lt_system.h \ libltdl/slist.h \ loaders/preopen.c \ lt__alloc.c \ lt_dlloader.c \ lt_error.c \ ltdl.c \ ltdl.h \ slist.c libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(LTLIBOBJS) libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) libltdlc_la_DEPENDENCIES = $(libltdl_la_DEPENDENCIES) dlopen_la_SOURCES = loaders/dlopen.c dlopen_la_LDFLAGS = -module -avoid-version dlopen_la_LIBADD = $(LIBADD_DLOPEN) dld_link_la_SOURCES = loaders/dld_link.c dld_link_la_LDFLAGS = -module -avoid-version dld_link_la_LIBADD = -ldld dyld_la_SOURCES = loaders/dyld.c dyld_la_LDFLAGS = -module -avoid-version load_add_on_la_SOURCES = loaders/load_add_on.c load_add_on_la_LDFLAGS = -module -avoid-version loadlibrary_la_SOURCES = loaders/loadlibrary.c loadlibrary_la_LDFLAGS = -module -avoid-version shl_load_la_SOURCES = loaders/shl_load.c shl_load_la_LDFLAGS = -module -avoid-version shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config-h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config-h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done dld_link.la: $(dld_link_la_OBJECTS) $(dld_link_la_DEPENDENCIES) $(EXTRA_dld_link_la_DEPENDENCIES) $(dld_link_la_LINK) $(dld_link_la_OBJECTS) $(dld_link_la_LIBADD) $(LIBS) dlopen.la: $(dlopen_la_OBJECTS) $(dlopen_la_DEPENDENCIES) $(EXTRA_dlopen_la_DEPENDENCIES) $(dlopen_la_LINK) $(dlopen_la_OBJECTS) $(dlopen_la_LIBADD) $(LIBS) dyld.la: $(dyld_la_OBJECTS) $(dyld_la_DEPENDENCIES) $(EXTRA_dyld_la_DEPENDENCIES) $(dyld_la_LINK) $(dyld_la_OBJECTS) $(dyld_la_LIBADD) $(LIBS) libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES) $(EXTRA_libltdl_la_DEPENDENCIES) $(libltdl_la_LINK) $(am_libltdl_la_rpath) $(libltdl_la_OBJECTS) $(libltdl_la_LIBADD) $(LIBS) libltdlc.la: $(libltdlc_la_OBJECTS) $(libltdlc_la_DEPENDENCIES) $(EXTRA_libltdlc_la_DEPENDENCIES) $(libltdlc_la_LINK) $(am_libltdlc_la_rpath) $(libltdlc_la_OBJECTS) $(libltdlc_la_LIBADD) $(LIBS) load_add_on.la: $(load_add_on_la_OBJECTS) $(load_add_on_la_DEPENDENCIES) $(EXTRA_load_add_on_la_DEPENDENCIES) $(load_add_on_la_LINK) $(load_add_on_la_OBJECTS) $(load_add_on_la_LIBADD) $(LIBS) loadlibrary.la: $(loadlibrary_la_OBJECTS) $(loadlibrary_la_DEPENDENCIES) $(EXTRA_loadlibrary_la_DEPENDENCIES) $(loadlibrary_la_LINK) $(loadlibrary_la_OBJECTS) $(loadlibrary_la_LIBADD) $(LIBS) shl_load.la: $(shl_load_la_OBJECTS) $(shl_load_la_DEPENDENCIES) $(EXTRA_shl_load_la_DEPENDENCIES) $(shl_load_la_LINK) $(shl_load_la_OBJECTS) $(shl_load_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/argz.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lt__dirent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lt__strl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dld_link.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dyld.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt__alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt_dlloader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-ltdl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-preopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-slist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt__alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt_dlloader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-ltdl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-preopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-slist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_add_on.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadlibrary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shl_load.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< dld_link.lo: loaders/dld_link.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dld_link.lo -MD -MP -MF $(DEPDIR)/dld_link.Tpo -c -o dld_link.lo `test -f 'loaders/dld_link.c' || echo '$(srcdir)/'`loaders/dld_link.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dld_link.Tpo $(DEPDIR)/dld_link.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/dld_link.c' object='dld_link.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dld_link.lo `test -f 'loaders/dld_link.c' || echo '$(srcdir)/'`loaders/dld_link.c dlopen.lo: loaders/dlopen.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dlopen.lo -MD -MP -MF $(DEPDIR)/dlopen.Tpo -c -o dlopen.lo `test -f 'loaders/dlopen.c' || echo '$(srcdir)/'`loaders/dlopen.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dlopen.Tpo $(DEPDIR)/dlopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/dlopen.c' object='dlopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dlopen.lo `test -f 'loaders/dlopen.c' || echo '$(srcdir)/'`loaders/dlopen.c dyld.lo: loaders/dyld.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dyld.lo -MD -MP -MF $(DEPDIR)/dyld.Tpo -c -o dyld.lo `test -f 'loaders/dyld.c' || echo '$(srcdir)/'`loaders/dyld.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dyld.Tpo $(DEPDIR)/dyld.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/dyld.c' object='dyld.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dyld.lo `test -f 'loaders/dyld.c' || echo '$(srcdir)/'`loaders/dyld.c libltdl_la-preopen.lo: loaders/preopen.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-preopen.lo -MD -MP -MF $(DEPDIR)/libltdl_la-preopen.Tpo -c -o libltdl_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-preopen.Tpo $(DEPDIR)/libltdl_la-preopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/preopen.c' object='libltdl_la-preopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c libltdl_la-lt__alloc.lo: lt__alloc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt__alloc.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt__alloc.Tpo -c -o libltdl_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-lt__alloc.Tpo $(DEPDIR)/libltdl_la-lt__alloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt__alloc.c' object='libltdl_la-lt__alloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c libltdl_la-lt_dlloader.lo: lt_dlloader.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt_dlloader.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt_dlloader.Tpo -c -o libltdl_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-lt_dlloader.Tpo $(DEPDIR)/libltdl_la-lt_dlloader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_dlloader.c' object='libltdl_la-lt_dlloader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c libltdl_la-lt_error.lo: lt_error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt_error.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt_error.Tpo -c -o libltdl_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-lt_error.Tpo $(DEPDIR)/libltdl_la-lt_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_error.c' object='libltdl_la-lt_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c libltdl_la-ltdl.lo: ltdl.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-ltdl.lo -MD -MP -MF $(DEPDIR)/libltdl_la-ltdl.Tpo -c -o libltdl_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-ltdl.Tpo $(DEPDIR)/libltdl_la-ltdl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ltdl.c' object='libltdl_la-ltdl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c libltdl_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-slist.lo -MD -MP -MF $(DEPDIR)/libltdl_la-slist.Tpo -c -o libltdl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-slist.Tpo $(DEPDIR)/libltdl_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slist.c' object='libltdl_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c libltdlc_la-preopen.lo: loaders/preopen.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-preopen.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-preopen.Tpo -c -o libltdlc_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-preopen.Tpo $(DEPDIR)/libltdlc_la-preopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/preopen.c' object='libltdlc_la-preopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c libltdlc_la-lt__alloc.lo: lt__alloc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt__alloc.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt__alloc.Tpo -c -o libltdlc_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-lt__alloc.Tpo $(DEPDIR)/libltdlc_la-lt__alloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt__alloc.c' object='libltdlc_la-lt__alloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c libltdlc_la-lt_dlloader.lo: lt_dlloader.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt_dlloader.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt_dlloader.Tpo -c -o libltdlc_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-lt_dlloader.Tpo $(DEPDIR)/libltdlc_la-lt_dlloader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_dlloader.c' object='libltdlc_la-lt_dlloader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c libltdlc_la-lt_error.lo: lt_error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt_error.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt_error.Tpo -c -o libltdlc_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-lt_error.Tpo $(DEPDIR)/libltdlc_la-lt_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_error.c' object='libltdlc_la-lt_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c libltdlc_la-ltdl.lo: ltdl.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-ltdl.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-ltdl.Tpo -c -o libltdlc_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-ltdl.Tpo $(DEPDIR)/libltdlc_la-ltdl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ltdl.c' object='libltdlc_la-ltdl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c libltdlc_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-slist.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-slist.Tpo -c -o libltdlc_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-slist.Tpo $(DEPDIR)/libltdlc_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slist.c' object='libltdlc_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c load_add_on.lo: loaders/load_add_on.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT load_add_on.lo -MD -MP -MF $(DEPDIR)/load_add_on.Tpo -c -o load_add_on.lo `test -f 'loaders/load_add_on.c' || echo '$(srcdir)/'`loaders/load_add_on.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/load_add_on.Tpo $(DEPDIR)/load_add_on.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/load_add_on.c' object='load_add_on.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o load_add_on.lo `test -f 'loaders/load_add_on.c' || echo '$(srcdir)/'`loaders/load_add_on.c loadlibrary.lo: loaders/loadlibrary.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT loadlibrary.lo -MD -MP -MF $(DEPDIR)/loadlibrary.Tpo -c -o loadlibrary.lo `test -f 'loaders/loadlibrary.c' || echo '$(srcdir)/'`loaders/loadlibrary.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/loadlibrary.Tpo $(DEPDIR)/loadlibrary.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/loadlibrary.c' object='loadlibrary.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o loadlibrary.lo `test -f 'loaders/loadlibrary.c' || echo '$(srcdir)/'`loaders/loadlibrary.c shl_load.lo: loaders/shl_load.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shl_load.lo -MD -MP -MF $(DEPDIR)/shl_load.Tpo -c -o shl_load.lo `test -f 'loaders/shl_load.c' || echo '$(srcdir)/'`loaders/shl_load.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/shl_load.Tpo $(DEPDIR)/shl_load.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/shl_load.c' object='shl_load.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shl_load.lo `test -f 'loaders/shl_load.c' || echo '$(srcdir)/'`loaders/shl_load.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-ltdlincludeHEADERS: $(ltdlinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ltdlincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ltdlincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(ltdlincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(ltdlincludedir)" || exit $$?; \ done uninstall-ltdlincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ltdlincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(ltdlincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-ltdlincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-ltdlincludeHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES ctags dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-ltdlincludeHEADERS install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-ltdlincludeHEADERS # We need the following in order to create an when the system # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): $(ARGZ_H) argz.h: argz_.h $(mkinstalldirs) . cp $(srcdir)/argz_.h $@-t mv $@-t $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: redland-1.0.17/libltdl/lt_dlloader.c0000644000175000017500000001367412155164573014235 00000000000000/* lt_dlloader.c -- dynamic library loader interface Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" #define RETURN_SUCCESS 0 #define RETURN_FAILURE 1 static void * loader_callback (SList *item, void *userdata); /* A list of all the dlloaders we know about, each stored as a boxed SList item: */ static SList *loaders = 0; /* Return NULL, unless the loader in this ITEM has a matching name, in which case we return the matching item so that its address is passed back out (for possible freeing) by slist_remove. */ static void * loader_callback (SList *item, void *userdata) { const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata; const char * name = (const char *) userdata; assert (vtable); return streq (vtable->name, name) ? (void *) item : NULL; } /* Hook VTABLE into our global LOADERS list according to its own PRIORITY field value. */ int lt_dlloader_add (const lt_dlvtable *vtable) { SList *item; if ((vtable == 0) /* diagnose invalid vtable fields */ || (vtable->module_open == 0) || (vtable->module_close == 0) || (vtable->find_sym == 0) || ((vtable->priority != LT_DLLOADER_PREPEND) && (vtable->priority != LT_DLLOADER_APPEND))) { LT__SETERROR (INVALID_LOADER); return RETURN_FAILURE; } item = slist_box (vtable); if (!item) { (*lt__alloc_die) (); /* Let the caller know something went wrong if lt__alloc_die doesn't abort. */ return RETURN_FAILURE; } if (vtable->priority == LT_DLLOADER_PREPEND) { loaders = slist_cons (item, loaders); } else { assert (vtable->priority == LT_DLLOADER_APPEND); loaders = slist_concat (loaders, item); } return RETURN_SUCCESS; } #ifdef LT_DEBUG_LOADERS static void * loader_dump_callback (SList *item, void *userdata) { const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata; fprintf (stderr, ", %s", (vtable && vtable->name) ? vtable->name : "(null)"); return 0; } void lt_dlloader_dump (void) { fprintf (stderr, "loaders: "); if (!loaders) { fprintf (stderr, "(empty)"); } else { const lt_dlvtable *head = (const lt_dlvtable *) loaders->userdata; fprintf (stderr, "%s", (head && head->name) ? head->name : "(null)"); if (slist_tail (loaders)) slist_foreach (slist_tail (loaders), loader_dump_callback, NULL); } fprintf (stderr, "\n"); } #endif /* An iterator for the global loader list: if LOADER is NULL, then return the first element, otherwise the following element. */ lt_dlloader lt_dlloader_next (lt_dlloader loader) { SList *item = (SList *) loader; return (lt_dlloader) (item ? item->next : loaders); } /* Non-destructive unboxing of a loader. */ const lt_dlvtable * lt_dlloader_get (lt_dlloader loader) { return (const lt_dlvtable *) (loader ? ((SList *) loader)->userdata : NULL); } /* Return the contents of the first item in the global loader list with a matching NAME after removing it from that list. If there was no match, return NULL; if there is an error, return NULL and set an error for lt_dlerror; do not set an error if only resident modules need this loader; in either case, the loader list is not changed if NULL is returned. */ lt_dlvtable * lt_dlloader_remove (const char *name) { const lt_dlvtable * vtable = lt_dlloader_find (name); static const char id_string[] = "lt_dlloader_remove"; lt_dlinterface_id iface; lt_dlhandle handle = 0; int in_use = 0; int in_use_by_resident = 0; if (!vtable) { LT__SETERROR (INVALID_LOADER); return 0; } /* Fail if there are any open modules which use this loader. */ iface = lt_dlinterface_register (id_string, NULL); while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; if (cur->vtable == vtable) { in_use = 1; if (lt_dlisresident (handle)) in_use_by_resident = 1; } } lt_dlinterface_free (iface); if (in_use) { if (!in_use_by_resident) LT__SETERROR (REMOVE_LOADER); return 0; } /* Call the loader finalisation function. */ if (vtable && vtable->dlloader_exit) { if ((*vtable->dlloader_exit) (vtable->dlloader_data) != 0) { /* If there is an exit function, and it returns non-zero then it must set an error, and we will not remove it from the list. */ return 0; } } /* If we got this far, remove the loader from our global list. */ return (lt_dlvtable *) slist_unbox ((SList *) slist_remove (&loaders, loader_callback, (void *) name)); } const lt_dlvtable * lt_dlloader_find (const char *name) { return lt_dlloader_get (slist_find (loaders, loader_callback, (void *) name)); } redland-1.0.17/libltdl/loaders/0000755000175000017500000000000012257576340013304 500000000000000redland-1.0.17/libltdl/loaders/load_add_on.c0000644000175000017500000001130412155164573015610 00000000000000/* loader-load_add_on.c -- dynamic linking for BeOS Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable load_add_on_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_load_add_on"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #include /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { image_id image = 0; if (filename) { image = load_add_on (filename); } else { image_info info; int32 cookie = 0; if (get_next_image_info (0, &cookie, &info) == B_OK) image = load_add_on (info.name); } if (image <= 0) { LT__SETERROR (CANNOT_OPEN); image = 0; } return (lt_module) image; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (unload_add_on ((image_id) module) != B_OK) { LT__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = 0; image_id image = (image_id) module; if (get_image_symbol (image, name, B_SYMBOL_TYPE_ANY, address) != B_OK) { LT__SETERROR (SYMBOL_NOT_FOUND); address = 0; } return address; } redland-1.0.17/libltdl/loaders/loadlibrary.c0000644000175000017500000002517312155164573015702 00000000000000/* loader-loadlibrary.c -- dynamic linking for Win32 Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" #if defined(__CYGWIN__) # include #endif /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable loadlibrary_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlinterface_id iface_id = 0; static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); iface_id = lt_dlinterface_register ("ltdl loadlibrary", NULL); } if (vtable && !vtable->name) { vtable->name = "lt_loadlibrary"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #include #define LOCALFREE(mem) LT_STMT_START { \ if (mem) { LocalFree ((void *)mem); mem = NULL; } } LT_STMT_END #define LOADLIB__SETERROR(errmsg) LT__SETERRORSTR (loadlibraryerror (errmsg)) #define LOADLIB_SETERROR(errcode) LOADLIB__SETERROR (LT__STRERROR (errcode)) static const char *loadlibraryerror (const char *default_errmsg); static DWORD WINAPI wrap_getthreaderrormode (void); static DWORD WINAPI fallback_getthreaderrormode (void); static BOOL WINAPI wrap_setthreaderrormode (DWORD mode, DWORD *oldmode); static BOOL WINAPI fallback_setthreaderrormode (DWORD mode, DWORD *oldmode); typedef DWORD (WINAPI getthreaderrormode_type) (void); typedef BOOL (WINAPI setthreaderrormode_type) (DWORD, DWORD *); static getthreaderrormode_type *getthreaderrormode = wrap_getthreaderrormode; static setthreaderrormode_type *setthreaderrormode = wrap_setthreaderrormode; static char *error_message = 0; /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; LOCALFREE (error_message); return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { lt_module module = 0; char *ext; char wpath[MAX_PATH]; size_t len; if (!filename) { /* Get the name of main module */ *wpath = 0; GetModuleFileName (NULL, wpath, sizeof (wpath)); filename = wpath; } else { len = LT_STRLEN (filename); if (len >= MAX_PATH) { LT__SETERROR (CANNOT_OPEN); return 0; } #if HAVE_DECL_CYGWIN_CONV_PATH if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, filename, wpath, MAX_PATH)) { LT__SETERROR (CANNOT_OPEN); return 0; } len = 0; #elif defined(__CYGWIN__) cygwin_conv_to_full_win32_path (filename, wpath); len = 0; #else strcpy(wpath, filename); #endif ext = strrchr (wpath, '.'); if (!ext) { /* Append a `.' to stop Windows from adding an implicit `.dll' extension. */ if (!len) len = strlen (wpath); if (len + 1 >= MAX_PATH) { LT__SETERROR (CANNOT_OPEN); return 0; } wpath[len] = '.'; wpath[len+1] = '\0'; } } { /* Silence dialog from LoadLibrary on some failures. */ DWORD errormode = getthreaderrormode (); DWORD last_error; setthreaderrormode (errormode | SEM_FAILCRITICALERRORS, NULL); module = LoadLibrary (wpath); /* Restore the error mode. */ last_error = GetLastError (); setthreaderrormode (errormode, NULL); SetLastError (last_error); } /* libltdl expects this function to fail if it is unable to physically load the library. Sadly, LoadLibrary will search the loaded libraries for a match and return one of them if the path search load fails. We check whether LoadLibrary is returning a handle to an already loaded module, and simulate failure if we find one. */ { lt_dlhandle cur = 0; while ((cur = lt_dlhandle_iterate (iface_id, cur))) { if (!cur->module) { cur = 0; break; } if (cur->module == module) { break; } } if (!module) LOADLIB_SETERROR (CANNOT_OPEN); else if (cur) { LT__SETERROR (CANNOT_OPEN); module = 0; } } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (FreeLibrary ((HMODULE) module) == 0) { LOADLIB_SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = (void *) GetProcAddress ((HMODULE) module, name); if (!address) { LOADLIB_SETERROR (SYMBOL_NOT_FOUND); } return address; } /* --- HELPER FUNCTIONS --- */ /* Return the windows error message, or the passed in error message on failure. */ static const char * loadlibraryerror (const char *default_errmsg) { size_t len; LOCALFREE (error_message); FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError (), 0, (char *) &error_message, 0, NULL); /* Remove trailing CRNL */ len = LT_STRLEN (error_message); if (len && error_message[len - 1] == '\n') error_message[--len] = LT_EOS_CHAR; if (len && error_message[len - 1] == '\r') error_message[--len] = LT_EOS_CHAR; return len ? error_message : default_errmsg; } /* A function called through the getthreaderrormode variable which checks if the system supports GetThreadErrorMode (or GetErrorMode) and arranges for it or a fallback implementation to be called directly in the future. The selected version is then called. */ static DWORD WINAPI wrap_getthreaderrormode (void) { HMODULE kernel32 = GetModuleHandleA ("kernel32.dll"); getthreaderrormode = (getthreaderrormode_type *) GetProcAddress (kernel32, "GetThreadErrorMode"); if (!getthreaderrormode) getthreaderrormode = (getthreaderrormode_type *) GetProcAddress (kernel32, "GetErrorMode"); if (!getthreaderrormode) getthreaderrormode = fallback_getthreaderrormode; return getthreaderrormode (); } /* A function called through the getthreaderrormode variable for cases where the system does not support GetThreadErrorMode or GetErrorMode */ static DWORD WINAPI fallback_getthreaderrormode (void) { /* Prior to Windows Vista, the only way to get the current error mode was to set a new one. In our case, we are setting a new error mode right after "getting" it while ignoring the error mode in effect when setting the new error mode, so that's fairly ok. */ return (DWORD) SetErrorMode (SEM_FAILCRITICALERRORS); } /* A function called through the setthreaderrormode variable which checks if the system supports SetThreadErrorMode and arranges for it or a fallback implementation to be called directly in the future. The selected version is then called. */ static BOOL WINAPI wrap_setthreaderrormode (DWORD mode, DWORD *oldmode) { HMODULE kernel32 = GetModuleHandleA ("kernel32.dll"); setthreaderrormode = (setthreaderrormode_type *) GetProcAddress (kernel32, "SetThreadErrorMode"); if (!setthreaderrormode) setthreaderrormode = fallback_setthreaderrormode; return setthreaderrormode (mode, oldmode); } /* A function called through the setthreaderrormode variable for cases where the system does not support SetThreadErrorMode. */ static BOOL WINAPI fallback_setthreaderrormode (DWORD mode, DWORD *oldmode) { /* Prior to Windows 7, there was no way to set the thread local error mode, so set the process global error mode instead. */ DWORD old = (DWORD) SetErrorMode (mode); if (oldmode) *oldmode = old; return TRUE; } redland-1.0.17/libltdl/loaders/dyld.c0000644000175000017500000003253612155164573014333 00000000000000/* loader-dyld.c -- dynamic linking on darwin and OS X Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Peter O'Gorman, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dyld_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_init (lt_user_data loader_data); static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dyld"; vtable->sym_prefix = "_"; vtable->dlloader_init = vl_init; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_MACH_O_DYLD_H) # if !defined(__APPLE_CC__) && !defined(__MWERKS__) && !defined(__private_extern__) /* Is this correct? Does it still function properly? */ # define __private_extern__ extern # endif # include #endif #include /* We have to put some stuff here that isn't in older dyld.h files */ #if !defined(ENUM_DYLD_BOOL) # define ENUM_DYLD_BOOL # undef FALSE # undef TRUE enum DYLD_BOOL { FALSE, TRUE }; #endif #if !defined(LC_REQ_DYLD) # define LC_REQ_DYLD 0x80000000 #endif #if !defined(LC_LOAD_WEAK_DYLIB) # define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) #endif #if !defined(NSADDIMAGE_OPTION_NONE) # define NSADDIMAGE_OPTION_NONE 0x0 #endif #if !defined(NSADDIMAGE_OPTION_RETURN_ON_ERROR) # define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 #endif #if !defined(NSADDIMAGE_OPTION_WITH_SEARCHING) # define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 #endif #if !defined(NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED) # define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 #endif #if !defined(NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME) # define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND) # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW) # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY) # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) # define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 #endif #define LT__SYMLOOKUP_OPTS (NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW \ | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) #if defined(__BIG_ENDIAN__) # define LT__MAGIC MH_MAGIC #else # define LT__MAGIC MH_CIGAM #endif #define DYLD__SETMYERROR(errmsg) LT__SETERRORSTR (dylderror (errmsg)) #define DYLD__SETERROR(errcode) DYLD__SETMYERROR (LT__STRERROR (errcode)) typedef struct mach_header mach_header; typedef struct dylib_command dylib_command; static const char *dylderror (const char *errmsg); static const mach_header *lt__nsmodule_get_header (NSModule module); static const char *lt__header_get_instnam (const mach_header *mh); static const mach_header *lt__match_loadedlib (const char *name); static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh); static const mach_header *(*lt__addimage) (const char *image_name, unsigned long options) = 0; static NSSymbol (*lt__image_symbol) (const mach_header *image, const char *symbolName, unsigned long options) = 0; static enum DYLD_BOOL (*lt__image_symbol_p) (const mach_header *image, const char *symbolName) = 0; static enum DYLD_BOOL (*lt__module_export) (NSModule module) = 0; static int dyld_cannot_close = 0; /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to initialise this loader. */ static int vl_init (lt_user_data loader_data) { int errors = 0; if (! dyld_cannot_close) { if (!_dyld_present ()) { ++errors; } else { (void) _dyld_func_lookup ("__dyld_NSAddImage", (unsigned long*) <__addimage); (void) _dyld_func_lookup ("__dyld_NSLookupSymbolInImage", (unsigned long*)<__image_symbol); (void) _dyld_func_lookup ("__dyld_NSIsSymbolNameDefinedInImage", (unsigned long*) <__image_symbol_p); (void) _dyld_func_lookup ("__dyld_NSMakePrivateModulePublic", (unsigned long*) <__module_export); dyld_cannot_close = lt_dladderror ("can't close a dylib"); } } return errors; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { lt_module module = 0; NSObjectFileImage ofi = 0; if (!filename) { return (lt_module) -1; } switch (NSCreateObjectFileImageFromFile (filename, &ofi)) { case NSObjectFileImageSuccess: module = NSLinkModule (ofi, filename, NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_PRIVATE | NSLINKMODULE_OPTION_BINDNOW); NSDestroyObjectFileImage (ofi); if (module) { lt__module_export (module); } break; case NSObjectFileImageInappropriateFile: if (lt__image_symbol_p && lt__image_symbol) { module = (lt_module) lt__addimage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR); } break; case NSObjectFileImageFailure: case NSObjectFileImageArch: case NSObjectFileImageFormat: case NSObjectFileImageAccess: /*NOWORK*/ break; } if (!module) { DYLD__SETERROR (CANNOT_OPEN); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data, lt_module module) { int errors = 0; if (module != (lt_module) -1) { const mach_header *mh = (const mach_header *) module; int flags = 0; if (mh->magic == LT__MAGIC) { lt_dlseterror (dyld_cannot_close); ++errors; } else { /* Currently, if a module contains c++ static destructors and it is unloaded, we get a segfault in atexit(), due to compiler and dynamic loader differences of opinion, this works around that. */ if ((const struct section *) NULL != getsectbynamefromheader (lt__nsmodule_get_header (module), "__DATA", "__mod_term_func")) { flags |= NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED; } #if defined(__ppc__) flags |= NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES; #endif if (!NSUnLinkModule (module, flags)) { DYLD__SETERROR (CANNOT_CLOSE); ++errors; } } } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data, lt_module module, const char *name) { NSSymbol *nssym = 0; const mach_header *mh = (const mach_header *) module; char saveError[256] = "Symbol not found"; if (module == (lt_module) -1) { void *address, *unused; _dyld_lookup_and_bind (name, (unsigned long*) &address, &unused); return address; } if (mh->magic == LT__MAGIC) { if (lt__image_symbol_p && lt__image_symbol) { if (lt__image_symbol_p (mh, name)) { nssym = lt__image_symbol (mh, name, LT__SYMLOOKUP_OPTS); } } } else { nssym = NSLookupSymbolInModule (module, name); } if (!nssym) { strncpy (saveError, dylderror (LT__STRERROR (SYMBOL_NOT_FOUND)), 255); saveError[255] = 0; if (!mh) { mh = (mach_header *)lt__nsmodule_get_header (module); } nssym = lt__linkedlib_symbol (name, mh); } if (!nssym) { LT__SETERRORSTR (saveError); } return nssym ? NSAddressOfSymbol (nssym) : 0; } /* --- HELPER FUNCTIONS --- */ /* Return the dyld error string, or the passed in error string if none. */ static const char * dylderror (const char *errmsg) { NSLinkEditErrors ler; int lerno; const char *file; const char *errstr; NSLinkEditError (&ler, &lerno, &file, &errstr); if (! (errstr && *errstr)) { errstr = errmsg; } return errstr; } /* There should probably be an apple dyld api for this. */ static const mach_header * lt__nsmodule_get_header (NSModule module) { int i = _dyld_image_count(); const char *modname = NSNameOfModule (module); const mach_header *mh = 0; if (!modname) return NULL; while (i > 0) { --i; if (strneq (_dyld_get_image_name (i), modname)) { mh = _dyld_get_image_header (i); break; } } return mh; } /* NSAddImage is also used to get the loaded image, but it only works if the lib is installed, for uninstalled libs we need to check the install_names against each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a different lib was loaded as a result. */ static const char * lt__header_get_instnam (const mach_header *mh) { unsigned long offset = sizeof(mach_header); const char* result = 0; int j; for (j = 0; j < mh->ncmds; j++) { struct load_command *lc; lc = (struct load_command*) (((unsigned long) mh) + offset); if (LC_ID_DYLIB == lc->cmd) { result=(char*)(((dylib_command*) lc)->dylib.name.offset + (unsigned long) lc); } offset += lc->cmdsize; } return result; } static const mach_header * lt__match_loadedlib (const char *name) { const mach_header *mh = 0; int i = _dyld_image_count(); while (i > 0) { const char *id; --i; id = lt__header_get_instnam (_dyld_get_image_header (i)); if (id && strneq (id, name)) { mh = _dyld_get_image_header (i); break; } } return mh; } /* Safe to assume our mh is good. */ static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh) { NSSymbol symbol = 0; if (lt__image_symbol && NSIsSymbolNameDefined (symname)) { unsigned long offset = sizeof(mach_header); struct load_command *lc; int j; for (j = 0; j < mh->ncmds; j++) { lc = (struct load_command*) (((unsigned long) mh) + offset); if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) { unsigned long base = ((dylib_command *) lc)->dylib.name.offset; char *name = (char *) (base + (unsigned long) lc); const mach_header *mh1 = lt__match_loadedlib (name); if (!mh1) { /* Maybe NSAddImage can find it */ mh1 = lt__addimage (name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED | NSADDIMAGE_OPTION_WITH_SEARCHING | NSADDIMAGE_OPTION_RETURN_ON_ERROR); } if (mh1) { symbol = lt__image_symbol (mh1, symname, LT__SYMLOOKUP_OPTS); if (symbol) break; } } offset += lc->cmdsize; } } return symbol; } redland-1.0.17/libltdl/loaders/shl_load.c0000644000175000017500000001507612155164573015164 00000000000000/* loader-shl_load.c -- dynamic linking with shl_load (HP-UX) Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable shl_load_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_shl_load"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_DL_H) # include #endif /* some flags are missing on some systems, so we provide * harmless defaults. * * Mandatory: * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. * BIND_DEFERRED - Delay code symbol resolution until actual reference. * * Optionally: * BIND_FIRST - Place the library at the head of the symbol search * order. * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all * unsatisfied symbols as fatal. This flag allows * binding of unsatisfied code symbols to be deferred * until use. * [Perl: For certain libraries, like DCE, deferred * binding often causes run time problems. Adding * BIND_NONFATAL to BIND_IMMEDIATE still allows * unresolved references in situations like this.] * BIND_NOSTART - Do not call the initializer for the shared library * when the library is loaded, nor on a future call to * shl_unload(). * BIND_VERBOSE - Print verbose messages concerning possible * unsatisfied symbols. * * hp9000s700/hp9000s800: * BIND_RESTRICTED - Restrict symbols visible by the library to those * present at library load time. * DYNAMIC_PATH - Allow the loader to dynamically search for the * library specified by the path argument. */ #if !defined(DYNAMIC_PATH) # define DYNAMIC_PATH 0 #endif #if !defined(BIND_RESTRICTED) # define BIND_RESTRICTED 0 #endif #define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { static shl_t self = (shl_t) 0; lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); /* Since searching for a symbol against a NULL module handle will also look in everything else that was already loaded and exported with the -E compiler flag, we always cache a handle saved before any modules are loaded. */ if (!self) { void *address; shl_findsym (&self, "main", TYPE_UNDEFINED, &address); } if (!filename) { module = self; } else { module = shl_load (filename, LT_BIND_FLAGS, 0L); if (!module) { LT__SETERROR (CANNOT_OPEN); } } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (module && (shl_unload ((shl_t) (module)) != 0)) { LT__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = 0; /* sys_shl_open should never return a NULL module handle */ if (module == (lt_module) 0) { LT__SETERROR (INVALID_HANDLE); } else if (!shl_findsym((shl_t*) &module, name, TYPE_UNDEFINED, &address)) { if (!address) { LT__SETERROR (SYMBOL_NOT_FOUND); } } return address; } redland-1.0.17/libltdl/loaders/dld_link.c0000644000175000017500000001074112155164573015151 00000000000000/* loader-dld_link.c -- dynamic linking with dld Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dld_link_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dld_link"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_DLD_H) # include #endif /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { lt_module module = lt__strdup (filename); if (dld_link (filename) != 0) { LT__SETERROR (CANNOT_OPEN); FREE (module); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (dld_unlink_by_file ((char*)(module), 1) != 0) { LT__SETERROR (CANNOT_CLOSE); ++errors; } else { FREE (module); } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module LT__UNUSED module, const char *name) { void *address = dld_get_func (name); if (!address) { LT__SETERROR (SYMBOL_NOT_FOUND); } return address; } redland-1.0.17/libltdl/loaders/dlopen.c0000644000175000017500000001434112155164573014652 00000000000000/* loader-dlopen.c -- dynamic linking with dlopen/dlsym Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dlopen_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dlopen"; #if defined(DLSYM_USCORE) vtable->sym_prefix = "_"; #endif vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_PREPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_DLFCN_H) # include #endif #if defined(HAVE_SYS_DL_H) # include #endif /* We may have to define LT_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #if !defined(LT_LAZY_OR_NOW) # if defined(RTLD_LAZY) # define LT_LAZY_OR_NOW RTLD_LAZY # else # if defined(DL_LAZY) # define LT_LAZY_OR_NOW DL_LAZY # endif # endif /* !RTLD_LAZY */ #endif #if !defined(LT_LAZY_OR_NOW) # if defined(RTLD_NOW) # define LT_LAZY_OR_NOW RTLD_NOW # else # if defined(DL_NOW) # define LT_LAZY_OR_NOW DL_NOW # endif # endif /* !RTLD_NOW */ #endif #if !defined(LT_LAZY_OR_NOW) # define LT_LAZY_OR_NOW 0 #endif /* !LT_LAZY_OR_NOW */ /* We only support local and global symbols from modules for loaders that provide such a thing, otherwise the system default is used. */ #if !defined(RTLD_GLOBAL) # if defined(DL_GLOBAL) # define RTLD_GLOBAL DL_GLOBAL # endif #endif /* !RTLD_GLOBAL */ #if !defined(RTLD_LOCAL) # if defined(DL_LOCAL) # define RTLD_LOCAL DL_LOCAL # endif #endif /* !RTLD_LOCAL */ #if defined(HAVE_DLERROR) # define DLERROR(arg) dlerror () #else # define DLERROR(arg) LT__STRERROR (arg) #endif #define DL__SETERROR(errorcode) \ LT__SETERRORSTR (DLERROR (errorcode)) /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise advise) { int module_flags = LT_LAZY_OR_NOW; lt_module module; if (advise) { #ifdef RTLD_GLOBAL /* If there is some means of asking for global symbol resolution, do so. */ if (advise->is_symglobal) module_flags |= RTLD_GLOBAL; #else /* Otherwise, reset that bit so the caller can tell it wasn't acted on. */ advise->is_symglobal = 0; #endif /* And similarly for local only symbol resolution. */ #ifdef RTLD_LOCAL if (advise->is_symlocal) module_flags |= RTLD_LOCAL; #else advise->is_symlocal = 0; #endif } module = dlopen (filename, module_flags); if (!module) { DL__SETERROR (CANNOT_OPEN); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (dlclose (module) != 0) { DL__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = dlsym (module, name); if (!address) { DL__SETERROR (SYMBOL_NOT_FOUND); } return address; } redland-1.0.17/libltdl/loaders/preopen.c0000644000175000017500000002245512155164573015046 00000000000000/* loader-preopen.c -- emulate dynamic linking using preloaded_symbols Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable preopen_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_init (lt_user_data loader_data); static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_preopen"; vtable->sym_prefix = 0; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_init = vl_init; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_PREPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ /* Wrapper type to chain together symbol lists of various origins. */ typedef struct symlist_chain { struct symlist_chain *next; const lt_dlsymlist *symlist; } symlist_chain; static int add_symlist (const lt_dlsymlist *symlist); static int free_symlists (void); /* The start of the symbol lists chain. */ static symlist_chain *preloaded_symlists = 0; /* A symbol list preloaded before lt_init() was called. */ static const lt_dlsymlist *default_preloaded_symbols = 0; /* A function called through the vtable to initialise this loader. */ static int vl_init (lt_user_data LT__UNUSED loader_data) { int errors = 0; preloaded_symlists = 0; if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } return errors; } /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; free_symlists (); return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { symlist_chain *lists; lt_module module = 0; if (!preloaded_symlists) { LT__SETERROR (NO_SYMBOLS); goto done; } /* Can't use NULL as the reflective symbol header, as NULL is used to mark the end of the entire symbol list. Self-dlpreopened symbols follow this magic number, chosen to be an unlikely clash with a real module name. */ if (!filename) { filename = "@PROGRAM@"; } for (lists = preloaded_symlists; lists; lists = lists->next) { const lt_dlsymlist *symbol; for (symbol= lists->symlist; symbol->name; ++symbol) { if (!symbol->address && streq (symbol->name, filename)) { /* If the next symbol's name and address is 0, it means the module just contains the originator and no symbols. In this case we pretend that we never saw the module and hope that some other loader will be able to load the module and have access to its symbols */ const lt_dlsymlist *next_symbol = symbol +1; if (next_symbol->address && next_symbol->name) { module = (lt_module) lists->symlist; goto done; } } } } LT__SETERROR (FILE_NOT_FOUND); done: return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module LT__UNUSED module) { /* Just to silence gcc -Wall */ module = 0; return 0; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { lt_dlsymlist *symbol = (lt_dlsymlist*) module; symbol +=2; /* Skip header (originator then libname). */ while (symbol->name) { if (streq (symbol->name, name)) { return symbol->address; } ++symbol; } LT__SETERROR (SYMBOL_NOT_FOUND); return 0; } /* --- HELPER FUNCTIONS --- */ /* The symbol lists themselves are not allocated from the heap, but we can unhook them and free up the chain of links between them. */ static int free_symlists (void) { symlist_chain *lists; lists = preloaded_symlists; while (lists) { symlist_chain *next = lists->next; FREE (lists); lists = next; } preloaded_symlists = 0; return 0; } /* Add a new symbol list to the global chain. */ static int add_symlist (const lt_dlsymlist *symlist) { symlist_chain *lists; int errors = 0; /* Search for duplicate entries: */ for (lists = preloaded_symlists; lists && lists->symlist != symlist; lists = lists->next) /*NOWORK*/; /* Don't add the same list twice: */ if (!lists) { symlist_chain *tmp = (symlist_chain *) lt__zalloc (sizeof *tmp); if (tmp) { tmp->symlist = symlist; tmp->next = preloaded_symlists; preloaded_symlists = tmp; } else { ++errors; } } return errors; } /* --- PRELOADING API CALL IMPLEMENTATIONS --- */ /* Save a default symbol list for later. */ int lt_dlpreload_default (const lt_dlsymlist *preloaded) { default_preloaded_symbols = preloaded; return 0; } /* Add a symbol list to the global chain, or with a NULL argument, revert to just the default list. */ int lt_dlpreload (const lt_dlsymlist *preloaded) { int errors = 0; if (preloaded) { errors = add_symlist (preloaded); } else { free_symlists(); if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } } return errors; } /* Open all the preloaded modules from the named originator, executing a callback for each one. If ORIGINATOR is NULL, then call FUNC for each preloaded module from the program itself. */ int lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func) { symlist_chain *list; int errors = 0; int found = 0; /* For each symlist in the chain... */ for (list = preloaded_symlists; list; list = list->next) { /* ...that was preloaded by the requesting ORIGINATOR... */ if ((originator && streq (list->symlist->name, originator)) || (!originator && streq (list->symlist->name, "@PROGRAM@"))) { const lt_dlsymlist *symbol; unsigned int idx = 0; ++found; /* ...load the symbols per source compilation unit: (we preincrement the index to skip over the originator entry) */ while ((symbol = &list->symlist[++idx])->name != 0) { if ((symbol->address == 0) && (strneq (symbol->name, "@PROGRAM@"))) { lt_dlhandle handle = lt_dlopen (symbol->name); if (handle == 0) { ++errors; } else { errors += (*func) (handle); } } } } } if (!found) { LT__SETERROR(CANNOT_OPEN); ++errors; } return errors; } redland-1.0.17/libltdl/argz_.h0000644000175000017500000000425412155164573013051 00000000000000/* lt__argz.h -- internal argz interface for non-glibc systems Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__ARGZ_H) #define LT__ARGZ_H 1 #include #define __need_error_t #include #include #if defined(LTDL) # include "lt__glibc.h" # include "lt_system.h" #else # define LT_SCOPE #endif #if defined(__cplusplus) extern "C" { #endif LT_SCOPE error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len); LT_SCOPE error_t argz_create_sep(const char *str, int delim, char **pargz, size_t *pargz_len); LT_SCOPE error_t argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry); LT_SCOPE char * argz_next (char *argz, size_t argz_len, const char *entry); LT_SCOPE void argz_stringify (char *argz, size_t argz_len, int sep); #if defined(__cplusplus) } #endif #if !defined(LTDL) # undef LT_SCOPE #endif #endif /*!defined(LT__ARGZ_H)*/ redland-1.0.17/libltdl/ltdl.h0000644000175000017500000001312512155164573012703 00000000000000/* ltdl.h -- generic dlopen functions Copyright (C) 1998-2000, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Only include this header file once. */ #if !defined(LTDL_H) #define LTDL_H 1 #include #include #include LT_BEGIN_C_DECLS /* LT_STRLEN can be used safely on NULL pointers. */ #define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) /* --- DYNAMIC MODULE LOADING API --- */ typedef struct lt__handle *lt_dlhandle; /* A loaded module. */ /* Initialisation and finalisation functions for libltdl. */ LT_SCOPE int lt_dlinit (void); LT_SCOPE int lt_dlexit (void); /* Module search path manipulation. */ LT_SCOPE int lt_dladdsearchdir (const char *search_dir); LT_SCOPE int lt_dlinsertsearchdir (const char *before, const char *search_dir); LT_SCOPE int lt_dlsetsearchpath (const char *search_path); LT_SCOPE const char *lt_dlgetsearchpath (void); LT_SCOPE int lt_dlforeachfile ( const char *search_path, int (*func) (const char *filename, void *data), void *data); /* User module loading advisors. */ LT_SCOPE int lt_dladvise_init (lt_dladvise *advise); LT_SCOPE int lt_dladvise_destroy (lt_dladvise *advise); LT_SCOPE int lt_dladvise_ext (lt_dladvise *advise); LT_SCOPE int lt_dladvise_resident (lt_dladvise *advise); LT_SCOPE int lt_dladvise_local (lt_dladvise *advise); LT_SCOPE int lt_dladvise_global (lt_dladvise *advise); LT_SCOPE int lt_dladvise_preload (lt_dladvise *advise); /* Portable libltdl versions of the system dlopen() API. */ LT_SCOPE lt_dlhandle lt_dlopen (const char *filename); LT_SCOPE lt_dlhandle lt_dlopenext (const char *filename); LT_SCOPE lt_dlhandle lt_dlopenadvise (const char *filename, lt_dladvise advise); LT_SCOPE void * lt_dlsym (lt_dlhandle handle, const char *name); LT_SCOPE const char *lt_dlerror (void); LT_SCOPE int lt_dlclose (lt_dlhandle handle); /* --- PRELOADED MODULE SUPPORT --- */ /* A preopened symbol. Arrays of this type comprise the exported symbols for a dlpreopened module. */ typedef struct { const char *name; void *address; } lt_dlsymlist; typedef int lt_dlpreload_callback_func (lt_dlhandle handle); LT_SCOPE int lt_dlpreload (const lt_dlsymlist *preloaded); LT_SCOPE int lt_dlpreload_default (const lt_dlsymlist *preloaded); LT_SCOPE int lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func); #define lt_preloaded_symbols lt__PROGRAM__LTX_preloaded_symbols /* Ensure C linkage. */ extern LT_DLSYM_CONST lt_dlsymlist lt__PROGRAM__LTX_preloaded_symbols[]; #define LTDL_SET_PRELOADED_SYMBOLS() \ lt_dlpreload_default(lt_preloaded_symbols) /* --- MODULE INFORMATION --- */ /* Associating user data with loaded modules. */ typedef void * lt_dlinterface_id; typedef int lt_dlhandle_interface (lt_dlhandle handle, const char *id_string); LT_SCOPE lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface); LT_SCOPE void lt_dlinterface_free (lt_dlinterface_id key); LT_SCOPE void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data); LT_SCOPE void * lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle); /* Read only information pertaining to a loaded module. */ typedef struct { char * filename; /* file name */ char * name; /* module name */ int ref_count; /* number of times lt_dlopened minus number of times lt_dlclosed. */ unsigned int is_resident:1; /* module can't be unloaded. */ unsigned int is_symglobal:1; /* module symbols can satisfy subsequently loaded modules. */ unsigned int is_symlocal:1; /* module symbols are only available locally. */ } lt_dlinfo; LT_SCOPE const lt_dlinfo *lt_dlgetinfo (lt_dlhandle handle); LT_SCOPE lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place); LT_SCOPE lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name); LT_SCOPE int lt_dlhandle_map (lt_dlinterface_id iface, int (*func) (lt_dlhandle handle, void *data), void *data); /* Deprecated module residency management API. */ LT_SCOPE int lt_dlmakeresident (lt_dlhandle handle); LT_SCOPE int lt_dlisresident (lt_dlhandle handle); #define lt_ptr void * LT_END_C_DECLS #endif /*!defined(LTDL_H)*/ redland-1.0.17/libltdl/configure.ac0000644000175000017500000000501012155164573014053 00000000000000# Process this file with autoconf to create configure. -*- autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # NOTE: The canonical source of this file is maintained with the # GNU Libtool package. Report bugs to bug-libtool@gnu.org. # # GNU Libltdl is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # As a special exception to the GNU Lesser General Public License, # if you distribute this file as part of a program or library that # is built using GNU libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libltdl is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU LesserGeneral Public # License along with GNU Libltdl; see the file COPYING.LIB. If not, a # copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #### # This configure.ac is not used at all by the libtool bootstrap, but # is copied to the ltdl subdirectory if you libtoolize --ltdl your own # project. Adding LT_WITH_LTDL to your project configure.ac will then # configure this directory if your user doesn't want to use the installed # libltdl. AC_PREREQ(2.59)dnl We use AS_HELP_STRING ## ------------------------ ## ## Autoconf initialisation. ## ## ------------------------ ## AC_INIT([libltdl], [2.4.2], [bug-libtool@gnu.org]) AC_CONFIG_HEADERS([config.h:config-h.in]) AC_CONFIG_SRCDIR([ltdl.c]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([m4]) LT_CONFIG_LTDL_DIR([.]) # I am me! ## ------------------------ ## ## Automake Initialisation. ## ## ------------------------ ## AM_INIT_AUTOMAKE([gnu]) ## ------------------------------- ## ## Libtool specific configuration. ## ## ------------------------------- ## pkgdatadir='${datadir}'"/${PACKAGE}" ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## LT_INIT([dlopen win32-dll]) _LTDL_SETUP ## -------- ## ## Outputs. ## ## -------- ## AC_CONFIG_FILES([Makefile]) AC_OUTPUT redland-1.0.17/libltdl/m4/0000755000175000017500000000000012257576337012201 500000000000000redland-1.0.17/libltdl/m4/argz.m40000644000175000017500000000507112155164573013321 00000000000000# Portability macros for glibc argz. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # Written by Gary V. Vaughan # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 argz.m4 AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for `error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test "$lt_cv_sys_argz_works" = yes], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [ARGZ_H=argz.h AC_LIBOBJ([argz])])]) AC_SUBST([ARGZ_H]) ]) # Prerequisites of lib/argz.c. AC_DEFUN([gl_PREREQ_ARGZ], [:]) redland-1.0.17/libltdl/m4/ltversion.m40000644000175000017500000000126212155164573014401 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) redland-1.0.17/libltdl/m4/ltdl.m40000644000175000017500000006470412155164573013325 00000000000000# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- # # Copyright (C) 1999-2006, 2007, 2008, 2011 Free Software Foundation, Inc. # Written by Thomas Tanner, 1999 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 18 LTDL_INIT # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) # ------------------------------------------ # DIRECTORY contains the libltdl sources. It is okay to call this # function multiple times, as long as the same DIRECTORY is always given. AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) _$0($*) ])# LT_CONFIG_LTDL_DIR # We break this out into a separate macro, so that we can call it safely # internally without being caught accidentally by the sed scan in libtoolize. m4_defun([_LT_CONFIG_LTDL_DIR], [dnl remove trailing slashes m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) m4_case(_LTDL_DIR, [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.' m4_if(_ARG_DIR, [.], [], [m4_define([_LTDL_DIR], _ARG_DIR) _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], [m4_if(_ARG_DIR, _LTDL_DIR, [], [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])]) m4_popdef([_ARG_DIR]) ])# _LT_CONFIG_LTDL_DIR # Initialise: m4_define([_LTDL_DIR], []) # _LT_BUILD_PREFIX # ---------------- # If Autoconf is new enough, expand to `${top_build_prefix}', otherwise # to `${top_builddir}/'. m4_define([_LT_BUILD_PREFIX], [m4_ifdef([AC_AUTOCONF_VERSION], [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], [${top_build_prefix}], [${top_builddir}/])], [${top_build_prefix}])], [${top_builddir}/])[]dnl ]) # LTDL_CONVENIENCE # ---------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with # '${top_build_prefix}' if available, otherwise with '${top_builddir}/', # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_build_prefix, top_builddir, and top_srcdir appropriately # in your Makefiles. AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_CONVENIENCE # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) # _LTDL_CONVENIENCE # ----------------- # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). m4_defun([_LTDL_CONVENIENCE], [case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" AC_SUBST([INCLTDL]) ])# _LTDL_CONVENIENCE # LTDL_INSTALLABLE # ---------------- # sets LIBLTDL to the link flags for the libltdl installable library # and LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl # is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if # available, otherwise with '${top_builddir}/', and LTDLINCL will be # prefixed with '${top_srcdir}/' (note the single quotes!). If your # package is not flat and you're not using automake, define top_build_prefix, # top_builddir, and top_srcdir appropriately in your Makefiles. # In the future, this macro may have to be called after LT_INIT. AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_INSTALLABLE # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) # _LTDL_INSTALLABLE # ----------------- # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). m4_defun([_LTDL_INSTALLABLE], [if test -f $prefix/lib/libltdl.la; then lt_save_LDFLAGS="$LDFLAGS" LDFLAGS="-L$prefix/lib $LDFLAGS" AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) LDFLAGS="$lt_save_LDFLAGS" if test x"${lt_lib_ltdl-no}" = xyes; then if test x"$enable_ltdl_install" != xyes; then # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install']) enable_ltdl_install=no fi elif test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) fi fi # If configure.ac declared an installable ltdl, and the user didn't override # with --disable-ltdl-install, we will install the shipped libltdl. case $enable_ltdl_install in no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLDEPS= LTDLINCL= ;; *) enable_ltdl_install=yes ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" ;; esac AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" AC_SUBST([INCLTDL]) ])# LTDL_INSTALLABLE # _LTDL_MODE_DISPATCH # ------------------- m4_define([_LTDL_MODE_DISPATCH], [dnl If _LTDL_DIR is `.', then we are configuring libltdl itself: m4_if(_LTDL_DIR, [], [], dnl if _LTDL_MODE was not set already, the default value is `subproject': [m4_case(m4_default(_LTDL_MODE, [subproject]), [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])], [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])], [recursive], [], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl dnl Be careful not to expand twice: m4_define([$0], []) ])# _LTDL_MODE_DISPATCH # _LT_LIBOBJ(MODULE_NAME) # ----------------------- # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead # of into LIBOBJS. AC_DEFUN([_LT_LIBOBJ], [ m4_pattern_allow([^_LT_LIBOBJS$]) _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" ])# _LT_LIBOBJS # LTDL_INIT([OPTIONS]) # -------------------- # Clients of libltdl can use this macro to allow the installer to # choose between a shipped copy of the ltdl sources or a preinstalled # version of the library. If the shipped ltdl sources are not in a # subdirectory named libltdl, the directory name must be given by # LT_CONFIG_LTDL_DIR. AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) dnl We need to keep our own list of libobjs separate from our parent project, dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while dnl we look for our own LIBOBJs. m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) m4_pushdef([AC_LIBSOURCES]) dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: m4_if(_LTDL_MODE, [], [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) AC_ARG_WITH([included_ltdl], [AS_HELP_STRING([--with-included-ltdl], [use the GNU ltdl sources included here])]) if test "x$with_included_ltdl" != xyes; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_DECL([lt_dlinterface_register], [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], [with_included_ltdl=no], [with_included_ltdl=yes])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT #include ])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT] ) fi dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE dnl was called yet, then for old times' sake, we assume libltdl is in an dnl eponymous directory: AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) AC_ARG_WITH([ltdl_include], [AS_HELP_STRING([--with-ltdl-include=DIR], [use the ltdl headers installed in DIR])]) if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include']) fi else with_ltdl_include=no fi AC_ARG_WITH([ltdl_lib], [AS_HELP_STRING([--with-ltdl-lib=DIR], [use the libltdl.la installed in DIR])]) if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib']) fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) m4_case(m4_default(_LTDL_TYPE, [convenience]), [convenience], [_LTDL_CONVENIENCE], [installable], [_LTDL_INSTALLABLE], [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together]) ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL="-I$with_ltdl_include" ;; esac INCLTDL="$LTDLINCL" # Report our decision... AC_MSG_CHECKING([where to find libltdl headers]) AC_MSG_RESULT([$LTDLINCL]) AC_MSG_CHECKING([where to find libltdl library]) AC_MSG_RESULT([$LIBLTDL]) _LTDL_SETUP dnl restore autoconf definition. m4_popdef([AC_LIBOBJ]) m4_popdef([AC_LIBSOURCES]) AC_CONFIG_COMMANDS_PRE([ _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) ]) # Only expand once: m4_define([LTDL_INIT]) ])# LTDL_INIT # Old names: AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIB_LTDL], []) dnl AC_DEFUN([AC_WITH_LTDL], []) dnl AC_DEFUN([LT_WITH_LTDL], []) # _LTDL_SETUP # ----------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. This is a public # interface mainly for the benefit of libltdl's own configure.ac, most # other users should call LTDL_INIT instead. AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_SYS_MODULE_EXT])dnl AC_REQUIRE([LT_SYS_MODULE_PATH])dnl AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl AC_REQUIRE([LT_LIB_DLLOAD])dnl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl AC_REQUIRE([gl_FUNC_ARGZ])dnl m4_require([_LT_CHECK_OBJDIR])dnl m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL dnl _LTDL_MODE specific code must be called at least once: _LTDL_MODE_DISPATCH # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). AC_CONFIG_COMMANDS_PRE([dnl m4_pattern_allow([^LT_CONFIG_H$])dnl m4_ifset([AH_HEADER], [LT_CONFIG_H=AH_HEADER], [m4_ifset([AC_LIST_HEADERS], [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`], [])])]) AC_SUBST([LT_CONFIG_H]) AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) name= eval "lt_libprefix=\"$libname_spec\"" m4_pattern_allow([LT_LIBPREFIX])dnl AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) name=ltdl eval "LTDLOPEN=\"$libname_spec\"" AC_SUBST([LTDLOPEN]) ])# _LTDL_SETUP # _LT_ENABLE_INSTALL # ------------------ m4_define([_LT_ENABLE_INSTALL], [AC_ARG_ENABLE([ltdl-install], [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac m4_ifdef([AM_CONDITIONAL], [AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)]) ])# _LT_ENABLE_INSTALL # LT_SYS_DLOPEN_DEPLIBS # --------------------- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd* | netbsdelf*-gnu) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test "$lt_cv_sys_dlopen_deplibs" != yes; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ])# LT_SYS_DLOPEN_DEPLIBS # Old name: AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) # LT_SYS_MODULE_EXT # ----------------- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_MODULE_EXT])dnl AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for runtime loadable modules, say, ".so".]) fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_SHARED_EXT])dnl AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], [Define to the shared library suffix, say, ".dylib".]) fi ])# LT_SYS_MODULE_EXT # Old name: AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) # LT_SYS_MODULE_PATH # ------------------ AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) if test -n "$lt_cv_module_path_var"; then m4_pattern_allow([LT_MODULE_PATH_VAR])dnl AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], [Define to the name of the environment variable that determines the run-time module search path.]) fi ])# LT_SYS_MODULE_PATH # Old name: AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) # LT_SYS_DLSEARCH_PATH # -------------------- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done m4_pattern_allow([LT_DLSEARCH_PATH])dnl AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], [Define to the system default library search path.]) fi ])# LT_SYS_DLSEARCH_PATH # Old name: AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) # _LT_CHECK_DLPREOPEN # ------------------- m4_defun([_LT_CHECK_DLPREOPEN], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], [libltdl_cv_preloaded_symbols], [if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi ]) if test x"$libltdl_cv_preloaded_symbols" = xyes; then AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], [Define if libtool can extract symbol lists from object files.]) fi ])# _LT_CHECK_DLPREOPEN # LT_LIB_DLLOAD # ------------- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include #endif ]], [[dlopen(0, 0);]])], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" AC_CHECK_FUNCS([dlerror]) LIBS="$lt_save_LIBS" fi AC_SUBST([LIBADD_DLOPEN]) LIBADD_SHL_LOAD= AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld"])]) AC_SUBST([LIBADD_SHL_LOAD]) case $host_os in darwin[[1567]].*) # We only want this for pre-Mac OS X 10.4. AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform]) fi AC_SUBST([LT_DLPREOPEN]) dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) AC_LANG_POP ])# LT_LIB_DLLOAD # Old name: AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLLIB], []) # LT_SYS_SYMBOL_USCORE # -------------------- # does the compiler prefix global symbols with an underscore? AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.c >&AS_MESSAGE_LOG_FD fi rm -rf conftest* ]) sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ])# LT_SYS_SYMBOL_USCORE # Old name: AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) # LT_FUNC_DLSYM_USCORE # -------------------- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" _LT_TRY_DLOPEN_SELF( [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], [], [libltdl_cv_need_uscore=cross]) LIBS="$save_LIBS" ]) fi fi if test x"$libltdl_cv_need_uscore" = xyes; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ])# LT_FUNC_DLSYM_USCORE # Old name: AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) redland-1.0.17/libltdl/m4/ltsugar.m40000644000175000017500000001042412155164573014035 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) redland-1.0.17/libltdl/m4/lt~obsolete.m40000644000175000017500000001375612155164573014741 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) redland-1.0.17/libltdl/m4/libtool.m40000644000175000017500000105754212155164573014035 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS redland-1.0.17/libltdl/m4/ltoptions.m40000644000175000017500000003007312155164573014411 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) redland-1.0.17/libltdl/config/0000755000175000017500000000000012257576337013126 500000000000000redland-1.0.17/libltdl/config/missing0000755000175000017500000002415212155164572014440 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: redland-1.0.17/libltdl/config/ltmain.sh0000644000175000017500000105202612155164572014663 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 redland-1.0.17/libltdl/config/config.sub0000755000175000017500000010532712155164572015030 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: redland-1.0.17/libltdl/config/install-sh0000755000175000017500000003325612155164572015052 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: redland-1.0.17/libltdl/config/compile0000755000175000017500000001615212155164572014420 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-03-05.13; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free # Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: redland-1.0.17/libltdl/config/depcomp0000755000175000017500000005064312155164572014422 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: redland-1.0.17/libltdl/config/config.guess0000755000175000017500000012743212155164572015366 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: redland-1.0.17/libltdl/slist.c0000644000175000017500000002316412155164573013101 00000000000000/* slist.c -- generalised singly linked lists Copyright (C) 2000, 2004, 2007, 2008, 2009 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "slist.h" #include #include static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata); /* Call DELETE repeatedly on each element of HEAD. CAVEAT: If you call this when HEAD is the start of a list of boxed items, you must remember that each item passed back to your DELETE function will be a boxed item that must be slist_unbox()ed before operating on its contents. e.g. void boxed_delete (void *item) { item_free (slist_unbox (item)); } ... slist = slist_delete (slist, boxed_delete); ... */ SList * slist_delete (SList *head, void (*delete_fct) (void *item)) { assert (delete_fct); while (head) { SList *next = head->next; (*delete_fct) (head); head = next; } return 0; } /* Call FIND repeatedly with MATCHDATA and each item of *PHEAD, until FIND returns non-NULL, or the list is exhausted. If a match is found the matching item is destructively removed from *PHEAD, and the value returned by the matching call to FIND is returned. CAVEAT: To avoid memory leaks, unless you already have the address of the stale item, you should probably return that from FIND if it makes a successful match. Don't forget to slist_unbox() every item in a boxed list before operating on its contents. */ SList * slist_remove (SList **phead, SListCallback *find, void *matchdata) { SList *stale = 0; void *result = 0; assert (find); if (!phead || !*phead) return 0; /* Does the head of the passed list match? */ result = (*find) (*phead, matchdata); if (result) { stale = *phead; *phead = stale->next; } /* what about the rest of the elements? */ else { SList *head; for (head = *phead; head->next; head = head->next) { result = (*find) (head->next, matchdata); if (result) { stale = head->next; head->next = stale->next; break; } } } return (SList *) result; } /* Call FIND repeatedly with each element of SLIST and MATCHDATA, until FIND returns non-NULL, or the list is exhausted. If a match is found the value returned by the matching call to FIND is returned. */ void * slist_find (SList *slist, SListCallback *find, void *matchdata) { void *result = 0; assert (find); for (; slist; slist = slist->next) { result = (*find) (slist, matchdata); if (result) break; } return result; } /* Return a single list, composed by destructively concatenating the items in HEAD and TAIL. The values of HEAD and TAIL are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_concat (slist1, slist2); */ SList * slist_concat (SList *head, SList *tail) { SList *last; if (!head) { return tail; } last = head; while (last->next) last = last->next; last->next = tail; return head; } /* Return a single list, composed by destructively appending all of the items in SLIST to ITEM. The values of ITEM and SLIST are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_cons (slist_box (data), slist1); */ SList * slist_cons (SList *item, SList *slist) { if (!item) { return slist; } assert (!item->next); item->next = slist; return item; } /* Return a list starting at the second item of SLIST. */ SList * slist_tail (SList *slist) { return slist ? slist->next : NULL; } /* Return a list starting at the Nth item of SLIST. If SLIST is less than N items long, NULL is returned. Just to be confusing, list items are counted from 1, to get the 2nd element of slist: e.g. shared_list = slist_nth (slist, 2); */ SList * slist_nth (SList *slist, size_t n) { for (;n > 1 && slist; n--) slist = slist->next; return slist; } /* Return the number of items in SLIST. We start counting from 1, so the length of a list with no items is 0, and so on. */ size_t slist_length (SList *slist) { size_t n; for (n = 0; slist; ++n) slist = slist->next; return n; } /* Destructively reverse the order of items in SLIST. The value of SLIST is undefined after calling this function. CAVEAT: You must store the result of this function, or you might not be able to get all the items except the first one back again. e.g. slist = slist_reverse (slist); */ SList * slist_reverse (SList *slist) { SList *result = 0; SList *next; while (slist) { next = slist->next; slist->next = result; result = slist; slist = next; } return result; } /* Call FOREACH once for each item in SLIST, passing both the item and USERDATA on each call. */ void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata) { void *result = 0; assert (foreach); while (slist) { SList *next = slist->next; result = (*foreach) (slist, userdata); if (result) break; slist = next; } return result; } /* Destructively merge the items of two ordered lists LEFT and RIGHT, returning a single sorted list containing the items of both -- Part of the quicksort algorithm. The values of LEFT and RIGHT are undefined after calling this function. At each iteration, add another item to the merged list by taking the lowest valued item from the head of either LEFT or RIGHT, determined by passing those items and USERDATA to COMPARE. COMPARE should return less than 0 if the head of LEFT has the lower value, greater than 0 if the head of RIGHT has the lower value, otherwise 0. */ static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata) { SList merged, *insert; insert = &merged; while (left && right) { if ((*compare) (left, right, userdata) <= 0) { insert = insert->next = left; left = left->next; } else { insert = insert->next = right; right = right->next; } } insert->next = left ? left : right; return merged.next; } /* Perform a destructive quicksort on the items in SLIST, by repeatedly calling COMPARE with a pair of items from SLIST along with USERDATA at every iteration. COMPARE is a function as defined above for slist_sort_merge(). The value of SLIST is undefined after calling this function. e.g. slist = slist_sort (slist, compare, 0); */ SList * slist_sort (SList *slist, SListCompare *compare, void *userdata) { SList *left, *right; if (!slist) return slist; /* Be sure that LEFT and RIGHT never contain the same item. */ left = slist; right = slist->next; if (!right) return left; /* Skip two items with RIGHT and one with SLIST, until RIGHT falls off the end. SLIST must be about half way along. */ while (right && (right = right->next)) { if (!right || !(right = right->next)) break; slist = slist->next; } right = slist->next; slist->next = 0; /* Sort LEFT and RIGHT, then merge the two. */ return slist_sort_merge (slist_sort (left, compare, userdata), slist_sort (right, compare, userdata), compare, userdata); } /* Aside from using the functions above to manage chained structures of any type that has a NEXT pointer as its first field, SLISTs can be comprised of boxed items. The boxes are chained together in that case, so there is no need for a NEXT field in the item proper. Some care must be taken to slist_box and slist_unbox each item in a boxed list at the appropriate points to avoid leaking the memory used for the boxes. It us usually a very bad idea to mix boxed and non-boxed items in a single list. */ /* Return a `boxed' freshly mallocated 1 element list containing USERDATA. */ SList * slist_box (const void *userdata) { SList *item = (SList *) malloc (sizeof *item); if (item) { item->next = 0; item->userdata = userdata; } return item; } /* Return the contents of a `boxed' ITEM, recycling the box itself. */ void * slist_unbox (SList *item) { void *userdata = 0; if (item) { /* Strip the const, because responsibility for this memory passes to the caller on return. */ userdata = (void *) item->userdata; free (item); } return userdata; } redland-1.0.17/libltdl/lt__dirent.c0000644000175000017500000000573212155164573014067 00000000000000/* lt__dirent.c -- internal directory entry scanning interface Copyright (C) 2001, 2004 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2001 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include #include #include "lt__dirent.h" #if defined(__WINDOWS__) void closedir (DIR *entry) { assert (entry != (DIR *) NULL); FindClose (entry->hSearch); free ((void *) entry); } DIR * opendir (const char *path) { char file_spec[LT_FILENAME_MAX]; DIR *entry; assert (path != (char *) 0); if (lt_strlcpy (file_spec, path, sizeof file_spec) >= sizeof file_spec || lt_strlcat (file_spec, "\\", sizeof file_spec) >= sizeof file_spec) return (DIR *) 0; entry = (DIR *) malloc (sizeof(DIR)); if (entry != (DIR *) 0) { entry->firsttime = TRUE; entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData); if (entry->hSearch == INVALID_HANDLE_VALUE) { if (lt_strlcat (file_spec, "\\*.*", sizeof file_spec) < sizeof file_spec) { entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData); } if (entry->hSearch == INVALID_HANDLE_VALUE) { entry = (free (entry), (DIR *) 0); } } } return entry; } struct dirent * readdir (DIR *entry) { int status; if (entry == (DIR *) 0) return (struct dirent *) 0; if (!entry->firsttime) { status = FindNextFile (entry->hSearch, &entry->Win32FindData); if (status == 0) return (struct dirent *) 0; } entry->firsttime = FALSE; if (lt_strlcpy (entry->file_info.d_name, entry->Win32FindData.cFileName, sizeof entry->file_info.d_name) >= sizeof entry->file_info.d_name) return (struct dirent *) 0; entry->file_info.d_namlen = strlen (entry->file_info.d_name); return &entry->file_info; } #endif /*defined(__WINDOWS__)*/ redland-1.0.17/libltdl/lt_error.c0000644000175000017500000000562112155164573013571 00000000000000/* lt_error.c -- error propogation interface Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_error.h" static const char *last_error = 0; static const char error_strings[LT_ERROR_MAX][LT_ERROR_LEN_MAX + 1] = { #define LT_ERROR(name, diagnostic) diagnostic, lt_dlerror_table #undef LT_ERROR }; static const char **user_error_strings = 0; static int errorcount = LT_ERROR_MAX; int lt_dladderror (const char *diagnostic) { int errindex = 0; int result = -1; const char **temp = (const char **) 0; assert (diagnostic); errindex = errorcount - LT_ERROR_MAX; temp = REALLOC (const char *, user_error_strings, 1 + errindex); if (temp) { user_error_strings = temp; user_error_strings[errindex] = diagnostic; result = errorcount++; } return result; } int lt_dlseterror (int errindex) { int errors = 0; if (errindex >= errorcount || errindex < 0) { /* Ack! Error setting the error message! */ LT__SETERROR (INVALID_ERRORCODE); ++errors; } else if (errindex < LT_ERROR_MAX) { /* No error setting the error message! */ LT__SETERRORSTR (error_strings[errindex]); } else { /* No error setting the error message! */ LT__SETERRORSTR (user_error_strings[errindex - LT_ERROR_MAX]); } return errors; } const char * lt__error_string (int errorcode) { assert (errorcode >= 0); assert (errorcode < LT_ERROR_MAX); return error_strings[errorcode]; } const char * lt__get_last_error (void) { return last_error; } const char * lt__set_last_error (const char *errormsg) { return last_error = errormsg; } redland-1.0.17/libltdl/lt__strl.c0000644000175000017500000000702612155164573013564 00000000000000/* lt__strl.c -- size-bounded string copying and concatenation Copyright (C) 2004 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "lt__strl.h" /* lt_strlcat appends the NULL-terminated string src to the end of dst. It will append at most dstsize - strlen(dst) - 1 bytes, NULL-terminating the result. The total length of the string which would have been created given sufficient buffer size (may be longer than dstsize) is returned. This function substitutes for strlcat() which is available under NetBSD, FreeBSD and Solaris 9. Buffer overflow can be checked as follows: if (lt_strlcat(dst, src, dstsize) >= dstsize) return -1; */ #if !defined(HAVE_STRLCAT) size_t lt_strlcat(char *dst, const char *src, const size_t dstsize) { size_t length; char *p; const char *q; assert(dst != NULL); assert(src != (const char *) NULL); assert(dstsize >= 1); length=strlen(dst); /* Copy remaining characters from src while constraining length to size - 1. */ for ( p = dst + length, q = src; (*q != 0) && (length < dstsize - 1) ; length++, p++, q++ ) *p = *q; dst[length]='\0'; /* Add remaining length of src to length. */ while (*q++) length++; return length; } #endif /* !defined(HAVE_STRLCAT) */ /* lt_strlcpy copies up to dstsize - 1 characters from the NULL-terminated string src to dst, NULL-terminating the result. The total length of the string which would have been created given sufficient buffer size (may be longer than dstsize) is returned. This function substitutes for strlcpy() which is available under OpenBSD, FreeBSD and Solaris 9. Buffer overflow can be checked as follows: if (lt_strlcpy(dst, src, dstsize) >= dstsize) return -1; */ #if !defined(HAVE_STRLCPY) size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize) { size_t length=0; char *p; const char *q; assert(dst != NULL); assert(src != (const char *) NULL); assert(dstsize >= 1); /* Copy src to dst within bounds of size-1. */ for ( p=dst, q=src, length=0 ; (*q != 0) && (length < dstsize-1) ; length++, p++, q++ ) *p = *q; dst[length]='\0'; /* Add remaining length of src to length. */ while (*q++) length++; return length; } #endif /* !defined(HAVE_STRLCPY) */ redland-1.0.17/libltdl/libltdl/0000755000175000017500000000000012257576337013307 500000000000000redland-1.0.17/libltdl/libltdl/lt__dirent.h0000644000175000017500000000472412155164573015522 00000000000000/* lt__dirent.h -- internal directory entry scanning interface Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2001 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__DIRENT_H) #define LT__DIRENT_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #include "lt_system.h" #ifdef HAVE_DIRENT_H /* We have a fully operational dirent subsystem. */ # include # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) #elif defined __WINDOWS__ /* Use some wrapper code to emulate dirent on windows.. */ # define WINDOWS_DIRENT_EMULATION 1 # include # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) # define dirent lt__dirent # define DIR lt__DIR # define opendir lt__opendir # define readdir lt__readdir # define closedir lt__closedir LT_BEGIN_C_DECLS struct dirent { char d_name[LT_FILENAME_MAX]; int d_namlen; }; typedef struct { HANDLE hSearch; WIN32_FIND_DATA Win32FindData; BOOL firsttime; struct dirent file_info; } DIR; LT_SCOPE DIR * opendir (const char *path); LT_SCOPE struct dirent *readdir (DIR *entry); LT_SCOPE void closedir (DIR *entry); LT_END_C_DECLS #else /* !defined(__WINDOWS__)*/ ERROR - cannot find dirent #endif /*!defined(__WINDOWS__)*/ #endif /*!defined(LT__DIRENT_H)*/ redland-1.0.17/libltdl/libltdl/lt__glibc.h0000644000175000017500000000524012155164573015307 00000000000000/* lt__glibc.h -- support for non glibc environments Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__GLIBC_H) #define LT__GLIBC_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #if !defined(HAVE_ARGZ_H) || !defined(HAVE_WORKING_ARGZ) /* Redefine any glibc symbols we reimplement to import the implementations into our lt__ namespace so we don't ever clash with the system library if our clients use argz_* from there in addition to libltdl. */ # undef argz_append # define argz_append lt__argz_append # undef argz_create_sep # define argz_create_sep lt__argz_create_sep # undef argz_insert # define argz_insert lt__argz_insert # undef argz_next # define argz_next lt__argz_next # undef argz_stringify # define argz_stringify lt__argz_stringify #endif #ifdef __cplusplus extern "C" { #endif #include #ifdef __cplusplus } #endif # define slist_concat lt__slist_concat # define slist_cons lt__slist_cons # define slist_delete lt__slist_delete # define slist_remove lt__slist_remove # define slist_reverse lt__slist_reverse # define slist_sort lt__slist_sort # define slist_tail lt__slist_tail # define slist_nth lt__slist_nth # define slist_find lt__slist_find # define slist_length lt__slist_length # define slist_foreach lt__slist_foreach # define slist_box lt__slist_box # define slist_unbox lt__slist_unbox #include #endif /*!defined(LT__GLIBC_H)*/ redland-1.0.17/libltdl/libltdl/lt_dlloader.h0000644000175000017500000000620012155164573015653 00000000000000/* lt_dlloader.h -- dynamic library loader interface Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined(LT_DLLOADER_H) #define LT_DLLOADER_H 1 #include LT_BEGIN_C_DECLS typedef void * lt_dlloader; typedef void * lt_module; typedef void * lt_user_data; typedef struct lt__advise * lt_dladvise; /* Function pointer types for module loader vtable entries: */ typedef lt_module lt_module_open (lt_user_data data, const char *filename, lt_dladvise advise); typedef int lt_module_close (lt_user_data data, lt_module module); typedef void * lt_find_sym (lt_user_data data, lt_module module, const char *symbolname); typedef int lt_dlloader_init (lt_user_data data); typedef int lt_dlloader_exit (lt_user_data data); /* Default priority is LT_DLLOADER_PREPEND if none is explicitly given. */ typedef enum { LT_DLLOADER_PREPEND = 0, LT_DLLOADER_APPEND } lt_dlloader_priority; /* This structure defines a module loader, as populated by the get_vtable entry point of each loader. */ typedef struct { const char * name; const char * sym_prefix; lt_module_open * module_open; lt_module_close * module_close; lt_find_sym * find_sym; lt_dlloader_init * dlloader_init; lt_dlloader_exit * dlloader_exit; lt_user_data dlloader_data; lt_dlloader_priority priority; } lt_dlvtable; LT_SCOPE int lt_dlloader_add (const lt_dlvtable *vtable); LT_SCOPE lt_dlloader lt_dlloader_next (const lt_dlloader loader); LT_SCOPE lt_dlvtable * lt_dlloader_remove (const char *name); LT_SCOPE const lt_dlvtable *lt_dlloader_find (const char *name); LT_SCOPE const lt_dlvtable *lt_dlloader_get (lt_dlloader loader); /* Type of a function to get a loader's vtable: */ typedef const lt_dlvtable *lt_get_vtable (lt_user_data data); #ifdef LT_DEBUG_LOADERS LT_SCOPE void lt_dlloader_dump (void); #endif LT_END_C_DECLS #endif /*!defined(LT_DLLOADER_H)*/ redland-1.0.17/libltdl/libltdl/slist.h0000644000175000017500000000623112155164573014530 00000000000000/* slist.h -- generalised singly linked lists Copyright (C) 2000, 2004, 2009 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* A generalised list. This is deliberately transparent so that you can make the NEXT field of all your chained data structures first, and then cast them to `(SList *)' so that they can be manipulated by this API. Alternatively, you can generate raw SList elements using slist_new(), and put the element data in the USERDATA field. Either way you get to manage the memory involved by yourself. */ #if !defined(SLIST_H) #define SLIST_H 1 #if defined(LTDL) # include # include #else # define LT_SCOPE #endif #include #if defined(__cplusplus) extern "C" { #endif typedef struct slist { struct slist *next; /* chain forward pointer*/ const void *userdata; /* for boxed `SList' item */ } SList; typedef void * SListCallback (SList *item, void *userdata); typedef int SListCompare (const SList *item1, const SList *item2, void *userdata); LT_SCOPE SList *slist_concat (SList *head, SList *tail); LT_SCOPE SList *slist_cons (SList *item, SList *slist); LT_SCOPE SList *slist_delete (SList *slist, void (*delete_fct) (void *item)); LT_SCOPE SList *slist_remove (SList **phead, SListCallback *find, void *matchdata); LT_SCOPE SList *slist_reverse (SList *slist); LT_SCOPE SList *slist_sort (SList *slist, SListCompare *compare, void *userdata); LT_SCOPE SList *slist_tail (SList *slist); LT_SCOPE SList *slist_nth (SList *slist, size_t n); LT_SCOPE void * slist_find (SList *slist, SListCallback *find, void *matchdata); LT_SCOPE size_t slist_length (SList *slist); LT_SCOPE void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata); LT_SCOPE SList *slist_box (const void *userdata); LT_SCOPE void * slist_unbox (SList *item); #if defined(__cplusplus) } #endif #if !defined(LTDL) # undef LT_SCOPE #endif #endif /*!defined(SLIST_H)*/ redland-1.0.17/libltdl/libltdl/lt__strl.h0000644000175000017500000000370012155164573015212 00000000000000/* lt__strl.h -- size-bounded string copying and concatenation Copyright (C) 2004, 2006 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined(LT__STRL_H) #define LT__STRL_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #include #include "lt_system.h" #if !defined(HAVE_STRLCAT) # define strlcat(dst,src,dstsize) lt_strlcat(dst,src,dstsize) LT_SCOPE size_t lt_strlcat(char *dst, const char *src, const size_t dstsize); #endif /* !defined(HAVE_STRLCAT) */ #if !defined(HAVE_STRLCPY) # define strlcpy(dst,src,dstsize) lt_strlcpy(dst,src,dstsize) LT_SCOPE size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize); #endif /* !defined(HAVE_STRLCPY) */ #endif /*!defined(LT__STRL_H)*/ redland-1.0.17/libltdl/libltdl/lt_system.h0000644000175000017500000001237312155164573015421 00000000000000/* lt_system.h -- system portability abstraction layer Copyright (C) 2004, 2007, 2010 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined(LT_SYSTEM_H) #define LT_SYSTEM_H 1 #include #include #include /* Some systems do not define EXIT_*, even with STDC_HEADERS. */ #if !defined(EXIT_SUCCESS) # define EXIT_SUCCESS 0 #endif #if !defined(EXIT_FAILURE) # define EXIT_FAILURE 1 #endif /* Just pick a big number... */ #define LT_FILENAME_MAX 2048 /* Saves on those hard to debug '\0' typos.... */ #define LT_EOS_CHAR '\0' /* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations, so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at the end of C declarations. */ #if defined(__cplusplus) # define LT_BEGIN_C_DECLS extern "C" { # define LT_END_C_DECLS } #else # define LT_BEGIN_C_DECLS /* empty */ # define LT_END_C_DECLS /* empty */ #endif /* LT_STMT_START/END are used to create macros which expand to a a single compound statement in a portable way. */ #if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus) # define LT_STMT_START (void)( # define LT_STMT_END ) #else # if (defined (sun) || defined (__sun__)) # define LT_STMT_START if (1) # define LT_STMT_END else (void)0 # else # define LT_STMT_START do # define LT_STMT_END while (0) # endif #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* Canonicalise Windows and Cygwin recognition macros. To match the values set by recent Cygwin compilers, make sure that if __CYGWIN__ is defined (after canonicalisation), __WINDOWS__ is NOT! */ #if defined(__CYGWIN32__) && !defined(__CYGWIN__) # define __CYGWIN__ __CYGWIN32__ #endif #if defined(__CYGWIN__) # if defined(__WINDOWS__) # undef __WINDOWS__ # endif #elif defined(_WIN32) # define __WINDOWS__ _WIN32 #elif defined(WIN32) # define __WINDOWS__ WIN32 #endif #if defined(__CYGWIN__) && defined(__WINDOWS__) # undef __WINDOWS__ #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #if !defined(LT_SCOPE) # if defined(__WINDOWS__) || defined(__CYGWIN__) # if defined(DLL_EXPORT) /* defined by libtool (if required) */ # define LT_SCOPE extern __declspec(dllexport) # endif # if defined(LIBLTDL_DLL_IMPORT) /* define if linking with this dll */ /* note: cygwin/mingw compilers can rely instead on auto-import */ # define LT_SCOPE extern __declspec(dllimport) # endif # endif # if !defined(LT_SCOPE) /* static linking or !__WINDOWS__ */ # define LT_SCOPE extern # endif #endif #if defined(__WINDOWS__) /* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory separator when it is set. */ # define LT_DIRSEP_CHAR '\\' # define LT_PATHSEP_CHAR ';' #else # define LT_PATHSEP_CHAR ':' #endif #if defined(_MSC_VER) /* Visual Studio */ # define R_OK 4 #endif /* fopen() mode flags for reading a text file */ #undef LT_READTEXT_MODE #if defined(__WINDOWS__) || defined(__CYGWIN__) # define LT_READTEXT_MODE "rt" #else # define LT_READTEXT_MODE "r" #endif /* The extra indirection to the LT__STR and LT__CONC macros is required so that if the arguments to LT_STR() (or LT_CONC()) are themselves macros, they will be expanded before being quoted. */ #ifndef LT_STR # define LT__STR(arg) #arg # define LT_STR(arg) LT__STR(arg) #endif #ifndef LT_CONC # define LT__CONC(a, b) a##b # define LT_CONC(a, b) LT__CONC(a, b) #endif #ifndef LT_CONC3 # define LT__CONC3(a, b, c) a##b##c # define LT_CONC3(a, b, c) LT__CONC3(a, b, c) #endif #endif /*!defined(LT_SYSTEM_H)*/ redland-1.0.17/libltdl/libltdl/lt_error.h0000644000175000017500000000707212155164573015226 00000000000000/* lt_error.h -- error propogation interface Copyright (C) 1999, 2000, 2001, 2004, 2007 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Only include this header file once. */ #if !defined(LT_ERROR_H) #define LT_ERROR_H 1 #include LT_BEGIN_C_DECLS /* Defining error strings alongside their symbolic names in a macro in this way allows us to expand the macro in different contexts with confidence that the enumeration of symbolic names will map correctly onto the table of error strings. \0 is appended to the strings to expilicitely initialize the string terminator. */ #define lt_dlerror_table \ LT_ERROR(UNKNOWN, "unknown error\0") \ LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available\0") \ LT_ERROR(INVALID_LOADER, "invalid loader\0") \ LT_ERROR(INIT_LOADER, "loader initialization failed\0") \ LT_ERROR(REMOVE_LOADER, "loader removal failed\0") \ LT_ERROR(FILE_NOT_FOUND, "file not found\0") \ LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found\0") \ LT_ERROR(NO_SYMBOLS, "no symbols defined\0") \ LT_ERROR(CANNOT_OPEN, "can't open the module\0") \ LT_ERROR(CANNOT_CLOSE, "can't close the module\0") \ LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found\0") \ LT_ERROR(NO_MEMORY, "not enough memory\0") \ LT_ERROR(INVALID_HANDLE, "invalid module handle\0") \ LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow\0") \ LT_ERROR(INVALID_ERRORCODE, "invalid errorcode\0") \ LT_ERROR(SHUTDOWN, "library already shutdown\0") \ LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module\0") \ LT_ERROR(INVALID_MUTEX_ARGS, "internal error (code withdrawn)\0")\ LT_ERROR(INVALID_POSITION, "invalid search path insert position\0")\ LT_ERROR(CONFLICTING_FLAGS, "symbol visibility can be global or local\0") /* Enumerate the symbolic error names. */ enum { #define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name), lt_dlerror_table #undef LT_ERROR LT_ERROR_MAX }; /* Should be max of the error string lengths above (plus one for C++) */ #define LT_ERROR_LEN_MAX (41) /* These functions are only useful from inside custom module loaders. */ LT_SCOPE int lt_dladderror (const char *diagnostic); LT_SCOPE int lt_dlseterror (int errorcode); LT_END_C_DECLS #endif /*!defined(LT_ERROR_H)*/ redland-1.0.17/libltdl/libltdl/lt__private.h0000644000175000017500000001065012155164573015702 00000000000000/* lt__private.h -- internal apis for libltdl Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy con be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__PRIVATE_H) #define LT__PRIVATE_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #include #include #include #include #include #if defined(HAVE_UNISTD_H) # include #endif /* Import internal interfaces... */ #include "lt__alloc.h" #include "lt__dirent.h" #include "lt__strl.h" #include "lt__glibc.h" /* ...and all exported interfaces. */ #include "ltdl.h" #if defined(WITH_DMALLOC) # include #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #ifndef LT_GLOBAL_DATA # if defined(__WINDOWS__) || defined(__CYGWIN__) # if defined(DLL_EXPORT) /* defined by libtool (if required) */ # define LT_GLOBAL_DATA __declspec(dllexport) # endif # endif # ifndef LT_GLOBAL_DATA # define LT_GLOBAL_DATA /* static linking or !__WINDOWS__ */ # endif #endif #ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ # define __attribute__(x) # endif #endif #ifndef LT__UNUSED # define LT__UNUSED __attribute__ ((__unused__)) #endif LT_BEGIN_C_DECLS #if !defined(errno) extern int errno; #endif LT_SCOPE void lt__alloc_die_callback (void); /* For readability: */ #define strneq(s1, s2) (strcmp((s1), (s2)) != 0) #define streq(s1, s2) (!strcmp((s1), (s2))) /* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ /* This type is used for the array of interface data sets in each handler. */ typedef struct { lt_dlinterface_id key; void * data; } lt_interface_data; struct lt__handle { lt_dlhandle next; const lt_dlvtable * vtable; /* dlopening interface */ lt_dlinfo info; /* user visible fields */ int depcount; /* number of dependencies */ lt_dlhandle * deplibs; /* dependencies */ lt_module module; /* system module handle */ void * system; /* system specific data */ lt_interface_data * interface_data; /* per caller associated data */ int flags; /* various boolean stats */ }; struct lt__advise { unsigned int try_ext:1; /* try system library extensions. */ unsigned int is_resident:1; /* module can't be unloaded. */ unsigned int is_symglobal:1; /* module symbols can satisfy subsequently loaded modules. */ unsigned int is_symlocal:1; /* module symbols are only available locally. */ unsigned int try_preload_only:1;/* only preloaded modules will be tried. */ }; /* --- ERROR HANDLING --- */ /* Extract the diagnostic strings from the error table macro in the same order as the enumerated indices in lt_error.h. */ #define LT__STRERROR(name) lt__error_string(LT_CONC(LT_ERROR_,name)) #define LT__GETERROR(lvalue) (lvalue) = lt__get_last_error() #define LT__SETERRORSTR(errormsg) lt__set_last_error(errormsg) #define LT__SETERROR(errorcode) LT__SETERRORSTR(LT__STRERROR(errorcode)) LT_SCOPE const char *lt__error_string (int errorcode); LT_SCOPE const char *lt__get_last_error (void); LT_SCOPE const char *lt__set_last_error (const char *errormsg); LT_END_C_DECLS #endif /*!defined(LT__PRIVATE_H)*/ redland-1.0.17/libltdl/libltdl/lt__alloc.h0000644000175000017500000000422312155164573015321 00000000000000/* lt__alloc.h -- internal memory management interface Copyright (C) 2004 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__ALLOC_H) #define LT__ALLOC_H 1 #include "lt_system.h" LT_BEGIN_C_DECLS #define MALLOC(tp, n) (tp*) lt__malloc((n) * sizeof(tp)) #define REALLOC(tp, mem, n) (tp*) lt__realloc((mem), (n) * sizeof(tp)) #define FREE(mem) LT_STMT_START { \ if (mem) { free ((void *)mem); mem = NULL; } } LT_STMT_END #define MEMREASSIGN(p, q) LT_STMT_START { \ if ((p) != (q)) { if (p) free (p); (p) = (q); (q) = 0; } \ } LT_STMT_END /* If set, this function is called when memory allocation has failed. */ LT_SCOPE void (*lt__alloc_die) (void); LT_SCOPE void *lt__malloc (size_t n); LT_SCOPE void *lt__zalloc (size_t n); LT_SCOPE void *lt__realloc (void *mem, size_t n); LT_SCOPE void *lt__memdup (void const *mem, size_t n); LT_SCOPE char *lt__strdup (const char *string); LT_END_C_DECLS #endif /*!defined(LT__ALLOC_H)*/ redland-1.0.17/libltdl/configure0000755000175000017500000152742112155164573013514 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libltdl 2.4.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: bug-libtool@gnu.org about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libltdl' PACKAGE_TARNAME='libltdl' PACKAGE_VERSION='2.4.2' PACKAGE_STRING='libltdl 2.4.2' PACKAGE_BUGREPORT='bug-libtool@gnu.org' PACKAGE_URL='' ac_unique_file="ltdl.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LTDLOPEN LT_CONFIG_H CONVENIENCE_LTDL_FALSE CONVENIENCE_LTDL_TRUE INSTALL_LTDL_FALSE INSTALL_LTDL_TRUE ARGZ_H LIBOBJS sys_symbol_underscore LIBADD_DL LT_DLPREOPEN LIBADD_DLD_LINK LIBADD_SHL_LOAD LIBADD_DLOPEN LT_DLLOADERS CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL OBJDUMP DLLTOOL AS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_shared enable_static with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_ltdl_install ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libltdl 2.4.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libltdl] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libltdl 2.4.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libltdl configure 2.4.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libltdl $as_me 2.4.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h:config-h.in" ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # I am me! ## ------------------------ ## ## Automake Initialisation. ## ## ------------------------ ## am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libltdl' VERSION='2.4.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' ## ------------------------------- ## ## Libtool specific configuration. ## ## ------------------------------- ## pkgdatadir='${datadir}'"/${PACKAGE}" ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=yes enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 $as_echo_n "checking which extension is used for runtime loadable modules... " >&6; } if ${libltdl_cv_shlibext+:} false; then : $as_echo_n "(cached) " >&6 else module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 $as_echo "$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_EXT "$libltdl_cv_shlibext" _ACEOF fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_EXT "$libltdl_cv_shrext" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variable specifies run-time module search path" >&5 $as_echo_n "checking which variable specifies run-time module search path... " >&6; } if ${lt_cv_module_path_var+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_module_path_var="$shlibpath_var" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 $as_echo "$lt_cv_module_path_var" >&6; } if test -n "$lt_cv_module_path_var"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 $as_echo_n "checking for the default library search path... " >&6; } if ${lt_cv_sys_dlsearch_path+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 $as_echo "$lt_cv_sys_dlsearch_path" >&6; } if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done cat >>confdefs.h <<_ACEOF #define LT_DLSEARCH_PATH "$sys_dlsearch_path" _ACEOF fi LT_DLLOADERS= ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBADD_DLOPEN= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBDL 1" >>confdefs.h if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" for ac_func in dlerror do : ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" if test "x$ac_cv_func_dlerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLERROR 1 _ACEOF fi done LIBS="$lt_save_LIBS" fi LIBADD_SHL_LOAD= ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld" fi fi case $host_os in darwin[1567].*) # We only want this for pre-Mac OS X 10.4. ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : $as_echo "#define HAVE_DYLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include " if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl _ACEOF LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : $as_echo "#define HAVE_DLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done $as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; } if ${lt_cv_sys_symbol_underscore+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 $as_echo "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 $as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } if ${libltdl_cv_need_uscore+:} false; then : $as_echo_n "(cached) " >&6 else libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" if test "$cross_compiling" = yes; then : libltdl_cv_need_uscore=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; x$lt_dlunknown|x*) ;; esac else : # compilation failed fi fi rm -fr conftest* LIBS="$save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 $as_echo "$libltdl_cv_need_uscore" >&6; } fi fi if test x"$libltdl_cv_need_uscore" = xyes; then $as_echo "#define NEED_USCORE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 $as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } if ${lt_cv_sys_dlopen_deplibs+:} false; then : $as_echo_n "(cached) " >&6 else # PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[4-9]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[12345]*|irix6.[01]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd* | netbsdelf*-gnu) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[1234]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } if test "$lt_cv_sys_dlopen_deplibs" != yes; then $as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h fi : for ac_header in argz.h do : ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default " if test "x$ac_cv_header_argz_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARGZ_H 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) # include #endif " if test "x$ac_cv_type_error_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF else $as_echo "#define error_t int" >>confdefs.h $as_echo "#define __error_t_defined 1" >>confdefs.h fi ARGZ_H= for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ARGZ_H=argz.h; case " $LIBOBJS " in *" argz.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS argz.$ac_objext" ;; esac fi done if test -z "$ARGZ_H"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 $as_echo_n "checking if argz actually works... " >&6; } if ${lt_cv_sys_argz_works+:} false; then : $as_echo_n "(cached) " >&6 else case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 $as_echo "$lt_cv_sys_argz_works" >&6; } if test "$lt_cv_sys_argz_works" = yes; then : $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h else ARGZ_H=argz.h case " $LIBOBJS " in *" argz.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS argz.$ac_objext" ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 $as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } if ${libltdl_cv_preloaded_symbols+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 $as_echo "$libltdl_cv_preloaded_symbols" >&6; } if test x"$libltdl_cv_preloaded_symbols" = xyes; then $as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h fi # Check whether --enable-ltdl-install was given. if test "${enable_ltdl_install+set}" = set; then : enableval=$enable_ltdl_install; fi case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac if test x"${enable_ltdl_install-no}" != xno; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else INSTALL_LTDL_TRUE='#' INSTALL_LTDL_FALSE= fi if test x"${enable_ltdl_convenience-no}" != xno; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else CONVENIENCE_LTDL_TRUE='#' CONVENIENCE_LTDL_FALSE= fi # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in closedir opendir readdir do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" lt__dirent.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lt__dirent.$ac_objext" ;; esac fi done for ac_func in strlcat strlcpy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" lt__strl.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lt__strl.$ac_objext" ;; esac fi done cat >>confdefs.h <<_ACEOF #define LT_LIBEXT "$libext" _ACEOF name= eval "lt_libprefix=\"$libname_spec\"" cat >>confdefs.h <<_ACEOF #define LT_LIBPREFIX "$lt_libprefix" _ACEOF name=ltdl eval "LTDLOPEN=\"$libname_spec\"" ## -------- ## ## Outputs. ## ## -------- ## ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi LT_CONFIG_H=config.h : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libltdl $as_me 2.4.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libltdl config.status 2.4.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config-h.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi redland-1.0.17/libltdl/aclocal.m40000644000175000017500000010450112155164573013432 00000000000000# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/argz.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltdl.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) redland-1.0.17/libltdl/config-h.in0000644000175000017500000001124012155164573013611 00000000000000/* config-h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to a type to use for `error_t' if it is not otherwise available. */ #undef error_t redland-1.0.17/COPYING0000644000175000017500000004310310444336174011174 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. redland-1.0.17/ChangeLog.10000644000175000017500000021735411171007723012056 000000000000002000-12-30 Dave Beckett * expat/Makefile.am, expat/xmltok/Makefile.am: Moved rule using gennmtab to xmltok dir * configure.in: expat,h -> expat.h 2000-12-29 Dave Beckett * repat/Makefile.am: Added rdftests.i * docs/Makefile.am: Extra 'a' in api-big.html rule * acconfig.h: Added RDFPARSE_INCLUDE_XMLPARSE for expat headers * configure.in: Updated to handle Repat 2000-12-24 with rdftest and old/new expat headers * repat/Makefile.am: Updated to handle Repat 2000-12-24 with rdftest * repat/rdftest.c, repat/rdftests.i, repat/rdfparse.h, repat/rdfparse.c, repat/rdfdump.c, repat/CHANGES: Updated to Repat 2000-12-24 * repat/expat.h: Deleted, fixed via configure 2000-12-06 Dave Beckett * redland.spec.in: Updated description Tidied SMP code (never tested) Made clean code be careful Changed installed user/groups Updated list of includes 2000-12-01 Dave Beckett * perl/dc.rdf: Small test file for example.pl * perl/Makefile.am: Added dc.rdf test file to dist 2000-11-30 Dave Beckett * perl/Makefile.am: Added example.pl to the release * example4.c: Updated for new concept names 2000-11-27 Dave Beckett * rdf_utf8.h, rdf_utf8.c: UTF-8 support * Makefile.am: Added rdf_utf8.c, rdf_utf8.h * rdf_parser_sirpac.c: Updated for new concept names * rdf_concepts.h, rdf_concepts.c: Amended concepts to include rdf:RDF and rdf:Description - useful for Redland's RDF parser. 2000-11-22 Dave Beckett * rdf_uri.c (librdf_new_uri_normalised_to_base): Handle fragment URIs relative to base. * rdf_uri.c (librdf_new_uri_normalised_to_base): When URI is NULL or "" and relative to a base URI, just make a new URI from the base URI. * rdf_parser_repat.c: XML literals - note problem with namespaces in results. 2000-11-21 Dave Beckett * repat/Makefile.am: Added expat.h - shim since Repat moved to new expat sources, header files * rdf_parser_repat.c: Final changes to interface with repat to handle parseType=literal and rdf:_'ordinal' Pass on some more fatal errors and tidy up better when things go wrong at RDF or XML layer. * perl/rss-dump.pl: Show namespaced-properties off channel. * perl/lib/RDF/RSS.pm (items): Return channel items in correct order (from rdf:_n properties) * repat/repat.html, repat/rdfparse.h, repat/expat.h, repat/README, repat/CHANGES: Synchronised with repat 2000-11-10 (no code changes) 2000-11-19 Dave Beckett * rdf_statement.h: Replaced #define-s for statement parts with enum; makes for potentially better compiler checking 2000-11-17 Dave Beckett * perl/rss-dump.pl: Updated to dump all & particular namespaced properties off nodes. * perl/lib/RDF/Node.pm: Defined node type constants for use with type method. * perl/lib/RDF/RSS.pm (property): Added, returns value of a property off a node. (properties): Added, returns all properties off a node. (properties_with_ns_prefix): Added, returns NS-prefixed properties off a node. 2000-11-15 Dave Beckett * perl/lib/RDF/RSS.pm: Removed accessors since RDF::RSS is a RDF::Model and can use methods from there. Renamed method RDF::RSS::Node method url to image_url to lessen confusion with uri method on RDF::Node 2000-11-14 Dave Beckett * rdf_stream.c (librdf_stream_from_node_iterator_next_statement): Added cast to librdf_node* from iterator get_next * rdf_storage_hashes.c: (librdf_storage_hashes_add_remove_statement, librdf_storage_hashes_contains_statement, librdf_storage_hashes_node_iterator_create) Added some missing casts from return value of LIBRDF_MALLOC Replaced some char* with unsigned char* when used as encoding/decoding buffers (librdf_storage_hashes_serialise_next_statement, librdf_storage_storage_hashes_node_iterator_get_next): Added casts for statement encode/decode parameters (from void*) * rdf_parser_repat.c (librdf_parser_repat_serialise_finished): Added cast to librdf_statement* from list pop * rdf_parser_libwww.c (librdf_parser_libwww_parse_common): Store pcontext (correct type) rather than context (void*) (librdf_parser_libwww_get_next_statement): Added cast to librdf_statement* from list pop * rdf_hash.c: Added some missing casts from return value of LIBRDF_MALLOC and some arguments to strlen * perl/lib/RDF/RSS.pm: RDF::RSS ISA RDF::Model now - makes code tidier too. 2000-11-12 Dave Beckett * perl/Makefile.am: How did python references get in here? 2000-11-08 Dave Beckett * Redland.i: Declare librdf_iterator_get_next returns librdf_node* which is true, at the user level. * configure.in: Make 'make clean' work when python isn't available * rdf_parser.c: Tidy of warning / error message format * perl/MANIFEST: Added RDF::RSS and rss-dump.pl * perl/rss-dump.pl: RSS 1.0 test program for RDF::RSS * perl/lib/RDF/URI.pm (_new_from_object): Created. * perl/lib/RDF/Node.pm (new_from_uri_string): Die if no URI is given. (uri): Return an RDF::URI object * perl/lib/RDF/Model.pm (find_statements,get_arcs,get_sources,get_targets): Retrieve all results if evaluated in a Perl list context. Makes this common thing easy to do. In scalar context return a Rdf::Stream of RDF::Statement-s or RDF::Iterator of RDF::Node-s as before. * perl/lib/RDF/Makefile.am: Added RSS.pm * perl/lib/RDF/Iterator.pm (new): Take a list of creators for the nodes that were used to create the iteration. * perl/lib/RDF/RSS.pm: Redland Perl RSS 1.0 module 2000-11-06 Dave Beckett * configure.in: Bump version to 0.9.7 * Snapshotted redland_0_9_6 for 0.9.6 release * redland.spec.in: Tidy for 0.9.6 release * python/setup.py: Use string.strip for python 1.5/2.0 compatibility 2000-11-05 Dave Beckett * docs/api.sgml.in: Minor updates to link to new modules. * docs/Makefile.am: Worked out a way to make 1 big HTML API document 2000-11-04 Dave Beckett * redland.spec.in: Added Perl and Python docs * docs/Makefile.am: Reordered doc sections Added documentation for perl, python interfaces. * Makefile.am: Added SWIG 1.3a5 common perl/python interface file * rdf_storage_hashes.c (librdf_storage_hashes_init_common): On any hash creation failure, end construction. Correct the clean up during creation failures * rdf_storage.c (librdf_new_storage_from_factory): Don't free options on failure - will be done by storage factory * rdf_parser_repat.c, rdf_parser_redland.c: Updated comment documentation for parser API changes * example4.c: Tidy up properly when parsing fails * python/RDF.py: Updates for SWIG 1.3a5 * python/Makefile.am, python/MANIFEST.in, perl/MANIFEST, perl/Makefile.PL, perl/Makefile.am: Updates for SWIG 1.3a5 and common perl/python interface file * Redland.i: Merged of perl/python versions * perl/Redland.i, python/Redland.i: Moved to root src dir * perl/lib/RDF/Statement.pm (new,new_from_statement,_new_from_object,new_from_nodes): Return undef on failure to create an librdf_statement * perl/lib/RDF/Node.pm (new,new_from_uri_string,new_from_uri,new_from_literal,new_from_node,_new_from_object): Return undef on failure to create an librdf_node * perl/lib/RDF/URI.pm (new,new_from_uri): Return undef on failure to create an librdf_uri * perl/lib/RDF/Parser.pm (feature): Use $uri consistently. * perl/example.pl: Use repat as test parser since it's always included. 2000-11-03 Dave Beckett * Makefile.am: Don't compile java classes here for the moment * rdf_parser_libwww.c: Updates for new parser API 2000-11-02 Dave Beckett * rdf_parser_sirpac.c: Updated for changed parser API Split for 2 SiRPAC implementations - W3C and Stanford Support for streaming/static support via Java --streaming/--static depending on whether the parser features aboutEach/prefix are set. * rdf_parser_repat.c: Updated for changed parser API Start to gather parseType literal content - unfinished. * rdf_parser_redland.c: Updated for changed parser API Other minor changes * rdf_parser_libwww.c: Updated for changed parser API * rdf_parser.c: Updated for changed parser API: Constructor takes optional MIME type, URI of syntax Added error/warning handling methods and callbacks Added set/get parser features Modifications for 2 SiRPACs * rdf_parser.h: Changed parser API: Constructor takes optional MIME type, URI of syntax Added error/warning handling methods and callbacks Added set/get parser features * configure.in: Added python support and configuration Updated for 2 sirpac parsers, SAX and added lots more configuration * rdf_concepts.h, rdf_concepts.c: Fixed bad ordering of rdf:/rdfs: concepts. They may be all correct now but since this hasn't been machine generated or validated, no guarantee. * example1.c: Update for new parser constructor * acconfig.h: Updated Java parser defines for SiRPAC, SAX * PrintParser.java: Updated to have --streaming/--static flags to pick parser modes. Tidied messages and error reporting. * example4.c: Update for new parser constructor Set rdf:aboutEach/prefix parser features depending on the type of parse: parse (model) - yes or parse-stream - no * python/Makefile.am: Remove obsolete fake lib stuff - not compiling separate C module * python/setup.py: Another attempt to get the linking libraries line right * python/MANIFEST.in: Tweaked to pick up test dir * python/Makefile.am: Need to use includes in top srcdir * python/test/Makefile.am: Added to make autoconf-able * perl/example.pl: Updated for new parser constructor api * perl/Redland.i: Updated for new parser APIs - constructor, features * perl/Makefile.am: Pass installation prefix on to perl commands * perl/lib/RDF/Parser.pm (new): Updated for parser constructor args (feature): Added to get/set parser features * python/test/test.py, python/setup.py, python/Makefile.am, python/MANIFEST.in, python/RDF.py, python/README, python/Redland.i, python/setup.cfg: Python interface 2000-10-26 Dave Beckett * rdf_parser_repat.c, rdf_parser_libwww.c: Updated for amended parser API with base URIs Use the base URI to fix IDs relative to source URIs (file names) * rdf_parser_redland.c, rdf_parser_sirpac.c: Updated for amended parser API with base URIs * rdf_parser.h: Updated prototypes for librdf_parser_parse_as_stream and librdf_parser_parse_into_model) to pass base URIs in. Updated factory API to have general URI/file: URI versions of methods * rdf_parser.c: (librdf_parser_parse_as_stream,librdf_parser_parse_into_model): Updated to pass base URIs to parsers and deal with parsers that only do file: URIs (have no built in HTTP etc. networking code). * example4.c: Updated for amended parser API with base URIs Split parse into parse into model / parse as stream into model * example1.c: Updated for amended parser API with base URIs * repat/repat.html, repat/rdfparse.h, repat/rdfparse.c, repat/rdfdump.c, repat/CHANGES: Updated to Repat 2000-10-22 * perl/example.pl: Updated to have parsing too. Tidied message output * perl/Makefile.PL, perl/Makefile.am: Zap redland_perl.c - can do in perl land. * perl/redland_perl.c: Deleted, can do in perl land * perl/Redland.i: Zap get_empty_* functions * perl/Redland.i: Update parse APIs now taking base uri parameters. * perl/test.pl: Update for strictness - use "" for undef-s in places. * perl/lib/RDF/Iterator.pm (next): Document why the returned librdf_node-s are wrapped this way. * perl/lib/RDF/Model.pm (serialise): Return stream of librdf_statement-s that should freed (find_statements): Return stream of librdf_statement-s that should NOT be freed * perl/lib/RDF/Parser.pm (parse_as_stream,parse_into_model): Update for base uris * perl/lib/RDF/Statement.pm (new_from_nodes): Use undef for C-land NULLs. (_new_from_object): Allow control over freedom of wrapped librdf_statement object. (subject,predicate,object): Fixed using these to set a statment part which didn't work at all. * perl/lib/RDF/Stream.pm (new,next): Track if streamed librdf_statement objects should be freed as you go or left (shared, handled by librdf_stream destruction) * perl/lib/RDF/Node.pm (new_from_node): Use internal object reference not RDF:::Node one to get copy of node (_new_from_object): Don't free librdf_nodes attached this way, at present they are shared. (DESTROY): Support for freeing protection 2000-10-24 Dave Beckett * rdf_node.h: Added prototype for librdf_new_node_from_normalised_uri_string * rdf_node.c (librdf_new_node_from_normalised_uri_string): Added to create nodes with URIs relative to new bases * rdf_uri.h: Added prototypes for librdf_new_uri_normalised_to_base, librdf_uri_is_file_uri, librdf_uri_as_filename * rdf_uri.c (librdf_new_uri_normalised_to_base): Added to create URIs for objects relative to new bases (librdf_uri_is_file_uri): Return true if URI is a file (librdf_uri_as_filename): Get the filename from URI (shared) Updated test code to check the normalising works * configure.in, acconfig.h: Added JAVA_CLASS_DIR * perl/lib/RDF.pm: Call librdf_init_world with "" for empty char* field, swig is happier that way. * perl/lib/RDF/Parser.pm (new): Return undef when object creation fails (parse_into_model): Use correct internal reference * perl/lib/RDF/Stream.pm (end, next): Return empty stream when stream object undef 2000-10-20 Dave Beckett * redland.spec.in: Added perl RPM * configure.in: Bump version to 0.9.6 * redland.spec.in: zap rdf_context.h from devel RPM * Snapshotted redland_0_9_5 for 0.9.5 release * rdf_parser.c (librdf_init_parser): Make Repat the default RDF parser since it is always available. * configure.in: Another round of XML parser configuration work, tests. Now assumes expat and libxml may live in dirs called those names * Makefile.am: Added rdf_parser_repat.c to distribution * repat/Makefile.am: No need for CFLAGS changes 2000-10-19 Dave Beckett * rdf_list.h, rdf_list.c: Made list implementation be double-linked so can remove at both ends * rdf_parser.h, rdf_parser.c: Added repat * rdf_parser_repat.c: Repat RDF Parser implementation * configure.in: Added tests for repat RDF parser and configuring repat sub directory * acconfig.h: Added HAVE_REPAT_RDF_PARSER * repat/rdfdump.c, repat/rdfparse.c, repat/rdfparse.h, repat/repat.html, repat/CHANGES, repat/Makefile.am, repat/README: Imported Repat dated 2000-10-14 2000-10-13 Dave Beckett * configure.in: Check for XML_Parser_Create in xmlparse, don't need expat namespace support any more * Makefile.am: Added concepts, removed contexts * rdf_parser_redland.c: Track namespace declarations in/out of XML parsing scope (librdf_parser_redland_free): Created * rdf_concepts.c: Initialise namespace uri static pointers to NULLs 2000-10-12 Dave Beckett * librdf.h: Removed contexts * rdf_statement.h: Lots of changes throughout to make librdf_statement be librdf_node. No user visible changes to the interface. Removed all context interface references * rdf_node.h: Lots of changes throughout to make nodes be Statements (done) and other RDF concepts (not done yet). * rdf_statement.c: Lots of changes throughout to make librdf_statement be librdf_node. No user visible changes from this interface. Removed all references to contexts - these will be done another way * rdf_node.c: Lots of changes throughout to make nodes be Statements (done) and other RDF concepts (not done yet). (librdf_finish_node): Added Use const char* instead of char* where appropriate (librdf_new_node_from_uri_qname): Added, to create a new from a URI+qname * rdf_uri.h: Try using const char* instead of char* Added librdf_new_uri_from_uri_qname * rdf_uri.c: (librdf_new_uri, ..) Try using const char* instead of char* (librdf_new_uri_from_uri_qname): Create a URI from an existing URI plus a qname * rdf_init.c (librdf_destroy_world): Reorder destruction order to be reverse of creation Added concepts init/finish stuff * rdf_concepts.c, rdf_concepts.h: RDF Model, Syntax and Schema concepts * rdf_context.h: Not needed 2000-10-10 Dave Beckett * perl/example.pl: Exercise the methods for retrieving statement parts and the as_string methods * perl/lib/RDF/Statement.pm (object): Extra return removed, oops. 2000-10-06 Dave Beckett * perl/lib/RDF/Statement.pm (subject,predicate,object): Return new RDF::Node objects 2000-10-02 Dave Beckett * perl/Makefile.am: make clean now tidies everything generated except for swig-derived output * perl/redland_perl.c, perl/Redland.i: Added redland_perl_get_empty_hash 2000-10-02 Dave Beckett * perl/Makefile.am: make clean now tidies everything generated except for swig-derived output * perl/redland_perl.c, perl/Redland.i: Added redland_perl_get_empty_hash 2000-10-01 Dave Beckett * perl/Makefile.PL: Add all remaining libs to linkin from output of redland --libs * perl/Redland.i: Remove support for librdf_uri_as_string since librdf_uri_to_string is better for Perl, it owns the new memory. * perl/test.pl: Added Redland:: and RDF:: versions of all tests. * perl/lib/RDF/Statement.pm: Add flag to avoid freeing a 'wrapped' object created and owned by librdf * perl/lib/RDF/Model.pm: When creating streams or iterators, return a reference to this model so that the objects can keep a reference to this object preventing premature destruction before this object. * perl/lib/RDF/URI.pm (as_string): Use librdf_uri_to_string to prevent sharing a char* pointer. * perl/lib/RDF/Stream.pm: Track the object that created the RDF::Stream object so we don't get freed before it does. * perl/lib/RDF/Iterator.pm: Track the object that created the RDF::Iterator object so we don't get freed before it does. 2000-09-29 Dave Beckett * configure.in: Bump version to 0.9.4 * Snapshotted redland_0_9_4 for 0.9.4 release * perl/example.pl: Redland eaxmple Perl program * perl/Makefile.PL: Convert output of redland-config --libs into absolute dirs - hack. * perl/Makefile.am: Added redland_perl.c * perl/redland_perl.c: Extra SWIG-perl / redland interfaces for Redland * perl/Redland.i: Added redland_perl_get_empty_node to get (librdf_node*)NULL pointers - there must be an easier way to do this. * perl/test.pl: More warnings, error checking. Turn on debugging if TEST_VERBOSE envariable defined Check statement querying, serialising and printing * perl/lib/RDF/URI.pm: Use $RDF::Debug * perl/lib/RDF/Stream.pm: Use $RDF::Debug (next) Fixed to return RDF::Statement objects * perl/lib/RDF/Storage.pm: Use $RDF::Debug Make constructors return undef on failure * perl/lib/RDF/Statement.pm: Use $RDF::Debug (new_from_nodes) Replace undef node references with NULL librdf_node pointers and tidy up more carefully. (_new_from_object): Created to make perl objects from librdf_statement objects created by librdf * perl/lib/RDF/Parser.pm: Use $RDF::Debug * perl/lib/RDF/Node.pm: Use $RDF::Debug (_new_from_object): Created to make perl objects from librdf_node objects created by librdf * perl/lib/RDF/Model.pm: Use $RDF::Debug Make constructors return undef on failure (add_statement): Don't zap things that don't exist. * perl/lib/RDF/Iterator.pm: Use $RDF::Debug (next) Renamed from get_next, fixed to return RDF::Node objects * perl/lib/RDF.pm: Added $RDF::Debug variable. 2000-09-28 Dave Beckett * rdf_parser_redland.c: Redland RDF Parser implementation * configure.in: Check for libxml using xml-config program and insert xml-config invocations into LIBS and CFLAGS when needed. Don't build libwww rdf parser if RDF support isn't in it. * Makefile.am: Added rdf_parser_redland.c * configure.in: Fix XML library checking tests Add XML objects to librdf when using local copies from source Added perl directory to subdirs list and use automakefiles there * Makefile.am: Added XML_OBJS to allow XML parser objects to be in librdf.a when necessary * perl/Makefile.PL: Receive configuration values (package, version, top src dir) from environment * perl/Makefile.am: Added perl build, check, install, clean etc support * perl/lib/RDF/Makefile.am, perl/Makefile.am, perl/lib/Makefile.am: Added automake for perl * perl/Makefile.PL: Output to Makefile.perl Ensure only .pm files are installed * perl/MANIFEST, perl/MANIFEST.SKIP, perl/lib/RDF/Storage.pm, perl/lib/RDF/Stream.pm, perl/lib/RDF/URI.pm, perl/lib/RDF/Iterator.pm, perl/lib/RDF/Model.pm, perl/lib/RDF/Node.pm, perl/lib/RDF/Parser.pm, perl/lib/RDF/Statement.pm, perl/Makefile.PL, perl/Redland.i, perl/lib/RDF.pm, perl/test.pl: Added perl interface * rdf_init.c: export copyright and version constants 2000-09-27 Dave Beckett * rdf_parser.c (librdf_init_parser): Don't use redland RDF parser by default - not working yet. * expat/xmltok/Makefile.am: Add -DXML_NS for expat - enabling namespace support. * rdf_parser.h: Prototype for redland librdf_parser_redland_constructor * rdf_parser.c: Initialise redland (internal) parser if present * configure.in: Added expat / libxml configuration - searching in system or source tree Added configurable rdf parser option --enables-parsers * acconfig.h: Added NEED_EXPAT and NEED_LIBXML * Makefile.am: Reorganised header macros Added LICENSE.txt to dist 2000-09-25 Dave Beckett * acconfig.h: Added HAVE_REDLAND_RDF_PARSER 2000-08-31 Dave Beckett * librdf.h, rdf_storage_hashes.c, rdf_hash.c, rdf_heuristics.c: Use rdf_heuristics.h header * rdf_init.c: Use rdf_init.h header * rdf_init.h: Overall library initialisation / termination prototypes * rdf_heuristics.h: Heuristic routines to guess things about RDF prototypes * redland.spec.in: RPM spec file * configure.in: Bump version to 0.9.4 2000-08-30 Dave Beckett * Snapshotted redland_0_9_3 for 0.9.3 release * example4.c: oops - s/new/free/ * docs/Makefile.am: Tidy order of junk * example4.c: Added parse command. * example4.c: initialise cmd * Makefile.am: Added autogen.sh to distribution. * autogen.sh: Generates the initial makefiles from a pristine CVS tree * configure.in: Configure Java sources * Makefile.am: Maintainer - compile the java classes Add the sources and classes to the release 2000-08-28 Dave Beckett * PrintParser.java: Use streaming SiRPAC to parse RDF/XML content to triples * PrintConsumer.java: SiRPAC RDF consumer that prints out triple as they are added * rdf_parser_sirpac.c: Use SiRPAC in streaming mode via local PrintParser class * configure.in: Don't check for HTRDFParseFile yet * rdf_stream.h: Added prototype for librdf_new_stream_from_node_iterator * rdf_stream.c (librdf_new_stream_from_node_iterator): Added, creating a stream from a node iterator and a partial statement. (librdf_stream_from_node_iterator_end_of_stream, librdf_stream_from_node_iterator_next_statement, librdf_stream_from_node_iterator_finished): Added, implementing the stream for the above function. * rdf_storage_hashes.c: Updated comments in storage hashes context structure. (librdf_storage_hashes_find_sources,librdf_storage_hashes_find_arcs,librdf_storage_hashes_find_targest): Added and implemented returning an interator over sources, arcs, targets nodes for storage hashes. (librdf_storage_storage_hashes_node_iterator_have_elements, librdf_storage_storage_hashes_node_iterator_get_next, librdf_storage_storage_hashes_node_iterator_finished): Added, implementing the iterator API for the above node iterators (librdf_storage_hashes_node_iterator_create): Added helper function to create the iterator for the above node iterators. * rdf_storage.c (librdf_storage_node_stream_to_node_create): Added, implementing duplicated code that was in get sources, targets and arcs methods. * rdf_statement.h: Update documentation about use of statement parts macros * rdf_statement.c (librdf_new_statement_from_statement): Copy partial statements correctly and return an error only when a node copy fails. * rdf_node.c (librdf_new_node_from_node): Return NULL (fail) when given NULL node * rdf_init.c (librdf_init_world): More documentation added. * rdf_hash_memory.c: Corrected librdf_hash_memory_exists return code documentation. * rdf_hash_bdb.c (librdf_hash_bdb_exists): Corrected return code documentation. When want key/value, for earlier BDB V2, with no DB_GET_BOTH flag, implement using cursor and for BDB V1, using sequence (V1 not tested) * rdf_hash.c: Corrected librdf_hash_exists return code documentation. * Makefile.am: clean test databases * example4.c: Tidied code, removed some duplicate long expressions. Added more detailed usage. * configure.in: Check for HTRDFParseFile in libwww * docs/Makefile.am: Added hash cursor, storage hashes, heuristics sections Amended rules to build HTML api automatically when SGML changes * docs/api.sgml.in: Added hash cursor, storage hashes, heuristics sections 2000-08-27 Dave Beckett * rdf_storage_hashes.c: Updated for new hash API (librdf_storage_hashes_init_common): Created from init method to provide core code for init and clone. (librdf_storage_hashes_clone): Created and works. (librdf_storage_hashes_add_remove_statement): Create from add_statement method to provide core code for add/remove statement (librdf_storage_hashes_remove_statement): Implemented. * example4.c: Can now check for statements with contains, add and remove statements. * example1.c: Set new=yes to create new storage * Makefile.am: Added examples target * rdf_hash_memory.c, rdf_hash_bdb.c, rdf_hash.h, rdf_hash.c: Updated for new hash API * rdf_heuristics.c (librdf_heuristic_gen_name): Fix an off-by-one error. * rdf_model.h: Removed librdf_new_model_from_stream prototype - not needed * rdf_model.c (librdf_new_model_from_stream): Deleted, not needed. A model can be created using librdf_new_model and statements added from a stream using librdf_model_add_statements * rdf_uri.c: Updated for new hash API 2000-08-26 Dave Beckett * example3.c: option hash_type -> hash-type * Makefile.am: Added example4 * example4.c: Redland example code querying stored triples * rdf_hash_gdbm.c: Updated for cloning support but not tested - it compiles and that's all. * example1.c: option hash_type -> hash-type * rdf_hash_memory.c: Update context for clone support (librdf_hash_memory_create): Added object creation call (librdf_hash_memory_destroy): Added object destruction call - memory freeing is now done here. (librdf_hash_memory_open): Now a nop (librdf_hash_memory_close): Now a nop (librdf_hash_memory_clone): Added clone method * rdf_hash_bdb.c: Update context for clone support (librdf_hash_bdb_create): Added object creation call (librdf_hash_bdb_destroy): Added object destruction call (nop) (librdf_hash_bdb_open): Initialise more state for use by clone (librdf_hash_bdb_clone): Added clone method, calling librdf_hash_bdb_open * rdf_storage.c (librdf_new_storage_from_storage): Correct order of storage initialisation * rdf_storage.h: Added clone method * example2.c: option hash_type -> hash-type * rdf_hash.c (librdf_new_hash_from_factory): Call factory create method (librdf_new_hash_from_hash): Generate a new identifier for copy, pass on to hash factory clone method to do work. (librdf_free_hash): Call factory destroy method too. (librdf_hash_open): Copy and store identifier for later use. (librdf_hash_close): Free store identifier Test code: test hash cloning and get as long and boolean methods * rdf_hash.h: Rename prototype arg to prevent clash with type defined in gdbm.h hash object now stores identifier, for later use when cloning In hash factory: Amended clone method to take necessary parameters. Added create and destroy methods for work at hash object creation / destruction * librdf.h: Made librdf_heuristic_object_is_literal public again - useful in user code. 2000-08-25 Dave Beckett * rdf_storage_hashes.c: Keep a copy of the hash_type and db_dir options, for use in cloneing renamed "hash_type" option to "hash-type" * rdf_storage.h: Added storage factory clone function Added librdf_new_storage_from_storage prototype. * rdf_storage.c (librdf_new_storage_from_storage): Added, uses clone method of factory if defined (else dies at present) * rdf_heuristics.c: Added include to get strncpy prototype * rdf_model.c (librdf_new_model_from_model): Implemented by making librdf_new_storage_from_storage to do all the work. * Makefile.am: rdf_heuristics_test test added * rdf_heuristics.c (librdf_heuristic_gen_name): Added. Test code - added for librdf_heuristic_gen_name * configure.in: Check for mkstemp mktemp tmpnam, used in librdf_heuristic_gen_name * rdf_hash.h: Added hash factory clone function Added librdf_new_hash_from_hash prototype. * rdf_hash.c (librdf_new_hash_from_hash): Copy constructor added - requires hash factory clone function to be implemented 2000-08-22 Dave Beckett * librdf.h: Attempt to split public / private header files * rdf_parser_sirpac.c: Don't throw away SiRPAC stderr output (error messages), and display warning if pipe closes or sirpac execution seems to fail. * rdf_files.h, rdf_files.c: RDF File and directory handling utilities * configure.in: Bump version to 0.9.3 * example3.c: Redland example code creating model, statement and storing it in 10 lines * Makefile.am: Added example3, renamed example to example1 * example.c, example1.c: example.c renamed to example1.c * rdf_statement.h: Added librdf_new_statement_from_nodes prototype * rdf_statement.c (librdf_new_statement_from_nodes): Added, creates a new statement from node objects - useful for chaining calls to create statements. * rdf_digest.c: Test code: check digest answers against known correct values 2000-08-21 Dave Beckett * Snapshotted redland_0_9_2 for 0.9.2 release * acconfig.h, configure.in, rdf_init.c: configure now splits and generates sub-version numbers * Makefile.am: Add api directory to distribution, remove it when really cleaning * docs/Makefile.am: Tidy up before building SGML file * docs/build-docs: Fix kernel-doc problem ignoring &librdf_foo stuff * docs/api.sgml.in: Added new section "Introduction to Objects in C" outlining conventions for methods, constructors etc. * docs/Makefile.am: Added overview.pdf, some make targets for overview.* * docs/overview.xfig: Added title, copyright. Made a little smaller 2000-08-18 Dave Beckett * docs/Makefile.am: Added API overview files * docs/overview.xfig: API overview XFig * Snapshotted redland_0_9_1 for 0.9.1 release * Updated for 0.9.1 * configure.in: Emit warnings if no persistant storage or RDF parsers configured * configure.in, rdf_init.c: Bump version to 0.9.1 * configure.in: BDB V1 does not work - make configure warn and disable BDB support if only that version is found. * rdf_hash_bdb.c (librdf_hash_bdb_cursor_init): cursor creation failures were not passed on. (librdf_hash_bdb_cursor_get): Make it compile with BDB V1 - may not work. * Snapshotted redland_0_9_0 for 0.9.1 release * configure.in: Now 0.9.0 * rdf_init.c: Added copyright and version constants * Makefile.am: Moved headers around, tried to put correct ones installed. No promises. * example2.c, example.c: Updated file descriptions * rdf_uri.c, rdf_stream.c, rdf_storage_list.c, rdf_storage_hashes.c, rdf_storage.c, rdf_statement.c, rdf_parser_sirpac.c, rdf_parser_libwww.c, rdf_parser.c, rdf_node.c, rdf_model.c, rdf_memory.c, rdf_list.c, rdf_iterator.c, rdf_init.c, rdf_heuristics.c, rdf_hash_memory.c, rdf_hash_gdbm.c, rdf_hash_cursor.c, rdf_hash_bdb.c, rdf_hash.c, rdf_digest_openssl.c, rdf_digest_md5.c, rdf_digest.c: Inside librdf - redland.h -> librdf.h * redland.h: Fix macros * redland.h: Now just a main header, including component headers * librdf.h: redland.h -> librdf.h * Makefile.am, redland-config.in: libredland -> librdf 2000-08-17 Dave Beckett * Makefile.am, librdf.h, redland.h: librdf.h->redland.h * rdf_parser.c, rdf_parser_libwww.c, rdf_parser_sirpac.c, rdf_statement.c, rdf_storage.c, rdf_storage_hashes.c, rdf_storage_list.c, rdf_stream.c, rdf_uri.c, rdf_hash_cursor.c, rdf_hash_gdbm.c, rdf_hash_memory.c, rdf_heuristics.c, rdf_init.c, rdf_iterator.c, rdf_list.c, rdf_memory.c, rdf_model.c, rdf_node.c, example.c, example2.c, rdf_digest.c, rdf_digest_md5.c, rdf_digest_openssl.c, rdf_hash.c, rdf_hash_bdb.c: librdf.h -> redland.h * .cvsignore: librdf->redland * MPL.html: Mozilla Public License V1.1 * librdf.h, Makefile.am, configure.in: librdf->redland * redland-config.in: Renamed from librdf-config.in * librdf-config.in: Renamed to redland-config.in * rdf_init.c, rdf_heuristics.c: librdf->redland * docs/build-docs: License now LGPL/MPL * docs/api.sgml.in: librdf->redland Reordered to put most public interfaces at top. * Makefile.am: Put MPL.html in distribution. * docs/Makefile.am: Added README, README.html and build it * configure.in: Ooh lets call it redland, V0.9 * Makefile.am, configure.in: librdf->redland * configure.in, TODO.html, README.html, NEWS.html, Makefile.am, LICENSE.html, INSTALL.html, FAQS.html, librdf-config.in, rdf_digest_md5.c, rdf_storage_hashes.h, rdf_storage_list.c, rdf_storage_list.h, rdf_stream.c, rdf_stream.h, rdf_types.h, rdf_uri.c, rdf_uri.h, rdf_parser_sirpac.c, rdf_statement.c, rdf_statement.h, rdf_storage.c, rdf_storage.h, rdf_storage_hashes.c, rdf_iterator.c, rdf_iterator.h, rdf_list.c, rdf_list.h, rdf_memory.c, rdf_model.c, rdf_model.h, rdf_node.c, rdf_node.h, rdf_parser.c, rdf_parser.h, rdf_parser_libwww.c, rdf_hash.h, rdf_hash_bdb.c, rdf_hash_bdb.h, rdf_hash_cursor.c, rdf_hash_gdbm.c, rdf_hash_gdbm.h, rdf_hash_memory.c, rdf_hash_memory.h, rdf_heuristics.c, rdf_init.c, example.c, example2.c, librdf.h, rdf_context.h, rdf_digest.c, rdf_digest.h, rdf_digest_openssl.c, rdf_hash.c: License now LGPL/MPL * rdf_node.c: Correct module comment header * example2.c: Store triples on disk in BDB hashes * example.c: Update librdf_new_storage calls to include identifier and options Only print search result streams if streams were created. * rdf_storage.h: Added new terminate storage method Update librdf_new_storage* prototypes to include identifier * rdf_storage.c: Use and initialise the storage as hashes module. Updated some comment documentation. (librdf_new_storage): New API now gets name passed in - since compulsory, no reason to stick in options. Create options hash here and pass on to librdf_new_storage_from_factory, which then owns it. (librdf_new_storage_from_factory): New API including name. Now owns the options hash, so delete it on error or finishing. (librdf_free_storage): Terminate storage class before freeing. (librdf_storage_stream_to_node_iterator_finished): Delete partial statement parts, stream only if allocated. Test code: Update to new storage open api * rdf_hash.h: Updated librdf_hash_open and factory open method to new api * rdf_hash.c (librdf_free_hash,librdf_hash_open,librdf_hash_close): Make sure hash is closed before freeing - easy to forget! (librdf_hash_open): New api with is_writable and is_new fields - compulsory for this internal interface so make them arguments not stuck in the options. (librdf_hash_get): Copy data out of value returned from librdf_hash_get_one hash datum and \0 terminate since we want a string. Don't free the key string passed in. (librdf_hash_get_one): Copy data out of hash datum returned by cursor (shared) into new one, returned to caller. (librdf_hash_from_string): More debugging code, remove 1 state, handle keys with '-' and '_' in them. Test code: Updated for new open api * rdf_storage_list.c (librdf_storage_list_init): Use new api. Free passed in options, since not used here. Added new storage terminate method (librdf_storage_list_add_statements): Free stream after finishing with it. * rdf_parser_libwww.c: Updated comment documentation. * rdf_hash_bdb.c: Changed hash open method to new api (librdf_hash_bdb_open): Use the new is_new and is_writable flags to do correct thing with options. Use the mode argument for file creation rather than the previous encoded 0644 * rdf_hash_memory.c: Changed hash open method to new api (librdf_hash_memory_find_node): Fail search if hash is empty (librdf_hash_memory_cursor_get,librdf_hash_memory_cursor_finish): Store last key, value found and free them during cursor use and when finished. * rdf_parser_sirpac.c: sirparc -> sirpac throughout (librdf_parser_sirpac_serialise_finished): Free statement used internally on finish. * rdf_uri.c (librdf_init_uri): Updated to new librdf_hash_open args (librdf_new_uri): Free hash value once pointer has been extracted. This code still makes me ill to look at. * rdf_stream.c (librdf_stream_end): NULL streams are always finished - useful for helping calling code to be smaller. * rdf_statement.h: Added prototypes_t for encode/decode routines * rdf_statement.c (librdf_statement_encode, librdf_statement_encode_parts,librdf_statement_decode): Added for serialising/deserialising statements into/out of buffers. Test code: Added tests for above * rdf_node.h, rdf_node.c: Use size_t for encode/decode routine lengths * rdf_model.c: Update to new librdf_new_storage args * configure.in: Don't stomp over configure default CFLAGS 2000-08-16 Dave Beckett * Makefile.am: Added rdf_storage_hashes.[ch] * rdf_storage_hashes.h, rdf_storage_hashes.c: Storage in multiple hashes 2000-08-15 Dave Beckett * rdf_node.c: Fix return values from librdf_node_set_uri - previously wrong or ignored (however never fails at present) (librdf_node_encode, librdf_node_decode): Serialise/deserialise node to buffer Test code - added encoding/decoding test * rdf_parser_libwww.c (librdf_parser_libwww_parse_common): Renamed from dumb name librdf_parser_libwww_parse_as_stream2. Parsing into model now works. * example.c: Use parse_into_model method * rdf_parser_sirpac.c, rdf_parser_libwww.c, rdf_parser.h, rdf_parser.c: Renamed method parse_from_uri to parse_as_stream and added parse_into_model method * example.c: Expanded to do querying using find_statement and get_targets methods of model. * rdf_storage.c: (librdf_storage_get_sources,librdf_storage_get_arcs,librdf_storage_get_targets): Added, either calling storage factory if supported, otherwise provided using the storage factory method find_statements and an iterator that converts the resulting librdf_stream into the required nodes. * rdf_storage.h: Added get sources, arcs, targets methods to storage factory Added prototypes for get sources, arcs, targets storage methods * rdf_model.c: (librdf_model_get_sources,librdf_model_get_arcs,librdf_model_get_targets): Added, calling storage to implement them Test code: free statement retrieved from stream * rdf_model.h: Added prototypes for get sources, arcs, targets methods * rdf_node.c (librdf_new_node_from_node): Copy node type. Set literal value on new node, not old! (librdf_node_print): Added (librdf_node_equals): Correct the return values to match interface. * rdf_node.h: Added prototype for librdf_node_print * rdf_stream.c (librdf_free_stream): Free any stored next statement if present. (librdf_stream_end): Return correct status using stream->is_end_stream * rdf_storage_list.c (librdf_storage_list_serialise_next_statement): Create a duplicate statement when serialising, don't pass on original statement pointer. * rdf_memory.c (librdf_free): abort() on duplicate free * rdf_uri.c (librdf_uri_to_string): Return NULL if NULL uri passed in * rdf_statement.c (librdf_new_statement_from_statement): Return NULL if NULL statement passed in. (librdf_statement_to_string): Output s, p, o in that order. (librdf_statement_print): Added * rdf_statement.h: Added prototype for librdf_statement_print * rdf_iterator.c (librdf_free_iterator): Do nothing if NULL iterator passed in - makes calling code easier to read 2000-08-14 Dave Beckett * rdf_hash_cursor.c: RDF Hash Cursor Implementation * docs/.cvsignore: CVS ignore file * example2.c, example.c: Update librdf_init_world call * rdf_hash.h, rdf_hash.c: put method takes no flags * rdf_uri.h: When verbose debugging, count max URI usage * rdf_uri.c: Store URIs in a hash, so there is at most 1 object per URI. Needs more work. * rdf_node.c, rdf_statement.c: Initialise/terminate more dependent modules. * rdf_model.c: Initialise/terminate all modules, this one needs them all * rdf_hash_gdbm.c, rdf_hash_bdb.c, rdf_hash_memory.c: put method takes no flags * rdf_init.c: (librdf_init_world) Now takes uris_hash Reordered to init hash before uri * librdf.h: librdf_init_world now takes uris_hash * acconfig.h: Use #undef not #define * acconfig.h: Added HAVE_BDB_CURSOR_4_ARGS, renamed some others * configure.in: More improvements to BDB version / capability checking * rdf_hash_bdb.c (librdf_hash_bdb_cursor_get): For LIBRDF_HASH_CURSOR_NEXT, with V2 and no DB_NEXT_NODUP, make sure loop is exited when there is no previous key. * rdf_hash_bdb.c: Works with BDB V3, V2 with duplicates! * rdf_hash_gdbm.c: Allegedly might works for getting all key/values, keys, values of one key. However, no duplicates - do not use. * rdf_hash_bdb.c: Works for getting all key/values, keys, values of one key * rdf_hash.h: Added get iterator defs (internal) Added prototypes for librdf_hash_print_values, hash cursor functions (internal) * rdf_hash_memory.c: Works for getting all key/values, keys, values of one key * rdf_hash.c (librdf_hash_get_all,librdf_hash_get_all_iterator_have_elements, librdf_hash_get_all_iterator_get_next, librdf_hash_get_all_iterator_finished): Updated - works with no leaks for memory, bdb. (librdf_hash_print_values): Created Added duplicate key, values to test code Added print values to test code * rdf_memory.c: Added dmalloc memory debugging support Improved some messages form * librdf.h: Remove inline - not used Added macros for dmalloc memory debugging * configure.in: Remove inline check - not needed Check for dmalloc and define MEM, MEM_LIBS Remove rest of gdbm configuration (not working) * Makefile.am: Added MEM, MEM_LIBS defines for memory debugging 2000-08-12 Dave Beckett * librdf.h: Added librdf_hash_cursor * Makefile.am: Added rdf_hash_cursor.c * rdf_hash_memory.c, rdf_hash.c: Interface changed again to use librdf_hash_cursor Zillions of lines changed * rdf_hash.h: Interface changed again to use librdf_hash_cursor 2000-08-11 Dave Beckett * rdf_hash_memory.c: Use much dumber hash key algorithm, probably good enough * configure.in: Turn on low level (and slow) memory debugging for maintainer * rdf_memory.c: Don't give detailed warnings unless LIBRDF_MEMORY_DEBUG > 1 * rdf_hash.c (librdf_hash_datum_new): Fix memory leak - always allocated new memory even if free list had spare datums * docs/api.sgml.in: Remove hash_gdbm, since not possible to use at present * docs/build-docs: construct the SGML docbook files from the parts * docs/Makefile.am: Remove hash_gdbm, since not possible to use at present Invoke perl on build-docs so doesn't matter where perl is * rdf_hash_memory.c: Lots of changes to support new hash interface. Created two iterator implementations for providing keys, values of a key. Changed data structure so hash nodes have a list of values. Now track more hash stats - keys, values, ... * rdf_hash.c: Updated interface using iterators for getting all keys, all values of a key (librdf_hash_get_as_boolean,librdf_hash_get_as_long): Added Created librdf_hash_datum object and factory to manage them (librdf_init_hash_datums, librdf_free_hash_datums): factory (librdf_hash_datum_new, librdf_hash_datum_free): constructor / destructor Removed factories from user level constructor Added factory constructor (librdf_hash_get): Returns an arbitrary value of key (librdf_hash_get_all): Gets all values of key (librdf_hash_print): Use keys and values iterators (librdf_hash_get_as_boolean, librdf_hash_get_as_long): Created utility routines for use with options e.g. in storage Removed factory stuff from test code * rdf_hash.h: Updated interface usign iterators for getting all keys, all values of a key (librdf_hash_get_as_boolean,librdf_hash_get_as_long): Added * rdf_hash_gdbm.c: Partially converted to new iterator sequence but not finished. Will abort() if used. * rdf_parser_sirpac.c: Updated for factories, debugging define changes * configure.in: Disable gdbm since it can't do dup keys * Makefile.am: Clean example2 * Makefile.am: Compile rdf_parser_test Added rdf_heuristics.c module * rdf_node.c: Updated for factories, debugging define changes Added cast to keep C++ happy * rdf_statement.c: Updated for debugging define changes * example.c: Updated for factories, debugging define changes * example2.c: Moved object_is_literal code to rdf_heuristics module. Updated for factories, debugging define changes * rdf_parser_libwww.c: Moved object_is_literal code to rdf_heuristics module. * rdf_model.c: Removed factory concept, hash options from user level constructors Added extra constructor(s) for power users with factory and hash options. Updated tests for above Print extra debugging iff LIBRDF_DEBUG > 1 * rdf_memory.c: Compile functions only if LIBRDF_MEMORY_DEBUG defined * rdf_iterator.c (librdf_iterator_have_elements): Return false if iterator object is NULL - makes calling code neater since doesn't have to check if iterator object was actually created OK. * rdf_uri.c: Updated code for removal of factories from default constructors Enable memory debugging from new macro * rdf_storage.c, rdf_parser.c: Removed factory concept, hash options from user level constructors Added extra constructor(s) for power users with factory and hash options. Updated tests for above Print extra debugging iff LIBRDF_DEBUG > 1 * rdf_storage.h, rdf_parser.h, rdf_model.h, rdf_digest.h: Amended prototypes for constructors with/without factories, hash options * rdf_digest.c: Removed factory concept, hash options from user level constructors Added extra constructor(s) for power users with factory and hash options. Updated tests for above Print extra debugging iff LIBRDF_DEBUG > 1 * rdf_heuristics.c: Heuristic routines used by librdf to guess things * librdf.h: Separated memory debugging from general debugging. Now only turned on when LIBRDF_MEMORY_DEBUG defined. Added prototypes from rdf_heuristics.c 2000-08-09 Dave Beckett * BUGS.html, TODO.html, Makefile.am: Merge BUGS.html into TODO.html * Makefile.am: Send BUGS.html * configure.in: don't build expat Makefiles (not used at present) * docs/api.sgml.in: Added librdf_digest_md5 * docs/Makefile.am: Create docbook SGML and HTML * Makefile.am: Removed rdf_config.h from dist * rdf_digest_md5.c: Make function names consistent with other code and document public function * rdf_digest.h, rdf_digest.c: Make librdf local digest calls consistent with other code * configure.in, Makefile.am, md5.c, rdf_digest_md5.c: Renamed md5.c to rdf_digest_md5.c * docs/api.sgml.in: API documentation skeleton, includes parts derived automatically from source * rdf_parser_sirpac.c, rdf_model.c: comment structure typos * rdf_node.h: Added prototypes for librdf_node_get_literal_value_is_wf_xml, librdf_node_get_literal_value_xml_space * rdf_node.c (librdf_node_get_literal_value_is_wf_xml, librdf_node_get_literal_value_xml_space): Added * rdf_uri.c, rdf_stream.c, rdf_storage.c, rdf_statement.c, rdf_parser_sirpac.c, rdf_parser_libwww.c, rdf_parser.c, rdf_node.c, rdf_model.c, rdf_list.c, rdf_iterator.c, rdf_init.c, rdf_hash_memory.c, rdf_hash_gdbm.c, rdf_hash_bdb.c, rdf_hash.c, rdf_digest_openssl.c, rdf_digest.c: Reformatted docu-comments to have short descriptions. * rdf_statement.c, rdf_parser_sirpac.c, rdf_parser_libwww.c, rdf_node.h, rdf_node.c, rdf_model.h, rdf_model.c, example2.c: Amend librdf_node object to have optional preservation of xml:space property for literals. * configure.in: Don't compile expat dir even if present (just yet) 2000-08-08 Dave Beckett * rdf_uri.c (librdf_new_uri_from_uri): Fix arg documentation * rdf_storage.c (librdf_new_storage): Document missing arg * rdf_parser_sirpac.c: Remove typedef struct comments - not understood yet * rdf_node.c: Fix badly formatted structured comments * rdf_iterator.c (librdf_iterator_set_map): Document missing parameter * rdf_hash.c: Use hash memory default load factory, don't set it * rdf_hash_memory.c (librdf_init_hash_memory): Document default load factor parameter. * rdf_hash.c: Indenting * rdf_uri.c: Added comments for functions. * rdf_parser_libwww.c: Tidy comments * rdf_parser_libwww.c: Added comments for functions. Fixed bad use of new URI class. 2000-08-06 Dave Beckett * rdf_hash_memory.h: Renamed ratio to be load factor * rdf_hash_memory.c: Renamed ratio to be load factor and changed to 75%, out of 1000 2000-08-04 Dave Beckett * example.c: Optionally pass in parser name 2000-08-03 Dave Beckett * rdf_parser_sirpac.c: Use new URI string interface * Makefile.am: Use new in memory hash code * rdf_hash.c: Use and regiser new in memory hash code * rdf_hash_memory.h, rdf_hash_memory.c: RDF hash in memory * rdf_hash_list.c, rdf_hash_list.h: Renamed to rdf_hash_memory * Makefile.am: Added rdf_uri_test * rdf_uri.c: Test URI digest code. * rdf_uri.c: Added tests, fixed bug in librdf_new_uri_from_uri * rdf_uri.h, rdf_init.c: Added librdf_finish_uri * rdf_uri.h, rdf_uri.c, librdf.h: librdf_uri objects are now structs rather than char* wrappers * example2.c: Don't do progress markers * librdf.h: Include rdf_node.h * example2.c: Triple importer example * Makefile.am: Added example2 2000-08-02 Dave Beckett * Makefile.am: example.c is not part of the library! * configure.in: One more cflags fix for maintainer * Makefile.am: Put rdf parser sources in dist * rdf_parser_libwww.c: First working version. * rdf_node.c: Don't use memcpy to copy a string, misses out the \0! * rdf_list.h: Prototype for librdf_list_pop added. * rdf_list.c (librdf_list_pop): Added, to get and remove item from head/top of list * configure.in: Alter CFLAGS for debug flag at end of calculating what CFLAGS might be * expat/Makefile.am: Add expat documentation to dist * expat/xmltok/Makefile.am: Automakefile for expat xmltok * expat/xmltok/xmltok_impl.h, expat/xmltok/xmltok_ns.c, expat/xmltok/xmlrole.c, expat/xmltok/xmlrole.h, expat/xmltok/xmltok.c, expat/xmltok/xmltok.h, expat/xmltok/xmltok_impl.c, expat/xmltok/dllmain.c, expat/xmltok/iasciitab.h, expat/xmltok/latin1tab.h, expat/xmltok/nametab.h, expat/xmltok/utf8tab.h, expat/xmltok/xmldef.h, expat/xmltok/asciitab.h: Sources for expat xmltok * expat/xmltok/.cvsignore: CVS ignore file * expat/xmlparse/Makefile.am: automakefile for expat xmlparse * expat/xmlparse/.cvsignore: CVS ignore file * expat/xmlparse/xmlparse.h, expat/xmlparse/hashtable.c, expat/xmlparse/hashtable.h, expat/xmlparse/xmlparse.c: xmlparse sources * expat/gennmtab.c: gennmtab.c * expat/expat.html: expat documentation * expat/Makefile.am: Automakefile for expat * expat/.cvsignore: CVS ignore file * rdf_parser_libwww.c: RDF Parser using libwww RDF implementation * rdf_parser.h, rdf_parser.c: Added libwww rdf parser * rdf_hash_list.c (librdf_hash_list_put): Init new_key to keep gcc happy * rdf_hash.c: Init some vars to keep gcc happy * acconfig.h: Added libwww rdf parser def * Makefile.am: Added full header Added STANDARD_CFLAGS for compiling (external) code that won't work with loads of gcc warning options. * configure.in: Added full header If gcc, only then add extra params to compiling If libwww present, check for RDF support If libwww RDF support, compile in libwww rdf parser Compile expat dir if present (not used yet) * rdf_hash_gdbm.c (librdf_hash_gdbm_get_seq): If gdbm_nextkey returns no data, return properly. 2000-07-31 Dave Beckett * Makefile.am: example is not a test * Makefile.am: Update tests * Makefile.am: install a binary - librdf-config, and a header file - librdf.h * rdf_storage.c, rdf_statement.c, rdf_parser.c, rdf_node.c, rdf_model.c, rdf_hash.c, rdf_digest.c: Don't turn on debugging by default when compiling STANDALONE * rdf_stream.c (librdf_stream_get_next_mapped_statement): Return end of list if next_statement function returns NULL * rdf_iterator.c (librdf_iterator_get_next_mapped_element): Return end of list if get_next function returns NULL * rdf_hash_bdb.c: Comment fix * rdf_hash_list.c: Added comments * examples/.cvsignore: Ignore me * rdf_hash.c: Small change * rdf_hash_gdbm.c (librdf_hash_gdbm_open): Don't add .gdbm to identifier name. * rdf_hash_bdb.c: Small fix * .cvsignore: Exclude old stuff, LICENSE * rdf_hash.c: Added last function comment. * rdf_digest.c: Comment typo * rdf_hash_bdb.c: Added comments * rdf_stream.c, rdf_storage.c, rdf_statement.c, rdf_parser_sirpac.c: Added comments for functions. 2000-07-28 Dave Beckett * example.c: Remove 1 sirpac reference * example.c: Example code using RDF parser * rdf_parser_sirpac.c: RDF Parser SiRPAC (via pipe) implementation * rdf_parser.h: RDF Parser Factory / Parser interfaces and definition * rdf_parser.c: RDF Parser Factory implementation * rdf_init.c: Call init/finish for parser module * rdf_hash.c: Indented * librdf.h: Added librdf_parser references * acconfig.h: Added defs for java, Java RDF API jar file and using sirpac rdf parser * Makefile.am: Added configurable rdf_parser_sirpac * configure.in: Check for java, Java RDF API jar file and configure that parser if possible * rdf_model.c: Only report memory leaks when debugging * rdf_storage_list.h: RDF Storage List Interface definition * rdf_storage.c: RDF Storage Implementation * rdf_model.c (librdf_model_print): Print something at start of model * .cvsignore: Ignore files generated from HTML Rename config file * rdf_storage_list.c (librdf_storage_list_find_map): Return a statement, rather than bool. * rdf_iterator.h, rdf_iterator.c: Make mapping function return a (potentially new) node * rdf_stream.c, rdf_stream.h: RDF Statement Streams * md5.c, rdf_digest.c, rdf_digest.h, rdf_digest_openssl.c, rdf_hash.c, rdf_hash.h, rdf_hash_bdb.c, rdf_hash_bdb.h, rdf_hash_gdbm.c, rdf_hash_gdbm.h, rdf_hash_list.c, rdf_hash_list.h: Comment header change Use new include files Indented again * rdf_init.c: Comment header change Use new include files Indented again (librdf_init_world): Re-ordered to create digest factory first, since it is used by other modules. * rdf_iterator.c: Comment header change Use new include files Indented again Added filtering/mapping of iterators via a user defined function (librdf_iterator_get_next_mapped_element): Added to provide mapping support. (librdf_iterator_have_elements, librdf_iterator_get_next): Update to provide mapping. (librdf_iterator_set_map): Added to set the map function * rdf_iterator.h: Comment header change Use new include files Indented again * rdf_list.c: Comment header change Use new include files Indented again (librdf_list_find_node): Uses user-defined 'equals' function if given. (librdf_list_contains): Added (librdf_list_size): Added (librdf_list_set_equals): Added (librdf_list_iterator_get_next): Fixed bug, always returned empty for a 1 element list / missed first element. * rdf_list.h, rdf_memory.c: Comment header change Use new include files Indented again * rdf_model.c: Comment header change Use new include files Indented again First version working with storage (librdf_free_model, librdf_model_add_submodel, librdf_model_remove_submodel): Sub models code (not tested). (librdf_model_add_statement): Documented (librdf_model_add, librdf_model_add_string_literal_statement): Implemented. (librdf_model_print): Added * rdf_model.h: Comment header change Use new include files Indented again Removed struct forward refs to librdf.h Added prototypes for new functions * rdf_node.c, rdf_node.h: Comment header change Use new include files Indented again * rdf_statement.c: Comment header change Use new include files Indented again Removed never-used commented out bits of methods (librdf_statement_to_string): Carefully handle empty s, p or o. (librdf_statement_equals, librdf_statement_match): Added * rdf_statement.h: Comment header change Use new include files Indented again Removed struct forward refs to librdf.h Added prototypes for equals and match methods * rdf_storage.h: First working version * rdf_uri.h: Comment header change Use new include files Indented again Added librdf_uri_equals * rdf_uri.c: Comment header change Use new include files Indented again * rdf_types.h: Comment header change * rdf_context.h: Use a real struct, still a dummy though. * rdf_config.h: Now output of auto-configure process * Makefile.am: Added rdf_storage_list and rdf_stream bits Added example.c - sirpac output filter * rdf_storage_list.c: RDF Storage List Interface Implementation * configure.in: Changes to only include -ldb once * configure.in: macro typo * configure.in: config header now rdf_config.h * librdf.h: Include all rdf_*h headers until just interfaces can be extracted. 2000-07-27 Dave Beckett * librdf.h: librdf main header 2000-07-17 Dave Beckett * rdf_digest.c: Missed , * rdf_hash_bdb.c: Indented * rdf_digest.c: Use calloc with 1 count * Makefile.am: Added rdf_storage.[ch] * rdf_list.c: Indented * rdf_iterator.h: Indented Added finished function / element. Added protototypes for librdf_iterator_have_elements and librdf_iterator_get_next * rdf_iterator.c: Indenting, addeddd finished function / element. (librdf_iterator_have_elements): Added (librdf_iterator_get_next): Added * rdf_statement.c (librdf_finish_statement): Created (librdf_new_statement_from_statement): Created - clone constructor * rdf_statement.h: Indenting, split struct/typdef Added prototypes for librdf_new_statement_from_statement, librdf_finish_statement * rdf_init.c: Indenting, added stream & storage * rdf_hash.c: Indenting Correct some comments re memory handling * examples/libwww-rdf-dump.c: Added ID header * examples/libwww-rdf-dump.c: Added header. Output instead of typed Description nodes * examples/libwww-rdf-dump.c: libwww program to dump RDF URI triples as reified RDF statements 2000-07-15 Dave Beckett * Makefile.am: Added TODO.html, TODO and renamed context * rdf_assertion_context.h, rdf_context.h: Renamed to rdf_context * rdf_statement.h, rdf_statement.c: Shortened name to rdf_context 2000-07-12 Dave Beckett * rdf_hash_bdb.c: Make db open/create functions alternatives * Makefile.am: Added CC line * rdf_hash_bdb.c: Beginnings of BDB V1 support - not working yet * acconfig.h: Added HAVE_DBOPEN * configure.in: Test for dbopen * .cvsignore: Added more autoconf bits * configure.in: Define HAVE_LOCAL_xxxx_DIGEST correctly * md5.c: Fix wrong header files. * rdf_hash.h: Added prototype for librdf_finish_hash * rdf_digest.h: Added prototype for librdf_finish_digest * Makefile.am: Added rdf_memory.c Define -DLIBRDF_DEBUG for maintainer CFLAGS * rdf_uri.c: Indented * rdf_statement.c (librdf_statement_to_string): Free strings for nodes before returning. * rdf_node.h: Indented. Made node type be enum librdf_node_type instead of int. * rdf_node.c: Indented, add documentation for all functions. * rdf_memory.c: Added verbose memory debugging if LIBRDF_MEMORY_DEBUG defined * rdf_init.c: Moved prototypes to rdf_config.h (librdf_destroy_world): Created. * rdf_hash_list.c: Indented and tidied code. * rdf_hash_gdbm.c (librdf_hash_gdbm_close): Added missing free of gdbm current key * rdf_hash.c (librdf_finish_hash): Added to clean up module (librdf_delete_hash_factories): Added to implement above (librdf_free_hash): Added missing free of hash context. (librdf_hash_print): Added missing free of hash value * rdf_digest.c (librdf_finish_digest): Added to clean up module (librdf_delete_digest_factories): Added to implement above * rdf_config.h: Use librdf debugging memory functions if LIBRDF_DEBUG is defined Added librdf_init_world and librdf_destroy_world prototypes. * rdf_memory.c: RDF Memory Debugging Implementation 2000-07-11 Dave Beckett * rdf_hash.c, rdf_digest_openssl.c: Comment all public functions, indented. * rdf_digest.c: Comment all functions, indented. * configure.in: Define correct macro for openssl crypto funcs * configure.in: Really 0.1 * rdf_hash_gdbm.h, rdf_hash.h, rdf_config.h, rdf_uri.h, rdf_uri.c, rdf_types.h, rdf_storage.h, rdf_statement.h, rdf_statement.c, rdf_node.h, rdf_node.c, rdf_model.h, rdf_model.c, rdf_list.h, rdf_list.c, rdf_iterator.h, rdf_iterator.c, rdf_init.c, rdf_hash_list.h, rdf_hash_list.c, rdf_hash_gdbm.c, rdf_hash_bdb.h, rdf_hash_bdb.c, rdf_hash.c, rdf_digest_openssl.c, rdf_digest.h, rdf_digest.c, rdf_assertion_context.h, md5.c: Renamed all functions to be librdf_* and all macros to be LIBRDF_* * rdf_hash_list.c, rdf_hash_bdb.c, rdf_hash.h, rdf_hash.c: Changed get_seq flags to use enum and called RDF_HASH_SEQUENCE* now * Makefile.am: Don't need LICENSE.h rule * rdf_hash_gdbm.c: Comment all functions, indented. 2000-07-10 Dave Beckett * rdf_node.c: Allow literals to be set with boolean is_wf_xml asserting if is well formed XML content. (rdf_node_get_digest): Digest literal string value when node is a literal * rdf_uri.c: Call final when calculating digest * rdf_statement.c, rdf_node.h: Allow literals to be set with boolean is_wf_xml asserting if is well formed XML content. 2000-07-06 Dave Beckett * docs/api.html, docs/packages.html: Documentation, of sorts * rdf_hash_list.c: Use memcmp, not strcmp - the keys are blobs not strings * Makefile.am: Added memcmp.c to dist, not library sources * memcmp.c: memcpy function * Makefile.am: Define SUBDIRS from configured content Added (optional) memcmp.c for systems with broken libc * configure.in: Look for an ANSI C compiler Default libwww=no for present Genercised digest check tests, thanks to another configure.in I read 2000-07-05 Dave Beckett * rdf_uri.h, rdf_types.h, rdf_storage.h, rdf_statement.h, rdf_node.h, rdf_model.h, rdf_list.h, rdf_iterator.h, rdf_hash_list.h, rdf_hash_gdbm.h, rdf_hash_bdb.h, rdf_hash_bdb.c, rdf_hash.h, rdf_digest.h, rdf_assertion_context.h: Added extern "C" { ... } blocks protecting C types for C++ * configure.in, Makefile.am: Added librdf-config.in * librdf-config.in: librdf config program * rdf_init.c, rdf_hash.h, rdf_hash.c, rdf_digest.h, rdf_digest.c: renamed get_rdf_* functions to rdf_get_* * Makefile.am: Added rdf_hash_bdb.[ch] to distribution 2000-07-04 Dave Beckett * acconfig.h: Added macros for Berkeley DB tests * rdf_hash_bdb.c: Use configure tests, not hard coded defines. Not tested with anything except V2 * configure.in: Added Berkeley DB tests, only done with V2 at present * rdf_hash_gdbm.c: Determine file name from identifier + suffix (should this really be here? Probably not) * rdf_hash.c: Added BDB inits, tests * rdf_hash_bdb.c, rdf_hash_bdb.h: Berkeley DB V2/3 * rdf_hash_db.c: junk * Makefile.am: Rule to create LICENSE.h for including in sources. * rdf_hash_list.c (rdf_hash_list_exists): Implemented new exists method * rdf_hash_gdbm.c (rdf_hash_gdbm_exists): Implemented new exists method * rdf_hash.h: Added exists method Made open take a rdf_hash* options Reorded declarations so can do above. * rdf_hash.c: Added javadoc-y comments for all functions. (rdf_hash_from_array_of_strings): Created, with test. (rdf_hash_exists): Created. * rdf_digest_openssl.c, rdf_digest.c: Reorder digests to make SHA, RIPEMD160 then MD5 defaults * rdf_config.h: Make fatal errors call abort() - core dump, usually. * rdf_hash.c: Enable tedious hash factory registrations, now that they can be trigged by debugging macros. * Makefile.am: Use -DSTANDALONE to trigger tests * rdf_statement.c, rdf_node.c, rdf_model.c, rdf_hash.c, rdf_digest.c: Use #ifdef STANDALONE to trigger tests and turn on debugging. Tweak debugging macro names. * md5.c, rdf_digest_openssl.c: Allocate digests with context - don't store in a class static area. 2000-07-03 Dave Beckett * rdf_hash.c: Added (int) casts for is* calls which causes warnings on Solaris where they are prototyped functions, not macros. * rdf_model.h: Added rdf_model_add_submodel and rdf_model_remove_submodel prototypes. * rdf_iterator.h: Defined real structures and functions * rdf_list.h, rdf_list.c: Simple Lists * rdf_iterator.c: Iterator implementation * rdf_uri.c, rdf_uri.h, rdf_hash_gdbm.c, rdf_hash_gdbm.h, rdf_hash_list.c, rdf_hash_list.h, rdf_init.c, rdf_model.c, rdf_model.h, rdf_node.c, rdf_node.h, rdf_statement.c, rdf_statement.h, rdf_digest.c, rdf_digest.h, rdf_hash.c, rdf_hash.h: Renamed init_rdf_* to start rdf_init_* * rdf_model.h, rdf_node.c, rdf_node.h, rdf_statement.c, rdf_statement.h, rdf_uri.c, rdf_uri.h, rdf_digest.c, rdf_digest.h, rdf_hash.c, rdf_hash.h, rdf_hash_list.c, rdf_model.c: Renamed free_rdf_* and new_rdf_* functions to start rdf_free_* and rdf_new_* respectively * configure.in, Makefile.am: Added docs subdir * COPYING.LIB: GNU LESSER GENERAL PUBLIC LICENSE * APIs: Removed, just notes * docs/Makefile.am: Added comment header * docs/Makefile.am: Documentation * rdf_hash_list.c: Use HAVE_STRING_H Replace memcmp with strncmp * md5.c: Use HAVE_STRING_H * configure.in: Use AM_MAINTAINER_MODE Check for string.h * Makefile.am: Added maintainer rules for setting extra CFLAGS * Makefile.am: Added rules to build text files from HTML sources * NEWS, README: Removed, now derived from HTML source * INTERPRETATIONS: Removed * configure.in: Added check for libwww (via libwww-config program) * acconfig.h: Added have_libwww macro 2000-06-30 Dave Beckett * .cvsignore: Ignore GPL-ed dir * rdf_digest_openssl.c: RDF Digest OpenSSL Digest interface * README: Slightly more structure and info * rdf_assertion_context.h: RDF Assertion Context definition * aclocal.m4: Should not be in CVS * acinclude.m4: Restored * Makefile.am: Fix \ing problem * ripemd160.h: Removed GPLed sources * acinclude.m4: No longer needed * rdf_statement.h, rdf_statement.c: Added assertion context * rdf_digest.h: Removed version structure field. * md5.c: Use rdf_types.h * configure.in: Test types with latest autoconf macros Fix openssl crypto func test * acconfig.h: Changed type defines to latest autoconf standard * Makefile.am: Removed GPLed sources * bithelp.h: Not used * ripemd160.c, sha1.c: Removed GPLed sources * types.h, rdf_types.h: types.h now rdf_types.h * md5.c: Tidied code * md5.c: Replaced GPLed version with public domain one * rdf_digest.c: Remove test OPENSSL digest names * rdf_digest.h, rdf_digest.c: Use new digest defines * configure.in: Improve digest checks * acconfig.h: Tidy openssl digest defs * Makefile.am: Added rdf_assertion_context.h Added ChangeLog to dist 2000-06-29 Dave Beckett * .cvsignore, ChangeLog: ChangeLog shouldn't be CVSed! * rdf_node.c (new_rdf_node_from_uri_string): Don't declare variables with the same name as the class. * rdf_model.c (new_rdf_model): Tweak to function header. * rdf_hash_list.c (rdf_hash_list_put): Fixed when updating a value for an existing key. * rdf_hash.h: Added prototype for rdf_hash_from_string * rdf_hash.c: Removed rather tedious hash registering debugging messages. (rdf_hash_from_string): Wrote - initialises as hash from a string of form "key='value', key2='value2'" with \' escaping ' (not fully tested yet) * rdf_digest.h: Added prototype for openssl digest constructor * rdf_digest.c: Initialise and test openssl crypto routines * configure.in: Rewrote crypto module checks to get them from the openssl crypto library, if present, otherwise look for local implementations * acconfig.h: Added more SSL crypto defs * rdf_statement.h: Added prototype for rdf_statement_to_string * rdf_statement.c (new_rdf_statement): Don't declare variables with the same name as the class. * Makefile.am: Renamed rmd* to ripemd160* Added $(LIBS) to link lines Added rdf_digest_openssl.c (optional) Boosed gcc -W options * ripemd160.c, ripemd160.h, rmd.h, rmd160.c: Renamed rmd* to ripemd160* * rdf_init.c: Added prototype * rdf_model.h: Use rdf_storage not rdf_model_storage Declare prototype correctly * rdf_storage.h: Renamed from rdf_model_storage.h * rdf_model_storage.h: Renamed to rdf_storage.h 2000-06-28 Dave Beckett * README: Added build proto-instructions * rdf_model_storage.h: RDF Model Storage definition * rdf_model.c: RDF Model implementation * rdf_iterator.h: RDF Iterator definition * rdf_init.c: Init digest, hash and model modules too * rdf_model.h: Model now has storage and sub models * Makefile.am: Added proto-model code, rdf_model_storage.h and rdf_iterator.h * .cvsignore: Ignore more * rdf_hash_list.c, rdf_hash_list.h, rdf_init.c, rdf_model.h, rdf_node.c, rdf_node.h, rdf_statement.c, rdf_statement.h, rdf_uri.c, rdf_uri.h, Makefile.am, rdf_config.h, rdf_digest.c, rdf_digest.h, rdf_hash.c, rdf_hash.h, rdf_hash_gdbm.c, rdf_hash_gdbm.h: CVS IDs * rdf_hash_list.h, rdf_init.c, rdf_model.h, rdf_node.c, rdf_node.h, rdf_statement.c, rdf_statement.h, rdf_uri.c, rdf_uri.h, rmd.h, rmd160.c, sha1.c, types.h: Created directory structure * rdf_hash_list.h, rdf_init.c, rdf_model.h, rdf_node.c, rdf_node.h, rdf_statement.c, rdf_statement.h, rdf_uri.c, rdf_uri.h, rmd.h, rmd160.c, sha1.c, types.h: New file. * aclocal.m4, bithelp.h, configure.in, md5.c, rdf_config.h, rdf_digest.c, rdf_digest.h, rdf_hash.c, rdf_hash.h, rdf_hash_db.c, rdf_hash_gdbm.c, rdf_hash_gdbm.h, rdf_hash_list.c: Created directory structure * aclocal.m4, bithelp.h, configure.in, md5.c, rdf_config.h, rdf_digest.c, rdf_digest.h, rdf_hash.c, rdf_hash.h, rdf_hash_db.c, rdf_hash_gdbm.c, rdf_hash_gdbm.h, rdf_hash_list.c: New file. * .cvsignore, APIs, AUTHORS, COPYING, ChangeLog, INTERPRETATIONS, Makefile.am, NEWS, README, acconfig.h, acinclude.m4: Created directory structure * .cvsignore, APIs, AUTHORS, COPYING, ChangeLog, INTERPRETATIONS, Makefile.am, NEWS, README, acconfig.h, acinclude.m4: New file. 2000-06-21 Dave Beckett * It compiles and builds as a GNU automake/conf suite with 'make distcheck' and 'make check' redland-1.0.17/redland-config.10000644000175000017500000000377011062100353013066 00000000000000.\" Hey, EMACS: -*- nroff -*- .\" .\" redland-config.1 - Redland compiling utility manual page .\" .\" Copyright (C) 2003-2008 David Beckett - http://www.dajobe.org/ .\" Copyright (C) 2003-2004 University of Bristol - http://www.bristol.ac.uk/ .\" .TH redland-config 1 "2008-09-07" .\" Please adjust this date whenever revising the manpage. .SH NAME redland-config \- script to get information about the installed version of Redland .SH SYNOPSIS .B redland-config [\-\-cflags] [\-\-help] [\-\-libs] [\-\-libtool\-libs] [\-\-prefix\fI[=DIR]\fP] [\-\-private\-libs] [\-\-version\-decimal] [\-\-version] .SH DESCRIPTION \fIredland-config\fP is a tool that is used to determine the compile and linker flags that should be used to compile and link programs that use the Redland RDF library. .SH OPTIONS \fIredland-config\fP accepts the following options: .TP 8 .B \-\-version Print the currently installed version of redland on the standard output. .TP 8 .B \-\-version\-decimal Print the currently installed version of redland as a decimal integer. .TP 8 .B \-\-libs Print the linker flags that are necessary to link a redland program. This excludes linker arguments used to build the librdf shared library. .TP 8 .B \-\-libtool\-libs Print the flags that are necessary to link a redland program with libtool. .TP 8 .B \-\-private\-libs Print the linker flags that are necessary to build the librdf shared library. This option is not usually needed because the librdf shared library has already been dynamically linked against these libs. .TP 8 .B \-\-cflags Print the compiler flags that are necessary to compile a redland program. .TP 8 .B \-\-prefix=PREFIX If specified, use PREFIX instead of the installation prefix that redland was built with when computing the output for the \-\-cflags and \-\-libs options. This option must be specified before any \-\-libs or \-\-cflags options. .SH SEE ALSO .BR redland (3), .SH AUTHOR Dave Beckett - .UR http://www.dajobe.org/ http://www.dajobe.org/ .UE redland-1.0.17/src/0000755000175000017500000000000012257576340011014 500000000000000redland-1.0.17/src/rdf_iterator.c0000644000175000017500000003306311615421777013571 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_iterator.c - RDF Iterator Implementation * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifndef STANDALONE /* prototypes of local helper functions */ static void* librdf_iterator_update_current_element(librdf_iterator* iterator); /** * librdf_new_iterator: * @world: redland world object * @context: context to pass to the iterator functions * @is_end_method: function to call to see if the iteration has ended * @next_method: function to get the next element * @get_method: function to get the next element * @finished_method: function to destroy the iterator context (or NULL if not needed) * * Constructor - create a new #librdf_iterator object. * The iterator object takes ownership of @context and frees it with @finished_method. * The finished method is not called if librdf_new_iterator fails and returns NULL. * * Return value: a new #librdf_iterator object or NULL on failure **/ REDLAND_EXTERN_C librdf_iterator* librdf_new_iterator(librdf_world *world, void* context, int (*is_end_method)(void*), int (*next_method)(void*), void* (*get_method)(void*, int), void (*finished_method)(void*)) { librdf_iterator* new_iterator; librdf_world_open(world); new_iterator = LIBRDF_CALLOC(librdf_iterator*, 1, sizeof(*new_iterator)); if(!new_iterator) return NULL; new_iterator->world=world; new_iterator->context=context; new_iterator->is_end_method=is_end_method; new_iterator->next_method=next_method; new_iterator->get_method=get_method; new_iterator->finished_method=finished_method; new_iterator->is_finished=0; new_iterator->current=NULL; return new_iterator; } /* helper function for deleting list map */ static void librdf_iterator_free_iterator_map(void *list_data, void *user_data) { librdf_iterator_map* map=(librdf_iterator_map*)list_data; if(map->free_context) map->free_context(map->context); LIBRDF_FREE(librdf_iterator_map, map); } /** * librdf_free_iterator: * @iterator: the #librdf_iterator object * * Destructor - destroy a #librdf_iterator object. * **/ void librdf_free_iterator(librdf_iterator* iterator) { if(!iterator) return; if(iterator->finished_method) iterator->finished_method(iterator->context); if(iterator->map_list) { librdf_list_foreach(iterator->map_list, librdf_iterator_free_iterator_map, NULL); librdf_free_list(iterator->map_list); } LIBRDF_FREE(librdf_iterator, iterator); } /* * librdf_iterator_update_current_element - Update the current iterator element with filtering * @iterator: the #librdf_iterator object * * Helper function to set the iterator->current to the current * element as filtered optionally by a user defined * map function as set by librdf_iterator_add_map() * * Return value: the next element or NULL if the iterator has ended */ static void* librdf_iterator_update_current_element(librdf_iterator* iterator) { void *element=NULL; if(iterator->is_updated) return iterator->current; iterator->is_updating=1; /* find next element subject to map */ while(!iterator->is_end_method(iterator->context)) { librdf_iterator* map_iterator; /* Iterator over iterator->map_list librdf_list */ element=iterator->get_method(iterator->context, LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT); if(!element) break; if(!iterator->map_list || !librdf_list_size(iterator->map_list)) break; map_iterator=librdf_list_get_iterator(iterator->map_list); if(!map_iterator) break; while(!librdf_iterator_end(map_iterator)) { librdf_iterator_map *map=(librdf_iterator_map*)librdf_iterator_get_object(map_iterator); if(!map) break; /* apply the map to the element */ element=map->fn(iterator, map->context, element); if(!element) break; librdf_iterator_next(map_iterator); } librdf_free_iterator(map_iterator); /* found something, return it */ if(element) break; iterator->next_method(iterator->context); } iterator->current=element; if(!iterator->current) iterator->is_finished=1; iterator->is_updated=1; iterator->is_updating=0; return element; } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_iterator_have_elements: * @iterator: the #librdf_iterator object * * Test if the iterator has finished. * * DEPRECATED - use !librdf_iterator_end(iterator) * * Return value: 0 if the iterator has finished **/ int librdf_iterator_have_elements(librdf_iterator* iterator) { return !librdf_iterator_end(iterator); } #endif /** * librdf_iterator_end: * @iterator: the #librdf_iterator object * * Test if the iterator has finished. * * Return value: non 0 if the iterator has finished **/ int librdf_iterator_end(librdf_iterator* iterator) { if(!iterator || iterator->is_finished) return 1; librdf_iterator_update_current_element(iterator); return iterator->is_finished; } /** * librdf_iterator_next: * @iterator: the #librdf_iterator object * * Move to the next iterator element. * * Return value: non 0 if the iterator has finished **/ int librdf_iterator_next(librdf_iterator* iterator) { if(!iterator || iterator->is_finished) return 1; if(iterator->next_method(iterator->context)) { iterator->is_finished=1; return 1; } iterator->is_updated=0; librdf_iterator_update_current_element(iterator); return iterator->is_finished; } /** * librdf_iterator_get_object: * @iterator: the #librdf_iterator object * * Get the current object from the iterator. * * This method returns a SHARED pointer to the current iterator object * which should be copied by the caller to preserve it if the iterator * is moved on librdf_iterator_next or if it should last after the * iterator is closed. * * Return value: The next element or NULL if the iterator has finished. **/ void* librdf_iterator_get_object(librdf_iterator* iterator) { if(iterator->is_finished) return NULL; return librdf_iterator_update_current_element(iterator); } /** * librdf_iterator_get_context: * @iterator: the #librdf_iterator object * * Get the context of the current object on the iterator. * * This method returns a SHARED pointer to the current context node object * which should be copied by the caller to preserve it if the iterator * is moved on librdf_iterator_next or if it should last after the * iterator is closed. * * Return value: The context (can be NULL) or NULL if the iterator has finished. **/ void* librdf_iterator_get_context(librdf_iterator* iterator) { if(iterator->is_finished) return NULL; /* Update current element only if we are not already in the middle of the element update process. Allows inspection of context in iterator map callbacks. */ if(!iterator->is_updating && !librdf_iterator_update_current_element(iterator)) return NULL; return iterator->get_method(iterator->context, LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT); } /** * librdf_iterator_get_key: * @iterator: the #librdf_iterator object * * Get the key of the current object on the iterator. * * Return value: The context or NULL if the iterator has finished. **/ void* librdf_iterator_get_key(librdf_iterator* iterator) { if(iterator->is_finished) return NULL; if(!librdf_iterator_update_current_element(iterator)) return NULL; return iterator->get_method(iterator->context, LIBRDF_ITERATOR_GET_METHOD_GET_KEY); } /** * librdf_iterator_get_value: * @iterator: the #librdf_iterator object * * Get the value of the current object on the iterator. * * Return value: The context or NULL if the iterator has finished. **/ void* librdf_iterator_get_value(librdf_iterator* iterator) { if(iterator->is_finished) return NULL; if(!librdf_iterator_update_current_element(iterator)) return NULL; return iterator->get_method(iterator->context, LIBRDF_ITERATOR_GET_METHOD_GET_VALUE); } /** * librdf_iterator_add_map: * @iterator: the iterator * @map_function: the function to operate * @free_context: the function to use to free the context (or NULL) * @map_context: the context to pass to the map function * * Add a librdf_iterator mapping function. * * Adds an iterator mapping function which operates over the iterator to * select which elements are returned; it will be applied as soon as * this method is called. * * Several mapping functions can be added and they are applied in * the order given * * The mapping function should return non 0 to allow the element to be * returned. * * Return value: Non 0 on failure **/ int librdf_iterator_add_map(librdf_iterator* iterator, librdf_iterator_map_handler map_function, librdf_iterator_map_free_context_handler free_context, void *map_context) { librdf_iterator_map *map; if(!iterator->map_list) { iterator->map_list=librdf_new_list(iterator->world); if(!iterator->map_list) return 1; } map = LIBRDF_CALLOC(librdf_iterator_map*, 1, sizeof(*map)); if(!map) return 1; map->fn=map_function; map->free_context=free_context; map->context=map_context; if(librdf_list_add(iterator->map_list, map)) { LIBRDF_FREE(librdf_iterator_map, map); return 1; } return 0; } /** * librdf_new_empty_iterator: * @world: redland world object * * Constructor - create a new #librdf_iterator with no content. * * Return value: a new #librdf_iterator object or NULL on failure **/ librdf_iterator* librdf_new_empty_iterator(librdf_world *world) { librdf_iterator* new_iterator; librdf_world_open(world); new_iterator = LIBRDF_CALLOC(librdf_iterator*, 1, sizeof(*new_iterator)); if(!new_iterator) return NULL; new_iterator->world=world; /* This ensures end, next, get_object, get_context factory methods * never get called and the methods always return finished. */ new_iterator->is_finished=1; return new_iterator; } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); #define ITERATOR_NODES_COUNT 6 #define NODE_URI_PREFIX "http://example.org/node" int main(int argc, char *argv[]) { librdf_world *world; librdf_uri* prefix_uri; librdf_node* nodes[ITERATOR_NODES_COUNT]; int i; librdf_iterator* iterator; int count; const char *program=librdf_basename((const char*)argv[0]); world=librdf_new_world(); librdf_world_open(world); prefix_uri=librdf_new_uri(world, (const unsigned char*)NODE_URI_PREFIX); if(!prefix_uri) { fprintf(stderr, "%s: Failed to create prefix URI\n", program); return(1); } for(i=0; i < ITERATOR_NODES_COUNT; i++) { unsigned char buf[2]; buf[0]='a'+i; buf[1]='\0'; nodes[i]=librdf_new_node_from_uri_local_name(world, prefix_uri, buf); if(!nodes[i]) { fprintf(stderr, "%s: Failed to create node %i (%s)\n", program, i, buf); return(1); } } fprintf(stdout, "%s: Creating static node iterator\n", program); iterator = librdf_node_new_static_node_iterator(world, nodes, ITERATOR_NODES_COUNT); if(!iterator) { fprintf(stderr, "%s: Failed to createstatic node iterator\n", program); return(1); } fprintf(stdout, "%s: Listing static node iterator\n", program); count=0; while(!librdf_iterator_end(iterator)) { librdf_node* i_node=(librdf_node*)librdf_iterator_get_object(iterator); if(!i_node) { fprintf(stderr, "%s: librdf_iterator_current return NULL when not end o fiterator\n", program); return(1); } fprintf(stdout, "%s: node %d is: ", program, count); librdf_node_print(i_node, stdout); fputc('\n', stdout); if(!librdf_node_equals(i_node, nodes[count])) { fprintf(stderr, "%s: static node iterator node %i returned unexpected node\n", program, count); librdf_node_print(i_node, stderr); fputs(" rather than ", stdout); librdf_node_print(nodes[count], stderr); fputc('\n', stdout); return(1); } librdf_iterator_next(iterator); count++; } librdf_free_iterator(iterator); if(count != ITERATOR_NODES_COUNT) { fprintf(stderr, "%s: Iterator returned %d nodes, expected %d\n", program, count, ITERATOR_NODES_COUNT); return(1); } fprintf(stdout, "%s: Static node iterator worked ok\n", program); fprintf(stdout, "%s: Freeing nodes\n", program); for (i=0; i #endif #ifdef WIN32 #include #endif #include #include #ifdef WITH_THREADS #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include /* for getpid() */ #endif /* for gettimeofday */ #if TIME_WITH_SYS_TIME #include #include #else #if HAVE_SYS_TIME_H #include #else #include #endif #endif #include /* for getpid */ #include #ifdef HAVE_UNISTD #include #endif #ifdef MODULAR_LIBRDF #include #endif #ifndef STANDALONE const char * const librdf_short_copyright_string = "Copyright 2000-2012 David Beckett. Copyright 2000-2005 University of Bristol"; const char * const librdf_copyright_string = "Copyright (C) 2000-2012 David Beckett - http://www.dajobe.org/\nCopyright (C) 2000-2005 University of Bristol - http://www.bristol.ac.uk/"; const char * const librdf_license_string = "LGPL 2.1 or newer, GPL 2 or newer, Apache 2.0 or newer.\nSee http://librdf.org/LICENSE.html for full terms."; const char * const librdf_home_url_string = "http://librdf.org/"; /** * librdf_version_string: * * Library full version as a string. * * See also #librdf_version_decimal. */ const char * const librdf_version_string = VERSION; /** * librdf_version_major: * * Library major version number as a decimal integer. */ const unsigned int librdf_version_major = LIBRDF_VERSION_MAJOR; /** * librdf_version_minor: * * Library minor version number as a decimal integer. */ const unsigned int librdf_version_minor = LIBRDF_VERSION_MINOR; /** * librdf_version_release: * * Library release version number as a decimal integer. */ const unsigned int librdf_version_release = LIBRDF_VERSION_RELEASE; /** * librdf_version_decimal: * * Library full version as a decimal integer. * * See also #librdf_version_string. */ const unsigned int librdf_version_decimal = LIBRDF_VERSION_DECIMAL; /** * librdf_new_world: * * Create a new Redland execution environment. * * Once this constructor is called to build a #librdf_world object * several functions may be called to set some parameters such as * librdf_world_set_error(), librdf_world_set_warning(), * librdf_world_set_logger(), librdf_world_set_digest(), * librdf_world_set_feature(). * * The world object needs initializing using librdf_world_open() * whether or not the above functions are called. It will be * automatically called by all object constructors in Redland 1.0.6 * or later, but for earlier versions it MUST be called before using * any other part of Redland. * * Returns: a new #librdf_world or NULL on failure */ librdf_world* librdf_new_world(void) { librdf_world *world; #ifdef HAVE_GETTIMEOFDAY struct timeval tv; struct timezone tz; #endif world = LIBRDF_CALLOC(librdf_world*, 1, sizeof(*world)); if(!world) return NULL; #ifdef HAVE_GETTIMEOFDAY if(!gettimeofday(&tv, &tz)) { world->genid_base = LIBRDF_GOOD_CAST(unsigned long, tv.tv_sec); } else world->genid_base = 1; #else world->genid_base = 1; #endif world->genid_counter = 1; #ifdef MODULAR_LIBRDF world->ltdl_opened = !(lt_dlinit()); if (world->ltdl_opened) lt_dlsetsearchpath(REDLAND_MODULE_PATH); #ifdef LIBRDF_DEBUG else LIBRDF_DEBUG1("lt_dlinit() failed\n"); #endif #endif return world; } /** * librdf_free_world: * @world: redland world object * * Terminate the library and frees all allocated resources. **/ void librdf_free_world(librdf_world *world) { if(!world) return; librdf_finish_serializer(world); librdf_finish_parser(world); librdf_finish_storage(world); librdf_finish_query(world); librdf_finish_model(world); librdf_finish_statement(world); librdf_finish_concepts(world); librdf_finish_node(world); librdf_finish_uri(world); /* Uses rdf_hash so free before destroying hashes */ librdf_finish_raptor(world); librdf_finish_hash(world); librdf_finish_digest(world); #ifdef WITH_THREADS if(world->hash_datums_mutex) { pthread_mutex_destroy(world->hash_datums_mutex); SYSTEM_FREE(world->hash_datums_mutex); world->hash_datums_mutex = NULL; } if(world->statements_mutex) { pthread_mutex_destroy(world->statements_mutex); SYSTEM_FREE(world->statements_mutex); world->statements_mutex = NULL; } if(world->nodes_mutex) { pthread_mutex_destroy(world->nodes_mutex); SYSTEM_FREE(world->nodes_mutex); world->nodes_mutex = NULL; } if(world->mutex) { pthread_mutex_destroy(world->mutex); SYSTEM_FREE(world->mutex); world->mutex = NULL; } #endif #ifdef MODULAR_LIBRDF if (world->ltdl_opened) lt_dlexit(); #endif LIBRDF_FREE(librdf_world, world); } /** * librdf_world_init_mutex: * @world: redland world object * * INTERNAL - Create the world mutex. */ void librdf_world_init_mutex(librdf_world* world) { #ifdef WITH_THREADS world->mutex = (pthread_mutex_t *) SYSTEM_MALLOC(sizeof(pthread_mutex_t)); pthread_mutex_init(world->mutex, NULL); world->nodes_mutex = (pthread_mutex_t *) SYSTEM_MALLOC(sizeof(pthread_mutex_t)); pthread_mutex_init(world->nodes_mutex, NULL); world->statements_mutex = (pthread_mutex_t *) SYSTEM_MALLOC(sizeof(pthread_mutex_t)); pthread_mutex_init(world->statements_mutex, NULL); world->hash_datums_mutex = (pthread_mutex_t *) SYSTEM_MALLOC(sizeof(pthread_mutex_t)); pthread_mutex_init(world->hash_datums_mutex, NULL); #else #endif } /** * librdf_world_open: * @world: redland world object * * Open a created redland world environment. **/ void librdf_world_open(librdf_world *world) { int rc = 0; if(world->opened++) return; librdf_world_init_mutex(world); /* Digests second, lots of things use these */ librdf_init_digest(world); /* Hash next, needed for URIs */ librdf_init_hash(world); /* Initialize raptor; uses rdf_hash for bnode mapping */ librdf_init_raptor(world); librdf_init_uri(world); librdf_init_node(world); librdf_init_concepts(world); librdf_init_statement(world); librdf_init_model(world); librdf_init_storage(world); librdf_init_parser(world); librdf_init_serializer(world); rc = librdf_init_query(world); if(rc) goto failed; return; failed: /* should return an error state */ return; } /** * librdf_world_set_rasqal: * @world: librdf_world object * @rasqal_world_ptr: rasqal_world object * * Set the #rasqal_world instance to be used with this #librdf_world. * * If no rasqal_world instance is set with this function, * librdf_world_open() creates a new instance. * * Ownership of the rasqal_world is not taken. If the rasqal library * instance is set with this function, librdf_free_world() will not * free it. * **/ void librdf_world_set_rasqal(librdf_world* world, rasqal_world* rasqal_world_ptr) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN(world, librdf_world); world->rasqal_world_ptr = rasqal_world_ptr; world->rasqal_world_allocated_here = 0; } /** * librdf_world_get_rasqal: * @world: librdf_world object * * Get the #rasqal_world instance used by this #librdf_world. * * Return value: rasqal_world object or NULL on failure (e.g. not initialized) **/ rasqal_world* librdf_world_get_rasqal(librdf_world* world) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); return world->rasqal_world_ptr; } /** * librdf_world_set_error: * @world: redland world object * @user_data: user data to pass to function * @error_handler: pointer to the function * * Set the world error handling function. * * The function will receive callbacks when the world fails. * librdf_world_set_logger() provides richer access to all log messages * and should be used in preference. **/ void librdf_world_set_error(librdf_world* world, void *user_data, librdf_log_level_func error_handler) { world->error_user_data = user_data; world->error_handler = error_handler; } /** * librdf_world_set_warning: * @world: redland world object * @user_data: user data to pass to function * @warning_handler: pointer to the function * * Set the world warning handling function. * * The function will receive callbacks when the world gives a warning. * librdf_world_set_logger() provides richer access to all log messages * and should be used in preference. **/ void librdf_world_set_warning(librdf_world* world, void *user_data, librdf_log_level_func warning_handler) { world->warning_user_data = user_data; world->warning_handler = warning_handler; } /** * librdf_world_set_logger: * @world: redland world object * @user_data: user data to pass to function * @log_handler: pointer to the function * * Set the world log handling function. * * The function will receive callbacks when redland generates a log message **/ void librdf_world_set_logger(librdf_world* world, void *user_data, librdf_log_func log_handler) { world->log_user_data = user_data; world->log_handler = log_handler; } /** * librdf_world_set_digest: * @world: redland world object * @name: Digest factory name * * Set the default content digest name. * * Sets the digest factory for various modules that need to make * digests of their objects. */ void librdf_world_set_digest(librdf_world* world, const char *name) { world->digest_factory_name = (char*)name; } /** * librdf_world_get_feature: * @world: #librdf_world object * @feature: #librdf_uri feature property * * Get the value of a world feature. * * Return value: new #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ librdf_node* librdf_world_get_feature(librdf_world* world, librdf_uri *feature) { return NULL; /* none retrievable */ } /** * librdf_world_set_feature: * @world: #librdf_world object * @feature: #librdf_uri feature property * @value: #librdf_node feature property value * * Set the value of a world feature. * * Return value: non 0 on failure (negative if no such feature) **/ int librdf_world_set_feature(librdf_world* world, librdf_uri* feature, librdf_node* value) { librdf_uri* genid_base; librdf_uri* genid_counter; int rc= -1; genid_counter = librdf_new_uri(world, (const unsigned char*)LIBRDF_WORLD_FEATURE_GENID_COUNTER); genid_base = librdf_new_uri(world, (const unsigned char*)LIBRDF_WORLD_FEATURE_GENID_BASE); if(librdf_uri_equals(feature, genid_base)) { if(!librdf_node_is_resource(value)) rc=1; else { long lid = atol((const char*)librdf_node_get_literal_value(value)); if(lid < 1) lid = 1; #ifdef WITH_THREADS pthread_mutex_lock(world->mutex); #endif world->genid_base = LIBRDF_GOOD_CAST(unsigned long, lid); #ifdef WITH_THREADS pthread_mutex_unlock(world->mutex); #endif rc = 0; } } else if(librdf_uri_equals(feature, genid_counter)) { if(!librdf_node_is_resource(value)) rc = 1; else { long lid = atol((const char*)librdf_node_get_literal_value(value)); if(lid < 1) lid = 1; #ifdef WITH_THREADS pthread_mutex_lock(world->mutex); #endif world->genid_counter = LIBRDF_GOOD_CAST(unsigned long, lid); #ifdef WITH_THREADS pthread_mutex_unlock(world->mutex); #endif rc = 0; } } librdf_free_uri(genid_base); librdf_free_uri(genid_counter); return rc; } /* Internal */ unsigned char* librdf_world_get_genid(librdf_world* world) { unsigned long id, tmpid, counter, tmpcounter, pid, tmppid; size_t length; unsigned char *buffer; /* This is read-only and thread safe */ tmpid = (id = world->genid_base); #ifdef WITH_THREADS pthread_mutex_lock(world->mutex); #endif tmpcounter = (counter = world->genid_counter++); #ifdef WITH_THREADS pthread_mutex_unlock(world->mutex); #endif /* Add the process ID to the seed to differentiate between * simultaneously executed child processes. */ pid = LIBRDF_GOOD_CAST(unsigned long, getpid()); if(!pid) pid = 1; tmppid = pid; /* min length 1 + "r" + min length 1 + "r" + min length 1 + "r" \0 */ length = 7; while(tmpid /= 10) length++; while(tmpcounter /= 10) length++; while(tmppid /= 10) length++; buffer = LIBRDF_MALLOC(unsigned char*, length); if(!buffer) return NULL; sprintf((char*)buffer, "r%lur%lur%lu", id, pid, counter); return buffer; } /* OLD INTERFACES BELOW HERE */ /* For old interfaces below ONLY */ #ifndef NO_STATIC_DATA static librdf_world* RDF_World; #endif #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_init_world: * @digest_factory_name: Name of digest factory to use * @not_used2: Not used * * Initialise the library * @deprecated: Do not use. * * Use librdf_new_world() and librdf_world_open() on #librdf_world object * * See librdf_world_set_digest() for documentation on arguments. **/ void librdf_init_world(char *digest_factory_name, void* not_used2) { #ifndef NO_STATIC_DATA RDF_World = librdf_new_world(); if(!RDF_World) return; if(digest_factory_name) librdf_world_set_digest(RDF_World, digest_factory_name); librdf_world_open(RDF_World); #else /* fail if NO_STATIC_DATA is defined */ abort(); #endif } /** * librdf_destroy_world: * * Terminate the library * @deprecated: Do not use. * * Use librdf_free_world() on #librdf_world object * * Terminates and frees the resources. **/ void librdf_destroy_world(void) { #ifndef NO_STATIC_DATA librdf_free_world(RDF_World); #else /* fail if NO_STATIC_DATA is defined */ abort(); #endif } #endif /** * librdf_basename: * @name: path * * Get the basename of a path * * Return value: filename part of a pathname **/ const char* librdf_basename(const char *name) { const char *p; if((p = strrchr(name, '/'))) name = p+1; else if((p = strrchr(name, '\\'))) name = p+1; return name; } /** * librdf_free_memory: * @ptr: pointer to free * * Free memory allocated in the library. * * Required for some runtimes where memory must be freed within the same * shared object it was allocated in. **/ void librdf_free_memory(void *ptr) { raptor_free_memory(ptr); } /** * librdf_alloc_memory: * @size: alloc size * * Allocate memory inside the library similar to malloc(). * * Required for some runtimes where memory must be freed within the same * shared object it was allocated in. * * Return value: pointer to memory or NULL on failure **/ void* librdf_alloc_memory(size_t size) { return raptor_alloc_memory(size); } /** * librdf_calloc_memory: * @nmemb: number of members * @size: size of member * * Allocate zeroed array of items inside the library similar to calloc(). * * Required for some runtimes where memory must be freed within the same * shared object it was allocated in. * * Return value: pointer to memory or NULL on failure **/ void* librdf_calloc_memory(size_t nmemb, size_t size) { return raptor_calloc_memory(nmemb, size); } #endif /* STANDALONE */ /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { librdf_world *world; rasqal_world *rasqal_world; unsigned char* id; const char *program=librdf_basename((const char*)argv[0]); /* Minimal setup-cleanup test without opening the world */ fprintf(stdout, "%s: Creating new world\n", program); world = librdf_new_world(); if(!world) { fprintf(stderr, "%s: librdf_new_world failed\n", program); return 1; } fprintf(stdout, "%s: Deleting world\n", program); librdf_free_world(world); /* Test setting and getting a the rasqal world */ fprintf(stdout, "%s: Setting and getting rasqal_world\n", program); world = librdf_new_world(); if(!world) { fprintf(stderr, "%s: librdf_new_world failed\n", program); return 1; } rasqal_world = rasqal_new_world(); if(!rasqal_world) { fprintf(stderr, "%s: rasqal_new_world failed\n", program); return 1; } librdf_world_set_rasqal(world, rasqal_world); if (librdf_world_get_rasqal(world) != rasqal_world) { fprintf(stderr, "%s: librdf_world_set_rasqal/librdf_world_get_rasqal failed\n", program); return 1; } rasqal_free_world(rasqal_world); librdf_free_world(world); /* Test id generation */ fprintf(stdout, "%s: Creating new world\n", program); world = librdf_new_world(); if(!world) { fprintf(stderr, "%s: librdf_new_world failed\n", program); return 1; } fprintf(stdout, "%s: Generating an identifier\n", program); id = librdf_world_get_genid(world); if(id == NULL || strlen((const char*)id) < 6) { fprintf(stderr, "%s: librdf_world_get_genid failed\n", program); return 1; } fprintf(stdout, "%s: New identifier is: '%s'\n", program, id); LIBRDF_FREE(char*, id); fprintf(stdout, "%s: Deleting world\n", program); librdf_free_world(world); /* keep gcc -Wall happy */ return(0); } #endif redland-1.0.17/src/rdf_query.c0000644000175000017500000004712411757416522013107 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_query.c - RDF Query Language/Syntax and Execution Interface * * Copyright (C) 2002-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2002-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include #ifdef HAVE_STDLIB_H #include #endif #include #include #ifndef STANDALONE /* prototypes for helper functions */ static void librdf_delete_query_factories(librdf_world *world); /** * librdf_init_query: * @world: redland world object * * INTERNAL - Initialise the query module. * * Initialises and registers all * compiled query modules. Must be called before using any of the query * factory functions such as librdf_get_query_factory() **/ int librdf_init_query(librdf_world *world) { int rc; /* Always have rasqal implementation available */ rc = librdf_query_rasqal_constructor(world); if(rc) return rc; #ifdef MODULAR_LIBRDF #else #ifdef STORAGE_VIRTUOSO librdf_init_query_virtuoso(world); #endif #endif return 0; } /** * librdf_finish_query: * @world: redland world object * * INTERNAL - Terminate the query module. * **/ void librdf_finish_query(librdf_world *world) { librdf_query_rasqal_destructor(world); librdf_delete_query_factories(world); } /* helper functions */ /* * librdf_free_query_factory - delete a query factory */ static void librdf_free_query_factory(librdf_query_factory *factory) { if(factory) { if(factory->name) LIBRDF_FREE(librdf_query_factory, factory->name); if(factory->uri) librdf_free_uri(factory->uri); LIBRDF_FREE(librdf_query_factory, factory); } } /* * librdf_delete_query_factories - helper function to delete all the registered query factories */ static void librdf_delete_query_factories(librdf_world *world) { librdf_query_factory *factory, *next; for(factory=world->query_factories; factory; factory=next) { next=factory->next; librdf_free_query_factory(factory); } world->query_factories=NULL; } /* class methods */ /** * librdf_query_register_factory: * @world: redland world object * @name: the query language name * @uri_string: the query language URI string (or NULL if none) * @factory: pointer to function to call to register the factory * * Register a query factory. * **/ REDLAND_EXTERN_C void librdf_query_register_factory(librdf_world *world, const char *name, const unsigned char *uri_string, void (*factory) (librdf_query_factory*)) { librdf_query_factory *query; librdf_world_open(world); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG2("Received registration for query name %s\n", name); #endif for(query = world->query_factories; query; query = query->next ) { if(!strcmp(query->name, name)) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "query language %s already registered", query->name); return; } } query = LIBRDF_CALLOC(librdf_query_factory*, 1, sizeof(*query)); if(!query) goto oom; query->name = LIBRDF_MALLOC(char*, strlen(name) + 1); if(!query->name) goto oom_tidy; strcpy(query->name, name); if(uri_string) { query->uri=librdf_new_uri(world, uri_string); if(!query->uri) goto oom_tidy; } query->next = world->query_factories; world->query_factories = query; /* Call the query registration function on the new object */ (*factory)(query); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("%s has context size %d\n", name, query->context_length); #endif return; oom_tidy: librdf_free_query_factory(query); oom: LIBRDF_FATAL1(world, LIBRDF_FROM_QUERY, "Out of memory"); } /** * librdf_get_query_factory: * @world: redland world object * @name: the factory name or NULL for the default factory * @uri: the factory URI or NULL for the default factory * * Get a query factory by name. * * Return value: the factory object or NULL if there is no such factory **/ librdf_query_factory* librdf_get_query_factory(librdf_world *world, const char *name, librdf_uri *uri) { librdf_query_factory *factory; librdf_world_open(world); /* return 1st query if no particular one wanted - why? */ if(!name && !uri) { factory=world->query_factories; if(!factory) { LIBRDF_DEBUG1("No (default) query factories registered\n"); return NULL; } } else { for(factory=world->query_factories; factory; factory=factory->next) { if(name && !strcmp(factory->name, name)) { break; } if(uri && factory->uri && librdf_uri_equals(factory->uri, uri)) { break; } } /* else FACTORY name not found */ if(!factory) { LIBRDF_DEBUG3("No query language with name '%s' uri %s found\n", name, (uri ? (char*)librdf_uri_as_string(uri) : "NULL")); return NULL; } } return factory; } /** * librdf_query_languages_enumerate: * @world: #librdf_world * @counter: index into the list of query language syntaxes * @name: pointer to store the name of the query language syntax (or NULL) * @uri_string: pointer to store query language syntax URI string (or NULL) * * Get information on query language syntaxes. * * All returned strings are shared and must be copied if needed to be * used dynamically. * * @deprecated: use librdf_query_language_get_description() to return * more information in a static structure. * * Return value: non 0 on failure of if counter is out of range */ int librdf_query_languages_enumerate(librdf_world* world, const unsigned int counter, const char **name, const unsigned char **uri_string) { unsigned int i; librdf_query_factory *factory; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, 1); if(!name && !uri_string) return 1; librdf_world_open(world); factory = world->query_factories; if(!factory) return 1; for(i=0; factory && i<=counter ; i++, factory=factory->next) { if(i == counter) { if(name) *name=factory->name; if(uri_string) { if (factory->uri) *uri_string=librdf_uri_as_string(factory->uri); else *uri_string=NULL; } return 0; } } return 1; } /** * librdf_query_language_get_description: * @world: #librdf_world * @counter: index into the list of query language syntaxes * * Get a query language syntax description. * * Return value: description or NULL if counter is out of range */ const raptor_syntax_description* librdf_query_language_get_description(librdf_world* world, unsigned int counter) { librdf_world_open(world); return rasqal_world_get_query_language_description(world->rasqal_world_ptr, counter); } /** * librdf_new_query: * @world: redland world object * @name: the name identifying the query language * @uri: the URI identifying the query language (or NULL) * @query_string: the query string * @base_uri: the base URI of the query string (or NULL) * * Constructor - create a new #librdf_query object. * * Return value: a new #librdf_query object or NULL on failure */ librdf_query* librdf_new_query(librdf_world *world, const char *name, librdf_uri *uri, const unsigned char *query_string, librdf_uri* base_uri) { librdf_query_factory* factory; librdf_world_open(world); factory=librdf_get_query_factory(world, name, uri); if(!factory) return NULL; return librdf_new_query_from_factory(world, factory, name, uri, query_string, base_uri); } /** * librdf_new_query_from_query: * @old_query: the existing query #librdf_query to use * * Copy constructor - create a new librdf_query object from an existing one * * Should create a new query in the same context as the existing one * as appropriate. * * Return value: a new #librdf_query object or NULL on failure */ librdf_query* librdf_new_query_from_query(librdf_query* old_query) { librdf_query* new_query; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(old_query, librdf_query, NULL); /* FIXME: fail if clone is not supported by this query (factory) */ if(!old_query->factory->clone) { LIBRDF_FATAL1(old_query->world, LIBRDF_FROM_QUERY, "clone not implemented for query factory"); return NULL; } new_query = LIBRDF_CALLOC(librdf_query*, 1, sizeof(*new_query)); if(!new_query) return NULL; new_query->usage=1; new_query->context = LIBRDF_CALLOC(void*, 1, old_query->factory->context_length); if(!new_query->context) { librdf_free_query(new_query); return NULL; } new_query->world=old_query->world; /* do this now so librdf_free_query won't call new factory on * partially copied query */ new_query->factory=old_query->factory; /* clone is assumed to do leave the new query in the same state * after an init() method on an existing query - i.e ready to use */ if(old_query->factory->clone(new_query, old_query)) { librdf_free_query(new_query); return NULL; } return new_query; } /** * librdf_new_query_from_factory: * @world: redland world object * @factory: the factory to use to construct the query * @name: query language name * @uri: query language URI (or NULL) * @query_string: the query string * @base_uri: base URI of the query string (or NULL) * * Constructor - create a new #librdf_query object. * * Return value: a new #librdf_query object or NULL on failure */ librdf_query* librdf_new_query_from_factory(librdf_world *world, librdf_query_factory* factory, const char *name, librdf_uri *uri, const unsigned char *query_string, librdf_uri *base_uri) { librdf_query* query; librdf_world_open(world); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(factory, librdf_query_factory, NULL); if(!factory) { LIBRDF_DEBUG1("No query factory given\n"); return NULL; } query = LIBRDF_CALLOC(librdf_query*, 1, sizeof(*query)); if(!query) return NULL; query->world=world; query->usage=1; query->context = LIBRDF_CALLOC(void*, 1, factory->context_length); if(!query->context) { librdf_free_query(query); return NULL; } query->factory=factory; if(factory->init(query, name, uri, query_string, base_uri)) { librdf_free_query(query); return NULL; } return query; } /** * librdf_free_query: * @query: #librdf_query object * * Destructor - destroy a #librdf_query object. **/ void librdf_free_query(librdf_query* query) { if(!query) return; if(--query->usage) return; if(query->factory) query->factory->terminate(query); if(query->context) LIBRDF_FREE(librdf_query_context, query->context); LIBRDF_FREE(librdf_query, query); } /* methods */ void librdf_query_add_query_result(librdf_query *query, librdf_query_results* query_results) { query_results->next=query->results; query->results=query_results; /* add reference to ensure query lives as long as this runs */ query->usage++; } void librdf_query_remove_query_result(librdf_query *query, librdf_query_results* query_results) { librdf_query_results *cur, *prev=NULL; for(cur = query->results; cur && cur != query_results; cur = cur->next) prev = cur; if(cur != NULL) { if(cur == query_results) { if(prev) prev->next = cur->next; } if(cur == query->results) query->results = cur->next; } /* remove reference and free if we are the last */ librdf_free_query(query); } /** * librdf_query_execute: * @query: #librdf_query object * @model: model to operate query on * * Run the query on a model. * * Runs the query against the (previously registered) model * and returns a #librdf_query_results for the result objects. * * Return value: #librdf_query_results or NULL on failure **/ librdf_query_results* librdf_query_execute(librdf_query* query, librdf_model* model) { librdf_query_results* results=NULL; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query, librdf_query, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); if(query->factory->execute) { if((results=query->factory->execute(query, model))) librdf_query_add_query_result(query, results); } return results; } /** * librdf_query_get_limit: * @query: #librdf_query query object * * Get the query-specified limit on results. * * This is the limit given in the query on the number of results allowed. * * Return value: integer >=0 if a limit is given, otherwise <0 **/ int librdf_query_get_limit(librdf_query *query) { if(query->factory->get_limit) return query->factory->get_limit(query); return -1; } /** * librdf_query_set_limit: * @query: #librdf_query query object * @limit: the limit on results, >=0 to set a limit, <0 to have no limit * * Set the query-specified limit on results. * * This is the limit given in the query on the number of results allowed. * * Return value: non-0 on failure **/ int librdf_query_set_limit(librdf_query *query, int limit) { if(query->factory->set_limit) { query->factory->set_limit(query, limit); return 0; } return -1; } /** * librdf_query_get_offset: * @query: #librdf_query query object * * Get the query-specified offset on results. * * This is the offset given in the query on the number of results allowed. * * Return value: integer >=0 if a offset is given, otherwise <0 **/ int librdf_query_get_offset(librdf_query *query) { if(query->factory->get_offset) return query->factory->get_offset(query); return -1; } /** * librdf_query_set_offset: * @query: #librdf_query query object * @offset: offset for results, >=0 to set an offset, <0 to have no offset * * Set the query-specified offset on results. * * This is the offset given in the query on the number of results allowed. * * Return value: non-0 on failure **/ int librdf_query_set_offset(librdf_query *query, int offset) { if(query->factory->set_offset) { query->factory->set_offset(query, offset); return 0; } return -1; } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); #define DATA "@prefix ex: .\ ex:fido a ex:Dog ;\ ex:label \"Fido\" .\ " #define DATA_LANGUAGE "turtle" #define DATA_BASE_URI "http://example.org/" #define QUERY_STRING "SELECT ?x WHERE { ?x a ?y }" #define QUERY_LANGUAGE "sparql" #define VARIABLES_COUNT 1 int main(int argc, char *argv[]) { librdf_query* query; librdf_query_results* results; librdf_model* model; librdf_storage* storage; librdf_parser* parser; librdf_uri *uri; const char *program=librdf_basename((const char*)argv[0]); librdf_world *world; size_t string_length; unsigned char *string; const char *query_string=QUERY_STRING; int i; world=librdf_new_world(); librdf_world_open(world); /* list available query languages */ fprintf(stdout, "%s: Enumerating query languages:\n", program); for (i = 0; 1; i++) { const raptor_syntax_description* desc = NULL; const char *name; const unsigned char *uri; desc = librdf_query_language_get_description(world, i); if (!desc) break; fprintf(stdout, " %s <%s>\n", desc->names[0], desc->uri_strings_count ? desc->uri_strings[0] : ""); } /* create model and storage */ if(1) { /* test in memory */ storage = librdf_new_storage(world, NULL, NULL, NULL); } else { /* test on disk */ #ifdef HAVE_BDB_HASH storage = librdf_new_storage(world, "hashes", "test", "hash-type='bdb',dir='.',write='yes',new='yes',contexts='yes'"); #else storage = librdf_new_storage(world, "file", "test.rdf", NULL); #endif } if(!storage) { fprintf(stderr, "%s: Failed to create new storage\n", program); return(1); } fprintf(stderr, "%s: Creating model\n", program); model=librdf_new_model(world, storage, NULL); if(!model) { fprintf(stderr, "%s: Failed to create new model\n", program); return(1); } /* read the example data in */ uri=librdf_new_uri(world, (const unsigned char*)DATA_BASE_URI); parser=librdf_new_parser(world, DATA_LANGUAGE, NULL, NULL); librdf_parser_parse_string_into_model(parser, (const unsigned char*)DATA, uri, model); librdf_free_parser(parser); librdf_free_uri(uri); fprintf(stdout, "%s: Creating query\n", program); query=librdf_new_query(world, QUERY_LANGUAGE, NULL, (const unsigned char*)query_string, NULL); if(!query) { fprintf(stderr, "%s: Failed to create new query\n", program); return(1); } /* do the query */ if(!(results=librdf_model_query_execute(model, query))) { fprintf(stderr, "%s: Query of model with '%s' failed\n", program, query_string); return 1; } /* print the results */ while(!librdf_query_results_finished(results)) { const char **names=NULL; librdf_node* values[VARIABLES_COUNT]; if(librdf_query_results_get_bindings(results, &names, values)) break; fputs("result: [", stdout); if(names) { int i; int count = librdf_query_results_get_bindings_count(results); for(i = 0; i < count; i++) { fprintf(stdout, "%s=", names[i]); if(values[i]) { librdf_node_print(values[i], stdout); librdf_free_node(values[i]); } else fputs("NULL", stdout); if(names[i+1]) fputs(", ", stdout); } } fputs("]\n", stdout); librdf_query_results_next(results); } fprintf(stdout, "%s: Query returned %d results\n", program, librdf_query_results_get_count(results)); librdf_free_query_results(results); fprintf(stdout, "%s: Executing a second time\n", program); if(!(results=librdf_model_query_execute(model, query))) { fprintf(stderr, "%s: Second query of model with '%s' failed\n", program, query_string); return 1; } string_length=0; string = librdf_query_results_to_counted_string2(results, "xml", NULL, NULL, NULL, &string_length); fprintf(stdout, "%s: Got query results string of length %d\n", program, (int)string_length); librdf_free_memory(string); librdf_free_query_results(results); fprintf(stdout, "%s: Freeing query\n", program); librdf_free_query(query); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); /* keep gcc -Wall happy */ return(0); } #endif redland-1.0.17/src/rdf_stream.h0000644000175000017500000000706011455350447013233 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_stream.h - RDF Stream interface and definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_STREAM_H #define LIBRDF_STREAM_H #ifdef __cplusplus extern "C" { #endif /** * librdf_stream_map_handler: * @stream: Stream that this map is operating over. * @map_context: Map data context pointer. * @item: Pointer to the current item in the iteration. * * Map function for a #librdf_stream map operation. * * See librdf_stream_add_map(). * * Returns: item in keep the iteration or NULL to remove it */ typedef librdf_statement* (*librdf_stream_map_handler)(librdf_stream *stream, void *map_context, librdf_statement *item); /** * librdf_stream_map_free_context_handler: * @map_context: Map data context pointer. * * Free handler function for a #librdf_stream map operation. * * See librdf_stream_add_map(). */ typedef void (*librdf_stream_map_free_context_handler)(void *map_context); #ifdef LIBRDF_INTERNAL #include #endif /** * librdf_stream_get_method_flags: * @LIBRDF_STREAM_GET_METHOD_GET_OBJECT: get object from iterator - implementing librdf_stream_get_object() * @LIBRDF_STREAM_GET_METHOD_GET_CONTEXT: get context from iterator - implementing librdf_stream_get_context() * * Flags for librdf_new_stream() get_method function pointer. */ typedef enum { LIBRDF_STREAM_GET_METHOD_GET_OBJECT = LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT, LIBRDF_STREAM_GET_METHOD_GET_CONTEXT = LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT } librdf_stream_get_method_flags; /* constructor */ REDLAND_API librdf_stream* librdf_new_stream(librdf_world *world, void* context, int (*is_end_method)(void*), int (*next_method)(void*), void* (*get_method)(void*, int), void (*finished_method)(void*)); REDLAND_API librdf_stream* librdf_new_stream_from_node_iterator(librdf_iterator* iterator, librdf_statement* statement, librdf_statement_part field); /* destructor */ REDLAND_API void librdf_free_stream(librdf_stream* stream); /* methods */ REDLAND_API int librdf_stream_end(librdf_stream* stream); REDLAND_API int librdf_stream_next(librdf_stream* stream); REDLAND_API librdf_statement* librdf_stream_get_object(librdf_stream* stream); REDLAND_API librdf_node* librdf_stream_get_context2(librdf_stream* stream); REDLAND_API REDLAND_DEPRECATED void* librdf_stream_get_context(librdf_stream* stream); REDLAND_API int librdf_stream_add_map(librdf_stream* stream, librdf_stream_map_handler map_function, librdf_stream_map_free_context_handler free_context, void *map_context); REDLAND_API REDLAND_DEPRECATED void librdf_stream_print(librdf_stream *stream, FILE *fh); REDLAND_API int librdf_stream_write(librdf_stream *stream, raptor_iostream *iostr); REDLAND_API librdf_stream* librdf_new_empty_stream(librdf_world *world); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_statement_common.c0000644000175000017500000001076611611163532015305 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_statement_common.c - RDF Triple (Statement) interface * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include #ifndef STANDALONE /* class methods */ /** * librdf_init_statement: * @world: redland world object * * INTERNAL - Initialise the statement module. * **/ void librdf_init_statement(librdf_world *world) { } /** * librdf_finish_statement: * @world: redland world object * * INTERNAL - Terminate the statement module. * **/ void librdf_finish_statement(librdf_world *world) { } /** * librdf_statement_encode_parts2: * @world: redland world object * @statement: statement to serialise * @context_node: #librdf_node context node (can be NULL) * @buffer: the buffer to use * @length: buffer size * @fields: fields to encode * * Serialise parts of a statement into a buffer. * * Encodes the given statement in the buffer, which must be of sufficient * size. If buffer is NULL, no work is done but the size of buffer * required is returned. * * The fields values are or-ed combinations of: * #LIBRDF_STATEMENT_SUBJECT #LIBRDF_STATEMENT_PREDICATE * #LIBRDF_STATEMENT_OBJECT * or #LIBRDF_STATEMENT_ALL for subject,prdicate,object fields * * If context_node is given, it is encoded also * * Return value: the number of bytes written or 0 on failure. **/ size_t librdf_statement_encode_parts2(librdf_world* world, librdf_statement* statement, librdf_node* context_node, unsigned char *buffer, size_t length, librdf_statement_part fields) { size_t total_length=0; size_t node_len; unsigned char *p; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 0); /* min size */ if(buffer && length < 1) return 0; p=buffer; /* magic number 'x' */ if(p) { *p++='x'; length--; } total_length++; if((fields & LIBRDF_STATEMENT_SUBJECT) && statement->subject) { /* 's' + subject */ if(p) { if(length < 1) return 0; *p++='s'; length--; } total_length++; node_len=librdf_node_encode(statement->subject, p, length); if(!node_len) return 0; if(p) { p += node_len; length -= node_len; } total_length += node_len; } if((fields & LIBRDF_STATEMENT_PREDICATE) && statement->predicate) { /* 'p' + predicate */ if(p) { if(length < 1) return 0; *p++='p'; length--; } total_length++; node_len=librdf_node_encode(statement->predicate, p, length); if(!node_len) return 0; if(p) { p += node_len; length -= node_len; } total_length += node_len; } if((fields & LIBRDF_STATEMENT_OBJECT) && statement->object) { /* 'o' object */ if(p) { if(length < 1) return 0; *p++='o'; length--; } total_length++; node_len= librdf_node_encode(statement->object, p, length); if(!node_len) return 0; if(p) { p += node_len; length -= node_len; } total_length += node_len; } if(context_node) { /* 'o' object */ if(p) { *p++='c'; length--; } total_length++; node_len= librdf_node_encode(context_node, p, length); if(!node_len) return 0; /* p and length changes never needed to be calculated [clang] */ /* if(p) { p += node_len; length -= node_len; } */ total_length += node_len; } return total_length; } #endif redland-1.0.17/src/rdf_types.h0000644000175000017500000000354711612367033013104 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_types.h - RDF data types used by some bit-twiddling routines * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_TYPES_H #define LIBRDF_TYPES_H #ifdef __cplusplus extern "C" { #endif #include #ifndef HAVE_U64 #if SIZEOF_UNSIGNED_INT == 8 typedef unsigned int u64; #define UINT64_T_FMT "%u" #elif SIZEOF_UNSIGNED_LONG == 8 typedef unsigned long u64; #define UINT64_T_FMT "%lu" #elif SIZEOF_UNSIGNED_LONG_LONG == 8 #ifdef WIN32 typedef __int64 u64; #define UINT64_T_FMT "%I64u" #else typedef unsigned long long u64; #define UINT64_T_FMT "%llu" #endif #else #error u64 type not defined #endif #endif #ifndef HAVE_U32 #if SIZEOF_UNSIGNED_INT == 4 typedef unsigned int u32; #elif SIZEOF_UNSIGNED_LONG == 4 typedef unsigned long u32; #else #error u32 type not defined #endif #endif #ifndef HAVE_BYTE #if SIZEOF_UNSIGNED_CHAR == 1 typedef unsigned char byte; #else #error byte type not defined #endif #endif #ifdef __cplusplus } #endif #endif redland-1.0.17/src/redland.spec0000644000175000017500000001313612257576330013224 00000000000000# -*- RPM-SPEC -*- # Note that this is NOT a relocatable package %define name redland %define version 1.0.17 %define release SNAP %define prefix /usr Summary: Redland RDF Application Framework Name: %{name} Version: %{version} Release: %{release} Prefix: %{_prefix} License: LGPLv2+ or ASL 2.0 Group: Development/Libraries Source: http://download.librdf.org/source/%{name}-%{version}.tar.gz URL: http://librdf.org/ BuildRoot: /tmp/%{name}-%{version} BuildRequires: libxml2-devel >= 2.4.0 BuildRequires: curl-devel BuildRequires: raptor2-devel >= 2.0.7 BuildRequires: rasqal-devel >= 0.9.25, rasqal-devel <= 0.9.99 BuildRequires: perl >= 5.8.0 BuildRequires: db4-devel BuildRequires: mysql-devel BuildRequires: sqlite-devel BuildRequires: postgresql-devel BuildRequires: gtk-doc BuildRequires: libtool Packager: Dave Beckett Docdir: %{prefix}/doc Requires: libxml2 Requires: curl Requires: raptor2 Requires: rasqal Requires: mysql %description Redland is a library that provides a high-level interface for RDF (Resource Description Framework) implemented in an object-based API. It is modular and supports different RDF parsers, serializers, storage and query languages. Redland is designed for developers to provide RDF support in their applications as well as a core library for RDF developers to start with. %package devel Summary: Libraries and header files for programs that use Redland. Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: raptor2 >= 2.0.7 Requires: rasqal >= 0.9.25, rasqal <= 0.9.99 %description devel Header files for development with Redland %prep %setup -q %build %configure \ --enable-release \ --with-threestore=no %{__make} OPTIMIZE="$RPM_OPT_FLAGS" %check make check %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %makeinstall find $RPM_BUILD_ROOT -print | xargs chmod u+w %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %{_libdir}/librdf*.so.* %{_bindir}/rdfproc %{_bindir}/redland-db-upgrade %dir %{_datadir}/redland %{_datadir}/redland/mysql-v1.ttl %{_datadir}/redland/mysql-v2.ttl %doc AUTHORS COPYING COPYING.LIB ChangeLog LICENSE.txt NEWS README %doc LICENSE-2.0.txt NOTICE %doc *.html %doc %{_mandir}/man1/redland-db-upgrade.1* %doc %{_mandir}/man1/rdfproc.1* %doc %{_mandir}/man3/redland.3* %files devel %defattr(-, root, root,-) %{_bindir}/redland-config %{_libdir}/librdf*.a %{_libdir}/librdf*.la %{_libdir}/librdf*.so %{_libdir}/pkgconfig/redland.pc %dir %{_datadir}/redland %{_datadir}/redland/Redland.i %{_includedir}/redland.h %{_includedir}/librdf.h %{_includedir}/rdf_*.h %doc AUTHORS COPYING COPYING.LIB ChangeLog LICENSE.txt NEWS README %doc LICENSE-2.0.txt NOTICE %doc docs/README.html %doc %{_datadir}/gtk-doc/html %doc %{_mandir}/man1/redland-config.1* %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %changelog * Tue Feb 1 2011 Dave Beckett - Require Raptor 2 - Do not use removed configure options --with-raptor and --with-rasqal * Sun Dec 16 2007 Dave Beckett - rasqal-devel has a max and a min version now - use macros like %{_bindir} and %{_includedir} - add postgresql-devel, gtk-doc and libtool to BuildRequires - create some new dirs explicitly * Sat May 5 2007 Dave Beckett - Add /usr/share/redland/mysql-v1.ttl and /usr/share/redland/mysql-v2.ttl * Wed Feb 15 2006 Dave Beckett - Require db4-devel - Disable postgresql for now * Thu Aug 11 2005 Dave Beckett - Update Source: - Do not require python-devel at build time - Add sqlite-devel build requirement. - Use %configure and %makeinstall * Thu Jul 21 2005 Dave Beckett - Updated for gtk-doc locations * Mon Nov 1 2004 Dave Beckett - License now LGPL/Apache 2 - Added LICENSE-2.0.txt and NOTICE * Mon Jul 19 2004 Dave Beckett - move perl, python packages into redland-bindings * Mon Jul 12 2004 Dave Beckett - put /usr/share/redland/Redland.i in redland-devel * Wed May 5 2004 Dave Beckett - require raptor 1.3.0 - require rasqal 0.2.0 * Fri Jan 30 2004 Dave Beckett - require raptor 1.2.0 - update for removal of python distutils - require python 2.2.0+ - require perl 5.8.0+ - build and require mysql - do not build and require threestore * Sun Jan 4 2004 Dave Beckett - added redland-python package - export some more docs * Mon Dec 15 2003 Dave Beckett - require raptor 1.1.0 - require libxml 2.4.0 or newer - added pkgconfig redland.pc - split redland/devel package shared libs correctly * Mon Sep 8 2003 Dave Beckett - require raptor 1.0.0 * Thu Sep 4 2003 Dave Beckett - added rdfproc * Thu Aug 28 2003 Dave Beckett - patches added post 0.9.13 to fix broken perl UNIVERSAL::isa * Thu Aug 21 2003 Dave Beckett - Add redland-db-upgrade.1 - Removed duplicate perl CORE shared objects * Sun Aug 17 2003 Dave Beckett - Updates for new perl module names. * Tue Apr 22 2003 Dave Beckett - Updated for Redhat 9, RPM 4 * Fri Feb 12 2003 Dave Beckett - Updated for redland 0.9.12 * Fri Jan 4 2002 Dave Beckett - Updated for new Perl module names * Fri Sep 14 2001 Dave Beckett - Added shared libraries redland-1.0.17/src/rdf_digest_md5.c0000644000175000017500000002443712241001460013744 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_digest_md5.c - MD5 Message Digest Algorithm * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ /* Original code notes: */ /* An independent implementation of MD5 by Colin Plumb. */ /* Original copyright message: */ /* * This code implements the MD5 message-digest algorithm. To compute * the message digest of a chunk of bytes, declare an MD5Context * structure, pass it to MD5Init, call MD5Update as needed on * buffers full of bytes, and then call MD5Final, which will fill a * supplied 16-byte array with the digest. * * Equivalent code is available from RSA Data Security, Inc. This code * has been tested against that, and is equivalent, except that you * don't need to include two pages of legalese with every copy. */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include /* for u32 here - never used in a public interface */ #include /* original code from header - function names have changed */ /* make compiler align u32* and unsigned char buffers */ struct MD5Context { union { unsigned char c[128]; u32 w[32]; } buf; u32 bits[2]; union { unsigned char c[64]; u32 w[16]; } in; unsigned char digest[16]; }; static void MD5Init(struct MD5Context *context); static void MD5Update(struct MD5Context *context, const unsigned char *buf, unsigned len); static void MD5Final(struct MD5Context *context); static void MD5Transform (u32 buf[4], u32 const in[16]); /* original code from C file - GNU configurised */ #ifndef WORDS_BIGENDIAN #define byteReverse(buf, len) /* Nothing */ #else static void byteReverse(unsigned char *buf, unsigned longs); /* ASM ifdef removed */ /* * Note: this code is harmless on little-endian machines. */ static void byteReverse(unsigned char *buf, unsigned longs) { u32 t; do { t = (u32) ((unsigned) buf[3] << 8 | buf[2]) << 16 | ((unsigned) buf[1] << 8 | buf[0]); *(u32 *) buf = t; buf += 4; } while (--longs); } #endif /* WORDS_BIGENDIAN */ /* * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ static void MD5Init(struct MD5Context *ctx) { ctx->buf.w[0] = 0x67452301; ctx->buf.w[1] = 0xefcdab89; ctx->buf.w[2] = 0x98badcfe; ctx->buf.w[3] = 0x10325476; ctx->bits[0] = 0; ctx->bits[1] = 0; } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ static void MD5Update(struct MD5Context *ctx, const unsigned char* buf, unsigned len) { u32 t; /* Update bitcount */ t = ctx->bits[0]; if ((ctx->bits[0] = t + ((u32) len << 3)) < t) ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1] += len >> 29; t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ /* Handle any leading odd-sized chunks */ if (t) { unsigned char *p = ctx->in.c + t; t = 64 - t; if (len < t) { memcpy(p, buf, len); return; } memcpy(p, buf, t); byteReverse(ctx->in.c, 16); MD5Transform(ctx->buf.w, ctx->in.w); buf += t; len -= t; } /* Process data in 64-byte chunks */ while (len >= 64) { memcpy(ctx->in.c, buf, 64); byteReverse(ctx->in.c, 16); MD5Transform(ctx->buf.w, ctx->in.w); buf += 64; len -= 64; } /* Handle any remaining bytes of data. */ memcpy(ctx->in.c, buf, len); } /* * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ /* Interface altered by DJB to write digest into pre-allocated context */ static void MD5Final(struct MD5Context *ctx) { unsigned count; unsigned char *p; /* Compute number of bytes mod 64 */ count = (ctx->bits[0] >> 3) & 0x3F; /* Set the first char of padding to 0x80. This is safe since there is always at least one byte free */ p = ctx->in.c + count; *p++ = 0x80; /* Bytes of padding needed to make 64 bytes */ count = 64 - 1 - count; /* Pad out to 56 mod 64 */ if (count < 8) { /* Two lots of padding: Pad the first block to 64 bytes */ memset(p, 0, count); byteReverse(ctx->in.c, 16); MD5Transform(ctx->buf.w, ctx->in.w); /* Now fill the next block with 56 bytes */ memset(ctx->in.c, 0, 56); } else { /* Pad block to 56 bytes */ memset(p, 0, count - 8); } byteReverse(ctx->in.c, 14); /* Append length in bits and transform */ (ctx->in.w)[14] = ctx->bits[0]; (ctx->in.w)[15] = ctx->bits[1]; MD5Transform(ctx->buf.w, ctx->in.w); byteReverse(ctx->buf.c, 4); memcpy(ctx->digest, ctx->buf.c, 16); } /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ static void MD5Transform(u32 buf[4], u32 const in[16]) { register u32 a, b, c, d; a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } /* my code from here */ static unsigned char * librdf_digest_md5_get_digest(struct MD5Context *c) { return c->digest; } static void librdf_digest_md5_register_factory(librdf_digest_factory *factory) { factory->context_length = sizeof(struct MD5Context); factory->digest_length = 16; factory->init = (void (*)(void *))MD5Init; factory->update = (void (*)(void *, const unsigned char*, size_t))MD5Update; factory->final = (void (*)(void *))MD5Final; factory->get_digest = (unsigned char *(*)(void *))librdf_digest_md5_get_digest; } /** * librdf_digest_md5_constructor: * @world: redland world object * * Initialise the MD5 digest factory. * **/ void librdf_digest_md5_constructor(librdf_world *world) { librdf_digest_register_factory(world, "MD5", &librdf_digest_md5_register_factory); } redland-1.0.17/src/rdf_concepts.c0000644000175000017500000002233112241001460013525 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_concepts.c - Nodes representing concepts from the RDF Model * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #ifdef HAVE_STDLIB_H #include #endif #include #include #ifndef STANDALONE /* FIXME: All the stuff here and in rdf_concepts.h should be machine * generated from the schemas but there is a catch-22 here - can't do * it without representing it */ /* TAKE CARE: Tokens != Labels */ /* Tokens used by the RDF world */ static const char* const librdf_concept_tokens[LIBRDF_CONCEPT_LAST+1]={ /* RDF M&S */ "Alt", "Bag", "Property", "Seq", "Statement", "object", "predicate", "subject", "type", "value", "li", "RDF", "Description", "aboutEach", "aboutEachPrefix", /* all new in RDF/XML revised */ "nodeID", "List", "first", "rest", "nil", "XMLLiteral", /* RDF S */ "Class", "ConstraintProperty", "ConstraintResource", "Container", "ContainerMembershipProperty", "Literal", "Resource", "comment", "domain", "isDefinedBy", "label", "range", "seeAlso", "subClassOf", "subPropertyOf", /* RDF 1.1 */ "HTML", "langString" }; static const unsigned char * const librdf_concept_ms_namespace=(const unsigned char *)"http://www.w3.org/1999/02/22-rdf-syntax-ns#"; static const unsigned char * const librdf_concept_schema_namespace=(const unsigned char *)"http://www.w3.org/2000/01/rdf-schema#"; /** * librdf_init_concepts: * @world: redland world object * * INTERNAL - Initialise the concepts module. * **/ void librdf_init_concepts(librdf_world *world) { int i; /* Create the Unique URI objects */ world->concept_ms_namespace_uri = librdf_new_uri(world, librdf_concept_ms_namespace); world->concept_schema_namespace_uri = librdf_new_uri(world, librdf_concept_schema_namespace); world->xsd_namespace_uri = librdf_new_uri(world, raptor_xmlschema_datatypes_namespace_uri); if(!world->concept_ms_namespace_uri || !world->concept_schema_namespace_uri || !world->xsd_namespace_uri) LIBRDF_FATAL1(world, LIBRDF_FROM_CONCEPTS, "Out of memory creating namespace URIs"); /* Create arrays for the M&S and Schema resource nodes and uris */ world->concept_uris = LIBRDF_CALLOC(librdf_uri**, LIBRDF_CONCEPT_LAST + 1, sizeof(librdf_uri*)); world->concept_resources = LIBRDF_CALLOC(librdf_node**, LIBRDF_CONCEPT_LAST + 1, sizeof(librdf_node*)); if(!world->concept_uris || !world->concept_resources) LIBRDF_FATAL1(world, LIBRDF_FROM_CONCEPTS, "Out of memory creating node/uri arrays"); /* Create the M&S and Schema resource nodes */ for (i = 0; i <= LIBRDF_CONCEPT_LAST; i++) { librdf_uri* ns_uri = (LIBRDF_CONCEPT_FIRST_S_ID <= i && i <= LIBRDF_CONCEPT_LAST_S_ID) ? world->concept_schema_namespace_uri : world->concept_ms_namespace_uri; const unsigned char * token = (const unsigned char *)librdf_concept_tokens[i]; world->concept_resources[i] = librdf_new_node_from_uri_local_name(world, ns_uri, token); if(!world->concept_resources[i]) LIBRDF_FATAL1(world, LIBRDF_FROM_CONCEPTS, "Failed to create Node from URI\n"); /* keep shared copy of URI from node */ world->concept_uris[i] = librdf_node_get_uri(world->concept_resources[i]); } } /** * librdf_get_concept_ms_namespace: * @world: librdf world object * * Get a shared #librdf_uri for the RDF Syntax namespace. * * Return value: #librdf_uri pointer or NULL on failure. */ librdf_uri * librdf_get_concept_ms_namespace(librdf_world *world) { librdf_world_open(world); return world->concept_ms_namespace_uri; } /** * librdf_get_concept_schema_namespace: * @world: librdf world object * * Get a shared #librdf_uri for the RDF Schema namespace. * * Return value: #librdf_uri pointer or NULL on failure. */ librdf_uri * librdf_get_concept_schema_namespace(librdf_world *world) { librdf_world_open(world); return world->concept_schema_namespace_uri; } /** * librdf_get_concept_by_name: * @world: redland world object * @is_ms: non zero if name is a RDF namespace concept (else is RDF schema) * @name: the name to look up * @uri_p: pointer to variable to hold #librdf_uri of concept or NULL if not required * @node_p: pointer to variable to hold #librdf_node of concept or NULL if not required * * Get Redland uri and/or node objects for RDF concepts. * * Allows the dynamic look-up of an RDF concept by the local_name of * the concept in either the RDF or RDF Schema namespace. Returns * the #librdf_uri and/or #librdf_node found as required. **/ void librdf_get_concept_by_name(librdf_world *world, int is_ms, const char *name, librdf_uri **uri_p, librdf_node **node_p) { int i; librdf_world_open(world); for (i=0; i < LIBRDF_CONCEPT_LAST; i++) { int this_is_ms = !(LIBRDF_CONCEPT_FIRST_S_ID <= i && i <= LIBRDF_CONCEPT_LAST_S_ID); if(this_is_ms != is_ms) continue; if(!strcmp(librdf_concept_tokens[i], name)) { if(uri_p) *uri_p=world->concept_uris[i]; if(node_p) *node_p=world->concept_resources[i]; } } } /** * librdf_get_concept_resource_by_index: * @world: redland world object * @idx: #librdf_concepts_index * * Get Redland node object for RDF concepts. * * Return value: #librdf_node pointer or NULL on failure. **/ librdf_node* librdf_get_concept_resource_by_index(librdf_world *world, librdf_concepts_index idx) { librdf_world_open(world); if ((int)idx < 0 || idx > LIBRDF_CONCEPT_LAST) return NULL; return world->concept_resources[idx]; } /** * librdf_get_concept_uri_by_index: * @world: redland world object * @idx: #librdf_concepts_index * * Get Redland uri object for RDF concepts. * * Return value: #librdf_uri pointer or NULL on failure. **/ librdf_uri* librdf_get_concept_uri_by_index(librdf_world *world, librdf_concepts_index idx) { librdf_world_open(world); if ((int)idx < 0 || idx > LIBRDF_CONCEPT_LAST) return NULL; return world->concept_uris[idx]; } /** * librdf_finish_concepts: * @world: redland world object * * INTERNAL - Terminate the concepts module. * **/ void librdf_finish_concepts(librdf_world *world) { int i; /* Free resources and set pointers to NULL so that they are cleared * in case the concepts module is initialised again in the same process. */ if(world->xsd_namespace_uri) { librdf_free_uri(world->xsd_namespace_uri); world->xsd_namespace_uri = NULL; } if(world->concept_ms_namespace_uri) { librdf_free_uri(world->concept_ms_namespace_uri); world->concept_ms_namespace_uri = NULL; } if(world->concept_schema_namespace_uri) { librdf_free_uri(world->concept_schema_namespace_uri); world->concept_schema_namespace_uri = NULL; } if(world->concept_resources) { for (i=0; i<= LIBRDF_CONCEPT_LAST; i++) { /* deletes associated URI too */ if(world->concept_resources[i]) librdf_free_node(world->concept_resources[i]); } LIBRDF_FREE(librdf_node**, world->concept_resources); world->concept_resources=NULL; } if(world->concept_uris) { /* uris were freed above, now just free the array */ LIBRDF_FREE(librdf_uri**, world->concept_uris); world->concept_uris=NULL; } } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); #define EXPECTED_STRING "http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq" int main(int argc, char *argv[]) { const char *program=librdf_basename((const char*)argv[0]); librdf_world *world; librdf_uri* uri; librdf_node* node; unsigned char* actual; world=librdf_new_world(); librdf_world_open(world); uri=LIBRDF_MS_Seq_URI(world); if(!uri) { fprintf(stderr, "%s: Got no concept URI for rdf:Seq\n", program); exit(1); } actual=librdf_uri_as_string(uri); if(strcmp(EXPECTED_STRING, (const char*)actual)) { fprintf(stderr, "%s: Expected URI: <%s> Got: <%s>\n", program, EXPECTED_STRING, actual); exit(1); } node=librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_LAST); if(!node) { fprintf(stderr, "%s: Got no concept node for the last concept\n", program); exit(1); } librdf_free_world(world); /* keep gcc -Wall happy */ return(0); } #endif redland-1.0.17/src/rdf_iterator_internal.h0000644000175000017500000000350011167024223015446 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_iterator_internal.h - Internal RDF Iterator definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_ITERATOR_INTERNAL_H #define LIBRDF_ITERATOR_INTERNAL_H #ifdef __cplusplus extern "C" { #endif /* used in map_list below */ typedef struct { void *context; /* context to pass on to map */ librdf_iterator_map_handler fn; librdf_iterator_map_free_context_handler free_context; } librdf_iterator_map; struct librdf_iterator_s { librdf_world *world; void *context; int is_finished; /* 1 when have no more elements */ int is_updated; /* 1 when we know there is a current item */ int is_updating; /* 1 when are in the middle of update process */ /* Used when mapping */ void *current; /* stores current element */ librdf_list *map_list; /* non-empty means there is a list of maps */ int (*is_end_method)(void*); int (*next_method)(void*); void* (*get_method)(void*, int); /* flags: type of get */ void (*finished_method)(void*); }; #ifdef __cplusplus } #endif #endif redland-1.0.17/src/memcmp.c0000644000175000017500000000055711167024223012350 00000000000000/* from public domain code in libiberty (GNU binutils) - ANSIfied */ #include int memcmp(const void* str1, const void* str2, size_t count) { register unsigned char *s1 = (unsigned char*)str1; register unsigned char *s2 = (unsigned char*)str2; while (count-- > 0) { if (*s1++ != *s2++) return s1[-1] < s2[-1] ? -1 : 1; } return 0; } redland-1.0.17/src/Makefile.am0000644000175000017500000002346512241001460012755 00000000000000# -*- Mode: Makefile -*- # # Makefile.am - top level automake file for Redland # # Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/ # Copyright (C) 2000-2006, University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # SUBDIRS=win32 lib_LTLIBRARIES = librdf.la include_HEADERS = redland.h librdf.h \ rdf_init.h \ rdf_raptor.h \ rdf_uri.h rdf_node.h rdf_statement.h rdf_concepts.h \ rdf_model.h \ rdf_iterator.h \ rdf_storage.h \ rdf_storage_module.h \ rdf_stream.h \ rdf_parser.h \ rdf_utf8.h \ rdf_query.h \ rdf_serializer.h \ rdf_log.h \ rdf_digest.h \ rdf_hash.h \ rdf_list.h noinst_HEADERS = win32_rdf_config.h librdf_la_SOURCES = rdf_init.c rdf_raptor.c \ rdf_uri.c \ rdf_digest.c rdf_hash.c rdf_hash_cursor.c rdf_hash_memory.c \ rdf_model.c rdf_model_storage.c \ rdf_iterator.c rdf_concepts.c \ rdf_list.c \ rdf_storage.c \ rdf_storage_sql.c \ rdf_stream.c \ rdf_parser.c rdf_parser_raptor.c \ rdf_heuristics.c rdf_files.c rdf_utf8.c \ rdf_query.c rdf_query_results.c \ rdf_query_rasqal.c \ rdf_serializer.c \ rdf_serializer_raptor.c \ rdf_log.c \ rdf_node_common.c rdf_statement_common.c \ rdf_node.c rdf_statement.c \ redland.h \ rdf_internal.h \ rdf_init.h \ rdf_uri.h rdf_node.h rdf_statement.h rdf_concepts.h \ rdf_digest.h rdf_hash.h \ rdf_types.h \ rdf_model.h \ rdf_iterator.h \ rdf_list.h \ rdf_storage.h \ rdf_stream.h \ rdf_parser.h \ rdf_heuristics.h rdf_files.h rdf_utf8.h \ rdf_query.h \ rdf_serializer.h \ rdf_log.h \ rdf_concepts_internal.h \ rdf_digest_internal.h \ rdf_hash_internal.h \ rdf_init_internal.h \ rdf_iterator_internal.h \ rdf_list_internal.h \ rdf_log_internal.h \ rdf_model_internal.h \ rdf_node_internal.h \ rdf_parser_internal.h \ rdf_query_internal.h \ rdf_raptor_internal.h \ rdf_serializer_internal.h \ rdf_statement_internal.h \ rdf_storage_internal.h \ rdf_stream_internal.h \ rdf_uri_internal.h if MEMCMP librdf_la_SOURCES += memcmp.c endif plugindir = $(libdir)/redland # Storages always built-in librdf_la_SOURCES += rdf_storage_list.c rdf_storage_hashes.c rdf_storage_trees.c if STORAGE_FILE librdf_la_SOURCES += rdf_storage_file.c endif if MODULAR_LIBRDF plugin_LTLIBRARIES = if STORAGE_TSTORE plugin_LTLIBRARIES += librdf_storage_tstore.la librdf_storage_tstore_la_SOURCES = rdf_storage_tstore.c librdf_storage_tstore_la_CPPFLAGS = @TSTORE_CPPFLAGS@ librdf_storage_tstore_la_LIBADD = @TSTORE_LIBS@ librdf.la librdf_storage_tstore_la_LDFLAGS = -module -avoid-version endif if STORAGE_MYSQL plugin_LTLIBRARIES += librdf_storage_mysql.la librdf_storage_mysql_la_SOURCES = rdf_storage_mysql.c librdf_storage_mysql_la_CPPFLAGS = @MYSQL_CPPFLAGS@ librdf_storage_mysql_la_LIBADD = @MYSQL_LIBS@ librdf.la librdf_storage_mysql_la_LDFLAGS = -module -avoid-version endif if STORAGE_SQLITE plugin_LTLIBRARIES += librdf_storage_sqlite.la librdf_storage_sqlite_la_SOURCES = rdf_storage_sqlite.c # This extra substitution is to ensure general -I paths appear before # ones for SQLITE headers. There is no other way to adjust the # automake-generated rule to ensure this. librdf_storage_sqlite_la_CPPFLAGS = $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @SQLITE_CFLAGS@ librdf_storage_sqlite_la_LIBADD = @SQLITE_LIBS@ librdf.la librdf_storage_sqlite_la_LDFLAGS = -module -avoid-version endif if STORAGE_POSTGRESQL plugin_LTLIBRARIES += librdf_storage_postgresql.la librdf_storage_postgresql_la_SOURCES = rdf_storage_postgresql.c librdf_storage_postgresql_la_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ librdf_storage_postgresql_la_LIBADD = @POSTGRESQL_LIBS@ librdf.la librdf_storage_postgresql_la_LDFLAGS = -module -avoid-version endif if STORAGE_VIRTUOSO plugin_LTLIBRARIES += librdf_storage_virtuoso.la librdf_storage_virtuoso_la_SOURCES = rdf_storage_virtuoso.c rdf_query_virtuoso.c rdf_storage_virtuoso_internal.h librdf_storage_virtuoso_la_CPPFLAGS = @ODBC_CFLAGS@ librdf_storage_virtuoso_la_LIBADD = @ODBC_LIBS@ librdf.la -lrasqal librdf_storage_virtuoso_la_LDFLAGS = -module -avoid-version endif else if STORAGE_TSTORE librdf_la_SOURCES += rdf_storage_tstore.c endif if STORAGE_MYSQL librdf_la_SOURCES += rdf_storage_mysql.c endif if STORAGE_SQLITE librdf_la_SOURCES += rdf_storage_sqlite.c endif if STORAGE_POSTGRESQL librdf_la_SOURCES += rdf_storage_postgresql.c endif if STORAGE_VIRTUOSO librdf_la_SOURCES += rdf_storage_virtuoso.c rdf_query_virtuoso.c rdf_storage_virtuoso_internal.h endif endif librdf_la_LIBADD = \ @LTLIBOBJS@ @DIGEST_OBJS@ @HASH_OBJS@ \ @LIBRDF_INTERNAL_LIBS@ librdf_la_DEPENDENCIES = \ @DIGEST_OBJS@ @HASH_OBJS@ \ @LIBRDF_INTERNAL_DEPS@ EXTRA_librdf_la_SOURCES = rdf_hash_bdb.c \ rdf_digest_md5.c rdf_digest_sha1.c \ rdf_parser_raptor.c EXTRA_DIST=\ redland.spec redland.spec.in librdf_la_LDFLAGS = -version-info @LIBRDF_LIBTOOL_VERSION@ \ @LIBRDF_LDFLAGS@ @LIBRDF_EXTERNAL_LIBS@ pkgdata_DATA= if STORAGE_MYSQL pkgdata_DATA += mysql-v1.ttl mysql-v2.ttl endif EXTRA_DIST += mysql-v1.ttl mysql-v2.ttl local_tests=rdf_storage_sql_test$(EXEEXT) EXTRA_PROGRAMS=$(local_tests) TESTS=rdf_node_test rdf_digest_test rdf_hash_test rdf_uri_test \ rdf_statement_test rdf_model_test rdf_storage_test rdf_parser_test \ rdf_files_test rdf_heuristics_test rdf_utf8_test rdf_concepts_test \ rdf_query_test rdf_serializer_test rdf_stream_test rdf_iterator_test \ rdf_init_test # Set the place to find storage modules for testing TESTS_ENVIRONMENT=REDLAND_MODULE_PATH=$(abs_builddir)/.libs CLEANFILES=$(TESTS) $(local_tests) test test*.db test.rdf *.plist # Use tar, whatever it is called (better be GNU tar though) TAR=@TAR@ # Why is this not in the default makefile? CC=@CC@ AM_CPPFLAGS=@LIBRDF_INTERNAL_CPPFLAGS@ @LIBRDF_CPPFLAGS@ @LIBRDF_EXTERNAL_CPPFLAGS@ AM_CFLAGS=@LIBRDF_INTERNAL_CPPFLAGS@ @LIBRDF_CPPFLAGS@ @LIBRDF_EXTERNAL_CPPFLAGS@ AM_CPPFLAGS += -DPKGDATADIR="\"$(pkgdatadir)\"" if MODULAR_LIBRDF AM_CFLAGS += -DREDLAND_MODULE_PATH="\""@REDLAND_MODULE_PATH@"\"" endif ANALYZE = clang ANALYZE_FLAGS = "--analyze" # Based on COMPILE target ANALYZE_COMMAND = $(ANALYZE) \ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ $(ANALYZE_FLAGS) LOCAL_LIB_DIR=lib # Rules to construct test programs check-local: $(local_tests) run-local-tests rdf_storage_sql_test_SOURCES = rdf_storage_sql_test.c rdf_storage_sql_test_LDADD = librdf.la run-local-tests: rdf_storage_sql_test$(EXEEXT) @tests="rdf_storage_sql_test"; \ status=0; \ for tst in $$tests; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(top_srcdir)/"; fi; \ if $${dir}$$tst $(srcdir); then \ echo "PASS: $$tst"; \ else \ echo "FAIL: $$tst"; \ status=1; \ break; \ fi; \ done; \ exit $$status # Some people need a little help ;-) test: check # rule for building tests in one step COMPILE_LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ rdf_node_test: rdf_node.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_node.c librdf.la rdf_digest_test: rdf_digest.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_digest.c librdf.la rdf_hash_test: rdf_hash.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_hash.c librdf.la rdf_uri_test: rdf_uri.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_uri.c librdf.la rdf_statement_test: rdf_statement.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_statement.c @LIBRDF_DIRECT_LIBS@ librdf.la rdf_model_test: rdf_model.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_model.c @LIBRDF_DIRECT_LIBS@ librdf.la rdf_storage_test: rdf_storage.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_storage.c librdf.la rdf_parser_test: rdf_parser.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_parser.c @LIBRDF_DIRECT_LIBS@ librdf.la rdf_files_test: rdf_files.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_files.c librdf.la rdf_heuristics_test: rdf_heuristics.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_heuristics.c librdf.la rdf_utf8_test: rdf_utf8.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_utf8.c librdf.la rdf_concepts_test: rdf_concepts.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_concepts.c librdf.la rdf_query_test: rdf_query.c rdf_query_results.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_query.c $(srcdir)/rdf_query_results.c @LIBRDF_DIRECT_LIBS@ librdf.la rdf_serializer_test: rdf_serializer.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_serializer.c librdf.la rdf_stream_test: rdf_stream.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_stream.c librdf.la rdf_iterator_test: rdf_iterator.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_iterator.c librdf.la rdf_init_test: rdf_init.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_init.c @LIBRDF_DIRECT_LIBS@ librdf.la @SET_MAKE@ ${top_build_prefix}libltdl/libltdlc.la: cd ${top_build_prefix}libltdl && $(MAKE) libltdlc.la if MAINTAINER_MODE # Run Clang static analyzer over sources. analyze: $(SOURCES) @list='$(SOURCES)'; \ result=0; \ for file in $$list; do \ if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ $(RECHO) "Analyzing $$file"; \ $(ANALYZE_COMMAND) $(srcdir)/$$file; \ status=$$?; \ if test $$status != 0; then \ result=1; \ fi; \ fi; \ done; \ set -e; exit $$result endif redland-1.0.17/src/rdf_storage_virtuoso_internal.h0000644000175000017500000001176311774175775017274 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_virtuoso_internal.h - RDF Storage using Virtuoso interface definition * * Copyright (C) 2008, Openlink Software http://www.openlinksw.com/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * */ #ifndef _RDF_STORAGE_VIRTUOSO_INTERNAL_H #define _RDF_STORAGE_VIRTUOSO_INTERNAL_H typedef enum { VIRTUOSO_CONNECTION_CLOSED = 0, VIRTUOSO_CONNECTION_OPEN = 1, VIRTUOSO_CONNECTION_BUSY = 2 } librdf_storage_virtuoso_connection_status; typedef struct librdf_storage_virtuoso_connection_s librdf_storage_virtuoso_connection; struct librdf_storage_virtuoso_connection_s { /* A ODBC connection */ librdf_storage_virtuoso_connection_status status; HENV henv; HDBC hdbc; HSTMT hstmt; short numCols; librdf_hash *h_lang; librdf_hash *h_type; void (*v_release_connection)(librdf_storage* storage, librdf_storage_virtuoso_connection *handle); librdf_node* (*v_rdf2node)(librdf_storage *storage, librdf_storage_virtuoso_connection *handle, int col, char *data); char* (*v_GetDataCHAR)(librdf_world *world, librdf_storage_virtuoso_connection *handle, int col, int *is_null); int (*v_GetDataINT)(librdf_world *world, librdf_storage_virtuoso_connection *handle, int col, int *is_null, int *val); }; typedef int vquery_results_type; #define VQUERY_RESULTS_UNKNOWN 0 #define VQUERY_RESULTS_BINDINGS 1 #define VQUERY_RESULTS_BOOLEAN 2 #define VQUERY_RESULTS_GRAPH 4 #define VQUERY_RESULTS_SYNTAX 8 typedef struct { librdf_query *query; /* librdf query object */ librdf_model *model; char *language; /* rasqal query language name to use */ unsigned char *query_string; librdf_uri *uri; /* base URI or NULL */ librdf_storage_virtuoso_connection *vc; librdf_storage *storage; int failed; int eof; short numCols; short offset; int limit; vquery_results_type result_type; int row_count; char **colNames; librdf_node **colValues; } librdf_query_virtuoso_context; #define LIBRDF_VIRTUOSO_CONTEXT_DSN_SIZE 4096 typedef struct { /* Virtuoso connection parameters */ librdf_storage *storage; librdf_node *current; librdf_storage_virtuoso_connection **connections; int connections_count; char *model_name; char *user; char *password; char *dsn; char *host; char *database; char *charset; char *conn_str; /* if inserts should be optimized by locking and index optimizations */ int bulk; int merge; librdf_hash* h_lang; librdf_hash* h_type; librdf_world *world; librdf_storage_virtuoso_connection *transaction_handle; /* for output connection DSN from SQLDriverConnect() as called by * librdf_storage_virtuoso_get_handle() */ UCHAR outdsn[LIBRDF_VIRTUOSO_CONTEXT_DSN_SIZE]; } librdf_storage_virtuoso_instance; typedef struct { librdf_storage *storage; librdf_statement *current_statement; librdf_statement *query_statement; librdf_storage_virtuoso_connection *handle; librdf_node *query_context; librdf_node *current_context; } librdf_storage_virtuoso_sos_context; typedef struct { librdf_storage *storage; librdf_node *current_context; librdf_storage_virtuoso_connection *handle; } librdf_storage_virtuoso_get_contexts_context; /******************* Virtuoso ODBC Extensions *******************/ /* See * http://docs.openlinksw.com/virtuoso/odbcimplementation.html#virtodbcsparql */ /* * ODBC extensions for SQLGetDescField */ #define SQL_DESC_COL_DV_TYPE 1057L #define SQL_DESC_COL_DT_DT_TYPE 1058L #define SQL_DESC_COL_LITERAL_ATTR 1059L #define SQL_DESC_COL_BOX_FLAGS 1060L #define SQL_DESC_COL_LITERAL_LANG 1061L #define SQL_DESC_COL_LITERAL_TYPE 1062L /* * Virtuoso - ODBC SQL_DESC_COL_DV_TYPE */ #define VIRTUOSO_DV_DATE 129 #define VIRTUOSO_DV_DATETIME 211 #define VIRTUOSO_DV_DOUBLE_FLOAT 191 #define VIRTUOSO_DV_IRI_ID 243 #define VIRTUOSO_DV_LONG_INT 189 #define VIRTUOSO_DV_NUMERIC 219 #define VIRTUOSO_DV_RDF 246 #define VIRTUOSO_DV_SINGLE_FLOAT 190 #define VIRTUOSO_DV_STRING 182 #define VIRTUOSO_DV_TIME 210 #define VIRTUOSO_DV_TIMESTAMP 128 #define VIRTUOSO_DV_TIMESTAMP_OBJ 208 /* * Virtuoso - ODBC SQL_DESC_COL_DT_DT_TYPE */ #define VIRTUOSO_DT_TYPE_DATETIME 1 #define VIRTUOSO_DT_TYPE_DATE 2 #define VIRTUOSO_DT_TYPE_TIME 3 /* * Virtuoso - ODBC SQL_DESC_COL_BOX_FLAGS */ #define VIRTUOSO_BF_IRI 0x1 #define VIRTUOSO_BF_UTF8 0x2 #define VIRTUOSO_BF_DEFAULT_ENC 0x4 #endif redland-1.0.17/src/rdf_query_internal.h0000644000175000017500000001457611517450330015002 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_query_internal.h - Internal RDF Query definitions * * Copyright (C) 2002-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2002-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_QUERY_INTERNAL_H #define LIBRDF_QUERY_INTERNAL_H #ifdef __cplusplus extern "C" { #endif /** A query object */ struct librdf_query_s { librdf_world *world; int usage; void *context; struct librdf_query_factory_s* factory; /* list of all the results for this query */ librdf_query_results* results; }; struct librdf_query_results_s { /* query that this was executed over */ librdf_query* query; /* next query result */ librdf_query_results* next; }; /* FIXME - remove when Rasqal minimum version is 0.9.21 or newer */ #if !defined(RASQAL_VERSION) || RASQAL_VERSION < 921 #define RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER 0 #define rasqal_query_results_formats_check2(world, name, uri, mime_type, flags) rasqal_query_results_formats_check(world, name, uri, mime_type) #endif #ifdef RASQAL_H /* rasqal.h will have defined this */ #else /* provide a forward reference */ #ifndef RASQAL_QUERY_RESULTS_FORMATTER_DECLARED #define RASQAL_QUERY_RESULTS_FORMATTER_DECLARED 1 typedef struct rasqal_query_results_formatter_s rasqal_query_results_formatter; #endif #endif struct librdf_query_results_formatter_s { /* query result that this is formatting */ librdf_query_results* query_results; rasqal_query_results_formatter *formatter; }; /** A Query Factory */ struct librdf_query_factory_s { librdf_world *world; struct librdf_query_factory_s* next; char* name; /* name of query language - required */ librdf_uri *uri; /* URI of query language - may be NULL */ /* the rest of this structure is populated by the * query-specific register function */ size_t context_length; /* create a new query */ int (*init)(librdf_query* query, const char *name, librdf_uri *uri, const unsigned char *query_string, librdf_uri *base_uri); /* copy a query */ /* clone is assumed to do leave the new query in the same state * after an init() method on an existing query - i.e ready to * use but closed. */ int (*clone)(librdf_query* new_query, librdf_query* old_query); /* destroy a query */ void (*terminate)(librdf_query* query); /* perform the query on a model */ librdf_query_results* (*execute)(librdf_query* query, librdf_model* model); /* get/set query results limit (max results to return) */ int (*get_limit)(librdf_query *query); int (*set_limit)(librdf_query *query, int limit); /* get/set query results offset (results to skip) */ int (*get_offset)(librdf_query *query); int (*set_offset)(librdf_query *query, int offset); /* get the query results as a stream - OPTIONAL */ librdf_stream* (*results_as_stream)(librdf_query_results* query_results); /* get number of results (so far) - OPTIONAL */ int (*results_get_count)(librdf_query_results* query_results); /* get next result - OPTIONAL */ int (*results_next)(librdf_query_results* query_results); /* find out if binding results are exhausted - OPTIONAL */ int (*results_finished)(librdf_query_results* query_results); /* get all binding names, values for current result - OPTIONAL */ int (*results_get_bindings)(librdf_query_results* query_results, const char ***names, librdf_node **values); /* get one value for current result - OPTIONAL */ librdf_node* (*results_get_binding_value)(librdf_query_results* query_results, int offset); /* get one name for current result - OPTIONAL */ const char* (*results_get_binding_name)(librdf_query_results* query_results, int offset); /* get one value by name for current result - OPTIONAL */ librdf_node* (*results_get_binding_value_by_name)(librdf_query_results* query_results, const char *name); /* get number of bound variables in the result - OPTIONAL */ int (*results_get_bindings_count)(librdf_query_results* query_results); /* tidy up query results - OPTIONAL */ void (*free_results)(librdf_query_results* query_results); /* Return true/false if result is format given - OPTIONAL */ int (*results_is_bindings)(librdf_query_results *query_results); int (*results_is_boolean)(librdf_query_results *query_results); int (*results_is_graph)(librdf_query_results *query_results); int (*results_is_syntax)(librdf_query_results *query_results); /* get a boolean result - OPTIONAL */ int (*results_get_boolean)(librdf_query_results *query_results); /* query results formatter */ /* 1.0.11+ for rasqal 0.9.18+ style API */ librdf_query_results_formatter* (*new_results_formatter)(librdf_query_results* query_results, const char *name, const char *mime_type, librdf_uri* format_uri); void (*free_results_formatter)(librdf_query_results_formatter* formatter); int (*results_formatter_write)(raptor_iostream *iostr, librdf_query_results_formatter* formatter, librdf_query_results* results, librdf_uri *base_uri); }; /* module init */ int librdf_init_query(librdf_world *world); /* module terminate */ void librdf_finish_query(librdf_world *world); /* class methods */ librdf_query_factory* librdf_get_query_factory(librdf_world *world, const char *name, librdf_uri* uri); int librdf_query_rasqal_constructor(librdf_world *world); #ifdef STORAGE_VIRTUOSO void librdf_init_query_virtuoso(librdf_world *world); #endif void librdf_query_rasqal_destructor(librdf_world *world); void librdf_query_add_query_result(librdf_query *query, librdf_query_results* query_results); void librdf_query_remove_query_result(librdf_query *query, librdf_query_results* query_results); /* rdf_query_rasqal.c */ rasqal_literal* redland_node_to_rasqal_literal(librdf_world* world, librdf_node *node); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_hash_bdb.c0000644000175000017500000006456711774157705013512 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_hash_bdb.c - RDF hash Berkeley DB Interface Implementation * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include /* for the memory allocation functions */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_DB_H #include #endif #include #include typedef struct { librdf_hash *hash; int mode; int is_writable; int is_new; /* for BerkeleyDB only */ DB* db; char* file_name; } librdf_hash_bdb_context; /* Implementing the hash cursor */ static int librdf_hash_bdb_cursor_init(void *cursor_context, void *hash_context); static int librdf_hash_bdb_cursor_get(void *context, librdf_hash_datum* key, librdf_hash_datum* value, unsigned int flags); static void librdf_hash_bdb_cursor_finish(void* context); /* prototypes for local functions */ static int librdf_hash_bdb_create(librdf_hash* hash, void* context); static int librdf_hash_bdb_destroy(void* context); static int librdf_hash_bdb_open(void* context, const char *identifier, int mode, int is_writable, int is_new, librdf_hash* options); static int librdf_hash_bdb_close(void* context); static int librdf_hash_bdb_clone(librdf_hash* new_hash, void *new_context, char *new_identifier, void* old_context); static int librdf_hash_bdb_values_count(void *context); static int librdf_hash_bdb_put(void* context, librdf_hash_datum *key, librdf_hash_datum *data); static int librdf_hash_bdb_exists(void* context, librdf_hash_datum *key, librdf_hash_datum *value); static int librdf_hash_bdb_delete_key(void* context, librdf_hash_datum *key); static int librdf_hash_bdb_delete_key_value(void* context, librdf_hash_datum *key, librdf_hash_datum *value); static int librdf_hash_bdb_sync(void* context); static int librdf_hash_bdb_get_fd(void* context); static void librdf_hash_bdb_register_factory(librdf_hash_factory *factory); /* functions implementing hash api */ /** * librdf_hash_bdb_create: * @hash: #librdf_hash hash that this implements * @context: BerkeleyDB hash context * * Create a BerkeleyDB hash. * * Return value: non 0 on failure. **/ static int librdf_hash_bdb_create(librdf_hash* hash, void* context) { librdf_hash_bdb_context* hcontext=(librdf_hash_bdb_context*)context; hcontext->hash=hash; return 0; } /** * librdf_hash_bdb_destroy: * @context: BerkeleyDB hash context * * Destroy a BerkeleyDB hash. * * Return value: non 0 on failure **/ static int librdf_hash_bdb_destroy(void* context) { /* NOP */ return 0; } /** * librdf_hash_bdb_open: * @context: BerkeleyDB hash context * @identifier: filename to use for BerkeleyDB file * @mode: file creation mode * @is_writable: is hash writable? * @is_new: is hash new? * @options: hash options (currently unused) * * Open and maybe create a BerkeleyDB hash. * * Return value: non 0 on failure. **/ static int librdf_hash_bdb_open(void* context, const char *identifier, int mode, int is_writable, int is_new, librdf_hash* options) { librdf_hash_bdb_context* bdb_context=(librdf_hash_bdb_context*)context; DB* bdb; char *file; int ret; u_int32_t flags = 0; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(identifier, cstring, 1); #ifdef HAVE_DB_OPEN DB_INFO bdb_info; #endif /* NOTE: If the options parameter is ever used here, the data must be * copied into a private part of the context so that the clone * method can access them */ bdb_context->mode=mode; bdb_context->is_writable=is_writable; bdb_context->is_new=is_new; file = LIBRDF_MALLOC(char*, strlen(identifier) + 4); if(!file) return 1; sprintf(file, "%s.db", identifier); #ifdef HAVE_DB_CREATE /* V3 prototype: * int db_create(DB **dbp, DB_ENV *dbenv, u_int32_t flags); */ ret = db_create(&bdb, NULL, flags); if(ret) { LIBRDF_DEBUG2("Failed to create BDB context - %d\n", ret); return 1; } #ifdef HAVE_BDB_SET_FLAGS if((ret=bdb->set_flags(bdb, DB_DUP))) { LIBRDF_DEBUG2("Failed to set BDB duplicate flag - %d\n", ret); return 1; } #endif /* V3 prototype: * int DB->open(DB *db, const char *file, const char *database, * DBTYPE type, u_int32_t flags, int mode); */ flags = is_writable ? DB_CREATE : DB_RDONLY; if(is_new) flags |= DB_TRUNCATE; #endif #if defined(HAVE_BDB_OPEN_6_ARGS) || defined(HAVE_BDB_OPEN_7_ARGS) #if defined(HAVE_BDB_OPEN_6_ARGS) && !defined(HAVE_BDB_OPEN_7_ARGS) /* * int DB->open(DB *db, const char *file, * const char *database, DBTYPE type, u_int32_t flags, int mode); */ ret = bdb->open(bdb, file, NULL, DB_BTREE, flags, mode); if(ret) { librdf_log(bdb_context->hash->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "BDB V4.0+ open of '%s' failed - %s", file, db_strerror(ret)); LIBRDF_FREE(char*, file); return 1; } #else /* Must be HAVE_BDB_OPEN_7_ARGS */ /* * int DB->open(DB *db, DB_TXN *txnid, const char *file, * const char *database, DBTYPE type, u_int32_t flags, int mode); */ ret = bdb->open(bdb, NULL, file, NULL, DB_BTREE, flags, mode); if(ret) { librdf_log(bdb_context->hash->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "BDB V4.1+ open of '%s' failed - %s", file, db_strerror(ret)); LIBRDF_FREE(char*, file); return 1; } #endif #else #ifdef HAVE_DB_OPEN /* V2 prototype: * int db_open(const char *file, DBTYPE type, u_int32_t flags, * int mode, DB_ENV *dbenv, DB_INFO *dbinfo, DB **dbpp); */ memset(&bdb_info, 0, sizeof(DB_INFO)); bdb_info.flags=DB_DUP; flags = is_writable ? DB_CREATE : DB_RDONLY; if(is_new) flags |= DB_TRUNCATE; ret = db_open(file, DB_BTREE, flags, mode, NULL, &bdb_info, &bdb); if(ret) { librdf_log(bdb_context->hash->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "BDB V2 open of '%s' failed - %d", file, ret); LIBRDF_FREE(char*, file); return 1; } #else #ifdef HAVE_DBOPEN /* V1 prototype: const char *file, int flags, int mode, DBTYPE, const void *openinfo */ flags = is_writable ? O_RDWR | O_CREAT : O_RDONLY flags |= R_DUP; /* There does not seem to be a V1 flag for truncate */ if(is_new) remove(file); bdb = dbopen(file, flags, mode, DB_BTREE, NULL); if(!bdb) { librdf_log(bdb_context->hash->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "BDB V1 open of '%s' failed - %d", file, ret); LIBRDF_FREE(char*, file); return 1; } ret=0; #else #ifdef HAVE_DB_CREATE /* earlier */ #else ERROR - no idea how to use Berkeley DB #endif #endif #endif #endif bdb_context->db=bdb; bdb_context->file_name=file; return 0; } /** * librdf_hash_bdb_close: * @context: BerkeleyDB hash context * * Close the hash. * * Finish the association between the rdf hash and the BDB file (does * not delete the file) * * Return value: non 0 on failure **/ static int librdf_hash_bdb_close(void* context) { librdf_hash_bdb_context* bdb_context=(librdf_hash_bdb_context*)context; DB* db=bdb_context->db; int ret; #ifdef HAVE_BDB_CLOSE_2_ARGS /* V2/V3 */ ret=db->close(db, 0); #else /* V1 */ ret=db->close(db); #endif LIBRDF_FREE(char*, bdb_context->file_name); return ret; } /** * librdf_hash_bdb_clone: * @hash: new #librdf_hash that this implements * @context: new BerkeleyDB hash context * @new_identifier: new identifier for this hash * @old_context: old BerkeleyDB hash context * * Clone the BerkeleyDB hash. * * Clones the existing Berkeley DB hash into the new one with the * new identifier. * * Return value: non 0 on failure **/ static int librdf_hash_bdb_clone(librdf_hash *hash, void* context, char *new_identifier, void *old_context) { librdf_hash_bdb_context* hcontext=(librdf_hash_bdb_context*)context; librdf_hash_bdb_context* old_hcontext=(librdf_hash_bdb_context*)old_context; librdf_hash_datum *key, *value; librdf_iterator *iterator; int status=0; /* copy data fields that might change */ hcontext->hash=hash; /* Note: The options are not used at present, so no need to make a copy */ if(librdf_hash_bdb_open(context, new_identifier, old_hcontext->mode, old_hcontext->is_writable, old_hcontext->is_new, NULL)) return 1; /* Use higher level functions to iterator this data * on the other hand, maybe this is a good idea since that * code is tested and works */ key=librdf_new_hash_datum(hash->world, NULL, 0); value=librdf_new_hash_datum(hash->world, NULL, 0); iterator=librdf_hash_get_all(old_hcontext->hash, key, value); while(!librdf_iterator_end(iterator)) { librdf_hash_datum* k= (librdf_hash_datum*)librdf_iterator_get_key(iterator); librdf_hash_datum* v= (librdf_hash_datum*)librdf_iterator_get_value(iterator); if(librdf_hash_bdb_put(hcontext, k, v)) { status=1; break; } librdf_iterator_next(iterator); } if(iterator) librdf_free_iterator(iterator); librdf_free_hash_datum(value); librdf_free_hash_datum(key); return status; } /** * librdf_hash_bdb_values_count: * @context: BerkeleyDB hash context * * Get the number of values in the hash. * * Return value: number of values in the hash or <0 if not available **/ static int librdf_hash_bdb_values_count(void *context) { return -1; } typedef struct { librdf_hash_bdb_context* hash; void *last_key; void *last_value; #ifdef HAVE_BDB_CURSOR DBC* cursor; #endif } librdf_hash_bdb_cursor_context; /** * librdf_hash_bdb_cursor_init: * @cursor_context: hash cursor context * @hash_context: hash to operate over * * Initialise a new bdb cursor. * * Return value: non 0 on failure **/ static int librdf_hash_bdb_cursor_init(void *cursor_context, void *hash_context) { librdf_hash_bdb_cursor_context *cursor=(librdf_hash_bdb_cursor_context*)cursor_context; #ifdef HAVE_BDB_CURSOR DB* db; #endif cursor->hash=(librdf_hash_bdb_context*)hash_context; #ifdef HAVE_BDB_CURSOR db=cursor->hash->db; #ifdef HAVE_BDB_CURSOR_4_ARGS /* V3 prototype: * int DB->cursor(DB *db, DB_TXN *txnid, DBC **cursorp, u_int32_t flags); */ if(db->cursor(db, NULL, &cursor->cursor, 0)) return 1; #else /* V2 prototype: * int DB->cursor(DB *db, DB_TXN *txnid, DBC **cursorp); */ if(db->cursor(db, NULL, &cursor->cursor)) return 1; #endif #endif return 0; } /** * librdf_hash_bdb_cursor_get: * @context: BerkeleyDB hash cursor context * @key: pointer to key to use * @value: pointer to value to use * @flags: flags * * Retrieve a hash value for the given key. * * Return value: non 0 on failure **/ static int librdf_hash_bdb_cursor_get(void* context, librdf_hash_datum *key, librdf_hash_datum *value, unsigned int flags) { librdf_hash_bdb_cursor_context *cursor=(librdf_hash_bdb_cursor_context*)context; #ifdef HAVE_BDB_CURSOR DBC *bdb_cursor=cursor->cursor; #else /* For BDB V1 */ DB* db; #endif DBT bdb_key; DBT bdb_value; int ret; /* docs say you must zero DBT's before use */ memset(&bdb_key, 0, sizeof(DBT)); memset(&bdb_value, 0, sizeof(DBT)); /* Always initialise BDB version of key */ bdb_key.data = (char*)key->data; bdb_key.size = LIBRDF_BAD_CAST(u_int32_t, key->size); #ifdef DB_DBT_MALLOC /* BDB V2 or later? */ bdb_key.flags=DB_DBT_MALLOC; /* Return in malloc() allocated memory */ bdb_value.flags=DB_DBT_MALLOC; #endif #ifndef HAVE_BDB_CURSOR /* For BDB V1 */ db=cursor->hash->db; #endif switch(flags) { case LIBRDF_HASH_CURSOR_SET: #ifdef HAVE_BDB_CURSOR /* V2/V3 prototype: * int DBcursor->c_get(DBC *cursor, DBT *key, DBT *data, u_int32_t flags); */ ret=bdb_cursor->c_get(bdb_cursor, &bdb_key, &bdb_value, DB_SET); #else /* V1 */ ret=db->seq(db, &bdb_key, &bdb_value, 0); #endif break; case LIBRDF_HASH_CURSOR_FIRST: #ifdef HAVE_BDB_CURSOR /* V2/V3 prototype: * int DBcursor->c_get(DBC *cursor, DBT *key, DBT *data, u_int32_t flags); */ ret=bdb_cursor->c_get(bdb_cursor, &bdb_key, &bdb_value, DB_FIRST); #else /* V1 */ ret=db->seq(db, &bdb_key, &bdb_value, R_FIRST); #endif break; case LIBRDF_HASH_CURSOR_NEXT_VALUE: #ifdef HAVE_BDB_CURSOR /* V2/V3 */ ret=bdb_cursor->c_get(bdb_cursor, &bdb_key, &bdb_value, DB_NEXT); #else /* V1 */ ret=db->seq(db, &bdb_key, &bdb_value, R_NEXT); #endif /* If succeeded and key has changed, end */ if(!ret && cursor->last_key && memcmp(cursor->last_key, bdb_key.data, bdb_key.size)) { /* always allocated by BDB using system malloc */ SYSTEM_FREE(bdb_key.data); SYSTEM_FREE(bdb_value.data); #ifdef DB_NOTFOUND /* V2 and V3 */ ret=DB_NOTFOUND; #else ret=1; #endif } break; case LIBRDF_HASH_CURSOR_NEXT: #ifdef HAVE_BDB_CURSOR #ifdef DB_NEXT_NODUP /* V3 */ /* Get next key, or next key/value (when value defined) */ ret=bdb_cursor->c_get(bdb_cursor, &bdb_key, &bdb_value, (value) ? DB_NEXT : DB_NEXT_NODUP); #else /* V2 */ /* Must mess about finding next key - note this relies on * the bdb btree having the keys in sorted order */ while(1) { ret=bdb_cursor->c_get(bdb_cursor, &bdb_key, &bdb_value, DB_NEXT); /* finish on error, want all values or no previous key */ if(ret || value || !cursor->last_key) break; /* else have previous key and want unique keys, so keep * going until the key changes */ if(memcmp(cursor->last_key, bdb_key.data, bdb_key.size)) break; /* always allocated by BDB using system malloc */ SYSTEM_FREE(bdb_key.data); SYSTEM_FREE(bdb_value.data); } #endif #else /* V1 */ ret=db->seq(db, &bdb_key, &bdb_value, R_NEXT); #endif break; default: librdf_log(cursor->hash->hash->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_HASH, NULL, "Unknown hash method flag %d", flags); return 1; } /* Free previous key and values */ if(cursor->last_key) { LIBRDF_FREE(char*, cursor->last_key); cursor->last_key=NULL; } if(cursor->last_value) { LIBRDF_FREE(char*, cursor->last_value); cursor->last_value=NULL; } if(ret) { #ifdef LIBRDF_DEBUG #ifdef DB_NOTFOUND /* V2 and V3 */ if(ret != DB_NOTFOUND) LIBRDF_DEBUG2("BDB cursor error - %d\n", ret); #endif #endif key->data=NULL; return ret; } cursor->last_key = key->data = LIBRDF_MALLOC(void*, bdb_key.size); if(!key->data) { /* always allocated by BDB using system malloc */ if(flags != LIBRDF_HASH_CURSOR_SET) SYSTEM_FREE(bdb_key.data); SYSTEM_FREE(bdb_value.data); return 1; } memcpy(key->data, bdb_key.data, bdb_key.size); key->size = bdb_key.size; if(value) { cursor->last_value = value->data = LIBRDF_MALLOC(void*, bdb_value.size); if(!value->data) { /* always allocated by BDB using system malloc */ if(flags != LIBRDF_HASH_CURSOR_SET) SYSTEM_FREE(bdb_key.data); SYSTEM_FREE(bdb_value.data); return 1; } memcpy(value->data, bdb_value.data, bdb_value.size); value->size = bdb_value.size; } /* always allocated by BDB using system malloc */ if(flags != LIBRDF_HASH_CURSOR_SET) SYSTEM_FREE(bdb_key.data); SYSTEM_FREE(bdb_value.data); return 0; } /** * librdf_hash_bdb_cursor_finished: * @context: BerkeleyDB hash cursor context * * Finish the serialisation of the hash bdb get. * **/ static void librdf_hash_bdb_cursor_finish(void* context) { librdf_hash_bdb_cursor_context* cursor=(librdf_hash_bdb_cursor_context*)context; #ifdef HAVE_BDB_CURSOR /* BDB V2/V3 */ if(cursor->cursor) cursor->cursor->c_close(cursor->cursor); #endif if(cursor->last_key) LIBRDF_FREE(char*, cursor->last_key); if(cursor->last_value) LIBRDF_FREE(char*, cursor->last_value); } /** * librdf_hash_bdb_put: * @context: BerkeleyDB hash context * @key: pointer to key to store * @value: pointer to value to store * * Store a key/value pair in the hash. * * Return value: non 0 on failure **/ static int librdf_hash_bdb_put(void* context, librdf_hash_datum *key, librdf_hash_datum *value) { librdf_hash_bdb_context* bdb_context=(librdf_hash_bdb_context*)context; DB* db=bdb_context->db; DBT bdb_value; DBT bdb_key; int ret; u_int32_t flags = 0; /* docs say you must zero DBT's before use */ memset(&bdb_value, 0, sizeof(DBT)); memset(&bdb_key, 0, sizeof(DBT)); /* Initialise BDB version of key */ bdb_key.data = (char*)key->data; bdb_key.size = LIBRDF_BAD_CAST(u_int32_t, key->size); /* Initialise BDB version of data */ bdb_value.data = (char*)value->data; bdb_value.size = LIBRDF_BAD_CAST(u_int32_t, value->size); #ifdef HAVE_BDB_DB_TXN /* V2/V3 prototype: * int DB->put(DB *db, DB_TXN *txnid, DBT *key, DBT *data, u_int32_t flags); */ ret = db->put(db, NULL, &bdb_key, &bdb_value, flags); #else /* V1 */ ret = db->put(db, &bdb_key, &bdb_value, flags); #endif #ifdef LIBRDF_DEBUG if(ret) LIBRDF_DEBUG2("BDB put failed - %d\n", ret); #endif return (ret != 0); } /** * librdf_hash_bdb_exists: * @context: BerkeleyDB hash context * @key: pointer to key * @value: pointer to value (optional) * * Test the existence of a key/value in the hash. * * The value can be NULL in which case the check will just be * for the key. * * Return value: >0 if the key/value exists in the hash, 0 if not, <0 on failure **/ static int librdf_hash_bdb_exists(void* context, librdf_hash_datum *key, librdf_hash_datum *value) { librdf_hash_bdb_context* bdb_context=(librdf_hash_bdb_context*)context; DB* db=bdb_context->db; DBT bdb_key; DBT bdb_value; int ret; u_int32_t flags = 0; /* docs say you must zero DBT's before use */ memset(&bdb_key, 0, sizeof(DBT)); memset(&bdb_value, 0, sizeof(DBT)); /* Initialise BDB version of key */ bdb_key.data = (char*)key->data; bdb_key.size = LIBRDF_BAD_CAST(u_int32_t, key->size); if(value) { bdb_value.data = (char*)value->data; bdb_value.size = LIBRDF_BAD_CAST(u_int32_t, value->size); } #ifdef HAVE_BDB_DB_TXN #ifdef DB_GET_BOTH /* later V2 (sigh)/V3 */ if(value) flags = DB_GET_BOTH; ret = db->get(db, NULL, &bdb_key, &bdb_value, flags); if(ret == DB_NOTFOUND) ret= 0; else if(ret) /* failed */ ret= -1; else ret= 1; #else /* earlier V2 */ if(!value) { /* don't care about value, can use standard get */ ret = db->get(db, NULL, &bdb_key, &bdb_value, flags); if(ret == DB_NOTFOUND) ret= 0; else if(ret) /* failed */ ret= -1; else ret= 1; } else { /* Want exact key/value - have to use a cursor, darn */ DBC* dbc=NULL; ret=1; if(db->cursor(db, NULL, &dbc)) ret= -1; if(ret >= 0) { ret=dbc->c_get(dbc, &bdb_key, &bdb_value, DB_SET); if(ret == DB_NOTFOUND) ret= 0; else if(ret) /* failed */ ret= -1; else ret= 1; } while(ret > 0) { /* key different - match failed */ if(memcmp(key->data, bdb_key.data, key->size)) { ret=0; break; } /* value equal - match found */ if(!memcmp(value->data, bdb_value.data, value->size)) { ret=1; break; } ret=dbc->c_get(dbc, &bdb_key, &bdb_value, DB_NEXT); if(ret == DB_NOTFOUND) ret= 0; else if(ret) /* failed */ ret= -1; else ret= 1; } if(dbc) dbc->c_close(dbc); } #endif #else /* V1 */ if(!value) { /* don't care about value, can use standard get */ ret=db->get(db, &bdb_key, &bdb_value, 0); if(ret >0) /* not found */ ret= 0; else if(ret <0) /* failed */ ret= -1; else /* 0 = found */ ret= 1; } else { /* Want exact key/value - have to use sequence */ ret=db->seq(bdb, &bdb_key, &bdb_value, 0); if(ret) /* failed */ ret= -1; else ret= 1; while(ret > 0) { /* key different - match failed */ if(memcmp(key->data, bdb_key.data, key->size)) { ret=0; break; } /* value equal - match found */ if(!memcmp(value->data, bdb_value.data, value->size)) { ret=1; break; } ret=db->seq(dbc, &bdb_key, &bdb_value, R_NEXT); if(ret) /* not found */ ret= 0; else ret= 1; } } #endif return ret; } /** * librdf_hash_bdb_delete_key: * @context: BerkeleyDB hash context * @key: key * * Delete all values for given key from the hash. * * Return value: non 0 on failure **/ static int librdf_hash_bdb_delete_key(void* context, librdf_hash_datum *key) { librdf_hash_bdb_context* bdb_context=(librdf_hash_bdb_context*)context; DB* bdb=bdb_context->db; DBT bdb_key; int ret; u_int32_t flags = 0; memset(&bdb_key, 0, sizeof(DBT)); /* Initialise BDB version of key */ bdb_key.data = (char*)key->data; bdb_key.size = LIBRDF_BAD_CAST(u_int32_t, key->size); #ifdef HAVE_BDB_DB_TXN /* V2/V3 */ ret = bdb->del(bdb, NULL, &bdb_key, flags); #else /* V1 */ ret = bdb->del(bdb, &bdb_key, flags); #endif #ifdef LIBRDF_DEBUG if(ret) LIBRDF_DEBUG2("BDB del failed - %d\n", ret); #endif return (ret != 0); } /** * librdf_hash_bdb_delete_key_value: * @context: BerkeleyDB hash context * @key: key * @value: value * * Delete given key/value from the hash. * * Return value: non 0 on failure **/ static int librdf_hash_bdb_delete_key_value(void* context, librdf_hash_datum *key, librdf_hash_datum *value) { librdf_hash_bdb_context* bdb_context=(librdf_hash_bdb_context*)context; DB* bdb=bdb_context->db; DBT bdb_key, bdb_value; int ret; u_int32_t flags = 0; #ifdef HAVE_BDB_CURSOR DBC* dbc; #endif memset(&bdb_key, 0, sizeof(DBT)); memset(&bdb_value, 0, sizeof(DBT)); /* Initialise BDB version of key */ bdb_key.data = (char*)key->data; bdb_key.size = LIBRDF_BAD_CAST(u_int32_t, key->size); bdb_value.data = (char*)value->data; bdb_value.size = LIBRDF_BAD_CAST(u_int32_t, value->size); #ifdef HAVE_BDB_CURSOR #ifdef HAVE_BDB_CURSOR_4_ARGS /* V3 prototype: * int DB->cursor(DB *db, DB_TXN *txnid, DBC **cursorp, u_int32_t flags); */ if(bdb->cursor(bdb, NULL, &dbc, flags)) return 1; #else /* V2 prototype: * int DB->cursor(DB *db, DB_TXN *txnid, DBC **cursorp); */ if(bdb->cursor(bdb, NULL, &dbc)) return 1; #endif /* V2/V3 prototype: * int DBcursor->c_get(DBC *cursor, DBT *key, DBT *data, u_int32_t flags); */ #ifdef DB_GET_BOTH /* later V2 (sigh) / V3 */ flags = DB_GET_BOTH; #else /* earlier V2 probably gives a memory leak */ #endif ret = dbc->c_get(dbc, &bdb_key, &bdb_value, flags); if(ret) { dbc->c_close(dbc); return 1; } /* finally - delete the sucker */ ret=dbc->c_del(dbc, 0); dbc->c_close(dbc); #else /* V1 prototype: * int db->seq(DB* db, DBT *key, DBT *data, u_int flags); */ ret=bdb->seq(bdb, &bdb_key, &bdb_value, 0); if(ret) return 1; /* V1 prototype: * int db->del(DB* db, DBT *key, u_int flags); */ ret=bdb->del(bdb, &bdb_key, R_CURSOR); #endif #ifdef LIBRDF_DEBUG if(ret) LIBRDF_DEBUG2("BDB del failed - %d\n", ret); #endif return (ret != 0); } /** * librdf_hash_bdb_sync: * @context: BerkeleyDB hash context * * Flush the hash to disk. * * Return value: non 0 on failure **/ static int librdf_hash_bdb_sync(void* context) { librdf_hash_bdb_context* bdb_context = (librdf_hash_bdb_context*)context; DB* db = bdb_context->db; int ret; ret = db->sync(db, 0); return ret; } /** * librdf_hash_bdb_get_fd: * @context: BerkeleyDB hash context * * Get the file description representing the hash. * * Return value: the file descriptor or < 0 on failure **/ static int librdf_hash_bdb_get_fd(void* context) { librdf_hash_bdb_context* bdb_context=(librdf_hash_bdb_context*)context; DB* db=bdb_context->db; int fd; int ret; #ifdef HAVE_BDB_FD_2_ARGS ret=db->fd(db, &fd); #else ret=0; fd=db->fd(db); #endif return (ret ? -1 : fd); } /* local function to register BDB hash functions */ /** * librdf_hash_bdb_register_factory: * @factory: hash factory prototype * * Register the BerkeleyDB hash module with the hash factory. * **/ static void librdf_hash_bdb_register_factory(librdf_hash_factory *factory) { factory->context_length = sizeof(librdf_hash_bdb_context); factory->cursor_context_length = sizeof(librdf_hash_bdb_cursor_context); factory->create = librdf_hash_bdb_create; factory->destroy = librdf_hash_bdb_destroy; factory->open = librdf_hash_bdb_open; factory->close = librdf_hash_bdb_close; factory->clone = librdf_hash_bdb_clone; factory->values_count = librdf_hash_bdb_values_count; factory->put = librdf_hash_bdb_put; factory->exists = librdf_hash_bdb_exists; factory->delete_key = librdf_hash_bdb_delete_key; factory->delete_key_value = librdf_hash_bdb_delete_key_value; factory->sync = librdf_hash_bdb_sync; factory->get_fd = librdf_hash_bdb_get_fd; factory->cursor_init = librdf_hash_bdb_cursor_init; factory->cursor_get = librdf_hash_bdb_cursor_get; factory->cursor_finish = librdf_hash_bdb_cursor_finish; } /** * librdf_init_hash_bdb: * @world: redland world object * * Initialise the BerkeleyDB hash module. * **/ void librdf_init_hash_bdb(librdf_world *world) { librdf_hash_register_factory(world, "bdb", &librdf_hash_bdb_register_factory); } redland-1.0.17/src/rdf_storage_postgresql.c0000644000175000017500000027217212067673075015677 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_postgresql.c - RDF Storage in PostgreSQL DB interface definition. * * Based in part on rdf_storage_mysql. * * Copyright (C) 2003-2005 Shi Wenzhong - email to shiwenzhong@hz.cn * Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include #include #include #include typedef enum { /* Status of individual postgresql connections */ LIBRDF_STORAGE_POSTGRESQL_CONNECTION_CLOSED = 0, LIBRDF_STORAGE_POSTGRESQL_CONNECTION_OPEN = 1, LIBRDF_STORAGE_POSTGRESQL_CONNECTION_BUSY = 2 } librdf_storage_postgresql_connection_status; typedef struct { /* A postgresql connection */ librdf_storage_postgresql_connection_status status; PGconn *handle; } librdf_storage_postgresql_connection; typedef struct { /* postgresql connection parameters */ char *host; char *port; char *dbname; char *user; const char *password; /* Array of virtual postgresql connections */ librdf_storage_postgresql_connection *connections; int connections_count; /* hash of model name in the database (table Models, column ID) */ u64 model; /* if inserts should be optimized by locking and index optimizations */ int bulk; /* if a table with merged models should be maintained */ int merge; /* digest object for node hashes */ librdf_digest *digest; PGconn* transaction_handle; } librdf_storage_postgresql_instance; /* prototypes for local functions */ static int librdf_storage_postgresql_init(librdf_storage* storage, const char *name, librdf_hash* options); static int librdf_storage_postgresql_merge(librdf_storage* storage); static void librdf_storage_postgresql_terminate(librdf_storage* storage); static int librdf_storage_postgresql_open(librdf_storage* storage, librdf_model* model); static int librdf_storage_postgresql_close(librdf_storage* storage); static int librdf_storage_postgresql_sync(librdf_storage* storage); static int librdf_storage_postgresql_size(librdf_storage* storage); static int librdf_storage_postgresql_add_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_postgresql_add_statements(librdf_storage* storage, librdf_stream* statement_stream); static int librdf_storage_postgresql_remove_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_postgresql_contains_statement(librdf_storage* storage, librdf_statement* statement); librdf_stream* librdf_storage_postgresql_serialise(librdf_storage* storage); static librdf_stream* librdf_storage_postgresql_find_statements(librdf_storage* storage, librdf_statement* statement); static librdf_stream* librdf_storage_postgresql_find_statements_with_options(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options); /* context functions */ static int librdf_storage_postgresql_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_postgresql_context_add_statements(librdf_storage* storage, librdf_node* context_node, librdf_stream* statement_stream); static int librdf_storage_postgresql_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_postgresql_context_remove_statements(librdf_storage* storage, librdf_node* context_node); static librdf_stream* librdf_storage_postgresql_context_serialise(librdf_storage* storage, librdf_node* context_node); static librdf_stream* librdf_storage_postgresql_find_statements_in_context(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node); static librdf_iterator* librdf_storage_postgresql_get_contexts(librdf_storage* storage); static void librdf_storage_postgresql_register_factory(librdf_storage_factory *factory); #ifdef MODULAR_LIBRDF void librdf_storage_module_register_factory(librdf_world *world); #endif /* "private" helper definitions */ typedef struct { librdf_storage *storage; librdf_statement *current_statement; librdf_node *current_context; librdf_statement *query_statement; librdf_node *query_context; PGconn *handle; PGresult *results; int current_rowno; char **row; int is_literal_match; } librdf_storage_postgresql_sos_context; typedef struct { librdf_storage *storage; librdf_node *current_context; PGconn *handle; PGresult *results; int current_rowno; char **row; } librdf_storage_postgresql_get_contexts_context; static u64 librdf_storage_postgresql_hash(librdf_storage* storage, const char *type, const char *string, size_t length); static u64 librdf_storage_postgresql_node_hash(librdf_storage* storage, librdf_node* node, int add); static int librdf_storage_postgresql_start_bulk(librdf_storage* storage); static int librdf_storage_postgresql_stop_bulk(librdf_storage* storage); static int librdf_storage_postgresql_context_add_statement_helper(librdf_storage* storage, u64 ctxt, librdf_statement* statement); static int librdf_storage_postgresql_find_statements_in_context_augment_query(char **query, const char *addition); /* methods for stream of statements */ static int librdf_storage_postgresql_find_statements_in_context_end_of_stream(void* context); static int librdf_storage_postgresql_find_statements_in_context_next_statement(void* context); static void* librdf_storage_postgresql_find_statements_in_context_get_statement(void* context, int flags); static void librdf_storage_postgresql_find_statements_in_context_finished(void* context); /* methods for iterator for contexts */ static int librdf_storage_postgresql_get_contexts_end_of_iterator(void* context); static int librdf_storage_postgresql_get_contexts_next_context(void* context); static void* librdf_storage_postgresql_get_contexts_get_context(void* context, int flags); static void librdf_storage_postgresql_get_contexts_finished(void* context); static int librdf_storage_postgresql_transaction_rollback(librdf_storage* storage); /* functions implementing storage api */ /* * librdf_storage_postgresql_hash - Find hash value of string. * @storage: the storage * @type: character type of node to hash ("R", "L" or "B") * @string: a string to get hash for * @length: length of string * * Find hash value of string. * * Return value: Non-zero on succes. **/ static u64 librdf_storage_postgresql_hash(librdf_storage* storage, const char *type, const char *string, size_t length) { librdf_storage_postgresql_instance* context; u64 hash; byte* digest; int i; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(string, char*, 0); context = (librdf_storage_postgresql_instance*)storage->instance; /* (Re)initialize digest object */ librdf_digest_init(context->digest); /* Update digest with data */ if(type) librdf_digest_update(context->digest, (unsigned char*)type, 1); librdf_digest_update(context->digest, (unsigned char*)string, length); librdf_digest_final(context->digest); /* Copy first 8 bytes of digest into unsigned 64bit hash * using a method portable across big/little endianness * * Fixes Issue#0000023 - http://bugs.librdf.org/mantis/view.php?id=23 */ digest = (byte*) librdf_digest_get_digest(context->digest); hash = 0; for(i=0; i<8; i++) hash += ((u64) digest[i]) << (i*8); return hash; } /* * librdf_storage_postgresql_init_connections - Initialize postgresql connection pool. * @storage: the storage * * Return value: Non-zero on success. **/ static int librdf_storage_postgresql_init_connections(librdf_storage* storage) { librdf_storage_postgresql_instance* context=(librdf_storage_postgresql_instance*)storage->instance; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 0); /* Reset connection pool */ context->connections=NULL; context->connections_count=0; return 0; } /* * librdf_storage_postgresql_finish_connections - Finish all connections in postgresql connection pool and free structures. * @storage: the storage * * Return value: None. **/ static void librdf_storage_postgresql_finish_connections(librdf_storage* storage) { librdf_storage_postgresql_instance* context=(librdf_storage_postgresql_instance*)storage->instance; int i; LIBRDF_ASSERT_OBJECT_POINTER_RETURN(storage, librdf_storage); /* Loop through connections and close */ for(i=0; i < context->connections_count; i++) { if(LIBRDF_STORAGE_POSTGRESQL_CONNECTION_CLOSED != context->connections[i].status) PQfinish(context->connections[i].handle); } /* Free structure and reset */ if (context->connections_count) { LIBRDF_FREE(librdf_storage_postgresql_connection*, context->connections); context->connections=NULL; context->connections_count=0; } } /* * librdf_storage_postgresql_get_handle: * @storage: the storage * * INTERNAL - get a connection handle to the postgresql server * * This attempts to reuses any existing available pooled connection * otherwise creates a new connection to the server. * * Return value: Non-zero on succes. **/ static PGconn* librdf_storage_postgresql_get_handle(librdf_storage* storage) { librdf_storage_postgresql_instance* context=(librdf_storage_postgresql_instance*)storage->instance; librdf_storage_postgresql_connection* connection= NULL; int i; const int pool_increment = 2; char coninfo_template[] = "host=%s port=%s dbname=%s user=%s password=%s"; size_t coninfo_size; char *conninfo; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); if(context->transaction_handle) return context->transaction_handle; /* Look for an open connection handle to return */ for(i=0; i < context->connections_count; i++) { if(LIBRDF_STORAGE_POSTGRESQL_CONNECTION_OPEN == context->connections[i].status) { context->connections[i].status=LIBRDF_STORAGE_POSTGRESQL_CONNECTION_BUSY; return context->connections[i].handle; } } /* Look for a closed connection */ for(i=0; i < context->connections_count && !connection; i++) { if(LIBRDF_STORAGE_POSTGRESQL_CONNECTION_CLOSED == context->connections[i].status) { connection=&context->connections[i]; break; } } /* Expand connection pool if no closed connection was found */ if (!connection) { /* Allocate new buffer with two extra slots */ int new_pool_size = context->connections_count + pool_increment; librdf_storage_postgresql_connection* connections; connections = LIBRDF_CALLOC(librdf_storage_postgresql_connection*, LIBRDF_GOOD_CAST(size_t, new_pool_size), sizeof(librdf_storage_postgresql_connection)); if(!connections) return NULL; if(context->connections_count) { /* Copy old buffer to new */ memcpy(connections, context->connections, sizeof(librdf_storage_postgresql_connection) * LIBRDF_GOOD_CAST(size_t, context->connections_count)); /* Free old buffer */ LIBRDF_FREE(librdf_storage_postgresql_connection*, context->connections); } /* Initialize expanded pool */ context->connections = connections; connection = &(context->connections[context->connections_count]); while (context->connections_count < new_pool_size) { context->connections[context->connections_count].status = LIBRDF_STORAGE_POSTGRESQL_CONNECTION_CLOSED; context->connections[context->connections_count].handle = NULL; context->connections_count++; } } /* Initialize closed postgresql connection handle */ coninfo_size = strlen(coninfo_template) + strlen(context->host) + strlen(context->port) + strlen(context->dbname) + strlen(context->user) + strlen(context->password); conninfo = LIBRDF_MALLOC(char*,coninfo_size); if(conninfo) { sprintf(conninfo,coninfo_template,context->host,context->port,context->dbname,context->user,context->password); connection->handle=PQconnectdb(conninfo); if(connection->handle) { if( PQstatus(connection->handle) == CONNECTION_OK ) { connection->status=LIBRDF_STORAGE_POSTGRESQL_CONNECTION_BUSY; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Connection to postgresql database %s:%s name %s as user %s failed: %s", context->host, context->port, context->dbname, context->user, PQerrorMessage(connection->handle)); PQfinish(connection->handle); connection->handle=NULL; } } LIBRDF_FREE(char*, conninfo); } return connection->handle; } /* * librdf_storage_postgresql_release_handle: * @storage: the storage * @handle: the postgresql handle to release * * INTERNAL - Release a connection handle to postgresql server back to the pool * * Return value: None. **/ static void librdf_storage_postgresql_release_handle(librdf_storage* storage, PGconn *handle) { librdf_storage_postgresql_instance* context=(librdf_storage_postgresql_instance*)storage->instance; int i; LIBRDF_ASSERT_OBJECT_POINTER_RETURN(storage, librdf_storage); LIBRDF_ASSERT_OBJECT_POINTER_RETURN(handle, PGconn*); /* Look for busy connection handle to drop */ for(i=0; i < context->connections_count; i++) { if(LIBRDF_STORAGE_POSTGRESQL_CONNECTION_BUSY == context->connections[i].status && context->connections[i].handle == handle) { context->connections[i].status=LIBRDF_STORAGE_POSTGRESQL_CONNECTION_OPEN; return; } } librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unable to find busy connection (in pool of %i connections) to drop for postgresql server thread: %d", context->connections_count, PQbackendPID(handle)); } /* * librdf_storage_postgresql_init: * @storage: the storage * @name: model name * @options: host, port, database, user, password [, new] [, bulk] [, merge]. * * INTERNAL - Create connection to database. Defaults to port 5432 if not given. * * The boolean bulk option can be set to true if optimized inserts (table * locks and temporary key disabling) is wanted. Note that this will block * all other access, and requires table locking and alter table privileges. * * The boolean merge option can be set to true if a merged "view" of all * models should be maintained. This "view" will be a table with TYPE=MERGE. * * Return value: Non-zero on failure. **/ static int librdf_storage_postgresql_init(librdf_storage* storage, const char *name, librdf_hash* options) { librdf_storage_postgresql_instance *context=(librdf_storage_postgresql_instance*)storage->instance; const char create_table_statements[]="\ CREATE TABLE Statements" UINT64_T_FMT " (\ Subject numeric(20) NOT NULL,\ Predicate numeric(20) NOT NULL,\ Object numeric(20) NOT NULL,\ Context numeric(20) NOT NULL\ ) "; const char create_table_literals[]="\ CREATE TABLE Literals (\ ID numeric(20) NOT NULL,\ Value text NOT NULL,\ Language text NOT NULL,\ Datatype text NOT NULL,\ PRIMARY KEY (ID)\ ) "; const char create_table_resources[]="\ CREATE TABLE Resources (\ ID numeric(20) NOT NULL,\ URI text NOT NULL,\ PRIMARY KEY (ID)\ ) "; const char create_table_bnodes[]="\ CREATE TABLE Bnodes (\ ID numeric(20) NOT NULL,\ Name text NOT NULL,\ PRIMARY KEY (ID)\ ) "; const char create_table_models[]="\ CREATE TABLE Models (\ ID numeric(20) NOT NULL,\ Name text NOT NULL,\ PRIMARY KEY (ID)\ ) "; const char *create_tables[] = { create_table_statements, create_table_literals, create_table_resources, create_table_bnodes, create_table_models, NULL, }; const char create_model[]="INSERT INTO Models (ID,Name) VALUES (" UINT64_T_FMT ",'%s')"; const char check_model[]="SELECT 1 FROM Models WHERE ID=" UINT64_T_FMT " AND Name='%s'"; int status=0; char *escaped_name=NULL; char *query=NULL; PGresult *res=NULL; PGconn *handle; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(name, char*, 1); /* Must have connection parameters passed as options */ if(!options) return 1; context = LIBRDF_CALLOC(librdf_storage_postgresql_instance*, 1, sizeof(*context)); if(!context) { librdf_free_hash(options); return 1; } librdf_storage_set_instance(storage, context); /* Create digest */ if(!(context->digest=librdf_new_digest(storage->world,"MD5"))) { librdf_free_hash(options); return 1; } /* Save hash of model name */ context->model = librdf_storage_postgresql_hash(storage, NULL, name, strlen(name)); /* Save connection parameters */ context->host = librdf_hash_get(options, "host"); if(!context->host) { context->host = LIBRDF_MALLOC(char*, 10); strcpy(context->host,"localhost"); } context->port = librdf_hash_get(options, "port"); if(!context->port) { context->port = LIBRDF_MALLOC(char*, 10); strcpy(context->port,"5432"); /* default postgresql port */ } context->dbname = librdf_hash_get(options, "database"); if(!context->dbname) context->dbname = librdf_hash_get(options, "dbname"); context->user = librdf_hash_get(options, "user"); if(context->user && !context->dbname) { context->dbname = LIBRDF_MALLOC(char*, strlen(context->user) + 1); strcpy(context->dbname, context->user); /* default dbname=user */ } context->password = librdf_hash_get(options, "password"); if(!context->host || !context->dbname || !context->user || !context->port || !context->password) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "%s storage requires database/dbname, user and password in options", storage->factory->name); librdf_free_hash(options); return 1; } /* Maintain merge table? */ context->merge=(librdf_hash_get_as_boolean(options, "merge")>0); /* Initialize postgresql connections */ librdf_storage_postgresql_init_connections(storage); /* Get postgresql connection handle */ handle=librdf_storage_postgresql_get_handle(storage); if(!handle) { librdf_free_hash(options); return 1; } /* Create tables, if new and not existing */ if(!status && (librdf_hash_get_as_boolean(options, "new")>0)) { query = LIBRDF_MALLOC(char*, strlen(create_table_statements) + (20*1) + 1); if(! query) { status=1; } else { int i; sprintf(query, create_table_statements, context->model); create_tables[0] = query; for (i = 0; !status && NULL != create_tables[i]; i++) { PGresult *res2 = PQexec(handle, create_tables[i]); if (res2) { if (PQresultStatus(res2) != PGRES_COMMAND_OK) { if (0 != strncmp("42P07", PQresultErrorField(res2, PG_DIAG_SQLSTATE), strlen("42P07"))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql table creation failed: %s", PQresultErrorMessage(res2)); status = -1; } } PQclear(res2); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql table creation failed: %s", PQerrorMessage(handle)); status = -1; } } LIBRDF_FREE(char*, query); query=NULL; } } /* Create model if new and not existing, or check for existence */ if(!status) { escaped_name = LIBRDF_MALLOC(char*, strlen(name) * 2 + 1); if(!escaped_name) status=1; else { int error = 0; PQescapeStringConn(handle, escaped_name, (const char*)name, strlen(name), &error); if(error) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql escapeStringConn() failed with error %s", PQerrorMessage(handle)); status = 1; } } } if(!status && (librdf_hash_get_as_boolean(options, "new")>0)) { /* Create new model */ query = LIBRDF_MALLOC(char*, strlen(create_model) + 20 + strlen(escaped_name) + 1); if(!query) status=1; else { sprintf(query, create_model, context->model, escaped_name); if((res=PQexec(handle, query))) { if (PQresultStatus(res) != PGRES_COMMAND_OK) { if (0 != strncmp("23505", PQresultErrorField(res, PG_DIAG_SQLSTATE), strlen("23505"))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql table creation failed with error %s", PQresultErrorMessage(res)); status = -1; } } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Models table failed: %s", PQerrorMessage(handle)); status=-1; } LIBRDF_FREE(char*, query); query=NULL; } /* Maintain merge table? */ if(!status && context->merge) status=librdf_storage_postgresql_merge(storage); } else if(!status) { /* Check for model existence */ query = LIBRDF_MALLOC(char*, strlen(check_model) + 20 + strlen(escaped_name) + 1); if(!query) status=1; else { sprintf(query, check_model, context->model, name); res=NULL; if((res=PQexec(handle, query))) { if (PQresultStatus(res) != PGRES_TUPLES_OK) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Models table failed: %s", PQresultErrorMessage(res)); status=-1; } if(!status && !(PQntuples(res))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql failed to find model '%s'", name); status=1; } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql select from Models table failed: %s", PQerrorMessage(handle)); status=-1; } LIBRDF_FREE(char*, query); query=NULL; } } if(escaped_name) LIBRDF_FREE(char*, escaped_name); /* Optimize loads? */ context->bulk=(librdf_hash_get_as_boolean(options, "bulk")>0); /* Truncate model? */ if(!status && (librdf_hash_get_as_boolean(options, "new")>0)) status=librdf_storage_postgresql_context_remove_statements(storage, NULL); /* Unused options: write (always...) */ librdf_free_hash(options); librdf_storage_postgresql_release_handle(storage, handle); return status; } /* * librdf_storage_postgresql_merge: * @storage: the storage * * INTERNAL - (re)create merged "view" of all models * * Return value: Non-zero on failure. */ static int librdf_storage_postgresql_merge(librdf_storage* storage) { const char get_models[]="SELECT ID FROM Models"; const char drop_table_statements[]="DROP TABLE Statements"; const char insert_statements[]="INSERT INTO statements SELECT * FROM "; const char create_table_statements[]="\ CREATE TABLE Statements (\ Subject numeric(20) NOT NULL,\ Predicate numeric(20) NOT NULL,\ Object numeric(20) NOT NULL,\ Context numeric(20) NOT NULL\ ) "; char *query=NULL; PGresult *res; int i; PGconn *handle; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); /* Get postgresql connection handle */ handle=librdf_storage_postgresql_get_handle(storage); if(!handle) return 1; /* Drop and create merge table. */ if(! PQexec(handle, drop_table_statements) || ! PQexec(handle, create_table_statements)) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql merge table creation failed: %s", PQerrorMessage(handle)); librdf_storage_postgresql_release_handle(storage, handle); return -1; } /* Query for list of models. */ if(!(res=PQexec(handle, get_models))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql query for model list failed: %s", PQresultErrorMessage(res)); librdf_storage_postgresql_release_handle(storage, handle); return -1; } /* Allocate space for merge table generation query. */ query = LIBRDF_MALLOC(char*, strlen(insert_statements) + 50); if(!query) { PQclear(res); librdf_storage_postgresql_release_handle(storage, handle); return 1; } /* Generate CSV list of models. */ for(i=0;iworld, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql merge table insert failed: %s", PQerrorMessage(handle)); LIBRDF_FREE(char*, query); PQclear(res); librdf_storage_postgresql_release_handle(storage, handle); return -1; } } LIBRDF_FREE(char*, query); PQclear(res); librdf_storage_postgresql_release_handle(storage, handle); return 0; } /* * librdf_storage_postgresql_terminate: * @storage: the storage * * INTERNAL - Close the storage and database connections. * * Return value: None. **/ static void librdf_storage_postgresql_terminate(librdf_storage* storage) { librdf_storage_postgresql_instance *context=(librdf_storage_postgresql_instance*)storage->instance; LIBRDF_ASSERT_OBJECT_POINTER_RETURN(storage, librdf_storage); librdf_storage_postgresql_finish_connections(storage); if(context->password) LIBRDF_FREE(char*, (char*)context->password); if(context->user) LIBRDF_FREE(char*, (char*)context->user); if(context->dbname) LIBRDF_FREE(char*, (char*)context->dbname); if(context->port) LIBRDF_FREE(char*, (char*)context->port); if(context->host) LIBRDF_FREE(char*, (char*)context->host); if(context->digest) librdf_free_digest(context->digest); if(context->transaction_handle) librdf_storage_postgresql_transaction_rollback(storage); LIBRDF_FREE(librdf_storage_postgresql_instance, storage->instance); } /* * librdf_storage_postgresql_open: * @storage: the storage * @model: the model * * INTERNAL - Create or open model in database (nop). * * Return value: Non-zero on failure. **/ static int librdf_storage_postgresql_open(librdf_storage* storage, librdf_model* model) { return 0; } /* * librdf_storage_postgresql_close: * @storage: the storage * * INTERNAL - Close model (nop). * * Return value: Non-zero on failure. **/ static int librdf_storage_postgresql_close(librdf_storage* storage) { librdf_storage_postgresql_transaction_rollback(storage); return librdf_storage_postgresql_sync(storage); } /* * librdf_storage_postgresql_sync * @storage: the storage * * INTERNAL - Flush all tables, making sure they are saved on disk. * * Return value: Non-zero on failure. **/ static int librdf_storage_postgresql_sync(librdf_storage* storage) { librdf_storage_postgresql_instance *context=(librdf_storage_postgresql_instance*)storage->instance; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); /* Make sure optimizing for bulk operations is stopped? */ if(context->bulk) librdf_storage_postgresql_stop_bulk(storage); return 0; } /* * librdf_storage_postgresql_size: * @storage: the storage * * INTERNAL - Close model (nop). * * Return value: Negative on failure. **/ static int librdf_storage_postgresql_size(librdf_storage* storage) { librdf_storage_postgresql_instance *context=(librdf_storage_postgresql_instance*)storage->instance; char model_size[]="SELECT COUNT(*) FROM Statements" UINT64_T_FMT; char *query; PGresult *res; long count; PGconn *handle; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, -1); /* Get postgresql connection handle */ handle=librdf_storage_postgresql_get_handle(storage); if(!handle) return -1; /* Query for number of statements */ query = LIBRDF_MALLOC(char*, strlen(model_size) + 20 + 1); if(!query) { librdf_storage_postgresql_release_handle(storage, handle); return -1; } sprintf(query, model_size, context->model); if(!(res=PQexec(handle, query)) || !(PQntuples(res))) { if (res) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql query for model size failed: %s", PQresultErrorMessage(res)); PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql query for model size failed: %s", PQerrorMessage(handle)); } LIBRDF_FREE(char*, query); librdf_storage_postgresql_release_handle(storage, handle); return -1; } count = atol(PQgetvalue(res,0,0)); PQclear(res); LIBRDF_FREE(char*, query); librdf_storage_postgresql_release_handle(storage, handle); return LIBRDF_BAD_CAST(int, count); } static int librdf_storage_postgresql_add_statement(librdf_storage* storage, librdf_statement* statement) { /* Do not add duplicate statements */ if(librdf_storage_postgresql_contains_statement(storage, statement)) return 0; return librdf_storage_postgresql_context_add_statement_helper(storage, 0, statement); } /* * librdf_storage_postgresql_add_statements: * @storage: the storage * @statement_stream: the stream of statements * * INTERNAL - Add statements in stream to storage, without context. * * Return value: Non-zero on failure. **/ static int librdf_storage_postgresql_add_statements(librdf_storage* storage, librdf_stream* statement_stream) { return librdf_storage_postgresql_context_add_statements(storage, NULL, statement_stream); } /* * librdf_storage_postgresql_node_hash - Create hash value for node * @storage: the storage * @node: a node to get hash for (and possibly create in database) * @add: whether to add the node to the database * * Return value: Non-zero on succes. **/ static u64 librdf_storage_postgresql_node_hash(librdf_storage* storage, librdf_node* node, int add) { librdf_node_type type=librdf_node_get_type(node); u64 hash; size_t nodelen; char *query; PGconn *handle; PGresult *res; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, 0); /* Get postgresql connection handle */ handle=librdf_storage_postgresql_get_handle(storage); if(!handle) return 0; if(type==LIBRDF_NODE_TYPE_RESOURCE) { /* Get hash */ unsigned char *uri=librdf_uri_as_counted_string(librdf_node_get_uri(node), &nodelen); hash = librdf_storage_postgresql_hash(storage, "R", (char*)uri, nodelen); if(add) { char create_resource[]="INSERT INTO Resources (ID,URI) VALUES (" UINT64_T_FMT ",'%s')"; int add_status = 0; char *escaped_uri; escaped_uri = LIBRDF_MALLOC(char*, nodelen * 2 + 1); if(escaped_uri) { int error = 0; PQescapeStringConn(handle, escaped_uri, (const char*)uri, nodelen, &error); if(error) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql escapeStringConn() failed: %s", PQerrorMessage(handle)); } query = LIBRDF_MALLOC(char*, strlen(create_resource) + 20 + nodelen + 1); if(query) { sprintf(query, create_resource, hash, escaped_uri); if((res=PQexec(handle, query))) { if(PQresultStatus(res) == PGRES_COMMAND_OK) { add_status = 1; } else { if (0 == strncmp("23505", PQresultErrorField(res, PG_DIAG_SQLSTATE), strlen("23505"))) { /* Don't care about unique key viloations */ add_status = 1; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Resources failed: %s", PQresultErrorMessage(res)); } } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Resources failed"); } LIBRDF_FREE(char*, query); } LIBRDF_FREE(char*, escaped_uri); } if(!add_status) { librdf_storage_postgresql_release_handle(storage, handle); return 0; } } } else if(type==LIBRDF_NODE_TYPE_LITERAL) { /* Get hash */ unsigned char *value, *datatype=0; char *lang, *nodestring; librdf_uri *dt; size_t valuelen, langlen=0, datatypelen=0; value=librdf_node_get_literal_value_as_counted_string(node,&valuelen); lang=librdf_node_get_literal_value_language(node); if(lang) langlen=strlen(lang); dt=librdf_node_get_literal_value_datatype_uri(node); if(dt) datatype=librdf_uri_as_counted_string(dt,&datatypelen); if(datatype) datatypelen=strlen((const char*)datatype); /* Create composite node string for hash generation */ nodestring = LIBRDF_MALLOC(char*, valuelen + langlen + datatypelen + 3); if(!nodestring) { librdf_storage_postgresql_release_handle(storage, handle); return 0; } strcpy(nodestring, (const char*)value); strcat(nodestring, "<"); if(lang) strcat(nodestring, lang); strcat(nodestring, ">"); if(datatype) strcat(nodestring, (const char*)datatype); nodelen=valuelen+langlen+datatypelen+2; hash = librdf_storage_postgresql_hash(storage, "L", nodestring, nodelen); LIBRDF_FREE(char*, nodestring); if(add) { char create_literal[]="INSERT INTO Literals (ID,Value,Language,Datatype) VALUES (" UINT64_T_FMT ",'%s','%s','%s')"; int add_status = 0; char *escaped_value, *escaped_lang, *escaped_datatype; escaped_value = LIBRDF_MALLOC(char*, valuelen * 2 + 1); if(escaped_value) { int error = 0; PQescapeStringConn(handle, escaped_value, (const char*)value, valuelen, &error); if(error) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql escapeStringConn() failed: %s", PQerrorMessage(handle)); } escaped_lang = LIBRDF_MALLOC(char*, langlen * 2 + 1); if(escaped_lang) { if(lang) { PQescapeStringConn(handle, escaped_lang, (const char*)lang, langlen, &error); if(error) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql escapeStringConn() failed: %s", PQerrorMessage(handle)); } } else strcpy(escaped_lang,""); escaped_datatype = LIBRDF_MALLOC(char*, datatypelen * 2 + 1); if(escaped_datatype) { if(datatype) { PQescapeStringConn(handle, escaped_datatype, (const char*)datatype, datatypelen, &error); if(error) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql escapeStringConn() failed: %s", PQerrorMessage(handle)); } } else strcpy(escaped_datatype,""); query = LIBRDF_MALLOC(char*, strlen(create_literal) + strlen(escaped_value) + strlen(escaped_lang) + strlen(escaped_datatype) + 21); if(query) { sprintf(query, create_literal, hash, escaped_value, escaped_lang, escaped_datatype); if((res=PQexec(handle, query))) { if(PQresultStatus(res) == PGRES_COMMAND_OK) { add_status = 1; } else { if (0 == strncmp("23505", PQresultErrorField(res, PG_DIAG_SQLSTATE), strlen("23505"))) { /* Don't care about unique key viloations */ add_status = 1; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Resources failed: %s", PQresultErrorMessage(res)); } } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Resources failed"); } LIBRDF_FREE(char*, query); } LIBRDF_FREE(char*, escaped_datatype); } LIBRDF_FREE(char*, escaped_lang); } LIBRDF_FREE(char*, escaped_value); } if(!add_status) { librdf_storage_postgresql_release_handle(storage, handle); return 0; } } } else if(type==LIBRDF_NODE_TYPE_BLANK) { /* Get hash */ unsigned char *name = librdf_node_get_blank_identifier(node); nodelen = strlen((const char*)name); hash = librdf_storage_postgresql_hash(storage, "B", (char*)name, nodelen); if(add) { char create_bnode[]="INSERT INTO Bnodes (ID,Name) VALUES (" UINT64_T_FMT ",'%s')"; int add_status = 0; char *escaped_name; escaped_name = LIBRDF_MALLOC(char*, nodelen * 2 + 1); if(escaped_name) { int error = 0; PQescapeStringConn(handle, escaped_name, (const char*)name, nodelen, &error); if(error) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql escapeStringConn() failed: %s", PQerrorMessage(handle)); } query = LIBRDF_MALLOC(char*, strlen(create_bnode) + 20 + nodelen + 1); if(query) { sprintf(query, create_bnode, hash, escaped_name); if((res=PQexec(handle, query))) { if(PQresultStatus(res) == PGRES_COMMAND_OK) { add_status = 1; } else { if (0 == strncmp("23505", PQresultErrorField(res, PG_DIAG_SQLSTATE), strlen("23505"))) { /* Don't care about unique key viloations */ add_status = 1; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Resources failed: %s", PQresultErrorMessage(res)); } } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Bnodes failed"); } LIBRDF_FREE(char*, query); } LIBRDF_FREE(char*, escaped_name); } if(!add_status) { librdf_storage_postgresql_release_handle(storage, handle); return 0; } } } else { /* Some node type we don't know about? */ librdf_storage_postgresql_release_handle(storage, handle); return 0; } librdf_storage_postgresql_release_handle(storage, handle); return hash; } /* * librdf_storage_postgresql_start_bulk: * @storage: the storage * * INTERNAL - Prepare for bulk insert operation * * Return value: Non-zero on failure. */ static int librdf_storage_postgresql_start_bulk(librdf_storage* storage) { return 1; } /* * librdf_storage_postgresql_stop_bulk: * @storage: the storage * * INTERNAL - End bulk insert operation * * Return value: Non-zero on failure. */ static int librdf_storage_postgresql_stop_bulk(librdf_storage* storage) { return 1; } /* * librdf_storage_postgresql_context_add_statements: * @storage: the storage * @context_node: #librdf_node object * @statement_stream: the stream of statements * * INTERNAL - Add statements in stream to storage, with context. * * Return value: Non-zero on failure. **/ static int librdf_storage_postgresql_context_add_statements(librdf_storage* storage, librdf_node* context_node, librdf_stream* statement_stream) { librdf_storage_postgresql_instance* context=(librdf_storage_postgresql_instance*)storage->instance; u64 ctxt=0; int helper=0; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement_stream, librdf_stream, 1); /* Optimize for bulk loads? */ if(context->bulk) { if(librdf_storage_postgresql_start_bulk(storage)) return 1; } /* Find hash for context, creating if necessary */ if(context_node) { ctxt=librdf_storage_postgresql_node_hash(storage,context_node,1); if(!ctxt) return 1; } while(!helper && !librdf_stream_end(statement_stream)) { librdf_statement* statement=librdf_stream_get_object(statement_stream); if(!context->bulk) { /* Do not add duplicate statements * but do not check for this when in bulk mode. */ if(librdf_storage_postgresql_contains_statement(storage, statement)) { librdf_stream_next(statement_stream); continue; } } helper=librdf_storage_postgresql_context_add_statement_helper(storage, ctxt, statement); librdf_stream_next(statement_stream); } return helper; } /* * librdf_storage_postgresql_context_add_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to add * * INTERNAL - Add a statement to a storage context * * Return value: non 0 on failure **/ static int librdf_storage_postgresql_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { u64 ctxt=0; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); /* Find hash for context, creating if necessary */ if(context_node) { ctxt=librdf_storage_postgresql_node_hash(storage,context_node,1); if(!ctxt) return 1; } return librdf_storage_postgresql_context_add_statement_helper(storage, ctxt, statement); } /* * librdf_storage_postgresql_context_add_statement_helper * @storage: #librdf_storage object * @ctxt: u64 context hash * @statement: #librdf_statement statement to add * * INTERNAL - Perform actual addition of a statement to a storage context * * Return value: non-zero on failure **/ static int librdf_storage_postgresql_context_add_statement_helper(librdf_storage* storage, u64 ctxt, librdf_statement* statement) { librdf_storage_postgresql_instance* context=(librdf_storage_postgresql_instance*)storage->instance; char insert_statement[]="INSERT INTO Statements" UINT64_T_FMT " (Subject,Predicate,Object,Context) VALUES (" UINT64_T_FMT "," UINT64_T_FMT "," UINT64_T_FMT "," UINT64_T_FMT ")"; u64 subject, predicate, object; PGconn *handle; int status = 1; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); /* Get postgresql connection handle */ if ((handle=librdf_storage_postgresql_get_handle(storage))) { /* Find hashes for nodes, creating if necessary */ subject=librdf_storage_postgresql_node_hash(storage, librdf_statement_get_subject(statement),1); predicate=librdf_storage_postgresql_node_hash(storage, librdf_statement_get_predicate(statement),1); object=librdf_storage_postgresql_node_hash(storage, librdf_statement_get_object(statement),1); if(subject && predicate && object) { char *query; PGresult *res; query = LIBRDF_MALLOC(char*, strlen(insert_statement) + (20 * 5) + 1); if(query) { sprintf(query, insert_statement, context->model, subject, predicate, object, ctxt); if((res=PQexec(handle, query))) { if(PQresultStatus(res) == PGRES_COMMAND_OK) { status = 0; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Statements failed: %s", PQresultErrorMessage(res)); } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Statements failed: %s", PQerrorMessage(handle)); } LIBRDF_FREE(char*, query); } } librdf_storage_postgresql_release_handle(storage, handle); } return status; } /* * librdf_storage_postgresql_contains_statement: * @storage: the storage * @statement: a complete statement * * INTERNAL - Test if a given complete statement is present in the model * * Return value: Non-zero if the model contains the statement. **/ static int librdf_storage_postgresql_contains_statement(librdf_storage* storage, librdf_statement* statement) { librdf_storage_postgresql_instance* context = (librdf_storage_postgresql_instance*)storage->instance; char find_statement[]="SELECT 1 FROM Statements" UINT64_T_FMT " WHERE Subject=" UINT64_T_FMT " AND Predicate=" UINT64_T_FMT " AND Object=" UINT64_T_FMT " limit 1"; u64 subject, predicate, object; PGconn *handle; int status = 0; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 0); /* Get postgresql connection handle */ if ((handle=librdf_storage_postgresql_get_handle(storage))) { /* Find hashes for nodes */ subject=librdf_storage_postgresql_node_hash(storage, librdf_statement_get_subject(statement),0); predicate=librdf_storage_postgresql_node_hash(storage, librdf_statement_get_predicate(statement),0); object=librdf_storage_postgresql_node_hash(storage, librdf_statement_get_object(statement),0); if(subject && predicate && object) { char *query; size_t len = strlen(find_statement)+(20*4)+1; query = LIBRDF_MALLOC(char*, len); if(query) { PGresult *res; snprintf(query, len, find_statement, context->model, subject, predicate, object); if((res=PQexec(handle, query))) { if(PQresultStatus(res) == PGRES_TUPLES_OK) { if(PQntuples(res)) { status = 1; } } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql insert into Statements failed: %s", PQresultErrorMessage(res)); } PQclear(res); } LIBRDF_FREE(char*, query); } } librdf_storage_postgresql_release_handle(storage, handle); } return status; } /* * librdf_storage_postgresql_remove_statement: * @storage: #librdf_storage object * @statement: #librdf_statement statement to remove * * INTERNAL - Remove a statement from storage * * Return value: non-zero on failure **/ static int librdf_storage_postgresql_remove_statement(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_postgresql_context_remove_statement(storage,NULL,statement); } /* * librdf_storage_postgresql_context_remove_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to remove * * INTERNAL - Remove a statement from a storage context * * Return value: non-zero on failure **/ static int librdf_storage_postgresql_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { librdf_storage_postgresql_instance* context=(librdf_storage_postgresql_instance*)storage->instance; char delete_statement[]="DELETE FROM Statements" UINT64_T_FMT " WHERE Subject=" UINT64_T_FMT " AND Predicate=" UINT64_T_FMT " AND Object=" UINT64_T_FMT; char delete_statement_with_context[]="DELETE FROM Statements" UINT64_T_FMT " WHERE Subject=" UINT64_T_FMT " AND Predicate=" UINT64_T_FMT " AND Object=" UINT64_T_FMT " AND Context=" UINT64_T_FMT; u64 subject, predicate, object, ctxt=0; PGconn *handle=NULL; int status = 1; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if((handle=librdf_storage_postgresql_get_handle(storage))) { /* Find hashes for nodes */ subject=librdf_storage_postgresql_node_hash(storage, librdf_statement_get_subject(statement),0); predicate=librdf_storage_postgresql_node_hash(storage, librdf_statement_get_predicate(statement),0); object=librdf_storage_postgresql_node_hash(storage, librdf_statement_get_object(statement),0); if (subject && predicate && object) { char *query=NULL; if(context_node) { ctxt=librdf_storage_postgresql_node_hash(storage,context_node,0); if(ctxt) { query = LIBRDF_MALLOC(char*, strlen(delete_statement_with_context) + (20 * 5) + 1); if(query) { sprintf(query, delete_statement_with_context, context->model, subject, predicate, object, ctxt); } } } else { query = LIBRDF_MALLOC(char*, strlen(delete_statement) + (20 * 4) + 1); if(query) { sprintf(query, delete_statement, context->model, subject, predicate, object); } } if(query) { PGresult *res=NULL; if((res=PQexec(handle, query))) { if(PQresultStatus(res) == PGRES_COMMAND_OK) { status = 0; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql delete from Statements failed: %s", PQresultErrorMessage(res)); } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql delete from Statements failed"); } LIBRDF_FREE(char*, query); } } librdf_storage_postgresql_release_handle(storage, handle); } return status; } /* * librdf_storage_postgresql_context_remove_statements: * @storage: #librdf_storage object * @context_node: #librdf_node object * * INTERNAL - Remove all statement from a storage context * * Return value: non-zero on failure **/ static int librdf_storage_postgresql_context_remove_statements(librdf_storage* storage, librdf_node* context_node) { librdf_storage_postgresql_instance* context=(librdf_storage_postgresql_instance*)storage->instance; char delete_context[]="DELETE FROM Statements" UINT64_T_FMT " WHERE Context=" UINT64_T_FMT; char delete_model[]="DELETE FROM Statements" UINT64_T_FMT; u64 ctxt=0; PGconn *handle=NULL; int status = 1; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); if((handle=librdf_storage_postgresql_get_handle(storage))) { char *query=NULL; if(context_node) { ctxt=librdf_storage_postgresql_node_hash(storage,context_node,0); if(ctxt) { query = LIBRDF_MALLOC(char*, strlen(delete_context) + (20 * 2) + 1); if(query) { sprintf(query, delete_context, context->model, ctxt); } } } else { query = LIBRDF_MALLOC(char*, strlen(delete_model) + (20) + 1); if(query) { sprintf(query, delete_model, context->model); } } if(query) { PGresult *res=NULL; if((res=PQexec(handle, query))) { if(PQresultStatus(res) == PGRES_COMMAND_OK) { status = 0; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql delete from Statements failed: %s", PQresultErrorMessage(res)); } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql delete from Statements failed"); } LIBRDF_FREE(char*, query); } librdf_storage_postgresql_release_handle(storage, handle); } return status; } /* * librdf_storage_postgresql_serialise: * @storage: the storage * * INTERNAL - Return a stream of all statements in a storage. * * Return value: a #librdf_stream or NULL on failure **/ librdf_stream* librdf_storage_postgresql_serialise(librdf_storage* storage) { return librdf_storage_postgresql_find_statements_in_context(storage,NULL,NULL); } /* * librdf_storage_postgresql_find_statements: * @storage: the storage * @statement: the statement to match * * INTERNAL - Find a graph of statements in storage. * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_postgresql_find_statements(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_postgresql_find_statements_in_context(storage,statement,NULL); } /* * librdf_storage_postgresql_context_serialise: * @storage: #librdf_storage object * @context_node: #librdf_node object * * INTERNAL - List all statements in a storage context * * Return value: #librdf_stream of statements or NULL on failure or context is empty **/ static librdf_stream* librdf_storage_postgresql_context_serialise(librdf_storage* storage, librdf_node* context_node) { return librdf_storage_postgresql_find_statements_in_context(storage,NULL,context_node); } /* * librdf_storage_postgresql_find_statements_in_context: * @storage: the storage * @statement: the statement to match * @context_node: the context to search * * INTERNAL - Find a graph of statements in a storage context. * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_postgresql_find_statements_in_context(librdf_storage* storage, librdf_statement* statement,librdf_node* context_node) { return librdf_storage_postgresql_find_statements_with_options(storage, statement, context_node, NULL); } /* * librdf_storage_postgresql_find_statements_with_options: * @storage: the storage * @statement: the statement to match * @context_node: the context to search * @options: #librdf_hash of match options or NULL * * INTERNAL - Find a graph of statements in a storage context with options. * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_postgresql_find_statements_with_options(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options) { librdf_storage_postgresql_instance* context=(librdf_storage_postgresql_instance*)storage->instance; librdf_storage_postgresql_sos_context* sos; librdf_node *subject=NULL, *predicate=NULL, *object=NULL; char *query; char tmp[64]; char where[256]; char joins[640]; librdf_stream *stream; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); /* Initialize sos context */ sos = LIBRDF_CALLOC(librdf_storage_postgresql_sos_context*, 1, sizeof(*sos)); if(!sos) return NULL; sos->storage=storage; librdf_storage_add_reference(sos->storage); if(statement) sos->query_statement=librdf_new_statement_from_statement(statement); if(context_node) sos->query_context=librdf_new_node_from_node(context_node); sos->current_statement=NULL; sos->current_context=NULL; sos->results=NULL; if(options) { sos->is_literal_match=librdf_hash_get_as_boolean(options, "match-substring"); } /* Get postgresql connection handle */ sos->handle=librdf_storage_postgresql_get_handle(storage); if(!sos->handle) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } /* Construct query */ query = LIBRDF_MALLOC(char*, 21); if(!query) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } strcpy(query, "SELECT "); *where='\0'; if(sos->is_literal_match) sprintf(joins, " FROM Literals AS L LEFT JOIN Statements" UINT64_T_FMT " as S ON L.ID=S.Object", context->model); else sprintf(joins, " FROM Statements" UINT64_T_FMT " AS S", context->model); if(statement) { subject=librdf_statement_get_subject(statement); predicate=librdf_statement_get_predicate(statement); object=librdf_statement_get_object(statement); } /* Subject */ if(statement && subject) { sprintf(tmp, "S.Subject=" UINT64_T_FMT "", librdf_storage_postgresql_node_hash(storage,subject,0)); if(!strlen(where)) strcat(where, " WHERE "); else strcat(where, " AND "); strcat(where, tmp); } else { if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, " SubjectR.URI AS SuR, SubjectB.Name AS SuB")) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } strcat(joins," LEFT JOIN Resources AS SubjectR ON S.Subject=SubjectR.ID"); strcat(joins," LEFT JOIN Bnodes AS SubjectB ON S.Subject=SubjectB.ID"); } /* Predicate */ if(statement && predicate) { sprintf(tmp, "S.Predicate=" UINT64_T_FMT "", librdf_storage_postgresql_node_hash(storage, predicate, 0)); if(!strlen(where)) strcat(where, " WHERE "); else strcat(where, " AND "); strcat(where, tmp); } else { if(!statement || !subject) { if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, ",")) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } } if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, " PredicateR.URI AS PrR")) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } strcat(joins," LEFT JOIN Resources AS PredicateR ON S.Predicate=PredicateR.ID"); } /* Object */ if(statement && object) { if(!sos->is_literal_match) { sprintf(tmp,"S.Object=" UINT64_T_FMT "", librdf_storage_postgresql_node_hash(storage, object, 0)); if(!strlen(where)) strcat(where, " WHERE "); else strcat(where, " AND "); strcat(where, tmp); } else { /* MATCH literal, not hash_id */ if(!statement || !subject || !predicate) { if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, ",")) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } } if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, " ObjectR.URI AS ObR, ObjectB.Name AS ObB, ObjectL.Value AS ObV, ObjectL.Language AS ObL, ObjectL.Datatype AS ObD")) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } strcat(joins," LEFT JOIN Resources AS ObjectR ON S.Object=ObjectR.ID"); strcat(joins," LEFT JOIN Bnodes AS ObjectB ON S.Object=ObjectB.ID"); strcat(joins," LEFT JOIN Literals AS ObjectL ON S.Object=ObjectL.ID"); sprintf(tmp, "MATCH(L.Value) AGAINST ('%s')", librdf_node_get_literal_value(object)); /* NOTE: This is NOT USED but could be if FULLTEXT wasn't enabled */ /* sprintf(tmp, " L.Value LIKE '%%%s%%'", librdf_node_get_literal_value(object)); */ if(!strlen(where)) strcat(where, " WHERE "); else strcat(where, " AND "); strcat(where, tmp); } } else { if(!statement || !subject || !predicate) { if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, ",")) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } } if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, " ObjectR.URI AS ObR, ObjectB.Name AS ObB, ObjectL.Value AS ObV, ObjectL.Language AS ObL, ObjectL.Datatype AS ObD")) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } strcat(joins," LEFT JOIN Resources AS ObjectR ON S.Object=ObjectR.ID"); strcat(joins," LEFT JOIN Bnodes AS ObjectB ON S.Object=ObjectB.ID"); strcat(joins," LEFT JOIN Literals AS ObjectL ON S.Object=ObjectL.ID"); } /* Context */ if(context_node) { sprintf(tmp,"S.Context=" UINT64_T_FMT "", librdf_storage_postgresql_node_hash(storage,context_node,0)); if(!strlen(where)) strcat(where, " WHERE "); else strcat(where, " AND "); strcat(where, tmp); } else { if(!statement || !subject || !predicate || !object) { if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, ",")) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } } if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, " ContextR.URI AS CoR, ContextB.Name AS CoB, ContextL.Value AS CoV, ContextL.Language AS CoL, ContextL.Datatype AS CoD")) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } strcat(joins," LEFT JOIN Resources AS ContextR ON S.Context=ContextR.ID"); strcat(joins," LEFT JOIN Bnodes AS ContextB ON S.Context=ContextB.ID"); strcat(joins," LEFT JOIN Literals AS ContextL ON S.Context=ContextL.ID"); } /* Query without variables? */ if(statement && subject && predicate && object && context_node) { if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, " 1")) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } } /* Complete query string */ if(librdf_storage_postgresql_find_statements_in_context_augment_query(&query, joins) || librdf_storage_postgresql_find_statements_in_context_augment_query(&query, where)) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } /* Start query... */ sos->results=PQexec(sos->handle, query); LIBRDF_FREE(char*, query); if (sos->results) { if (PQresultStatus(sos->results) != PGRES_TUPLES_OK) { librdf_log(sos->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql query failed: %s", PQresultErrorMessage(sos->results)); librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } } else { librdf_log(sos->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql query failed: %s", PQerrorMessage(sos->handle)); librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } sos->current_rowno=0; sos->row = LIBRDF_CALLOC(char**, LIBRDF_GOOD_CAST(size_t, PQnfields(sos->results) + 1), sizeof(char*)); if(!sos->row) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } /* Get first statement, if any, and initialize stream */ if(librdf_storage_postgresql_find_statements_in_context_next_statement(sos) ) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return librdf_new_empty_stream(storage->world); } stream=librdf_new_stream(storage->world,(void*)sos, &librdf_storage_postgresql_find_statements_in_context_end_of_stream, &librdf_storage_postgresql_find_statements_in_context_next_statement, &librdf_storage_postgresql_find_statements_in_context_get_statement, &librdf_storage_postgresql_find_statements_in_context_finished); if(!stream) { librdf_storage_postgresql_find_statements_in_context_finished((void*)sos); return NULL; } return stream; } static int librdf_storage_postgresql_find_statements_in_context_augment_query(char **query, const char *addition) { char *newquery; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query, char, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(addition, char, 1); /* Augment existing query, returning 0 on success. */ newquery = LIBRDF_MALLOC(char*, strlen(*query) + strlen(addition) + 1); if(!newquery) return 1; strcpy(newquery,*query); strcat(newquery,addition); LIBRDF_FREE(char*, *query); *query=newquery; return 0; } static int librdf_storage_postgresql_find_statements_in_context_end_of_stream(void* context) { librdf_storage_postgresql_sos_context* sos=(librdf_storage_postgresql_sos_context*)context; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(context, void, 1); return sos->current_statement==NULL; } static int librdf_storage_postgresql_find_statements_in_context_next_statement(void* context) { librdf_storage_postgresql_sos_context* sos=(librdf_storage_postgresql_sos_context*)context; librdf_node *subject=NULL, *predicate=NULL, *object=NULL; librdf_node *node; char **row=sos->row; int i; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(context, void, 1); if( sos->current_rowno < PQntuples(sos->results) ) { for(i=0;iresults);i++) { if(PQgetlength(sos->results,sos->current_rowno,i) > 0 ) { /* FIXME: why is this not copied? */ /* row[i] = LIBRDF_MALLOC(char*, PQgetlength(sos->results,sos->current_rowno, i) + 1) if(!row[i]) return 1; strcpy(row[i], PQgetvalue(sos->results,sos->current_rowno, i)); */ row[i]=PQgetvalue(sos->results,sos->current_rowno,i); } else row[i]=NULL; } sos->current_rowno=sos->current_rowno+1; /* Get ready for context */ if(sos->current_context) librdf_free_node(sos->current_context); sos->current_context=NULL; /* Is this a query with statement parts? */ if(sos->query_statement) { subject=librdf_statement_get_subject(sos->query_statement); predicate=librdf_statement_get_predicate(sos->query_statement); if(sos->is_literal_match) object=NULL; else object=librdf_statement_get_object(sos->query_statement); } /* Make sure we have a statement object to return */ if(!sos->current_statement) { if(!(sos->current_statement=librdf_new_statement(sos->storage->world))) return 1; } librdf_statement_clear(sos->current_statement); /* Query without variables? */ if(subject && predicate && object && sos->query_context) { librdf_statement_set_subject(sos->current_statement,librdf_new_node_from_node(subject)); librdf_statement_set_predicate(sos->current_statement,librdf_new_node_from_node(predicate)); librdf_statement_set_object(sos->current_statement,librdf_new_node_from_node(object)); sos->current_context=librdf_new_node_from_node(sos->query_context); } else { /* Turn row parts into statement and context */ int part=0; /* Subject - constant or from row? */ if(subject) { librdf_statement_set_subject(sos->current_statement,librdf_new_node_from_node(subject)); } else { /* Resource or Bnode? */ if(row[part]) { if(!(node=librdf_new_node_from_uri_string(sos->storage->world, (const unsigned char*)row[part]))) return 1; } else if(row[part+1]) { if(!(node=librdf_new_node_from_blank_identifier(sos->storage->world, (const unsigned char*)row[part+1]))) return 1; } else return 1; librdf_statement_set_subject(sos->current_statement,node); part+=2; } /* Predicate - constant or from row? */ if(predicate) { librdf_statement_set_predicate(sos->current_statement,librdf_new_node_from_node(predicate)); } else { /* Resource? */ if(row[part]) { if(!(node=librdf_new_node_from_uri_string(sos->storage->world, (const unsigned char*)row[part]))) return 1; } else return 1; librdf_statement_set_predicate(sos->current_statement,node); part+=1; } /* Object - constant or from row? */ if(object) { librdf_statement_set_object(sos->current_statement,librdf_new_node_from_node(object)); } else { /* Resource, Bnode or Literal? */ if(row[part]) { if(!(node=librdf_new_node_from_uri_string(sos->storage->world, (const unsigned char*)row[part]))) return 1; } else if(row[part+1]) { if(!(node=librdf_new_node_from_blank_identifier(sos->storage->world, (const unsigned char*)row[part+1]))) return 1; } else if(row[part+2]) { /* Typed literal? */ librdf_uri *datatype=NULL; if(row[part+4] && strlen(row[part+4])) datatype=librdf_new_uri(sos->storage->world, (const unsigned char*)row[part+4]); if(!(node=librdf_new_node_from_typed_literal(sos->storage->world, (const unsigned char*)row[part+2], row[part+3], datatype))) return 1; } else return 1; librdf_statement_set_object(sos->current_statement,node); part+=5; } /* Context - constant or from row? */ if(sos->query_context) { sos->current_context=librdf_new_node_from_node(sos->query_context); } else { /* Resource, Bnode or Literal? */ if(row[part]) { if(!(node=librdf_new_node_from_uri_string(sos->storage->world, (const unsigned char*)row[part]))) return 1; } else if(row[part+1]) { if(!(node=librdf_new_node_from_blank_identifier(sos->storage->world, (const unsigned char*)row[part+1]))) return 1; } else if(row[part+2]) { /* Typed literal? */ librdf_uri *datatype=NULL; if(row[part+4] && strlen(row[part+4])) datatype=librdf_new_uri(sos->storage->world, (const unsigned char*)row[part+4]); if(!(node=librdf_new_node_from_typed_literal(sos->storage->world, (const unsigned char*)row[part+2], row[part+3], datatype))) return 1; } else /* no context */ node=NULL; sos->current_context=node; } } } else { if(sos->current_statement) librdf_free_statement(sos->current_statement); sos->current_statement=NULL; if(sos->current_context) librdf_free_node(sos->current_context); sos->current_context=NULL; } return 0; } static void* librdf_storage_postgresql_find_statements_in_context_get_statement(void* context, int flags) { librdf_storage_postgresql_sos_context* sos=(librdf_storage_postgresql_sos_context*)context; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(context, void, NULL); switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return sos->current_statement; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return sos->current_context; default: LIBRDF_DEBUG2("Unknown flags %d\n", flags); return NULL; } } static void librdf_storage_postgresql_find_statements_in_context_finished(void* context) { librdf_storage_postgresql_sos_context* sos=(librdf_storage_postgresql_sos_context*)context; LIBRDF_ASSERT_OBJECT_POINTER_RETURN(context, void); if( sos->row ) LIBRDF_FREE(char*, sos->row); if(sos->results) PQclear(sos->results); if(sos->handle) librdf_storage_postgresql_release_handle(sos->storage, sos->handle); if(sos->current_statement) librdf_free_statement(sos->current_statement); if(sos->current_context) librdf_free_node(sos->current_context); if(sos->query_statement) librdf_free_statement(sos->query_statement); if(sos->query_context) librdf_free_node(sos->query_context); if(sos->storage) librdf_storage_remove_reference(sos->storage); LIBRDF_FREE(librdf_storage_postgresql_sos_context, sos); } /* * librdf_storage_postgresql_get_contexts: * @storage: the storage * * INTERNAL - Return an iterator with the context nodes present in storage. * * Return value: a #librdf_iterator or NULL on failure **/ static librdf_iterator* librdf_storage_postgresql_get_contexts(librdf_storage* storage) { librdf_storage_postgresql_instance* context=(librdf_storage_postgresql_instance*)storage->instance; librdf_storage_postgresql_get_contexts_context* gccontext; const char select_contexts[]="\ SELECT DISTINCT R.URI AS CoR, B.Name AS CoB, \ L.Value AS CoV, L.Language AS CoL, L.Datatype AS CoD \ FROM Statements" UINT64_T_FMT " as S \ LEFT JOIN Resources AS R ON S.Context=R.ID \ LEFT JOIN Bnodes AS B ON S.Context=B.ID \ LEFT JOIN Literals AS L ON S.Context=L.ID"; char *query; librdf_iterator *iterator; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); /* Initialize get_contexts context */ gccontext = LIBRDF_CALLOC(librdf_storage_postgresql_get_contexts_context*, 1, sizeof(*gccontext)); if(!gccontext) return NULL; gccontext->storage=storage; librdf_storage_add_reference(gccontext->storage); gccontext->current_context=NULL; gccontext->results=NULL; /* Get postgresql connection handle */ gccontext->handle=librdf_storage_postgresql_get_handle(storage); if(!gccontext->handle) { librdf_storage_postgresql_get_contexts_finished((void*)gccontext); return NULL; } /* Construct query */ query = LIBRDF_MALLOC(char*, strlen(select_contexts) + 21); if(!query) { librdf_storage_postgresql_get_contexts_finished((void*)gccontext); return NULL; } sprintf(query, select_contexts, context->model); /* Start query... */ gccontext->results=PQexec(gccontext->handle, query); LIBRDF_FREE(char*, query); if (gccontext->results) { if (PQresultStatus(gccontext->results) != PGRES_TUPLES_OK) { librdf_log(gccontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql query failed: %s", PQresultErrorMessage(gccontext->results)); librdf_storage_postgresql_get_contexts_finished((void*)gccontext); return NULL; } } else { librdf_log(gccontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql query failed: %s", PQerrorMessage(gccontext->handle)); librdf_storage_postgresql_get_contexts_finished((void*)gccontext); return NULL; } gccontext->current_rowno=0; gccontext->row = LIBRDF_CALLOC(char**, LIBRDF_GOOD_CAST(size_t, PQnfields(gccontext->results) + 1), sizeof(char*)); if(!gccontext->row) { librdf_storage_postgresql_get_contexts_finished((void*)gccontext); return NULL; } /* Get first context, if any, and initialize iterator */ if(librdf_storage_postgresql_get_contexts_next_context(gccontext) || !gccontext->current_context) { librdf_storage_postgresql_get_contexts_finished((void*)gccontext); return librdf_new_empty_iterator(storage->world); } iterator=librdf_new_iterator(storage->world,(void*)gccontext, &librdf_storage_postgresql_get_contexts_end_of_iterator, &librdf_storage_postgresql_get_contexts_next_context, &librdf_storage_postgresql_get_contexts_get_context, &librdf_storage_postgresql_get_contexts_finished); if(!iterator) librdf_storage_postgresql_get_contexts_finished(gccontext); return iterator; } static int librdf_storage_postgresql_get_contexts_end_of_iterator(void* context) { librdf_storage_postgresql_get_contexts_context* gccontext=(librdf_storage_postgresql_get_contexts_context*)context; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(context, void, 1); return gccontext->current_context==NULL; } static int librdf_storage_postgresql_get_contexts_next_context(void* context) { librdf_storage_postgresql_get_contexts_context* gccontext=(librdf_storage_postgresql_get_contexts_context*)context; librdf_node *node; char **row=gccontext->row; int i; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(context, void, 1); if( gccontext->current_rowno < PQntuples(gccontext->results) ) { for(i=0;iresults);i++) { if(PQgetlength(gccontext->results,gccontext->current_rowno,i) > 0 ) { /* FIXME: why is this not copied? */ /* row[i] = LIBRDF_MALLOC(char*, PQgetlength(gccontext->results, gccontext->current_rowno, i) + 1) if(!row[i) return 1; strcpy(row[i], PQgetvalue(gccontext->results, gccontext->current_rowno,i)); */ row[i]=PQgetvalue(gccontext->results,gccontext->current_rowno,i); } else row[i]=NULL; } gccontext->current_rowno=gccontext->current_rowno+1; /* Free old context node, if allocated */ if(gccontext->current_context) librdf_free_node(gccontext->current_context); /* Resource, Bnode or Literal? */ if(row[0]) { if(!(node=librdf_new_node_from_uri_string(gccontext->storage->world, (const unsigned char*)row[0]))) return 1; } else if(row[1]) { if(!(node=librdf_new_node_from_blank_identifier(gccontext->storage->world, (const unsigned char*)row[1]))) return 1; } else if(row[2]) { /* Typed literal? */ librdf_uri *datatype=NULL; if(row[4] && strlen(row[4])) datatype=librdf_new_uri(gccontext->storage->world, (const unsigned char*)row[4]); if(!(node=librdf_new_node_from_typed_literal(gccontext->storage->world, (const unsigned char*)row[2], row[3], datatype))) return 1; } else return 1; gccontext->current_context=node; } else { if(gccontext->current_context) librdf_free_node(gccontext->current_context); gccontext->current_context=NULL; } return 0; } static void* librdf_storage_postgresql_get_contexts_get_context(void* context, int flags) { librdf_storage_postgresql_get_contexts_context* gccontext=(librdf_storage_postgresql_get_contexts_context*)context; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(context, void, NULL); return gccontext->current_context; } #if 0 /* FIXME: why is this not used ? */ static void librdf_storage_postgresql_free_gccontext_row(void* context) { librdf_storage_postgresql_get_contexts_context* gccontext=(librdf_storage_postgresql_get_contexts_context*)context; /* for(i=0;iresults);i++) if( gccontext->row[i] ) LIBRDF_FREE(char*, gccontext->row[i]); */ } #endif static void librdf_storage_postgresql_get_contexts_finished(void* context) { librdf_storage_postgresql_get_contexts_context* gccontext=(librdf_storage_postgresql_get_contexts_context*)context; LIBRDF_ASSERT_OBJECT_POINTER_RETURN(context, void); if( gccontext->row ) LIBRDF_FREE(char*, gccontext->row); if(gccontext->results) PQclear(gccontext->results); if(gccontext->handle) librdf_storage_postgresql_release_handle(gccontext->storage, gccontext->handle); if(gccontext->current_context) librdf_free_node(gccontext->current_context); if(gccontext->storage) librdf_storage_remove_reference(gccontext->storage); LIBRDF_FREE(librdf_storage_postgresql_get_contexts_context, gccontext); } /* * librdf_storage_postgresql_get_feature: * @storage: #librdf_storage object * @feature: #librdf_uri feature property * * INTERNAL - get the value of a storage feature * * Return value: #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ static librdf_node* librdf_storage_postgresql_get_feature(librdf_storage* storage, librdf_uri* feature) { unsigned char *uri_string; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(feature, librdf_uri, NULL); if(!feature) return NULL; uri_string=librdf_uri_as_string(feature); if(!uri_string) return NULL; if(!strcmp((const char*)uri_string, (const char*)LIBRDF_MODEL_FEATURE_CONTEXTS)) { /* Always have contexts */ static const unsigned char value[2]="1"; return librdf_new_node_from_typed_literal(storage->world, value, NULL, NULL); } return NULL; } /* * librdf_storage_postgresql_transaction_start: * @storage: the storage object * * INTERNAL - Start a transaction * * Return value: non-0 on failure **/ static int librdf_storage_postgresql_transaction_start(librdf_storage* storage) { librdf_storage_postgresql_instance *context=(librdf_storage_postgresql_instance*)storage->instance; const char query[]="START TRANSACTION"; int status = 1; PGresult *res; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); if(context->transaction_handle) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql transaction already started"); return status; } context->transaction_handle=librdf_storage_postgresql_get_handle(storage); if(!context->transaction_handle) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Failed to establish transaction handle"); return status; } res = PQexec(context->transaction_handle, query); if (res) { if (PQresultStatus(res) == PGRES_COMMAND_OK) { status = 0; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql query failed: %s", PQresultErrorMessage(res)); } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql query failed: %s", PQerrorMessage(context->transaction_handle)); } if (0 != status) { librdf_storage_postgresql_release_handle(storage, context->transaction_handle); context->transaction_handle=NULL; } return status; } /* * librdf_storage_postgresql_transaction_start_with_handle: * @storage: the storage object * @handle: the transaction object * * INTERNAL - Start a transaction using an existing external transaction object. * * Return value: non-0 on failure **/ static int librdf_storage_postgresql_transaction_start_with_handle(librdf_storage* storage, void* handle) { return librdf_storage_postgresql_transaction_start(storage); } /* * librdf_storage_postgresql_transaction_commit: * @storage: the storage object * * INTERNAL - Commit a transaction. * * Return value: non-0 on failure **/ static int librdf_storage_postgresql_transaction_commit(librdf_storage* storage) { librdf_storage_postgresql_instance *context=(librdf_storage_postgresql_instance*)storage->instance; const char query[]="COMMIT TRANSACTION"; int status = 1; PGresult *res; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); if(!context->transaction_handle) return status; res = PQexec(context->transaction_handle, query); if (res) { if (PQresultStatus(res) == PGRES_COMMAND_OK) { status = 0; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql commit query failed: %s", PQresultErrorMessage(res)); } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql commit query failed: %s", PQerrorMessage(context->transaction_handle)); } librdf_storage_postgresql_release_handle(storage, context->transaction_handle); context->transaction_handle=NULL; return status; } /* * librdf_storage_postgresql_transaction_rollback: * @storage: the storage object * * INTERNAL - Rollback a transaction. * * Return value: non-0 on failure **/ static int librdf_storage_postgresql_transaction_rollback(librdf_storage* storage) { librdf_storage_postgresql_instance *context=(librdf_storage_postgresql_instance*)storage->instance; const char query[]="ROLLBACK TRANSACTION"; int status = 1; PGresult *res; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); if(!context->transaction_handle) return status; res = PQexec(context->transaction_handle, query); if (res) { if (PQresultStatus(res) == PGRES_COMMAND_OK) { status = 0; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql commit query failed: %s", PQresultErrorMessage(res)); } PQclear(res); } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "postgresql commit query failed: %s", PQerrorMessage(context->transaction_handle)); } librdf_storage_postgresql_release_handle(storage, context->transaction_handle); context->transaction_handle=NULL; return status; } /* * librdf_storage_postgresql_transaction_get_handle: * @storage: the storage object * * INTERNAL - Get the current transaction handle. * * Return value: non-0 on success **/ static void* librdf_storage_postgresql_transaction_get_handle(librdf_storage* storage) { librdf_storage_postgresql_instance *context=(librdf_storage_postgresql_instance*)storage->instance; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); return context->transaction_handle; } /* local function to register postgresql storage functions */ static void librdf_storage_postgresql_register_factory(librdf_storage_factory *factory) { LIBRDF_ASSERT_CONDITION(!strcmp(factory->name, "postgresql")); factory->version = LIBRDF_STORAGE_INTERFACE_VERSION; factory->init = librdf_storage_postgresql_init; factory->terminate = librdf_storage_postgresql_terminate; factory->open = librdf_storage_postgresql_open; factory->close = librdf_storage_postgresql_close; factory->sync = librdf_storage_postgresql_sync; factory->size = librdf_storage_postgresql_size; factory->add_statement = librdf_storage_postgresql_add_statement; factory->add_statements = librdf_storage_postgresql_add_statements; factory->remove_statement = librdf_storage_postgresql_remove_statement; factory->contains_statement = librdf_storage_postgresql_contains_statement; factory->serialise = librdf_storage_postgresql_serialise; factory->find_statements = librdf_storage_postgresql_find_statements; factory->find_statements_with_options = librdf_storage_postgresql_find_statements_with_options; factory->context_add_statement = librdf_storage_postgresql_context_add_statement; factory->context_add_statements = librdf_storage_postgresql_context_add_statements; factory->context_remove_statement = librdf_storage_postgresql_context_remove_statement; factory->context_remove_statements = librdf_storage_postgresql_context_remove_statements; factory->context_serialise = librdf_storage_postgresql_context_serialise; factory->find_statements_in_context = librdf_storage_postgresql_find_statements_in_context; factory->get_contexts = librdf_storage_postgresql_get_contexts; factory->get_feature = librdf_storage_postgresql_get_feature; factory->transaction_start = librdf_storage_postgresql_transaction_start; factory->transaction_start_with_handle = librdf_storage_postgresql_transaction_start_with_handle; factory->transaction_commit = librdf_storage_postgresql_transaction_commit; factory->transaction_rollback = librdf_storage_postgresql_transaction_rollback; factory->transaction_get_handle = librdf_storage_postgresql_transaction_get_handle; } #ifdef MODULAR_LIBRDF /* Entry point for dynamically loaded storage module */ void librdf_storage_module_register_factory(librdf_world *world) { librdf_storage_register_factory(world, "postgresql", "PostgreSQL database store", &librdf_storage_postgresql_register_factory); } #else /* * librdf_init_storage_postgresql: * @world: world object * * INTERNAL - Initialise the built-in storage_postgresql module. */ void librdf_init_storage_postgresql(librdf_world *world) { librdf_storage_register_factory(world, "postgresql", "PostgreSQL database store", &librdf_storage_postgresql_register_factory); } #endif redland-1.0.17/src/Makefile.in0000644000175000017500000020243112257575714013007 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- Mode: Makefile -*- # # Makefile.am - top level automake file for Redland # # Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/ # Copyright (C) 2000-2006, University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @MEMCMP_TRUE@am__append_1 = memcmp.c @STORAGE_FILE_TRUE@am__append_2 = rdf_storage_file.c @MODULAR_LIBRDF_TRUE@@STORAGE_TSTORE_TRUE@am__append_3 = librdf_storage_tstore.la @MODULAR_LIBRDF_TRUE@@STORAGE_MYSQL_TRUE@am__append_4 = librdf_storage_mysql.la @MODULAR_LIBRDF_TRUE@@STORAGE_SQLITE_TRUE@am__append_5 = librdf_storage_sqlite.la @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@am__append_6 = librdf_storage_postgresql.la @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@am__append_7 = librdf_storage_virtuoso.la @MODULAR_LIBRDF_FALSE@@STORAGE_TSTORE_TRUE@am__append_8 = rdf_storage_tstore.c @MODULAR_LIBRDF_FALSE@@STORAGE_MYSQL_TRUE@am__append_9 = rdf_storage_mysql.c @MODULAR_LIBRDF_FALSE@@STORAGE_SQLITE_TRUE@am__append_10 = rdf_storage_sqlite.c @MODULAR_LIBRDF_FALSE@@STORAGE_POSTGRESQL_TRUE@am__append_11 = rdf_storage_postgresql.c @MODULAR_LIBRDF_FALSE@@STORAGE_VIRTUOSO_TRUE@am__append_12 = rdf_storage_virtuoso.c rdf_query_virtuoso.c rdf_storage_virtuoso_internal.h @STORAGE_MYSQL_TRUE@am__append_13 = mysql-v1.ttl mysql-v2.ttl @MODULAR_LIBRDF_TRUE@am__append_14 = -DREDLAND_MODULE_PATH="\""@REDLAND_MODULE_PATH@"\"" subdir = src DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/librdf.h.in $(srcdir)/rdf_config.h.in \ $(srcdir)/redland.spec.in $(srcdir)/win32_rdf_config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = rdf_config.h CONFIG_CLEAN_FILES = librdf.h redland.spec win32_rdf_config.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(plugindir)" \ "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(plugin_LTLIBRARIES) am__librdf_la_SOURCES_DIST = rdf_init.c rdf_raptor.c rdf_uri.c \ rdf_digest.c rdf_hash.c rdf_hash_cursor.c rdf_hash_memory.c \ rdf_model.c rdf_model_storage.c rdf_iterator.c rdf_concepts.c \ rdf_list.c rdf_storage.c rdf_storage_sql.c rdf_stream.c \ rdf_parser.c rdf_parser_raptor.c rdf_heuristics.c rdf_files.c \ rdf_utf8.c rdf_query.c rdf_query_results.c rdf_query_rasqal.c \ rdf_serializer.c rdf_serializer_raptor.c rdf_log.c \ rdf_node_common.c rdf_statement_common.c rdf_node.c \ rdf_statement.c redland.h rdf_internal.h rdf_init.h rdf_uri.h \ rdf_node.h rdf_statement.h rdf_concepts.h rdf_digest.h \ rdf_hash.h rdf_types.h rdf_model.h rdf_iterator.h rdf_list.h \ rdf_storage.h rdf_stream.h rdf_parser.h rdf_heuristics.h \ rdf_files.h rdf_utf8.h rdf_query.h rdf_serializer.h rdf_log.h \ rdf_concepts_internal.h rdf_digest_internal.h \ rdf_hash_internal.h rdf_init_internal.h \ rdf_iterator_internal.h rdf_list_internal.h rdf_log_internal.h \ rdf_model_internal.h rdf_node_internal.h rdf_parser_internal.h \ rdf_query_internal.h rdf_raptor_internal.h \ rdf_serializer_internal.h rdf_statement_internal.h \ rdf_storage_internal.h rdf_stream_internal.h \ rdf_uri_internal.h memcmp.c rdf_storage_list.c \ rdf_storage_hashes.c rdf_storage_trees.c rdf_storage_file.c \ rdf_storage_tstore.c rdf_storage_mysql.c rdf_storage_sqlite.c \ rdf_storage_postgresql.c rdf_storage_virtuoso.c \ rdf_query_virtuoso.c rdf_storage_virtuoso_internal.h @MEMCMP_TRUE@am__objects_1 = memcmp.lo @STORAGE_FILE_TRUE@am__objects_2 = rdf_storage_file.lo @MODULAR_LIBRDF_FALSE@@STORAGE_TSTORE_TRUE@am__objects_3 = rdf_storage_tstore.lo @MODULAR_LIBRDF_FALSE@@STORAGE_MYSQL_TRUE@am__objects_4 = rdf_storage_mysql.lo @MODULAR_LIBRDF_FALSE@@STORAGE_SQLITE_TRUE@am__objects_5 = rdf_storage_sqlite.lo @MODULAR_LIBRDF_FALSE@@STORAGE_POSTGRESQL_TRUE@am__objects_6 = rdf_storage_postgresql.lo @MODULAR_LIBRDF_FALSE@@STORAGE_VIRTUOSO_TRUE@am__objects_7 = rdf_storage_virtuoso.lo \ @MODULAR_LIBRDF_FALSE@@STORAGE_VIRTUOSO_TRUE@ rdf_query_virtuoso.lo am_librdf_la_OBJECTS = rdf_init.lo rdf_raptor.lo rdf_uri.lo \ rdf_digest.lo rdf_hash.lo rdf_hash_cursor.lo \ rdf_hash_memory.lo rdf_model.lo rdf_model_storage.lo \ rdf_iterator.lo rdf_concepts.lo rdf_list.lo rdf_storage.lo \ rdf_storage_sql.lo rdf_stream.lo rdf_parser.lo \ rdf_parser_raptor.lo rdf_heuristics.lo rdf_files.lo \ rdf_utf8.lo rdf_query.lo rdf_query_results.lo \ rdf_query_rasqal.lo rdf_serializer.lo rdf_serializer_raptor.lo \ rdf_log.lo rdf_node_common.lo rdf_statement_common.lo \ rdf_node.lo rdf_statement.lo $(am__objects_1) \ rdf_storage_list.lo rdf_storage_hashes.lo rdf_storage_trees.lo \ $(am__objects_2) $(am__objects_3) $(am__objects_4) \ $(am__objects_5) $(am__objects_6) $(am__objects_7) librdf_la_OBJECTS = $(am_librdf_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent librdf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(librdf_la_LDFLAGS) $(LDFLAGS) -o $@ @MODULAR_LIBRDF_TRUE@@STORAGE_MYSQL_TRUE@librdf_storage_mysql_la_DEPENDENCIES = \ @MODULAR_LIBRDF_TRUE@@STORAGE_MYSQL_TRUE@ librdf.la am__librdf_storage_mysql_la_SOURCES_DIST = rdf_storage_mysql.c @MODULAR_LIBRDF_TRUE@@STORAGE_MYSQL_TRUE@am_librdf_storage_mysql_la_OBJECTS = librdf_storage_mysql_la-rdf_storage_mysql.lo librdf_storage_mysql_la_OBJECTS = \ $(am_librdf_storage_mysql_la_OBJECTS) librdf_storage_mysql_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(librdf_storage_mysql_la_LDFLAGS) \ $(LDFLAGS) -o $@ @MODULAR_LIBRDF_TRUE@@STORAGE_MYSQL_TRUE@am_librdf_storage_mysql_la_rpath = \ @MODULAR_LIBRDF_TRUE@@STORAGE_MYSQL_TRUE@ -rpath $(plugindir) @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@librdf_storage_postgresql_la_DEPENDENCIES = \ @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@ librdf.la am__librdf_storage_postgresql_la_SOURCES_DIST = \ rdf_storage_postgresql.c @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@am_librdf_storage_postgresql_la_OBJECTS = librdf_storage_postgresql_la-rdf_storage_postgresql.lo librdf_storage_postgresql_la_OBJECTS = \ $(am_librdf_storage_postgresql_la_OBJECTS) librdf_storage_postgresql_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(librdf_storage_postgresql_la_LDFLAGS) \ $(LDFLAGS) -o $@ @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@am_librdf_storage_postgresql_la_rpath = \ @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@ -rpath \ @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@ $(plugindir) @MODULAR_LIBRDF_TRUE@@STORAGE_SQLITE_TRUE@librdf_storage_sqlite_la_DEPENDENCIES = \ @MODULAR_LIBRDF_TRUE@@STORAGE_SQLITE_TRUE@ librdf.la am__librdf_storage_sqlite_la_SOURCES_DIST = rdf_storage_sqlite.c @MODULAR_LIBRDF_TRUE@@STORAGE_SQLITE_TRUE@am_librdf_storage_sqlite_la_OBJECTS = librdf_storage_sqlite_la-rdf_storage_sqlite.lo librdf_storage_sqlite_la_OBJECTS = \ $(am_librdf_storage_sqlite_la_OBJECTS) librdf_storage_sqlite_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(librdf_storage_sqlite_la_LDFLAGS) \ $(LDFLAGS) -o $@ @MODULAR_LIBRDF_TRUE@@STORAGE_SQLITE_TRUE@am_librdf_storage_sqlite_la_rpath = \ @MODULAR_LIBRDF_TRUE@@STORAGE_SQLITE_TRUE@ -rpath $(plugindir) @MODULAR_LIBRDF_TRUE@@STORAGE_TSTORE_TRUE@librdf_storage_tstore_la_DEPENDENCIES = \ @MODULAR_LIBRDF_TRUE@@STORAGE_TSTORE_TRUE@ librdf.la am__librdf_storage_tstore_la_SOURCES_DIST = rdf_storage_tstore.c @MODULAR_LIBRDF_TRUE@@STORAGE_TSTORE_TRUE@am_librdf_storage_tstore_la_OBJECTS = librdf_storage_tstore_la-rdf_storage_tstore.lo librdf_storage_tstore_la_OBJECTS = \ $(am_librdf_storage_tstore_la_OBJECTS) librdf_storage_tstore_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(librdf_storage_tstore_la_LDFLAGS) \ $(LDFLAGS) -o $@ @MODULAR_LIBRDF_TRUE@@STORAGE_TSTORE_TRUE@am_librdf_storage_tstore_la_rpath = \ @MODULAR_LIBRDF_TRUE@@STORAGE_TSTORE_TRUE@ -rpath $(plugindir) @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@librdf_storage_virtuoso_la_DEPENDENCIES = \ @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@ librdf.la am__librdf_storage_virtuoso_la_SOURCES_DIST = rdf_storage_virtuoso.c \ rdf_query_virtuoso.c rdf_storage_virtuoso_internal.h @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@am_librdf_storage_virtuoso_la_OBJECTS = librdf_storage_virtuoso_la-rdf_storage_virtuoso.lo \ @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@ librdf_storage_virtuoso_la-rdf_query_virtuoso.lo librdf_storage_virtuoso_la_OBJECTS = \ $(am_librdf_storage_virtuoso_la_OBJECTS) librdf_storage_virtuoso_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(librdf_storage_virtuoso_la_LDFLAGS) \ $(LDFLAGS) -o $@ @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@am_librdf_storage_virtuoso_la_rpath = \ @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@ -rpath \ @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@ $(plugindir) am_rdf_storage_sql_test_OBJECTS = rdf_storage_sql_test.$(OBJEXT) rdf_storage_sql_test_OBJECTS = $(am_rdf_storage_sql_test_OBJECTS) rdf_storage_sql_test_DEPENDENCIES = librdf.la DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(librdf_la_SOURCES) $(EXTRA_librdf_la_SOURCES) \ $(librdf_storage_mysql_la_SOURCES) \ $(librdf_storage_postgresql_la_SOURCES) \ $(librdf_storage_sqlite_la_SOURCES) \ $(librdf_storage_tstore_la_SOURCES) \ $(librdf_storage_virtuoso_la_SOURCES) \ $(rdf_storage_sql_test_SOURCES) DIST_SOURCES = $(am__librdf_la_SOURCES_DIST) \ $(EXTRA_librdf_la_SOURCES) \ $(am__librdf_storage_mysql_la_SOURCES_DIST) \ $(am__librdf_storage_postgresql_la_SOURCES_DIST) \ $(am__librdf_storage_sqlite_la_SOURCES_DIST) \ $(am__librdf_storage_tstore_la_SOURCES_DIST) \ $(am__librdf_storage_virtuoso_la_SOURCES_DIST) \ $(rdf_storage_sql_test_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgdata_DATA) HEADERS = $(include_HEADERS) $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ # Why is this not in the default makefile? CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIGEST_OBJS = @DIGEST_OBJS@ DIGEST_SRCS = @DIGEST_SRCS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HASH_OBJS = @HASH_OBJS@ HASH_SRCS = @HASH_SRCS@ HAVE_RAPTOR2_API = @HAVE_RAPTOR2_API@ HTML_DIR = @HTML_DIR@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IODBC_CONFIG = @IODBC_CONFIG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBRDF_CPPFLAGS = @LIBRDF_CPPFLAGS@ LIBRDF_DIRECT_LIBS = @LIBRDF_DIRECT_LIBS@ LIBRDF_EXTERNAL_CPPFLAGS = @LIBRDF_EXTERNAL_CPPFLAGS@ LIBRDF_EXTERNAL_LIBS = @LIBRDF_EXTERNAL_LIBS@ LIBRDF_INTERNAL_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ LIBRDF_INTERNAL_DEPS = @LIBRDF_INTERNAL_DEPS@ LIBRDF_INTERNAL_LIBS = @LIBRDF_INTERNAL_LIBS@ LIBRDF_LDFLAGS = @LIBRDF_LDFLAGS@ LIBRDF_LIBTOOLLIBS = @LIBRDF_LIBTOOLLIBS@ LIBRDF_LIBTOOL_VERSION = @LIBRDF_LIBTOOL_VERSION@ LIBRDF_PKGCONFIG_PRIVATE_LIBS = @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ LIBRDF_VERSION_DECIMAL = @LIBRDF_VERSION_DECIMAL@ LIBRDF_VERSION_MAJOR = @LIBRDF_VERSION_MAJOR@ LIBRDF_VERSION_MINOR = @LIBRDF_VERSION_MINOR@ LIBRDF_VERSION_RELEASE = @LIBRDF_VERSION_RELEASE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEM = @MEM@ MEM_LIBS = @MEM_LIBS@ MKDIR_P = @MKDIR_P@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ODBC_CFLAGS = @ODBC_CFLAGS@ ODBC_LIBS = @ODBC_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSTGRESQL_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ POSTGRESQL_LIBS = @POSTGRESQL_LIBS@ RANLIB = @RANLIB@ RAPTOR2_CFLAGS = @RAPTOR2_CFLAGS@ RAPTOR2_LIBS = @RAPTOR2_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ RASQAL_CFLAGS = @RASQAL_CFLAGS@ RASQAL_LIBS = @RASQAL_LIBS@ RASQAL_MAX_VERSION = @RASQAL_MAX_VERSION@ RASQAL_MIN_VERSION = @RASQAL_MIN_VERSION@ RECHO = @RECHO@ RECHO_C = @RECHO_C@ RECHO_N = @RECHO_N@ REDLAND_MODULE_PATH = @REDLAND_MODULE_PATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ # Use tar, whatever it is called (better be GNU tar though) TAR = @TAR@ TSTORE_CONFIG = @TSTORE_CONFIG@ TSTORE_CPPFLAGS = @TSTORE_CPPFLAGS@ TSTORE_LIBS = @TSTORE_LIBS@ VERSION = @VERSION@ VIRTUOSO_CPPFLAGS = @VIRTUOSO_CPPFLAGS@ VIRTUOSO_LIBS = @VIRTUOSO_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = win32 lib_LTLIBRARIES = librdf.la include_HEADERS = redland.h librdf.h \ rdf_init.h \ rdf_raptor.h \ rdf_uri.h rdf_node.h rdf_statement.h rdf_concepts.h \ rdf_model.h \ rdf_iterator.h \ rdf_storage.h \ rdf_storage_module.h \ rdf_stream.h \ rdf_parser.h \ rdf_utf8.h \ rdf_query.h \ rdf_serializer.h \ rdf_log.h \ rdf_digest.h \ rdf_hash.h \ rdf_list.h noinst_HEADERS = win32_rdf_config.h # Storages always built-in librdf_la_SOURCES = rdf_init.c rdf_raptor.c rdf_uri.c rdf_digest.c \ rdf_hash.c rdf_hash_cursor.c rdf_hash_memory.c rdf_model.c \ rdf_model_storage.c rdf_iterator.c rdf_concepts.c rdf_list.c \ rdf_storage.c rdf_storage_sql.c rdf_stream.c rdf_parser.c \ rdf_parser_raptor.c rdf_heuristics.c rdf_files.c rdf_utf8.c \ rdf_query.c rdf_query_results.c rdf_query_rasqal.c \ rdf_serializer.c rdf_serializer_raptor.c rdf_log.c \ rdf_node_common.c rdf_statement_common.c rdf_node.c \ rdf_statement.c redland.h rdf_internal.h rdf_init.h rdf_uri.h \ rdf_node.h rdf_statement.h rdf_concepts.h rdf_digest.h \ rdf_hash.h rdf_types.h rdf_model.h rdf_iterator.h rdf_list.h \ rdf_storage.h rdf_stream.h rdf_parser.h rdf_heuristics.h \ rdf_files.h rdf_utf8.h rdf_query.h rdf_serializer.h rdf_log.h \ rdf_concepts_internal.h rdf_digest_internal.h \ rdf_hash_internal.h rdf_init_internal.h \ rdf_iterator_internal.h rdf_list_internal.h rdf_log_internal.h \ rdf_model_internal.h rdf_node_internal.h rdf_parser_internal.h \ rdf_query_internal.h rdf_raptor_internal.h \ rdf_serializer_internal.h rdf_statement_internal.h \ rdf_storage_internal.h rdf_stream_internal.h \ rdf_uri_internal.h $(am__append_1) rdf_storage_list.c \ rdf_storage_hashes.c rdf_storage_trees.c $(am__append_2) \ $(am__append_8) $(am__append_9) $(am__append_10) \ $(am__append_11) $(am__append_12) plugindir = $(libdir)/redland @MODULAR_LIBRDF_TRUE@plugin_LTLIBRARIES = $(am__append_3) \ @MODULAR_LIBRDF_TRUE@ $(am__append_4) $(am__append_5) \ @MODULAR_LIBRDF_TRUE@ $(am__append_6) $(am__append_7) @MODULAR_LIBRDF_TRUE@@STORAGE_TSTORE_TRUE@librdf_storage_tstore_la_SOURCES = rdf_storage_tstore.c @MODULAR_LIBRDF_TRUE@@STORAGE_TSTORE_TRUE@librdf_storage_tstore_la_CPPFLAGS = @TSTORE_CPPFLAGS@ @MODULAR_LIBRDF_TRUE@@STORAGE_TSTORE_TRUE@librdf_storage_tstore_la_LIBADD = @TSTORE_LIBS@ librdf.la @MODULAR_LIBRDF_TRUE@@STORAGE_TSTORE_TRUE@librdf_storage_tstore_la_LDFLAGS = -module -avoid-version @MODULAR_LIBRDF_TRUE@@STORAGE_MYSQL_TRUE@librdf_storage_mysql_la_SOURCES = rdf_storage_mysql.c @MODULAR_LIBRDF_TRUE@@STORAGE_MYSQL_TRUE@librdf_storage_mysql_la_CPPFLAGS = @MYSQL_CPPFLAGS@ @MODULAR_LIBRDF_TRUE@@STORAGE_MYSQL_TRUE@librdf_storage_mysql_la_LIBADD = @MYSQL_LIBS@ librdf.la @MODULAR_LIBRDF_TRUE@@STORAGE_MYSQL_TRUE@librdf_storage_mysql_la_LDFLAGS = -module -avoid-version @MODULAR_LIBRDF_TRUE@@STORAGE_SQLITE_TRUE@librdf_storage_sqlite_la_SOURCES = rdf_storage_sqlite.c # This extra substitution is to ensure general -I paths appear before # ones for SQLITE headers. There is no other way to adjust the # automake-generated rule to ensure this. @MODULAR_LIBRDF_TRUE@@STORAGE_SQLITE_TRUE@librdf_storage_sqlite_la_CPPFLAGS = $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @SQLITE_CFLAGS@ @MODULAR_LIBRDF_TRUE@@STORAGE_SQLITE_TRUE@librdf_storage_sqlite_la_LIBADD = @SQLITE_LIBS@ librdf.la @MODULAR_LIBRDF_TRUE@@STORAGE_SQLITE_TRUE@librdf_storage_sqlite_la_LDFLAGS = -module -avoid-version @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@librdf_storage_postgresql_la_SOURCES = rdf_storage_postgresql.c @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@librdf_storage_postgresql_la_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@librdf_storage_postgresql_la_LIBADD = @POSTGRESQL_LIBS@ librdf.la @MODULAR_LIBRDF_TRUE@@STORAGE_POSTGRESQL_TRUE@librdf_storage_postgresql_la_LDFLAGS = -module -avoid-version @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@librdf_storage_virtuoso_la_SOURCES = rdf_storage_virtuoso.c rdf_query_virtuoso.c rdf_storage_virtuoso_internal.h @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@librdf_storage_virtuoso_la_CPPFLAGS = @ODBC_CFLAGS@ @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@librdf_storage_virtuoso_la_LIBADD = @ODBC_LIBS@ librdf.la -lrasqal @MODULAR_LIBRDF_TRUE@@STORAGE_VIRTUOSO_TRUE@librdf_storage_virtuoso_la_LDFLAGS = -module -avoid-version librdf_la_LIBADD = \ @LTLIBOBJS@ @DIGEST_OBJS@ @HASH_OBJS@ \ @LIBRDF_INTERNAL_LIBS@ librdf_la_DEPENDENCIES = \ @DIGEST_OBJS@ @HASH_OBJS@ \ @LIBRDF_INTERNAL_DEPS@ EXTRA_librdf_la_SOURCES = rdf_hash_bdb.c \ rdf_digest_md5.c rdf_digest_sha1.c \ rdf_parser_raptor.c EXTRA_DIST = redland.spec redland.spec.in mysql-v1.ttl mysql-v2.ttl librdf_la_LDFLAGS = -version-info @LIBRDF_LIBTOOL_VERSION@ \ @LIBRDF_LDFLAGS@ @LIBRDF_EXTERNAL_LIBS@ pkgdata_DATA = $(am__append_13) local_tests = rdf_storage_sql_test$(EXEEXT) EXTRA_PROGRAMS = $(local_tests) TESTS = rdf_node_test rdf_digest_test rdf_hash_test rdf_uri_test \ rdf_statement_test rdf_model_test rdf_storage_test rdf_parser_test \ rdf_files_test rdf_heuristics_test rdf_utf8_test rdf_concepts_test \ rdf_query_test rdf_serializer_test rdf_stream_test rdf_iterator_test \ rdf_init_test # Set the place to find storage modules for testing TESTS_ENVIRONMENT = REDLAND_MODULE_PATH=$(abs_builddir)/.libs CLEANFILES = $(TESTS) $(local_tests) test test*.db test.rdf *.plist AM_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ @LIBRDF_CPPFLAGS@ \ @LIBRDF_EXTERNAL_CPPFLAGS@ -DPKGDATADIR="\"$(pkgdatadir)\"" AM_CFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ @LIBRDF_CPPFLAGS@ \ @LIBRDF_EXTERNAL_CPPFLAGS@ $(am__append_14) ANALYZE = clang ANALYZE_FLAGS = "--analyze" # Based on COMPILE target ANALYZE_COMMAND = $(ANALYZE) \ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ $(ANALYZE_FLAGS) LOCAL_LIB_DIR = lib rdf_storage_sql_test_SOURCES = rdf_storage_sql_test.c rdf_storage_sql_test_LDADD = librdf.la # rule for building tests in one step COMPILE_LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ all: rdf_config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): rdf_config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/rdf_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/rdf_config.h $(srcdir)/rdf_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f rdf_config.h stamp-h1 librdf.h: $(top_builddir)/config.status $(srcdir)/librdf.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ redland.spec: $(top_builddir)/config.status $(srcdir)/redland.spec.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ win32_rdf_config.h: $(top_builddir)/config.status $(srcdir)/win32_rdf_config.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ } uninstall-pluginLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ done clean-pluginLTLIBRARIES: -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done librdf.la: $(librdf_la_OBJECTS) $(librdf_la_DEPENDENCIES) $(EXTRA_librdf_la_DEPENDENCIES) $(AM_V_CCLD)$(librdf_la_LINK) -rpath $(libdir) $(librdf_la_OBJECTS) $(librdf_la_LIBADD) $(LIBS) librdf_storage_mysql.la: $(librdf_storage_mysql_la_OBJECTS) $(librdf_storage_mysql_la_DEPENDENCIES) $(EXTRA_librdf_storage_mysql_la_DEPENDENCIES) $(AM_V_CCLD)$(librdf_storage_mysql_la_LINK) $(am_librdf_storage_mysql_la_rpath) $(librdf_storage_mysql_la_OBJECTS) $(librdf_storage_mysql_la_LIBADD) $(LIBS) librdf_storage_postgresql.la: $(librdf_storage_postgresql_la_OBJECTS) $(librdf_storage_postgresql_la_DEPENDENCIES) $(EXTRA_librdf_storage_postgresql_la_DEPENDENCIES) $(AM_V_CCLD)$(librdf_storage_postgresql_la_LINK) $(am_librdf_storage_postgresql_la_rpath) $(librdf_storage_postgresql_la_OBJECTS) $(librdf_storage_postgresql_la_LIBADD) $(LIBS) librdf_storage_sqlite.la: $(librdf_storage_sqlite_la_OBJECTS) $(librdf_storage_sqlite_la_DEPENDENCIES) $(EXTRA_librdf_storage_sqlite_la_DEPENDENCIES) $(AM_V_CCLD)$(librdf_storage_sqlite_la_LINK) $(am_librdf_storage_sqlite_la_rpath) $(librdf_storage_sqlite_la_OBJECTS) $(librdf_storage_sqlite_la_LIBADD) $(LIBS) librdf_storage_tstore.la: $(librdf_storage_tstore_la_OBJECTS) $(librdf_storage_tstore_la_DEPENDENCIES) $(EXTRA_librdf_storage_tstore_la_DEPENDENCIES) $(AM_V_CCLD)$(librdf_storage_tstore_la_LINK) $(am_librdf_storage_tstore_la_rpath) $(librdf_storage_tstore_la_OBJECTS) $(librdf_storage_tstore_la_LIBADD) $(LIBS) librdf_storage_virtuoso.la: $(librdf_storage_virtuoso_la_OBJECTS) $(librdf_storage_virtuoso_la_DEPENDENCIES) $(EXTRA_librdf_storage_virtuoso_la_DEPENDENCIES) $(AM_V_CCLD)$(librdf_storage_virtuoso_la_LINK) $(am_librdf_storage_virtuoso_la_rpath) $(librdf_storage_virtuoso_la_OBJECTS) $(librdf_storage_virtuoso_la_LIBADD) $(LIBS) rdf_storage_sql_test$(EXEEXT): $(rdf_storage_sql_test_OBJECTS) $(rdf_storage_sql_test_DEPENDENCIES) $(EXTRA_rdf_storage_sql_test_DEPENDENCIES) @rm -f rdf_storage_sql_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rdf_storage_sql_test_OBJECTS) $(rdf_storage_sql_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librdf_storage_mysql_la-rdf_storage_mysql.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librdf_storage_postgresql_la-rdf_storage_postgresql.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librdf_storage_sqlite_la-rdf_storage_sqlite.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librdf_storage_tstore_la-rdf_storage_tstore.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librdf_storage_virtuoso_la-rdf_query_virtuoso.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librdf_storage_virtuoso_la-rdf_storage_virtuoso.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_concepts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_digest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_digest_md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_digest_sha1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_files.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_hash_bdb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_hash_cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_hash_memory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_heuristics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_iterator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_model.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_model_storage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_node.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_node_common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_parser_raptor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_query.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_query_rasqal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_query_results.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_query_virtuoso.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_raptor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_serializer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_serializer_raptor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_statement.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_statement_common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_hashes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_mysql.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_postgresql.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_sql.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_sql_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_sqlite.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_trees.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_tstore.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_storage_virtuoso.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_uri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf_utf8.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< librdf_storage_mysql_la-rdf_storage_mysql.lo: rdf_storage_mysql.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_mysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librdf_storage_mysql_la-rdf_storage_mysql.lo -MD -MP -MF $(DEPDIR)/librdf_storage_mysql_la-rdf_storage_mysql.Tpo -c -o librdf_storage_mysql_la-rdf_storage_mysql.lo `test -f 'rdf_storage_mysql.c' || echo '$(srcdir)/'`rdf_storage_mysql.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librdf_storage_mysql_la-rdf_storage_mysql.Tpo $(DEPDIR)/librdf_storage_mysql_la-rdf_storage_mysql.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rdf_storage_mysql.c' object='librdf_storage_mysql_la-rdf_storage_mysql.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_mysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librdf_storage_mysql_la-rdf_storage_mysql.lo `test -f 'rdf_storage_mysql.c' || echo '$(srcdir)/'`rdf_storage_mysql.c librdf_storage_postgresql_la-rdf_storage_postgresql.lo: rdf_storage_postgresql.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_postgresql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librdf_storage_postgresql_la-rdf_storage_postgresql.lo -MD -MP -MF $(DEPDIR)/librdf_storage_postgresql_la-rdf_storage_postgresql.Tpo -c -o librdf_storage_postgresql_la-rdf_storage_postgresql.lo `test -f 'rdf_storage_postgresql.c' || echo '$(srcdir)/'`rdf_storage_postgresql.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librdf_storage_postgresql_la-rdf_storage_postgresql.Tpo $(DEPDIR)/librdf_storage_postgresql_la-rdf_storage_postgresql.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rdf_storage_postgresql.c' object='librdf_storage_postgresql_la-rdf_storage_postgresql.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_postgresql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librdf_storage_postgresql_la-rdf_storage_postgresql.lo `test -f 'rdf_storage_postgresql.c' || echo '$(srcdir)/'`rdf_storage_postgresql.c librdf_storage_sqlite_la-rdf_storage_sqlite.lo: rdf_storage_sqlite.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_sqlite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librdf_storage_sqlite_la-rdf_storage_sqlite.lo -MD -MP -MF $(DEPDIR)/librdf_storage_sqlite_la-rdf_storage_sqlite.Tpo -c -o librdf_storage_sqlite_la-rdf_storage_sqlite.lo `test -f 'rdf_storage_sqlite.c' || echo '$(srcdir)/'`rdf_storage_sqlite.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librdf_storage_sqlite_la-rdf_storage_sqlite.Tpo $(DEPDIR)/librdf_storage_sqlite_la-rdf_storage_sqlite.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rdf_storage_sqlite.c' object='librdf_storage_sqlite_la-rdf_storage_sqlite.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_sqlite_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librdf_storage_sqlite_la-rdf_storage_sqlite.lo `test -f 'rdf_storage_sqlite.c' || echo '$(srcdir)/'`rdf_storage_sqlite.c librdf_storage_tstore_la-rdf_storage_tstore.lo: rdf_storage_tstore.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_tstore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librdf_storage_tstore_la-rdf_storage_tstore.lo -MD -MP -MF $(DEPDIR)/librdf_storage_tstore_la-rdf_storage_tstore.Tpo -c -o librdf_storage_tstore_la-rdf_storage_tstore.lo `test -f 'rdf_storage_tstore.c' || echo '$(srcdir)/'`rdf_storage_tstore.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librdf_storage_tstore_la-rdf_storage_tstore.Tpo $(DEPDIR)/librdf_storage_tstore_la-rdf_storage_tstore.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rdf_storage_tstore.c' object='librdf_storage_tstore_la-rdf_storage_tstore.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_tstore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librdf_storage_tstore_la-rdf_storage_tstore.lo `test -f 'rdf_storage_tstore.c' || echo '$(srcdir)/'`rdf_storage_tstore.c librdf_storage_virtuoso_la-rdf_storage_virtuoso.lo: rdf_storage_virtuoso.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_virtuoso_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librdf_storage_virtuoso_la-rdf_storage_virtuoso.lo -MD -MP -MF $(DEPDIR)/librdf_storage_virtuoso_la-rdf_storage_virtuoso.Tpo -c -o librdf_storage_virtuoso_la-rdf_storage_virtuoso.lo `test -f 'rdf_storage_virtuoso.c' || echo '$(srcdir)/'`rdf_storage_virtuoso.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librdf_storage_virtuoso_la-rdf_storage_virtuoso.Tpo $(DEPDIR)/librdf_storage_virtuoso_la-rdf_storage_virtuoso.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rdf_storage_virtuoso.c' object='librdf_storage_virtuoso_la-rdf_storage_virtuoso.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_virtuoso_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librdf_storage_virtuoso_la-rdf_storage_virtuoso.lo `test -f 'rdf_storage_virtuoso.c' || echo '$(srcdir)/'`rdf_storage_virtuoso.c librdf_storage_virtuoso_la-rdf_query_virtuoso.lo: rdf_query_virtuoso.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_virtuoso_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librdf_storage_virtuoso_la-rdf_query_virtuoso.lo -MD -MP -MF $(DEPDIR)/librdf_storage_virtuoso_la-rdf_query_virtuoso.Tpo -c -o librdf_storage_virtuoso_la-rdf_query_virtuoso.lo `test -f 'rdf_query_virtuoso.c' || echo '$(srcdir)/'`rdf_query_virtuoso.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librdf_storage_virtuoso_la-rdf_query_virtuoso.Tpo $(DEPDIR)/librdf_storage_virtuoso_la-rdf_query_virtuoso.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rdf_query_virtuoso.c' object='librdf_storage_virtuoso_la-rdf_query_virtuoso.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdf_storage_virtuoso_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librdf_storage_virtuoso_la-rdf_query_virtuoso.lo `test -f 'rdf_query_virtuoso.c' || echo '$(srcdir)/'`rdf_query_virtuoso.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) rdf_config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) rdf_config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) rdf_config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) rdf_config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local check: check-recursive all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) rdf_config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-pluginLTLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-includeHEADERS install-pkgdataDATA \ install-pluginLTLIBRARIES install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgdataDATA uninstall-pluginLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check-am \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-TESTS check-am check-local clean \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-pluginLTLIBRARIES ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkgdataDATA install-pluginLTLIBRARIES install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgdataDATA uninstall-pluginLTLIBRARIES # Rules to construct test programs check-local: $(local_tests) run-local-tests run-local-tests: rdf_storage_sql_test$(EXEEXT) @tests="rdf_storage_sql_test"; \ status=0; \ for tst in $$tests; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(top_srcdir)/"; fi; \ if $${dir}$$tst $(srcdir); then \ echo "PASS: $$tst"; \ else \ echo "FAIL: $$tst"; \ status=1; \ break; \ fi; \ done; \ exit $$status # Some people need a little help ;-) test: check rdf_node_test: rdf_node.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_node.c librdf.la rdf_digest_test: rdf_digest.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_digest.c librdf.la rdf_hash_test: rdf_hash.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_hash.c librdf.la rdf_uri_test: rdf_uri.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_uri.c librdf.la rdf_statement_test: rdf_statement.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_statement.c @LIBRDF_DIRECT_LIBS@ librdf.la rdf_model_test: rdf_model.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_model.c @LIBRDF_DIRECT_LIBS@ librdf.la rdf_storage_test: rdf_storage.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_storage.c librdf.la rdf_parser_test: rdf_parser.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_parser.c @LIBRDF_DIRECT_LIBS@ librdf.la rdf_files_test: rdf_files.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_files.c librdf.la rdf_heuristics_test: rdf_heuristics.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_heuristics.c librdf.la rdf_utf8_test: rdf_utf8.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_utf8.c librdf.la rdf_concepts_test: rdf_concepts.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_concepts.c librdf.la rdf_query_test: rdf_query.c rdf_query_results.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_query.c $(srcdir)/rdf_query_results.c @LIBRDF_DIRECT_LIBS@ librdf.la rdf_serializer_test: rdf_serializer.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_serializer.c librdf.la rdf_stream_test: rdf_stream.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_stream.c librdf.la rdf_iterator_test: rdf_iterator.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_iterator.c librdf.la rdf_init_test: rdf_init.c librdf.la $(COMPILE_LINK) -DSTANDALONE $(srcdir)/rdf_init.c @LIBRDF_DIRECT_LIBS@ librdf.la @SET_MAKE@ ${top_build_prefix}libltdl/libltdlc.la: cd ${top_build_prefix}libltdl && $(MAKE) libltdlc.la # Run Clang static analyzer over sources. @MAINTAINER_MODE_TRUE@analyze: $(SOURCES) @MAINTAINER_MODE_TRUE@ @list='$(SOURCES)'; \ @MAINTAINER_MODE_TRUE@ result=0; \ @MAINTAINER_MODE_TRUE@ for file in $$list; do \ @MAINTAINER_MODE_TRUE@ if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ @MAINTAINER_MODE_TRUE@ $(RECHO) "Analyzing $$file"; \ @MAINTAINER_MODE_TRUE@ $(ANALYZE_COMMAND) $(srcdir)/$$file; \ @MAINTAINER_MODE_TRUE@ status=$$?; \ @MAINTAINER_MODE_TRUE@ if test $$status != 0; then \ @MAINTAINER_MODE_TRUE@ result=1; \ @MAINTAINER_MODE_TRUE@ fi; \ @MAINTAINER_MODE_TRUE@ fi; \ @MAINTAINER_MODE_TRUE@ done; \ @MAINTAINER_MODE_TRUE@ set -e; exit $$result # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: redland-1.0.17/src/rdf_storage_internal.h0000644000175000017500000000644611245142544015301 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_internal.h - Internal RDF Storage definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_STORAGE_INTERNAL_H #define LIBRDF_STORAGE_INTERNAL_H #include "rdf_storage_module.h" #ifdef __cplusplus extern "C" { #endif /** A storage object */ struct librdf_storage_s { librdf_world *world; /* usage count of this instance * Used by other redland classes such as model, iterator, stream * via librdf_storage_add_reference librdf_storage_remove_reference * The usage count of storage after construction is 1. */ int usage; librdf_model *model; void *instance; int index_contexts; struct librdf_storage_factory_s* factory; }; void librdf_init_storage_list(librdf_world *world); void librdf_init_storage_hashes(librdf_world *world); void librdf_init_storage_trees(librdf_world *world); void librdf_init_storage_file(librdf_world *world); #ifdef STORAGE_MYSQL void librdf_init_storage_mysql(librdf_world *world); #endif #ifdef STORAGE_VIRTUOSO void librdf_init_storage_virtuoso(librdf_world *world); #endif #ifdef STORAGE_POSTGRESQL void librdf_init_storage_postgresql(librdf_world *world); #endif #ifdef STORAGE_TSTORE void librdf_init_storage_tstore(librdf_world *world); #endif #ifdef STORAGE_SQLITE void librdf_init_storage_sqlite(librdf_world *world); #endif /* module init */ void librdf_init_storage(librdf_world *world); /* module terminate */ void librdf_finish_storage(librdf_world *world); /* class methods */ librdf_storage_factory* librdf_get_storage_factory(librdf_world* world, const char *name); /* rdf_storage_sql.c */ typedef struct { char* filename; const char** predicate_uri_strings; int predicates_count; /* array of char* with NULL at end - size predicates_count */ char** values; } librdf_sql_config; librdf_sql_config* librdf_new_sql_config(librdf_world* world, const char *storage_name, const char* layout, const char* config_dir, const char** predicate_uri_strings); librdf_sql_config* librdf_new_sql_config_for_storage(librdf_storage* storage, const char* layout, const char* dir); void librdf_free_sql_config(librdf_sql_config* config); typedef enum { DBCONFIG_CREATE_TABLE_STATEMENTS, DBCONFIG_CREATE_TABLE_LITERALS, DBCONFIG_CREATE_TABLE_RESOURCES, DBCONFIG_CREATE_TABLE_BNODES, DBCONFIG_CREATE_TABLE_MODELS, DBCONFIG_CREATE_TABLE_LAST = DBCONFIG_CREATE_TABLE_MODELS } librdf_dbconfig; extern const char* librdf_storage_sql_dbconfig_predicates[DBCONFIG_CREATE_TABLE_LAST+2]; #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_storage_file.c0000644000175000017500000003036311772502107014372 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_file.c - RDF Storage in a file, using an in-memory store * * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include #include typedef struct { librdf_model* model; librdf_storage* storage; int changed; /* 'uri' factory only */ librdf_uri* uri; /* 'file' factory only */ size_t name_len; char *name; /* serializing format ('file' factory only) */ char *format_name; } librdf_storage_file_instance; /* prototypes for local functions */ static int librdf_storage_file_init(librdf_storage* storage, const char *name, librdf_hash* options); static int librdf_storage_file_open(librdf_storage* storage, librdf_model* model); static int librdf_storage_file_close(librdf_storage* storage); static int librdf_storage_file_size(librdf_storage* storage); static int librdf_storage_file_add_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_file_add_statements(librdf_storage* storage, librdf_stream* statement_stream); static int librdf_storage_file_remove_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_file_contains_statement(librdf_storage* storage, librdf_statement* statement); static librdf_stream* librdf_storage_file_serialise(librdf_storage* storage); static librdf_stream* librdf_storage_file_find_statements(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_file_sync(librdf_storage *storage); static void librdf_storage_file_register_factory(librdf_storage_factory *factory); /* functions implementing storage api */ static int librdf_storage_file_init(librdf_storage* storage, const char *name, librdf_hash* options) { char *name_copy; char *contexts; int rc = 1; int is_uri = !strcmp(storage->factory->name, "uri"); const char *format_name = (is_uri ? "guess" : "rdfxml"); librdf_storage_file_instance* context; context = LIBRDF_CALLOC(librdf_storage_file_instance*, 1, sizeof(*context)); if(!context) goto done; librdf_storage_set_instance(storage, context); /* Cannot save contexts in a file; pass everything else on */ contexts = librdf_hash_get_del(options, "contexts"); if(contexts) LIBRDF_FREE(char*, contexts); context->format_name = librdf_hash_get_del(options, "format"); if(context->format_name) { /* for 'file' and 'uri' storage, check this is a valid parser * for 'file' storage, also check this is a valid serializer */ if(!librdf_parser_check_name(storage->world, context->format_name) || (!is_uri && !librdf_serializer_check_name(storage->world, context->format_name))) { librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, "Ignoring storage %s format option '%s' - using default format '%s'", storage->factory->name, context->format_name, format_name); LIBRDF_FREE(char*, context->format_name); context->format_name = NULL; } if(context->format_name) format_name = context->format_name; } if(is_uri) context->uri = librdf_new_uri(storage->world, (const unsigned char*)name); else { context->name_len = strlen(name); name_copy = LIBRDF_MALLOC(char*, context->name_len + 1); if(!name_copy) goto done; strcpy(name_copy,name); context->name = name_copy; context->uri = librdf_new_uri_from_filename(storage->world, context->name); } context->storage = librdf_new_storage_with_options(storage->world, NULL, NULL, options); if(!context->storage) goto done; context->model = librdf_new_model(storage->world, context->storage, NULL); if(!context->model) goto done; if(is_uri || !access((const char*)context->name, F_OK)) { librdf_parser *parser; parser = librdf_new_parser(storage->world, format_name, NULL, NULL); if(!parser) { rc = 1; goto done; } librdf_parser_parse_into_model(parser, context->uri, NULL, context->model); librdf_free_parser(parser); } context->changed = 0; rc = 0; done: /* no more options, might as well free them now */ if(options) librdf_free_hash(options); return rc; } static void librdf_storage_file_terminate(librdf_storage* storage) { librdf_storage_file_instance* context=(librdf_storage_file_instance*)storage->instance; if (context == NULL) return; librdf_storage_file_sync(storage); if(context->format_name) LIBRDF_FREE(char*, context->format_name); if(context->name) LIBRDF_FREE(char*, context->name); if(context->uri) librdf_free_uri(context->uri); if(context->model) librdf_free_model(context->model); if(context->storage) librdf_free_storage(context->storage); LIBRDF_FREE(librdf_storage_file_instance, context); } static int librdf_storage_file_open(librdf_storage* storage, librdf_model* model) { return 0; } static int librdf_storage_file_close(librdf_storage* storage) { return librdf_storage_file_sync(storage); } static int librdf_storage_file_size(librdf_storage* storage) { librdf_storage_file_instance* context=(librdf_storage_file_instance*)storage->instance; return librdf_model_size(context->model); } static int librdf_storage_file_add_statement(librdf_storage* storage, librdf_statement* statement) { librdf_storage_file_instance* context=(librdf_storage_file_instance*)storage->instance; context->changed=1; return librdf_model_add_statement(context->model, statement); } static int librdf_storage_file_add_statements(librdf_storage* storage, librdf_stream* statement_stream) { librdf_storage_file_instance* context=(librdf_storage_file_instance*)storage->instance; context->changed=1; return librdf_model_add_statements(context->model, statement_stream); } static int librdf_storage_file_remove_statement(librdf_storage* storage, librdf_statement* statement) { librdf_storage_file_instance* context=(librdf_storage_file_instance*)storage->instance; context->changed=1; return librdf_model_remove_statement(context->model, statement); } static int librdf_storage_file_contains_statement(librdf_storage* storage, librdf_statement* statement) { librdf_storage_file_instance* context=(librdf_storage_file_instance*)storage->instance; return librdf_model_contains_statement(context->model, statement); } static librdf_stream* librdf_storage_file_serialise(librdf_storage* storage) { librdf_storage_file_instance* context=(librdf_storage_file_instance*)storage->instance; return librdf_model_as_stream(context->model); } static librdf_stream* librdf_storage_file_find_statements(librdf_storage* storage, librdf_statement* statement) { librdf_storage_file_instance* context=(librdf_storage_file_instance*)storage->instance; return librdf_model_find_statements(context->model, statement); } static int librdf_storage_file_sync(librdf_storage *storage) { librdf_storage_file_instance* context=(librdf_storage_file_instance*)storage->instance; char *backup_name; char *new_name; librdf_serializer* serializer; FILE *fh; int rc=0; if(!context->changed) return 0; if(!context->name) { /* FIXME - URI cannot be written */ context->changed=0; return 0; } backup_name=NULL; if(!access((const char*)context->name, F_OK)) { /* name"~\0" */ backup_name = LIBRDF_MALLOC(char*, context->name_len + 2); if(!backup_name) return 1; strcpy(backup_name, (const char*)context->name); backup_name[context->name_len]='~'; backup_name[context->name_len+1]='\0'; if(rename(context->name, backup_name) < 0) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "rename of '%s' to '%s' failed - %s", context->name, backup_name, strerror(errno)); LIBRDF_FREE(char*, backup_name); return 1; } } /* name".new\0" */ new_name = LIBRDF_MALLOC(char*, context->name_len + 5); if(!new_name) { LIBRDF_FREE(char*, backup_name); return 1; } strcpy(new_name, (const char*)context->name); strcpy(new_name+context->name_len, ".new"); serializer = librdf_new_serializer(storage->world, context->format_name, NULL, NULL); if(!serializer) { LIBRDF_FREE(char*, new_name); if(backup_name) LIBRDF_FREE(char*, backup_name); return 1; } fh=fopen(new_name, "w+"); if(!fh) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "failed to open file '%s' for writing - %s", new_name, strerror(errno)); rc=1; } else { librdf_serializer_serialize_model_to_file_handle(serializer, fh, context->uri, context->model); fclose(fh); } librdf_free_serializer(serializer); if(fh && rename(new_name, context->name) < 0) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "rename of '%s' to '%s' failed - %s (%d)", new_name, context->name, strerror(errno), errno); fh=NULL; rc=1; } LIBRDF_FREE(char*, new_name); /* restore backup on failure (fh=NULL) */ if(!fh && backup_name && rename(backup_name, context->name) < 0) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "rename of '%s' to '%s' failed - %s", backup_name, context->name, strerror(errno)); rc=1; } if(backup_name) LIBRDF_FREE(char*, backup_name); context->changed=0; return rc; } static librdf_node* librdf_storage_file_get_feature(librdf_storage* storage, librdf_uri* feature) { return NULL; } /** Local entry point for dynamically loaded storage module */ static void librdf_storage_file_register_factory(librdf_storage_factory *factory) { factory->version = LIBRDF_STORAGE_INTERFACE_VERSION; factory->init = librdf_storage_file_init; factory->terminate = librdf_storage_file_terminate; factory->open = librdf_storage_file_open; factory->close = librdf_storage_file_close; factory->size = librdf_storage_file_size; factory->add_statement = librdf_storage_file_add_statement; factory->add_statements = librdf_storage_file_add_statements; factory->remove_statement = librdf_storage_file_remove_statement; factory->contains_statement = librdf_storage_file_contains_statement; factory->serialise = librdf_storage_file_serialise; factory->find_statements = librdf_storage_file_find_statements; factory->sync = librdf_storage_file_sync; factory->get_feature = librdf_storage_file_get_feature; } /* * librdf_init_storage_file: * @world: world object * * INTERNAL - Initialise the built-in storage_file module. */ void librdf_init_storage_file(librdf_world *world) { librdf_storage_register_factory(world, "file", "Local file based store", &librdf_storage_file_register_factory); librdf_storage_register_factory(world, "uri", "URI store (read-only)", &librdf_storage_file_register_factory); } redland-1.0.17/src/librdf.h0000644000175000017500000002044012257576330012346 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * redland.h - Redland RDF Application Framework public API * * Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_H #define LIBRDF_H #ifndef LIBRDF_OBJC_FRAMEWORK /* raptor */ #include /* rasqal: uses raptor */ #include /* librdf: uses rasqal and raptor */ #else #include #include #endif #ifdef __cplusplus extern "C" { #endif #include #ifndef REDLAND_API # ifdef WIN32 # ifdef __GNUC__ # undef _declspec # define _declspec(x) __declspec(x) # endif # ifdef REDLAND_STATIC # define REDLAND_API # else # ifdef LIBRDF_INTERNAL # define REDLAND_API _declspec(dllexport) # else # define REDLAND_API _declspec(dllimport) # endif # endif # else # define REDLAND_API # endif #endif #ifndef REDLAND_CALLBACK_STDCALL # if defined(WIN32) && defined(USE_STDCALL_CALLBACKS) # define REDLAND_CALLBACK_STDCALL _stdcall # else # define REDLAND_CALLBACK_STDCALL # endif #endif /* Use gcc 3.1+ feature to allow marking of deprecated API calls. * This gives a warning during compiling. */ #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 #define REDLAND_DEPRECATED __attribute__((deprecated)) #define REDLAND_NORETURN __attribute__((__noreturn__)) #else #define REDLAND_DEPRECATED #define REDLAND_NORETURN #endif #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #define REDLAND_PRINTF_FORMAT(string_index, first_to_check_index) \ __attribute__((__format__(__printf__, string_index, first_to_check_index))) #else #define REDLAND_PRINTF_FORMAT(string_index, first_to_check_index) #endif /* Public defines */ /** * LIBRDF_VERSION: * * Redland librdf library version number * * Format: major * 10000 + minor * 100 + release */ #define LIBRDF_VERSION 10017 /** * LIBRDF_VERSION_STRING: * * Redland librdf library version string */ #define LIBRDF_VERSION_STRING "1.0.17" /** * LIBRDF_VERSION_MAJOR: * * Redland librdf library major version */ #define LIBRDF_VERSION_MAJOR 1 /** * LIBRDF_VERSION_MINOR: * * Redland librdf library minor version */ #define LIBRDF_VERSION_MINOR 0 /** * LIBRDF_VERSION_RELEASE: * * Redland librdf library release */ #define LIBRDF_VERSION_RELEASE 17 /* Public typedefs (references to private structures) */ /** * librdf_world: * * Redland world class. */ typedef struct librdf_world_s librdf_world; /** * librdf_hash: * * Redland hash class. */ typedef struct librdf_hash_s librdf_hash; /** * librdf_hash_cursor: * * Redland hash cursor class. */ typedef struct librdf_hash_cursor_s librdf_hash_cursor; /** * librdf_digest: * * Redland content digest class. */ typedef struct librdf_digest_s librdf_digest; /** * librdf_digest_factory: * * Redland digest factory class. */ typedef struct librdf_digest_factory_s librdf_digest_factory; /** * librdf_uri: * * Redland URI class. */ typedef struct raptor_uri_s librdf_uri; /** * librdf_list: * * Redland list class. */ typedef struct librdf_list_s librdf_list; /** * librdf_iterator: * * Redland iterator class. */ typedef struct librdf_iterator_s librdf_iterator; /** * librdf_node: * * Redland node class. */ typedef raptor_term librdf_node; /** * librdf_statement: * * Redland statement class. */ typedef raptor_statement librdf_statement; /** * librdf_model: * * Redland model class. */ typedef struct librdf_model_s librdf_model; /** * librdf_model_factory: * * Redland model factory class. */ typedef struct librdf_model_factory_s librdf_model_factory; /** * librdf_storage: * * Redland storage class. */ typedef struct librdf_storage_s librdf_storage; /** * librdf_storage_factory: * * Redland storage factory class. */ typedef struct librdf_storage_factory_s librdf_storage_factory; /** * librdf_stream: * * Redland stream class. */ typedef struct librdf_stream_s librdf_stream; /** * librdf_parser: * * Redland parser class. */ typedef struct librdf_parser_s librdf_parser; /** * librdf_parser_factory: * * Redland parser factory class. */ typedef struct librdf_parser_factory_s librdf_parser_factory; /** * librdf_query: * * Redland query class. */ typedef struct librdf_query_s librdf_query; /** * librdf_query_factory: * * Redland query factory class. */ typedef struct librdf_query_factory_s librdf_query_factory; /** * librdf_query_results: * * Redland query results class. */ typedef struct librdf_query_results_s librdf_query_results; /** * librdf_query_results_formatter: * * Redland query results formatter class. */ typedef struct librdf_query_results_formatter_s librdf_query_results_formatter; /** * librdf_serializer: * * Redland serializer class. */ typedef struct librdf_serializer_s librdf_serializer; /** * librdf_serializer_factory: * * Redland serializer factory class. */ typedef struct librdf_serializer_factory_s librdf_serializer_factory; /* Public statics */ /** * librdf_short_copyright_string: * * Short copyright string (one line). */ REDLAND_API extern const char * const librdf_short_copyright_string; /** * librdf_copyright_string: * * Copyright string (multiple lines). */ REDLAND_API extern const char * const librdf_copyright_string; /** * librdf_version_string: * * Redland librdf version as a string. */ REDLAND_API extern const char * const librdf_version_string; /** * librdf_version_major: * * Redland librdf major version number. */ REDLAND_API extern const unsigned int librdf_version_major; /** * librdf_version_minor: * * Redland librdf minor version number. */ REDLAND_API extern const unsigned int librdf_version_minor; /** * librdf_version_release: * * Redland librdf release version number. */ REDLAND_API extern const unsigned int librdf_version_release; /** * librdf_version_decimal: * * Redland librdf version as a decimal number. * * Format: major * 10000 + minor * 100 + release */ REDLAND_API extern const unsigned int librdf_version_decimal; /** * librdf_license_string: * * Redland librdf license string. */ REDLAND_API extern const char * const librdf_license_string; /** * librdf_home_url_string: * * Redland librdf home page URL. */ REDLAND_API extern const char * const librdf_home_url_string; /* Required for va_list in error handler function registrations * which are in the public API */ #include /* internal interfaces */ #ifdef LIBRDF_INTERNAL #include #endif /* public interfaces */ /* FIXME: Should be replaced with automatically pulled * definitions from the listed rdf_*.h header files. */ #ifndef LIBRDF_OBJC_FRAMEWORK #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_init_internal.h0000644000175000017500000001023312002642721014557 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_init_internal.h - Internal library initialisation / termination * * Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_INIT_INTERNAL_H #define LIBRDF_INIT_INTERNAL_H #ifdef __cplusplus extern "C" { #endif #ifdef WITH_THREADS #include #endif #ifdef RASQAL_H /* rasqal.h will have defined this */ #else /* provide a forward reference */ #ifndef RASQAL_WORLD_DECLARED #define RASQAL_WORLD_DECLARED 1 typedef struct rasqal_world_s rasqal_world; #endif #endif struct librdf_world_s { void *error_user_data; librdf_log_level_func error_handler; void *warning_user_data; librdf_log_level_func warning_handler; void *log_user_data; librdf_log_func log_handler; /* static (last) log message */ librdf_log_message log; char *digest_factory_name; librdf_digest_factory* digest_factory; /* URI interning */ librdf_hash* uris_hash; int uris_hash_allocated_here; /* Node interning */ librdf_hash* nodes_hash[3]; /* resource, literal, blank */ /* Sequence of model factories */ raptor_sequence* models; /* Sequence of storage factories */ raptor_sequence* storages; /* Sequence of parser factories */ raptor_sequence* parsers; /* Sequence of serializer factories */ raptor_sequence* serializers; /* List of query factories */ librdf_query_factory* query_factories; /* List of digest factories */ librdf_digest_factory *digests; /* list of hash factories */ librdf_hash_factory* hashes; /* list of free librdf_hash_datums is kept */ librdf_hash_datum* hash_datums_list; /* hash load_factor out of 1000 */ int hash_load_factor; /* ID base from startup time */ unsigned long genid_base; /* Unique counter from there */ unsigned long genid_counter; #ifdef WITH_THREADS /* mutex so we can lock around this when we need to */ pthread_mutex_t* mutex; /* mutex to lock the nodes class */ pthread_mutex_t* nodes_mutex; /* mutex to lock the statements class */ pthread_mutex_t* statements_mutex; /* mutex to lock the hash_datums class */ pthread_mutex_t* hash_datums_mutex; #else /* !WITH_THREADS - pad structure to same size */ void* mutex_fake; void* nodes_mutex_fake; void* statements_mutex_fake; void* hash_datums_mutex_fake; #endif /* non-0 if librdf_world_open() has been called */ int opened; /* Sequence of storage modules * Used with --enable-modular / MODULAR_LIBRDF */ raptor_sequence* storage_modules; /* If libtdl has been opened with lt_dlinit() * Used with --enable-modular / MODULAR_LIBRDF */ int ltdl_opened; /* librdf_concepts RDF syntax and Schema namespace uris */ librdf_uri* concept_ms_namespace_uri; librdf_uri* concept_schema_namespace_uri; /* librdf_concepts nodes and uris */ librdf_uri** concept_uris; librdf_node** concept_resources; /* rasqal world object */ rasqal_world* rasqal_world_ptr; int rasqal_world_allocated_here; /* raptor world object */ raptor_world* raptor_world_ptr; int raptor_world_allocated_here; /* bnode id (raptor => internal) map during parsing */ librdf_hash *bnode_hash; librdf_raptor_init_handler raptor_init_handler; void* raptor_init_handler_user_data; librdf_rasqal_init_handler rasqal_init_handler; void* rasqal_init_handler_user_data; librdf_uri* xsd_namespace_uri; }; unsigned char* librdf_world_get_genid(librdf_world* world); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_hash.c0000644000175000017500000015045511773150065012662 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_hash.c - RDF Hash interface - set of (key: value) pairs with dups * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include #include #ifdef HAVE_STDLIB_H #include /* for strtol */ #endif #include #include #include #ifndef STANDALONE /* prototypes for helper functions */ static void librdf_delete_hash_factories(librdf_world *world); static void librdf_init_hash_datums(librdf_world *world); static void librdf_free_hash_datums(librdf_world *world); /* prototypes for iterator for getting all keys and values */ static int librdf_hash_get_all_iterator_is_end(void* iterator); static int librdf_hash_get_all_iterator_next_method(void* iterator); static void* librdf_hash_get_all_iterator_get_method(void* iterator, int); static void librdf_hash_get_all_iterator_finished(void* iterator); /* prototypes for iterator for getting all keys */ static int librdf_hash_keys_iterator_is_end(void* iterator); static int librdf_hash_keys_iterator_next_method(void* iterator); static void* librdf_hash_keys_iterator_get_method(void* iterator, int); static void librdf_hash_keys_iterator_finished(void* iterator); /** * librdf_init_hash: * * INTERNAL - Initialise the hash module. * * Initialises and registers all * compiled hash modules. Must be called before using any of the hash * factory functions such as librdf_get_hash_factory() * @world: redland world object **/ void librdf_init_hash(librdf_world *world) { /* Init hash datum cache */ librdf_init_hash_datums(world); #ifdef HAVE_BDB_HASH librdf_init_hash_bdb(world); #endif /* Always have hash in memory implementation available */ librdf_init_hash_memory(world); } /** * librdf_finish_hash: * @world: redland world object * * INTERNAL - Terminate the hash module. * **/ void librdf_finish_hash(librdf_world *world) { librdf_delete_hash_factories(world); librdf_free_hash_datums(world); } /* helper functions */ static void librdf_delete_hash_factories(librdf_world *world) { librdf_hash_factory *factory, *next; for(factory=world->hashes; factory; factory=next) { next=factory->next; LIBRDF_FREE(librdf_hash_factory, factory->name); LIBRDF_FREE(librdf_hash_factory, factory); } world->hashes=NULL; } /* hash datums structures */ static void librdf_init_hash_datums(librdf_world *world) { world->hash_datums_list=NULL; } static void librdf_free_hash_datums(librdf_world *world) { librdf_hash_datum *datum, *next; #ifdef WITH_THREADS if(world->hash_datums_mutex) pthread_mutex_lock(world->hash_datums_mutex); #endif for(datum = world->hash_datums_list; datum; datum = next) { next = datum->next; LIBRDF_FREE(librdf_hash_datum, datum); } world->hash_datums_list = NULL; #ifdef WITH_THREADS if(world->hash_datums_mutex) pthread_mutex_unlock(world->hash_datums_mutex); #endif } /** * librdf_new_hash_datum: * @world: redland world object * @data: data to store * @size: size of data * * Constructor - Create a new #librdf_hash_datum object. * * Return value: New #librdf_hash_datum object or NULL on failure **/ librdf_hash_datum* librdf_new_hash_datum(librdf_world *world, void *data, size_t size) { librdf_hash_datum *datum; librdf_world_open(world); #ifdef WITH_THREADS pthread_mutex_lock(world->hash_datums_mutex); #endif /* get one from free list, or allocate new one */ if((datum = world->hash_datums_list)) { world->hash_datums_list = datum->next; } else { datum = LIBRDF_CALLOC(librdf_hash_datum*, 1, sizeof(*datum)); if(datum) datum->world = world; } #ifdef WITH_THREADS pthread_mutex_unlock(world->hash_datums_mutex); #endif if(datum) { datum->data = data; datum->size = size; } return datum; } /** * librdf_free_hash_datum: * @datum: hash datum object * * Destructor - destroy a #librdf_hash_datum object. * **/ void librdf_free_hash_datum(librdf_hash_datum *datum) { if(!datum) return; if(datum->data) { #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG2("Freeing datum data, %p\n", datum); #endif LIBRDF_FREE(char*, datum->data); datum->data = NULL; } #ifdef WITH_THREADS pthread_mutex_lock(datum->world->hash_datums_mutex); #endif datum->next = datum->world->hash_datums_list; datum->world->hash_datums_list = datum; #ifdef WITH_THREADS pthread_mutex_unlock(datum->world->hash_datums_mutex); #endif } /* class methods */ /** * librdf_hash_register_factory: * @world: redland world object * @name: the hash factory name * @factory: pointer to function to call to register the factory * * Register a hash factory. * **/ REDLAND_EXTERN_C void librdf_hash_register_factory(librdf_world *world, const char *name, void (*factory) (librdf_hash_factory*)) { librdf_hash_factory *hash; librdf_world_open(world); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG2("Received registration for hash %s\n", name); #endif for(hash = world->hashes; hash; hash = hash->next ) { if(!strcmp(hash->name, name)) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_HASH, NULL, "hash %s already registered", hash->name); return; } } hash = LIBRDF_CALLOC(librdf_hash_factory*, 1, sizeof(*hash)); if(!hash) goto oom; hash->name = LIBRDF_MALLOC(char*, strlen(name) + 1); if(!hash->name) goto oom_tidy; strcpy(hash->name, name); hash->next = world->hashes; world->hashes = hash; /* Call the hash registration function on the new object */ (*factory)(hash); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("%s has context size %d\n", name, hash->context_length); #endif return; oom_tidy: LIBRDF_FREE(librdf_hash, hash); oom: LIBRDF_FATAL1(world, LIBRDF_FROM_HASH, "Out of memory"); } /** * librdf_get_hash_factory: * @world: redland world object * @name: the factory name or NULL for the default factory * * Get a hash factory by name. * * FIXME: several bits of code assume the default hash factory is * in memory. * * Return value: the factory object or NULL if there is no such factory **/ librdf_hash_factory* librdf_get_hash_factory(librdf_world *world, const char *name) { librdf_hash_factory *factory; librdf_world_open(world); /* return 1st hash if no particular one wanted - why? */ if(!name) { factory=world->hashes; if(!factory) { LIBRDF_DEBUG1("No (default) hashes registered\n"); return NULL; } } else { for(factory=world->hashes; factory; factory=factory->next) { if(!strcmp(factory->name, name)) { break; } } /* else FACTORY name not found */ if(!factory) return NULL; } return factory; } /** * librdf_new_hash: * @world: redland world object * @name: factory name * * Constructor - create a new #librdf_hash object. * * Return value: a new #librdf_hash object or NULL on failure */ librdf_hash* librdf_new_hash(librdf_world *world, const char* name) { librdf_hash_factory *factory; librdf_world_open(world); factory=librdf_get_hash_factory(world, name); if(!factory) return NULL; return librdf_new_hash_from_factory(world, factory); } /** * librdf_new_hash_from_factory: * @world: redland world object * @factory: the factory to use to construct the hash * * Constructor - create a new #librdf_hash object from a factory. * * Return value: a new #librdf_hash object or NULL on failure */ librdf_hash* librdf_new_hash_from_factory(librdf_world *world, librdf_hash_factory* factory) { librdf_hash* h; librdf_world_open(world); h = LIBRDF_CALLOC(librdf_hash*, 1, sizeof(*h)); if(!h) return NULL; h->context = LIBRDF_CALLOC(void*, 1, factory->context_length); if(!h->context) { librdf_free_hash(h); return NULL; } h->world=world; h->factory=factory; /* call factory constructor */ if(h->factory->create(h, h->context)) { librdf_free_hash(h); return NULL; } return h; } /** * librdf_new_hash_from_string: * @world: redland world object * @name: hash name * @string: hash encoded as a string * * Constructor - create a new #librdf_hash object from a string. * * See #librdf_hash_from_string for the string format. * * Return value: a new #librdf_hash object or NULL on failure */ librdf_hash* librdf_new_hash_from_string(librdf_world *world, const char *name, const char *string) { librdf_hash* hash; librdf_world_open(world); hash=librdf_new_hash(world, name); if(!hash) return NULL; if(librdf_hash_from_string(hash, string)) { librdf_free_hash(hash); return NULL; } return hash; } /** * librdf_new_hash_from_array_of_strings: * @world: redland world object * @name: hash name * @array: address of the start of the array of char* pointers * * Constructor - create a new #librdf_hash object from an array of strings. * * Return value: a new #librdf_hash object or NULL on failure */ librdf_hash* librdf_new_hash_from_array_of_strings(librdf_world *world, const char *name, const char **array) { librdf_hash* hash; librdf_world_open(world); hash=librdf_new_hash(world, name); if(!hash) return NULL; if(librdf_hash_from_array_of_strings(hash, array)) { librdf_free_hash(hash); return NULL; } return hash; } /** * librdf_new_hash_from_hash: * @old_hash: the hash to use to construct the hash * * Copy Constructor - create a new #librdf_hash object from an existing one. * * Return value: a new #librdf_hash object or NULL on failure */ librdf_hash* librdf_new_hash_from_hash(librdf_hash* old_hash) { librdf_hash* hash; hash = LIBRDF_CALLOC(librdf_hash*, 1, sizeof(*hash)); if(!hash) return NULL; hash->world=old_hash->world; hash->factory=old_hash->factory; hash->context = LIBRDF_CALLOC(void*, 1, hash->factory->context_length); if(!hash->context) { librdf_free_hash(hash); return NULL; } if(old_hash->identifier) { hash->identifier=librdf_heuristic_gen_name(old_hash->identifier); if(!hash->identifier) { librdf_free_hash(hash); return NULL; } } if(hash->factory->clone(hash, hash->context, hash->identifier, old_hash->context)) { if(hash->identifier) LIBRDF_FREE(char*, hash->identifier); librdf_free_hash(hash); return NULL; } return hash; } /** * librdf_free_hash: * @hash: hash object * * Destructor - destroy a #librdf_hash object. */ void librdf_free_hash(librdf_hash* hash) { if(!hash) return; if(hash->context) { if(hash->is_open) librdf_hash_close(hash); hash->factory->destroy(hash->context); LIBRDF_FREE(librdf_hash_context, hash->context); } LIBRDF_FREE(librdf_hash, hash); } /* methods */ /** * librdf_hash_open: * @hash: hash object * @identifier: indentifier for the hash factory - usually a URI or file name * @mode: hash access mode * @is_writable: is hash writable? * @is_new: is hash new? * @options: a hash of options for the hash factory or NULL if there are none. * * Start a hash association . * * This method opens and/or creates a new hash with any resources it * needs. * * Return value: non 0 on failure **/ int librdf_hash_open(librdf_hash* hash, const char *identifier, int mode, int is_writable, int is_new, librdf_hash* options) { int status; if(identifier) { hash->identifier = LIBRDF_MALLOC(char*, strlen(identifier) + 1); if(!hash->identifier) return 1; strcpy(hash->identifier, identifier); } status=hash->factory->open(hash->context, identifier, mode, is_writable, is_new, options); if(!status) hash->is_open=1; return status; } /** * librdf_hash_close: * @hash: hash object * * End a hash association. * * Return value: non 0 on failure **/ int librdf_hash_close(librdf_hash* hash) { hash->is_open=0; if(hash->identifier) { LIBRDF_FREE(char*, hash->identifier); hash->identifier=NULL; } return hash->factory->close(hash->context); } /** * librdf_hash_values_count: * @hash: hash object * * Get the number of values in the hash. * * Return value: integer number of values in the hash or <0 if cannot be determined **/ int librdf_hash_values_count(librdf_hash* hash) { return hash->factory->values_count(hash->context); } /** * librdf_hash_get: * @hash: hash object * @key: pointer to key * * Retrieve one value from hash for a given key as string. * * The value returned is from newly allocated memory which the * caller must free. * * Return value: the value or NULL on failure **/ char* librdf_hash_get(librdf_hash* hash, const char *key) { librdf_hash_datum *hd_key, *hd_value; char *value=NULL; hd_key=librdf_new_hash_datum(hash->world, (void*)key, strlen(key)); if(!hd_key) return NULL; hd_value=librdf_hash_get_one(hash, hd_key); if(hd_value) { if(hd_value->data) { value = LIBRDF_MALLOC(char*, hd_value->size + 1); if(value) { /* Copy into new null terminated string for userland */ memcpy(value, hd_value->data, hd_value->size); value[hd_value->size]='\0'; } } librdf_free_hash_datum(hd_value); } /* don't free user key */ hd_key->data=NULL; librdf_free_hash_datum(hd_key); return value; } /** * librdf_hash_get_one: * @hash: hash object * @key: pointer to key * * Retrieve one value from hash for a given key. * * The value returned is from newly allocated memory which the * caller must free. * * Return value: the value or NULL on failure **/ librdf_hash_datum* librdf_hash_get_one(librdf_hash* hash, librdf_hash_datum *key) { librdf_hash_datum *value; librdf_hash_cursor *cursor; int status; char *new_value; value=librdf_new_hash_datum(hash->world, NULL, 0); if(!value) return NULL; cursor=librdf_new_hash_cursor(hash); if(!cursor) { librdf_free_hash_datum(value); return NULL; } status=librdf_hash_cursor_get_next(cursor, key, value); if(!status) { /* value->data will point to SHARED area, so copy it */ new_value = LIBRDF_MALLOC(char*, value->size); if(new_value) { memcpy(new_value, value->data, value->size); value->data=new_value; } else { status=1; value->data=NULL; } } /* this deletes the data behind the datum */ librdf_free_hash_cursor(cursor); if(status) { librdf_free_hash_datum(value); return NULL; } return value; } typedef struct { librdf_hash* hash; librdf_hash_cursor* cursor; librdf_hash_datum *key; librdf_hash_datum *value; librdf_hash_datum next_key; /* not used if one_key set */ librdf_hash_datum next_value; int is_end; int one_key; } librdf_hash_get_all_iterator_context; /** * librdf_hash_get_all: * @hash: hash object * @key: pointer to key * @value: pointer to value * * Retrieve all values from hash for a given key. * * The iterator returns #librdf_hash_datum objects containing the values. * These are newly allocated memory which the caller must free. * * Return value: a #librdf_iterator serialization of all values or NULL on failure **/ librdf_iterator* librdf_hash_get_all(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value) { librdf_hash_get_all_iterator_context* context; int status; librdf_iterator* iterator; context = LIBRDF_CALLOC(librdf_hash_get_all_iterator_context*, 1, sizeof(*context)); if(!context) return NULL; if(!(context->cursor=librdf_new_hash_cursor(hash))) { librdf_hash_get_all_iterator_finished(context); return NULL; } if(key->data) context->one_key=1; context->hash=hash; context->key=key; context->value=value; if(context->one_key) status=librdf_hash_cursor_set(context->cursor, context->key, &context->next_value); else status=librdf_hash_cursor_get_first(context->cursor, &context->next_key, &context->next_value); context->is_end=(status != 0); iterator=librdf_new_iterator(hash->world, (void*)context, librdf_hash_get_all_iterator_is_end, librdf_hash_get_all_iterator_next_method, librdf_hash_get_all_iterator_get_method, librdf_hash_get_all_iterator_finished); if(!iterator) librdf_hash_get_all_iterator_finished(context); return iterator; } static int librdf_hash_get_all_iterator_is_end(void* iterator) { librdf_hash_get_all_iterator_context* context=(librdf_hash_get_all_iterator_context*)iterator; return context->is_end; } static int librdf_hash_get_all_iterator_next_method(void* iterator) { librdf_hash_get_all_iterator_context* context=(librdf_hash_get_all_iterator_context*)iterator; int status; if(context->is_end) return 1; /* move on */ if(context->one_key) status=librdf_hash_cursor_get_next_value(context->cursor, &context->next_key, &context->next_value); else { /* want the next key/value pair, so mark last data as used */ context->next_key.data=NULL; status=librdf_hash_cursor_get_next(context->cursor, &context->next_key, &context->next_value); } if(status) context->is_end=1; return context->is_end; } static void* librdf_hash_get_all_iterator_get_method(void* iterator, int flags) { librdf_hash_get_all_iterator_context* context = (librdf_hash_get_all_iterator_context*)iterator; void *result = NULL; if(context->is_end) return NULL; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: /* This is so that librdf_iterator_update_current_element works OK, * since the get_object method isn't used for hashes, * might as well return something useful to signify not-end-of-list. */ result = context; break; case LIBRDF_ITERATOR_GET_METHOD_GET_KEY: result = &context->next_key; break; case LIBRDF_ITERATOR_GET_METHOD_GET_VALUE: result = &context->next_value; break; default: librdf_log(context->hash->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_HASH, NULL, "Unknown iterator method flag %d", flags); result = NULL; break; } return result; } static void librdf_hash_get_all_iterator_finished(void* iterator) { librdf_hash_get_all_iterator_context* context=(librdf_hash_get_all_iterator_context*)iterator; if(context->cursor) librdf_free_hash_cursor(context->cursor); if(context->key) context->key->data=NULL; if(context->value) context->value->data=NULL; LIBRDF_FREE(librdf_hash_get_all_iterator_context, context); } /** * librdf_hash_get_del: * @hash: hash object * @key: pointer to key * * Retrieve one value from hash for a given key as string and remove all values with that key. * * The value returned is from newly allocated memory which the * caller must free. * * Return value: the value or NULL on failure **/ char* librdf_hash_get_del(librdf_hash* hash, const char *key) { librdf_hash_datum hd_key; char *s; s=librdf_hash_get(hash, key); if(!s) return NULL; hd_key.data=(char*)key; hd_key.size=strlen(key); librdf_hash_delete_all(hash, &hd_key); return s; } /** * librdf_hash_put: * @hash: hash object * @key: key * @value: value * * Insert key/value pairs into the hash according to flags. * * The key and values are copied into the hash; the original pointers * can be deleted. * * Return value: non 0 on failure **/ int librdf_hash_put(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value) { return hash->factory->put(hash->context, key, value); } /** * librdf_hash_exists: * @hash: hash object * @key: key * @value: value * * Check if a given key/value is in the hash. * * Return value: >0 if the key/value exists in the hash, 0 if not, <0 on failure **/ int librdf_hash_exists(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value) { return hash->factory->exists(hash->context, key, value); } /** * librdf_hash_delete: * @hash: hash object * @key: key * @value: value * * Delete a key/value pair from the hash. * * Return value: non 0 on failure (including pair not present) **/ int librdf_hash_delete(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value) { return hash->factory->delete_key_value(hash->context, key, value); } /** * librdf_hash_delete_all: * @hash: hash object * @key: key * * Delete a key and all values from the hash. * * Return value: non 0 on failure (including pair not present) **/ int librdf_hash_delete_all(librdf_hash* hash, librdf_hash_datum *key) { return hash->factory->delete_key(hash->context, key); } typedef struct { librdf_hash* hash; librdf_hash_cursor* cursor; librdf_hash_datum *key; librdf_hash_datum next_key; int is_end; } librdf_hash_keys_iterator_context; /** * librdf_hash_keys: * @hash: hash object * @key: pointer to key * * Get the hash keys. * * The iterator returns #librdf_hash_datum objects containingvalue returned is from newly allocated memory which the * caller must free. * * Return value: #librdf_iterator serialisation of keys or NULL on failure **/ librdf_iterator* librdf_hash_keys(librdf_hash* hash, librdf_hash_datum *key) { librdf_hash_keys_iterator_context* context; int status; librdf_iterator* iterator; context = LIBRDF_CALLOC(librdf_hash_keys_iterator_context*, 1, sizeof(*context)); if(!context) return NULL; if(!(context->cursor=librdf_new_hash_cursor(hash))) { librdf_hash_keys_iterator_finished(context); return NULL; } context->hash=hash; context->key=key; status=librdf_hash_cursor_get_first(context->cursor, &context->next_key, NULL); context->is_end=(status != 0); iterator=librdf_new_iterator(hash->world, (void*)context, librdf_hash_keys_iterator_is_end, librdf_hash_keys_iterator_next_method, librdf_hash_keys_iterator_get_method, librdf_hash_keys_iterator_finished); if(!iterator) librdf_hash_keys_iterator_finished(context); return iterator; } static int librdf_hash_keys_iterator_is_end(void* iterator) { librdf_hash_keys_iterator_context* context=(librdf_hash_keys_iterator_context*)iterator; if(context->is_end) return 1; /* have key */ if(context->next_key.data) return 0; /* no stored data, so check for it */ if(librdf_hash_cursor_get_next(context->cursor, &context->next_key, NULL)) context->is_end=1; return context->is_end; } static int librdf_hash_keys_iterator_next_method(void* iterator) { librdf_hash_keys_iterator_context* context=(librdf_hash_keys_iterator_context*)iterator; if(context->is_end) return 1; /* move on */ /* want the next key, so mark last key data as used */ context->next_key.data=NULL; if(librdf_hash_cursor_get_next(context->cursor, &context->next_key, NULL)) context->is_end=1; return context->is_end; } static void* librdf_hash_keys_iterator_get_method(void* iterator, int flags) { librdf_hash_keys_iterator_context* context = (librdf_hash_keys_iterator_context*)iterator; void *result = NULL; if(context->is_end) return NULL; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: /* This is so that librdf_iterator_update_current_element works OK, * since the get_object method isn't used for hashes, * might as well return something useful to signify not-end-of-list. */ result = context; break; case LIBRDF_ITERATOR_GET_METHOD_GET_KEY: result = &context->next_key; break; default: result = NULL; } return result; } static void librdf_hash_keys_iterator_finished(void* iterator) { librdf_hash_keys_iterator_context* context=(librdf_hash_keys_iterator_context*)iterator; if(context->cursor) librdf_free_hash_cursor(context->cursor); if(context->key) context->key->data = NULL; LIBRDF_FREE(librdf_hash_keys_iterator_context, context); } /** * librdf_hash_sync: * @hash: hash object * * Flush any cached information to disk if appropriate. * * Return value: non 0 on failure **/ int librdf_hash_sync(librdf_hash* hash) { return hash->factory->sync(hash->context); } /** * librdf_hash_get_fd: * @hash: hash object * * Get the file descriptor for the hash. * * This returns the file descriptor if it is file based for * use with file locking. * * Return value: the file descriptor **/ int librdf_hash_get_fd(librdf_hash* hash) { return hash->factory->get_fd(hash->context); } /** * librdf_hash_print: * @hash: the hash * @fh: file handle * * Pretty print the hash to a file descriptor. * **/ void librdf_hash_print(librdf_hash* hash, FILE *fh) { librdf_iterator* iterator; librdf_hash_datum *key, *value; fputs(hash->factory->name, fh); fputs(" hash: {\n", fh); key = librdf_new_hash_datum(hash->world, NULL, 0); if(!key) return; value = librdf_new_hash_datum(hash->world, NULL, 0); if(!value) { librdf_free_hash_datum(key); return; } iterator=librdf_hash_get_all(hash, key, value); while(!librdf_iterator_end(iterator)) { librdf_hash_datum *k, *v; size_t l; k=(librdf_hash_datum *)librdf_iterator_get_key(iterator); v=(librdf_hash_datum *)librdf_iterator_get_value(iterator); fputs(" '", fh); l=fwrite(k->data, 1, k->size, fh); if(l != k->size) break; fputs("'=>'", fh); l=fwrite(v->data, 1, v->size, fh); if(l != v->size) break; fputs("'\n", fh); librdf_iterator_next(iterator); } if(iterator) librdf_free_iterator(iterator); librdf_free_hash_datum(value); librdf_free_hash_datum(key); fputc('}', fh); } /** * librdf_hash_print_keys: * @hash: the hash * @fh: file handle * * Pretty print the keys to a file descriptor. * **/ void librdf_hash_print_keys(librdf_hash* hash, FILE *fh) { librdf_iterator* iterator; librdf_hash_datum *key; fputs("{\n", fh); key=librdf_new_hash_datum(hash->world, NULL, 0); if(!key) return; iterator=librdf_hash_keys(hash, key); while(!librdf_iterator_end(iterator)) { librdf_hash_datum *k=(librdf_hash_datum *)librdf_iterator_get_key(iterator); size_t l; fputs(" '", fh); l=fwrite(k->data, 1, k->size, fh); if(l != k->size) break; fputs("'\n", fh); librdf_iterator_next(iterator); } if(iterator) librdf_free_iterator(iterator); librdf_free_hash_datum(key); fputc('}', fh); } /** * librdf_hash_print_values: * @hash: the hash * @key_string: the key as a string * @fh: file handle * * Pretty print the values of one key to a file descriptor. * **/ void librdf_hash_print_values(librdf_hash* hash, const char *key_string, FILE *fh) { librdf_hash_datum *key, *value; librdf_iterator* iterator; int first=1; key=librdf_new_hash_datum(hash->world, (char*)key_string, strlen(key_string)); if(!key) return; value=librdf_new_hash_datum(hash->world, NULL, 0); if(!value) { key->data=NULL; librdf_free_hash_datum(key); return; } iterator=librdf_hash_get_all(hash, key, value); fputc('(', fh); while(!librdf_iterator_end(iterator)) { librdf_hash_datum *v=(librdf_hash_datum *)librdf_iterator_get_value(iterator); size_t l; if(!first) fputs(", ", fh); fputc('\'', fh); l=fwrite(v->data, 1, v->size, fh); if(l != v->size) break; fputc('\'', fh); first=0; librdf_iterator_next(iterator); } fputc(')', fh); librdf_free_iterator(iterator); key->data=NULL; librdf_free_hash_datum(key); librdf_free_hash_datum(value); } /* private enum */ typedef enum { HFS_PARSE_STATE_INIT = 0, HFS_PARSE_STATE_KEY = 1, HFS_PARSE_STATE_SEP = 2, HFS_PARSE_STATE_EQ = 3, HFS_PARSE_STATE_VALUE = 4 } librdf_hfs_parse_state; /** * librdf_hash_from_string: * @hash: hash object * @string: hash encoded as a string * * Initialise a hash from a string. * * The string format is something like: * key1='value1',key2='value2', key3='\'quoted value\'' * * The 's are required and whitespace can appear around the = and ,s * * Return value: non 0 on failure **/ int librdf_hash_from_string(librdf_hash* hash, const char *string) { const char * p; librdf_hash_datum hd_key, hd_value; /* on stack */ const char *key; size_t key_len; const char *value; size_t value_len; size_t backslashes; int saw_backslash; librdf_hfs_parse_state state; size_t real_value_len; char *new_value; size_t i; char *to; if(!string) return 0; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG2("Parsing >>%s<<\n", string); #endif p=string; key=NULL; key_len=0; value=NULL; state=HFS_PARSE_STATE_INIT; while(*p) { #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("state %d at %s\n", state, p); #endif switch(state){ /* start of config - before key */ case HFS_PARSE_STATE_INIT: while(*p && (isspace((int)*p) || *p == ',')) p++; if(!*p) break; /* fall through to next state */ state=HFS_PARSE_STATE_KEY; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("state %d at %s\n", state, p); #endif /* start of key */ case HFS_PARSE_STATE_KEY: key=p; while(*p && (isalnum((int)*p) || *p == '_' || *p == '-')) p++; if(!*p) break; key_len = LIBRDF_GOOD_CAST(size_t, p - key); /* if 1st char is not space or alpha, move on */ if(!key_len) { p++; state=HFS_PARSE_STATE_INIT; break; } state=HFS_PARSE_STATE_SEP; /* fall through to next state */ #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("state %d at %s\n", state, p); #endif /* got key, now skipping spaces */ case HFS_PARSE_STATE_SEP: while(*p && isspace((int)*p)) p++; if(!*p) break; /* expecting = now */ if(*p != '=') { p++; state=HFS_PARSE_STATE_INIT; break; } p++; state=HFS_PARSE_STATE_EQ; /* fall through to next state */ #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("state %d at %s\n", state, p); #endif /* got key\s+= now skipping spaces " */ case HFS_PARSE_STATE_EQ: while(*p && isspace((int)*p)) p++; if(!*p) break; /* expecting ' now */ if(*p != '\'') { p++; state=HFS_PARSE_STATE_INIT; break; } p++; /* state=HFS_PARSE_STATE_VALUE; */ /* fall through to next state */ #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("state %d at %s\n", state, p); #endif /* got key\s+=\s+" now reading value */ case HFS_PARSE_STATE_VALUE: value=p; backslashes=0; saw_backslash=0; while(*p) { if(!saw_backslash && *p == '\\') { /* backslashes are removed during value copy later */ backslashes++; /* reduces real length */ saw_backslash=1; } else { if (!saw_backslash && *p == '\'') break; saw_backslash=0; } p++; } if(!*p) return 1; /* ' at end of value found */ value_len = LIBRDF_GOOD_CAST(size_t, p - value); real_value_len = value_len - backslashes; new_value = LIBRDF_MALLOC(char*, real_value_len + 1); if(!new_value) return 1; for(i = 0, to = new_value; i < value_len; i++){ if(value[i] == '\\') i++; *to++=value[i]; } *to='\0'; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("decoded key >>%s<< (true) value >>%s<<\n", key, new_value); #endif hd_key.data=(void*)key; hd_key.size=key_len; hd_value.data=(void*)new_value; hd_value.size=real_value_len; librdf_hash_put(hash, &hd_key, &hd_value); LIBRDF_FREE(char*, new_value); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("after decoding "); librdf_hash_print (hash, stderr) ; fputc('\n', stderr); #endif state=HFS_PARSE_STATE_INIT; p++; break; default: librdf_log(hash->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_HASH, NULL, "No such state %d", state); return 1; } } return 0; } /** * librdf_hash_from_array_of_strings: * @hash: hash object * @array: address of the start of the array of char* pointers * * Initialise a hash from an array of strings. * * Return value: non 0 on failure **/ int librdf_hash_from_array_of_strings(librdf_hash* hash, const char **array) { librdf_hash_datum key, value; /* on stack */ int i; for(i=0; (key.data=(char*)array[i]); i+=2) { value.data=(char*)array[i+1]; if(!value.data) { librdf_log(hash->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_HASH, NULL, "Array contains an odd number of strings - %d", i); return 1; } key.size=strlen((char*)key.data); value.size=strlen((char*)value.data); librdf_hash_put(hash, &key, &value); } return 0; } /** * librdf_hash_to_string: * @hash: #librdf_hash object * @filter: NULL terminated list of keys to ignore * * Format the hash as a string, suitable for parsing by librdf_hash_from_string. * * Note: this method allocates a new string since this is a _to_ method * and the caller must call librdf_free_memory() to free the resulting memory. * * Return value: string representation of the hash or NULL on failure **/ char* librdf_hash_to_string(librdf_hash* hash, const char *filter[]) { librdf_hash_datum *key = NULL, *value = NULL; librdf_iterator* iterator = NULL; raptor_stringbuffer* sb; char* result = NULL; size_t len; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(hash, librdf_hash, NULL); sb = raptor_new_stringbuffer(); if(!sb) goto tidy; key=librdf_new_hash_datum(hash->world, NULL, 0); value=librdf_new_hash_datum(hash->world, NULL, 0); if (!key || !value) goto tidy; iterator=librdf_hash_get_all(hash, key, value); if (!iterator) goto tidy; while(!librdf_iterator_end(iterator)) { librdf_hash_datum *k, *v; int key_is_filtered = 0; size_t i; k=(librdf_hash_datum *)librdf_iterator_get_key(iterator); v=(librdf_hash_datum *)librdf_iterator_get_value(iterator); if (!k || !v) break; /* Is this one of the keys that we are ignoring? */ if(filter) { for(i=0; filter[i]; i++) { size_t f_len = strlen(filter[i]); if(f_len == k->size && strncmp((const char*)k->data, filter[i], f_len) == 0) { key_is_filtered = 1; break; } } } if(!key_is_filtered) { if(raptor_stringbuffer_length(sb) > 0) raptor_stringbuffer_append_counted_string(sb, (unsigned char*)", ", 2, 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)k->data, k->size, 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"='", 2, 1); for(i=0; i < v->size; i++) { char c = ((char*)v->data)[i]; switch (c) { case '\'': raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"\\'", 2, 1); break; case '\\': raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"\\\\", 2, 1); break; default: raptor_stringbuffer_append_counted_string(sb, (unsigned char*)&c, 1, 1); break; } } raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"'", 1, 1); } librdf_iterator_next(iterator); } /* Generate a string result */ len=raptor_stringbuffer_length(sb); result = (char *)librdf_alloc_memory(len + 1); if (result) raptor_stringbuffer_copy_to_string(sb, (unsigned char*)result, len); tidy: if(iterator) librdf_free_iterator(iterator); if(value) librdf_free_hash_datum(value); if(key) librdf_free_hash_datum(key); if(sb) raptor_free_stringbuffer(sb); return result; } /** * librdf_hash_get_as_boolean: * @hash: #librdf_hash object * @key: key string to look up * * Lookup a hash key and decode value as a boolean. * * False values: "no", "false" * True values: "yes", "true" * * Return value: >0 (for true), 0 (for false) or <0 (for key not found or not known boolean value) **/ int librdf_hash_get_as_boolean(librdf_hash* hash, const char *key) { int bvalue = (-1); char *value; value = librdf_hash_get(hash, key); if(!value) /* does not exist - fail */ return -1; switch(strlen(value)) { case 2: /* try 'no' */ if(*value == 'n' && value[1] == 'o') bvalue = 0; break; case 3: /* try 'yes' */ if(*value == 'y' && value[1] == 'e' && value[2] == 's') bvalue = 1; break; case 4: /* try 'true' */ if(*value == 't' && value[1] == 'r' && value[2] == 'u' && value[3] == 'e') bvalue = 1; break; case 5: /* try 'false' */ if(!strncmp(value, "false", 5)) bvalue = 0; break; /* no need for default, bvalue is set above */ } LIBRDF_FREE(char*, value); return bvalue; } /** * librdf_hash_get_as_long: * @hash: #librdf_hash object * @key: key string to look up * * Lookup a hash key and decode value as a long. * * Return value: >0 (for success), <0 (for key not found or not known boolean value) **/ long librdf_hash_get_as_long(librdf_hash* hash, const char *key) { long lvalue; char *value; char *end_ptr; value = librdf_hash_get(hash, key); if(!value) /* does not exist - fail */ return -1; /* Using special base 0 which allows decimal, hex and octal */ lvalue = strtol(value, &end_ptr, 0); /* nothing found, return error */ if(end_ptr == value) lvalue= (-1); LIBRDF_FREE(char*, value); return lvalue; } /** * librdf_hash_put_strings: * @hash: hash object * @key: key * @value: value * * Insert key/value pairs into the hash as strings. * * The key and values are copied into the hash, no sharing i s done. * * Return value: non 0 on failure **/ int librdf_hash_put_strings(librdf_hash* hash, const char *key, const char *value) { librdf_hash_datum key_hd; /* static */ librdf_hash_datum value_hd; /* Note: We do not have to init the world field of * these librdf_hash_datum since they are never put on the * hash datums free list */ key_hd.data=(void*)key; key_hd.size=strlen(key); value_hd.data=(void*)value; value_hd.size=strlen(value); return librdf_hash_put(hash, &key_hd, &value_hd); } /** * librdf_hash_interpret_template: * @template_string: template string to interprate * @dictionary: dictionary of key/values to substitute * @prefix: prefix to mark a key in the template * @suffix: suffix to mark a key in the template * * Interpret keys in a template string to their value in a dictionary. * * Can be used to do variable substitution for a string where * the syntax that marks the variable is defined by the @prefix * and @suffix strings, and the variables are stored in the @dictionary * hash table. * * Return value: Newly allocated string, or NULL on failure **/ unsigned char* librdf_hash_interpret_template(const unsigned char* template_string, librdf_hash* dictionary, const unsigned char* prefix, const unsigned char* suffix) { raptor_stringbuffer* sb; unsigned char* result=NULL; size_t len; size_t prefix_len=strlen((const char*)prefix); size_t suffix_len=strlen((const char*)suffix); sb=raptor_new_stringbuffer(); if(!sb) return NULL; len=strlen((const char*)template_string); while(*template_string) { unsigned char* p; unsigned char* s; librdf_hash_datum key; /* static */ librdf_hash_datum *hd_value; size_t len2; p=(unsigned char*)strstr((const char*)template_string, (const char*)prefix); if(!p) { /* No more prefixes found so append rest of template */ raptor_stringbuffer_append_counted_string(sb, template_string, len, 1); break; } len2 = LIBRDF_GOOD_CAST(size_t, p - template_string); if(len2) raptor_stringbuffer_append_counted_string(sb, template_string, len2, 1); template_string += len2 + prefix_len; len -= len2 + prefix_len; /* key starts here */ key.data=(void*)template_string; s=(unsigned char*)strstr((const char*)template_string, (const char*)suffix); if(!s) /* template ended without a closing key suffix so just give up */ break; /* now have key */ len2 = LIBRDF_GOOD_CAST(size_t, s - (unsigned char*)key.data); key.size= len2; /* move past key and suffix */ template_string += len2 + suffix_len; len -= len2 + suffix_len; hd_value=librdf_hash_get_one(dictionary, &key); /* append value if there is one */ if(hd_value) { raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)hd_value->data, hd_value->size, 1); librdf_free_hash_datum(hd_value); } } /* Generate a string result */ len=raptor_stringbuffer_length(sb); if(len) { result = LIBRDF_MALLOC(unsigned char*, len + 1); raptor_stringbuffer_copy_to_string(sb, result, len); } raptor_free_stringbuffer(sb); return result; } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { librdf_hash *h, *h2, *ch; const char *test_hash_types[]={"bdb", "memory", NULL}; const char *test_hash_values[]={"colour","yellow", /* Made in UK, can you guess? */ "age", "new", "size", "large", "colour", "green", "fruit", "banana", "colour", "yellow", NULL, NULL}; const char *test_duplicate_key="colour"; const char *test_hash_array[]={"shape", "cube", "sides", "6", /* for testing get as long */ "3d", "yes", /* testing bool */ "colours", "red", "colours", "yellow", "creator", "rubik", NULL}; const char * const test_hash_string="field1='value1', field2='\\'value2', field3='\\\\', field4='\\\\\\'', field5 = 'a' "; const char *test_hash_delete_key="size"; const unsigned char* template_string=(const unsigned char*)"the shape is %{shape} and the sides are %{sides} created by %{rubik}"; const unsigned char* template_expected=(const unsigned char*)"the shape is cube and the sides are 6 created by "; const char * filter_string[] = {"field1", NULL}; int i,j; const char *type; librdf_hash_datum hd_key, hd_value; /* on stack */ const char *program=librdf_basename((const char*)argv[0]); int b; long l; char* string_result; unsigned char* template_result; librdf_world *world; world=librdf_new_world(); librdf_world_open(world); if(argc ==2) { type=argv[1]; h=librdf_new_hash(world, NULL); if(!h) { fprintf(stderr, "%s: Failed to create new hash type '%s'\n", program, type); return(0); } librdf_hash_open(h, "test", 0644, 1, 1, NULL); librdf_hash_from_string(h, argv[1]); fprintf(stdout, "%s: resulting ", program); librdf_hash_print(h, stdout); fputc('\n', stdout); fprintf(stdout, "%s: values count %d\n", program, librdf_hash_values_count(h)); librdf_hash_close(h); librdf_free_hash(h); return(0); } for(i=0; (type=test_hash_types[i]); i++) { fprintf(stdout, "%s: Trying to create new %s hash\n", program, type); h=librdf_new_hash(world, type); if(!h) { fprintf(stderr, "%s: Failed to create new hash type '%s'\n", program, type); continue; } if(librdf_hash_open(h, "test", 0644, 1, 1, NULL)) { fprintf(stderr, "%s: Failed to open new hash type '%s'\n", program, type); continue; } for(j=0; test_hash_values[j]; j+=2) { hd_key.data=(char*)test_hash_values[j]; hd_value.data=(char*)test_hash_values[j+1]; fprintf(stdout, "%s: Adding key/value pair: %s=%s\n", program, (char*)hd_key.data, (char*)hd_value.data); hd_key.size=strlen((char*)hd_key.data); hd_value.size=strlen((char*)hd_value.data); librdf_hash_put(h, &hd_key, &hd_value); fprintf(stdout, "%s: resulting ", program); librdf_hash_print(h, stdout); fputc('\n', stdout); fprintf(stdout, "%s: values count %d\n", program, librdf_hash_values_count(h)); } fprintf(stdout, "%s: Deleting key '%s'\n", program, test_hash_delete_key); hd_key.data=(char*)test_hash_delete_key; hd_key.size=strlen((char*)hd_key.data); librdf_hash_delete_all(h, &hd_key); fprintf(stdout, "%s: resulting ", program); librdf_hash_print(h, stdout); fputc('\n', stdout); fprintf(stdout, "%s: values count %d\n", program, librdf_hash_values_count(h)); fprintf(stdout, "%s: resulting %s hash keys: ", program, type); librdf_hash_print_keys(h, stdout); fputc('\n', stdout); fprintf(stdout, "%s: all values of key '%s'=", program, test_duplicate_key); librdf_hash_print_values(h, test_duplicate_key, stdout); fputc('\n', stdout); fprintf(stdout, "%s: cloning %s hash\n", program, type); ch=librdf_new_hash_from_hash(h); if(ch) { fprintf(stdout, "%s: resulting cloned ", program); librdf_hash_print(ch, stdout); fputc('\n', stdout); fprintf(stdout, "%s: values count %d\n", program, librdf_hash_values_count(ch)); librdf_hash_close(ch); librdf_free_hash(ch); } else { fprintf(stderr, "%s: Failed to clone %s hash\n", program, type); } librdf_hash_close(h); fprintf(stdout, "%s: Freeing hash\n", program); librdf_free_hash(h); } fprintf(stdout, "%s: Getting default hash factory\n", program); h2=librdf_new_hash(world, NULL); if(!h2) { fprintf(stderr, "%s: Failed to create new hash from default factory\n", program); return(1); } fprintf(stdout, "%s: Initialising hash from array of strings\n", program); if(librdf_hash_from_array_of_strings(h2, test_hash_array)) { fprintf(stderr, "%s: Failed to init hash from array of strings\n", program); return(1); } fprintf(stdout, "%s: resulting hash ", program); librdf_hash_print(h2, stdout); fputc('\n', stdout); fprintf(stdout, "%s: values count %d\n", program, librdf_hash_values_count(h2)); fprintf(stdout, "%s: resulting hash keys: ", program); librdf_hash_print_keys(h2, stdout); fputc('\n', stdout); /* test get as boolean and long functions */ { librdf_iterator* iterator; librdf_hash_datum *key_hd; key_hd=librdf_new_hash_datum(world, NULL, 0); iterator=librdf_hash_keys(h2, key_hd); while(!librdf_iterator_end(iterator)) { librdf_hash_datum *k=(librdf_hash_datum*)librdf_iterator_get_key(iterator); char *key_string; key_string = LIBRDF_MALLOC(char*, k->size + 1); if(!key_string) break; strncpy(key_string, (char*)k->data, k->size); key_string[k->size]='\0'; fprintf(stdout, "%s: boolean value of key '%s' is ", program, key_string); b=librdf_hash_get_as_boolean(h2, key_string); fprintf(stdout, "%d (0 F, -1 Bad, else T)\n", b); fprintf(stdout, "%s: long value of key '%s' is ", program, key_string); l=librdf_hash_get_as_long(h2, key_string); fprintf(stdout, "%ld (decimal, -1 Bad)\n", l); LIBRDF_FREE(char*, key_string); librdf_iterator_next(iterator); } if(iterator) librdf_free_iterator(iterator); librdf_free_hash_datum(key_hd); } fprintf(stdout, "%s: Freeing hash\n", program); /* close() done automatically by free so not required */ /* librdf_hash_close(h2); */ librdf_free_hash(h2); h2=librdf_new_hash(world, NULL); fprintf(stdout, "%s: Initialising hash from string >>%s<<\n", program, test_hash_string); librdf_hash_from_string (h2, test_hash_string); fprintf(stdout, "%s: resulting ", program); librdf_hash_print(h2, stdout); fputc('\n', stdout); fprintf(stdout, "%s: values count %d\n", program, librdf_hash_values_count(h2)); fprintf(stdout, "%s: Converting hash back to a string\n", program); string_result=librdf_hash_to_string(h2, NULL); /* Order is not guaranteed, so sadly we can't just do a full string comparison */ if(!strstr(string_result, "field1='value1'")) { fprintf(stdout, "%s: Did not see field1='value1' in the generated string >>%s<<\n", program, string_result); exit(1); } else if(!strstr(string_result, "field2='\\'value2'")) { fprintf(stdout, "%s: Did not see field2='\\'value2'' in the generated string >>%s<<\n", program, string_result); exit(1); } else if(!strstr(string_result, "field3='\\\\'")) { fprintf(stdout, "%s: Did not see field3='\\\\' in the generated string >>%s<<\n", program, string_result); exit(1); } else if(!strstr(string_result, "field4='\\\\\\'")) { fprintf(stdout, "%s: Did not see field4='\\\\\\' in the generated string >>%s<<\n", program, string_result); exit(1); } else if(!strstr(string_result, "field5='a'")) { fprintf(stdout, "%s: Did not see field5='a' in the generated string >>%s<<\n", program, string_result); exit(1); } else { fprintf(stdout, "%s: resulting in >>%s<<\n", program, string_result); } librdf_free_memory(string_result); fprintf(stdout, "%s: Converting hash back to a string with filter\n", program); string_result=librdf_hash_to_string(h2, filter_string); if(strstr(string_result, "field1")) { fprintf(stdout, "%s: Was not expecting >>field1<< to be in the generated string >>%s<<\n", program, string_result); exit(1); } else { fprintf(stdout, "%s: resulting in >>%s<<\n", program, string_result); } librdf_free_memory(string_result); librdf_free_hash(h2); fprintf(stdout, "%s: Subtituting into template >>%s<<\n", program, template_string); h2=librdf_new_hash(world, NULL); librdf_hash_from_array_of_strings(h2, test_hash_array); template_result=librdf_hash_interpret_template(template_string, h2, (const unsigned char*)"%{", (const unsigned char*)"}"); if(strcmp((const char*)template_result, (const char*)template_expected)) { fprintf(stdout, "%s: Templating failed. Result was >>%s<< but expected >>%s<<\n", program, template_result, template_expected); exit(1); } else fprintf(stdout, "%s: resulting in >>%s<<\n", program, template_result); LIBRDF_FREE(char*, template_result); librdf_free_hash(h2); librdf_free_world(world); /* keep gcc -Wall happy */ return(0); } #endif redland-1.0.17/src/rdf_query_virtuoso.c0000644000175000017500000011361212241001460015031 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_query_virtuoso.c - RDF Query with Virtuoso * * Copyright (C) 2008, Openlink Software http://www.openlinksw.com/ * Copyright (C) 2010, Dave Beckett http://www.dajobe.org/ * * Based in part on rasqal_result_formats.c and rasqal_sparql_xml.c * (see NOTICE later in code) * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License(LGPL) V2.1 or any newer version * 2. GNU General Public License(GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include #include #if defined(__APPLE__) /* Ignore /usr/include/sql.h deprecated warnings on OSX 10.8 */ #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif #include #include /*#define VIRTUOSO_STORAGE_DEBUG 1 */ #include static int librdf_query_virtuoso_results_next(librdf_query_results *query_results); static const char *strexpect(const char *keyword, const char *source) { while(isspace(*source)) source++; while(*keyword &&(toupper(*keyword) == toupper(*source))) { keyword++; source++; } if(*keyword) return NULL; if(*source == '\0') return source; if(isspace(*source)) { while(isspace(*source)) source++; return source; } return NULL; } static int rdf_virtuoso_ODBC_Errors(const char *where, librdf_world *world, librdf_storage_virtuoso_connection* handle) { SQLCHAR buf[512]; SQLCHAR sqlstate[15]; while(SQLError(handle->henv, handle->hdbc, handle->hstmt, sqlstate, NULL, buf, sizeof(buf), NULL) == SQL_SUCCESS) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "%s ||%s, SQLSTATE=%s\n", where, buf, sqlstate); #endif librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "Virtuoso %s failed [%s] %s", where, sqlstate, buf); } while(SQLError(handle->henv, handle->hdbc, SQL_NULL_HSTMT, sqlstate, NULL, buf, sizeof(buf), NULL) == SQL_SUCCESS) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "%s ||%s, SQLSTATE=%s\n", where, buf, sqlstate); #endif librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "Virtuoso %s failed [%s] %s", where, sqlstate, buf); } while(SQLError(handle->henv, SQL_NULL_HDBC, SQL_NULL_HSTMT, sqlstate, NULL, buf, sizeof(buf), NULL) == SQL_SUCCESS) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "%s ||%s, SQLSTATE=%s\n", where, buf, sqlstate); #endif librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "Virtuoso %s failed [%s] %s", where, sqlstate, buf); } return -1; } /* functions implementing query api */ static void virtuoso_free_result(librdf_query* query) { librdf_query_virtuoso_context *context; short i; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "virtuoso_free_result \n"); #endif if(context->colNames) { for(i = 0; i < context->numCols; i++) { if(context->colNames[i]) LIBRDF_FREE(char*, (char*)context->colNames[i]); } LIBRDF_FREE(cstrings, (char **)context->colNames); } context->colNames = NULL; if(context->colValues) { for(i = 0; i < context->numCols; i++) { if(context->colValues[i]) { librdf_free_node(context->colValues[i]); } } LIBRDF_FREE(librdf_node*, context->colValues); } context->colValues = NULL; } static int librdf_query_virtuoso_init(librdf_query* query, const char *name, librdf_uri* uri, const unsigned char* query_string, librdf_uri *base_uri) { librdf_query_virtuoso_context *context; size_t len; unsigned char *query_string_copy; char *seps={(char *)" \t\n\r\f"}; char *token; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_init \n"); #endif context->query = query; context->language=context->query->factory->name; context->offset = 0; context->colNames = NULL; context->colValues = 0; context->numCols = 0; context->failed = 0; context->eof = 1; context->row_count = 0; context->result_type = VQUERY_RESULTS_UNKNOWN; len = strlen((const char*)query_string); query_string_copy = LIBRDF_MALLOC(unsigned char*, len + 1); if(!query_string_copy) return 1; memcpy(query_string_copy, query_string, len + 1); token = strtok((char*)query_string_copy, seps); while(token != NULL) { if(strexpect("SELECT", (const char*)token)) { context->result_type = VQUERY_RESULTS_BINDINGS; break; } else if(strexpect("ASK", (const char*)token)) { context->result_type = VQUERY_RESULTS_BOOLEAN; break; } else if(strexpect("CONSTRUCT", (const char*)token)) { context->result_type = VQUERY_RESULTS_GRAPH | VQUERY_RESULTS_BINDINGS; break; } else if(strexpect("DESCRIBE", (const char*)token)) { context->result_type = VQUERY_RESULTS_GRAPH | VQUERY_RESULTS_BINDINGS; break; } token = strtok(NULL, seps); } memcpy(query_string_copy, query_string, len + 1); context->query_string = query_string_copy; if(base_uri) context->uri=librdf_new_uri_from_uri(base_uri); return 0; } static void librdf_query_virtuoso_terminate(librdf_query* query) { librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_terminate \n"); #endif virtuoso_free_result(query); SQLCloseCursor(context->vc->hstmt); if(context->query_string) LIBRDF_FREE(char*, context->query_string); if(context->uri) librdf_free_uri(context->uri); if(context->vc) context->vc->v_release_connection(context->storage, context->vc); if(context->storage) librdf_storage_remove_reference(context->storage); } static librdf_query_results* librdf_query_virtuoso_execute(librdf_query* query, librdf_model* model) { librdf_query_virtuoso_context *context; librdf_query_results* results = NULL; int rc = 0; SQLUSMALLINT icol; char pref[]="sparql define output:format '_JAVA_' "; char *cmd = NULL; size_t pref_len; size_t query_string_len; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_execute \n"); #endif context->model=model; context->numCols = 0; context->failed = 0; context->eof = 1; context->row_count = 0; context->limit= -1; context->offset= -1; virtuoso_free_result(query); SQLCloseCursor(context->vc->hstmt); pref_len = strlen(pref); query_string_len = strlen((char *)context->query_string); cmd = LIBRDF_MALLOC(char*, pref_len + query_string_len + 1); if(!cmd) { goto error; } memcpy(cmd, pref, pref_len); memcpy(cmd + pref_len, context->query_string, query_string_len + 1); #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "SQL>>%s\n", cmd); #endif rc = SQLExecDirect(context->vc->hstmt, (SQLCHAR *)cmd, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { context->result_type = VQUERY_RESULTS_SYNTAX; rdf_virtuoso_ODBC_Errors("SQLExecDirect()", context->storage->world, context->vc); goto error; } rc = SQLNumResultCols(context->vc->hstmt, &context->numCols); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLNumResultCols()", context->storage->world, context->vc); goto error; } if(context->numCols > 0) { context->colNames = LIBRDF_CALLOC(char**, LIBRDF_GOOD_CAST(size_t, context->numCols + 1), sizeof(char*)); if(!context->colNames) { goto error; } context->colValues = LIBRDF_CALLOC(librdf_node**, LIBRDF_GOOD_CAST(size_t, context->numCols + 1), sizeof(librdf_node*)); if(!context->colValues) { goto error; } for(icol = 1; icol<= context->numCols; icol++) { SQLSMALLINT namelen; size_t snamelen; SQLCHAR name[255]; rc = SQLColAttributes(context->vc->hstmt, icol, SQL_COLUMN_LABEL, name, sizeof(name), &namelen, NULL); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLColAttributes()", context->storage->world, context->vc); goto error; } snamelen = LIBRDF_GOOD_CAST(size_t, namelen); context->colNames[icol - 1] = LIBRDF_MALLOC(char*, snamelen + 1); if(!context->colNames[icol-1]) goto error; memcpy(context->colNames[icol-1], name, snamelen + 1); } context->colNames[context->numCols] = NULL; context->result_type |= VQUERY_RESULTS_BINDINGS; context->eof = 0; } results = LIBRDF_MALLOC(librdf_query_results*, sizeof(*results)); if(!results) { SQLCloseCursor(context->vc->hstmt); } else { results->query = query; } rc = librdf_query_virtuoso_results_next(results); if(rc == 2) /* ERROR */ goto error; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_execute OK\n"); #endif if(cmd) LIBRDF_FREE(char*, (char*)cmd); return results; error: if(cmd) LIBRDF_FREE(char*, (char*)cmd); if(results) LIBRDF_FREE(librdf_query_results*, results); context->failed = 1; virtuoso_free_result(query); return NULL; } static int librdf_query_virtuoso_get_limit(librdf_query* query) { librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; return context->limit; } static int librdf_query_virtuoso_set_limit(librdf_query* query, int limit) { librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; context->limit = limit; return 0; } static int librdf_query_virtuoso_get_offset(librdf_query* query) { librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; return context->offset; } static int librdf_query_virtuoso_set_offset(librdf_query* query, int offset) { librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; context->offset = offset; return 0; } /** * librdf_query_results_get_count: * @query_results: #librdf_query_results query results * * Get number of bindings so far. * * Return value: number of bindings found so far **/ static int librdf_query_virtuoso_results_get_count(librdf_query_results *query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_get_count \n"); #endif if(!query) return -1; context = (librdf_query_virtuoso_context*)query->context; if(context->failed || context->numCols <= 0) return -1; if(context->numCols <= 0) return -1; return context->row_count; } /** * librdf_query_results_next: * @query_results: #librdf_query_results query results * * Move to the next result. * * Return value: non-0 if failed or results exhausted **/ static int librdf_query_virtuoso_results_next(librdf_query_results *query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; int rc; short col; short numCols; librdf_node *node; char *data; int is_null; context = (librdf_query_virtuoso_context*)query->context; numCols = context->numCols; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_next \n"); #endif if(context->failed || context->eof) return 1; for(col = 0; col < numCols; col++) if(context->colValues[col]) { librdf_free_node(context->colValues[col]); context->colValues[col] = NULL; } rc = SQLFetch(context->vc->hstmt); if(rc == SQL_NO_DATA_FOUND) { context->eof = 1; return 1; } else if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { rdf_virtuoso_ODBC_Errors((char *)"SQLFetch", context->storage->world, context->vc); return 2; } for(col = 1; col <= context->numCols; col++) { data = context->vc->v_GetDataCHAR(context->storage->world, context->vc, col, &is_null); if(!data && !is_null) return 2; if(!data || is_null) { node = NULL; } else { node = context->vc->v_rdf2node(context->storage, context->vc, col, data); LIBRDF_FREE(char*, (char*) data); if(!node) return 2; } context->colValues[col-1]=node; } context->row_count++; return 0; } /** * librdf_query_results_finished: * @query_results: #librdf_query_results query results * * Find out if binding results are exhausted. * * Return value: non-0 if results are finished or query failed **/ static int librdf_query_virtuoso_results_finished(librdf_query_results *query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_finished \n"); #endif if(context->failed || context->eof) return 1; return 0; } /** * librdf_query_results_get_bindings: * @query_results: #librdf_query_results query results * @names: pointer to an array of binding names(or NULL) * @values: pointer to an array of binding value #librdf_node(or NULL) * * Get all binding names, values for current result. * * If names is not NULL, it is set to the address of a shared array * of names of the bindings(an output parameter). These names * are shared and must not be freed by the caller * * If values is not NULL, it is used as an array to store pointers * to the librdf_node* of the results. These nodes must be freed * by the caller. The size of the array is determined by the * number of names of bindings, returned by * librdf_query_get_bindings_count dynamically or * will be known in advanced if hard-coded into the query string. * * Example * * const char **names = NULL; * librdf_node* values[10]; * * if(librdf_query_results_get_bindings(results, &names, values)) * ... * * Return value: non-0 if the assignment failed **/ static int librdf_query_virtuoso_results_get_bindings(librdf_query_results *query_results, const char ***names, librdf_node **values) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; short col; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_get_bindings \n"); #endif if(context->failed || context->numCols <= 0) return 1; if(names) *names = (const char**)context->colNames; if(values && !context->eof) { for(col = 0; col < context->numCols; col++) { values[col]=context->colValues[col]; context->colValues[col] = NULL; } } return 0; } /** * librdf_query_results_get_binding_value: * @query_results: #librdf_query_results query results * @offset: offset of binding name into array of known names * * Get one binding value for the current result. * * Return value: a new #librdf_node binding value or NULL on failure **/ static librdf_node* librdf_query_virtuoso_results_get_binding_value(librdf_query_results *query_results, int offset) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; librdf_node *retVal; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_get_binding_value \n"); #endif if(context->failed || context->numCols <= 0) return NULL; if(offset < 0 || offset > context->numCols-1 || !context->colValues) return NULL; retVal=context->colValues[offset]; context->colValues[offset] = NULL; return retVal; } /** * librdf_query_results_get_binding_name: * @query_results: #librdf_query_results query results * @offset: offset of binding name into array of known names * * Get binding name for the current result. * * Return value: a pointer to a shared copy of the binding name or NULL on failure **/ static const char* librdf_query_virtuoso_results_get_binding_name(librdf_query_results *query_results, int offset) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_get_binding_name \n"); #endif if(context->failed || context->numCols <= 0) return NULL; if(offset < 0 || offset > context->numCols-1 || !context->colNames) return NULL; return context->colNames[offset]; } /** * librdf_query_results_get_binding_value_by_name: * @query_results: #librdf_query_results query results * @name: variable name * * Get one binding value for a given name in the current result. * * Return value: a new #librdf_node binding value or NULL on failure **/ static librdf_node* librdf_query_virtuoso_results_get_binding_value_by_name(librdf_query_results *query_results, const char *name) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; short col; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_get_binding_value_by_name \n"); #endif if(context->failed || context->numCols <= 0) return NULL; if(!context->colNames || !context->colValues) return NULL; for(col = 0; col < context->numCols; col++) { if(!strcmp((const char*)name, (const char*)context->colNames[col])) { return context->colValues[col]; break; } } return NULL; } /** * librdf_query_results_get_bindings_count: * @query_results: #librdf_query_results query results * * Get the number of bound variables in the result. * * Return value: <0 if failed or results exhausted **/ static int librdf_query_virtuoso_results_get_bindings_count(librdf_query_results *query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_get_bindings_count \n"); #endif if(context->failed || context->numCols <= 0) return -1; if(!context->colNames || !context->colValues) return -1; return context->numCols; } /** * librdf_free_query_results: * @query_results: #librdf_query_results object * * Destructor - destroy a #librdf_query_results object. * **/ static void librdf_query_virtuoso_free_results(librdf_query_results* query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_free_results \n"); #endif if(!context->failed && context->numCols) { SQLCloseCursor(context->vc->hstmt); } virtuoso_free_result(query); context->eof = 1; context->numCols = 0; context->row_count = 0; context->result_type = VQUERY_RESULTS_UNKNOWN; } /** * librdf_query_results_is_bindings: * @query_results: #librdf_query_results object * * Test if librdf_query_results is variable bindings format. * * Return value: non-0 if true **/ static int librdf_query_virtuoso_results_is_bindings(librdf_query_results* query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_is_bindings \n"); #endif if(context->numCols <= 0) return 0; return(context->result_type & VQUERY_RESULTS_BINDINGS); } /** * librdf_query_results_is_boolean: * @query_results: #librdf_query_results object * * Test if librdf_query_results is boolean format. * * If this function returns true, the result can be retrieved by * librdf_query_results_get_boolean(). * * Return value: non-0 if true **/ static int librdf_query_virtuoso_results_is_boolean(librdf_query_results* query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_is_boolean \n"); #endif if(context->numCols <= 0) return 0; return(context->result_type & VQUERY_RESULTS_BOOLEAN); } /** * librdf_query_results_is_graph: * @query_results: #librdf_query_results object * * Test if librdf_query_results is RDF graph format. * * Return value: non-0 if true **/ static int librdf_query_virtuoso_results_is_graph(librdf_query_results* query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_is_graph \n"); #endif if(context->numCols <= 0) return 0; return(context->result_type & VQUERY_RESULTS_GRAPH); } /** * librdf_query_results_is_syntax: * @query_results: #librdf_query_results object * * Test if librdf_query_results is a syntax. * * If this function returns true, the ONLY result available * from this query is a syntax that can be serialized using * one of the #query_result_formatter class methods or with * librdf_query_results_to_counted_string(), librdf_query_results_to_string(), * librdf_query_results_to_file_handle() or librdf_query_results_to_file() * * Return value: non-0 if true **/ static int librdf_query_virtuoso_results_is_syntax(librdf_query_results* query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_is_syntax \n"); #endif if(context->numCols <= 0) return 0; return(context->result_type & VQUERY_RESULTS_SYNTAX); } /** * librdf_query_results_get_boolean: * @query_results: #librdf_query_results query_results * * Get boolean query result. * * The return value is only meaningful if this is a boolean * query result - see #librdf_query_results_is_boolean * * Return value: boolean query result - >0 is true, 0 is false, <0 on error or finished */ static int librdf_query_virtuoso_results_get_boolean(librdf_query_results* query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; int rc; int data; int is_null; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_get_boolean \n"); #endif if(context->failed || context->numCols <= 0) return -1; rc = SQLFetch(context->vc->hstmt); if(rc == SQL_NO_DATA_FOUND) { context->eof = 1; return 0; } else if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { rdf_virtuoso_ODBC_Errors((char *)"SQLFetch", context->storage->world, context->vc); return -1; } rc = context->vc->v_GetDataINT(context->storage->world, context->vc, 1, &is_null, &data); context->eof = 1; if(rc == -1) return -1; return data; } typedef struct { librdf_query *query; librdf_query_virtuoso_context* qcontext; /* query context */ librdf_statement* statement; /* current statement */ librdf_node *graph; int finished; short numCols; } librdf_query_virtuoso_stream_context; static int librdf_query_virtuoso_query_results_end_of_stream(void* context) { librdf_query_virtuoso_stream_context* scontext = (librdf_query_virtuoso_stream_context*)context; return scontext->finished; } static int librdf_query_virtuoso_query_results_update_statement(void* context) { librdf_query_virtuoso_stream_context* scontext; librdf_query_virtuoso_context *qcontext; librdf_world* world; librdf_node* node; short colNum; char *data; int is_null; scontext = (librdf_query_virtuoso_stream_context*)context; qcontext = scontext->qcontext; world = scontext->query->world; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_query_results_update_statement \n"); #endif scontext->statement=librdf_new_statement(world); if(!scontext->statement) return 1; if(scontext->graph) { librdf_free_node(scontext->graph); scontext->graph = NULL; } if(!(qcontext->result_type & VQUERY_RESULTS_GRAPH)) goto fail; colNum = 1; if(colNum > scontext->numCols) goto fail; if(scontext->numCols > 3) { data = qcontext->vc->v_GetDataCHAR(world, qcontext->vc, colNum, &is_null); if(!data || is_null) goto fail; node = qcontext->vc->v_rdf2node(qcontext->storage, qcontext->vc, colNum, data); LIBRDF_FREE(char*, (char*)data); if(!node) goto fail; scontext->graph=node; colNum++; } data = qcontext->vc->v_GetDataCHAR(world, qcontext->vc, colNum, &is_null); if(!data || is_null) goto fail; node = qcontext->vc->v_rdf2node(qcontext->storage, qcontext->vc, colNum, data); LIBRDF_FREE(char*, (char*)data); if(!node) goto fail; librdf_statement_set_subject(scontext->statement, node); colNum++; if(colNum > scontext->numCols) goto fail; data = qcontext->vc->v_GetDataCHAR(world, qcontext->vc, colNum, &is_null); if(!data || is_null) goto fail; node = qcontext->vc->v_rdf2node(qcontext->storage, qcontext->vc, colNum, data); LIBRDF_FREE(char*, (char*)data); if(!node) goto fail; librdf_statement_set_predicate(scontext->statement, node); colNum++; if(colNum > scontext->numCols) goto fail; data = qcontext->vc->v_GetDataCHAR(world, qcontext->vc, colNum, &is_null); if(!data || is_null) goto fail; node = qcontext->vc->v_rdf2node(qcontext->storage, qcontext->vc, colNum, data); LIBRDF_FREE(char*, (char*)data); if(!node) goto fail; librdf_statement_set_object(scontext->statement, node); return 0; /* success */ fail: librdf_free_statement(scontext->statement); scontext->statement = NULL; return 1; } static int librdf_query_virtuoso_query_results_next_statement(void* context) { librdf_query_virtuoso_stream_context* scontext; librdf_query_virtuoso_context *qcontext; librdf_world* world; int rc; scontext = (librdf_query_virtuoso_stream_context*)context; qcontext = scontext->qcontext; world =scontext->query->world; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_query_results_next_statement \n"); #endif if(scontext->finished) return 1; if(scontext->statement) { librdf_free_statement(scontext->statement); scontext->statement = NULL; } rc = SQLFetch(qcontext->vc->hstmt); if(rc == SQL_NO_DATA_FOUND) { scontext->finished = 1; } else if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { rdf_virtuoso_ODBC_Errors((char *)"SQLFetch", world, qcontext->vc); scontext->finished = 1; } if(!scontext->finished) librdf_query_virtuoso_query_results_update_statement(scontext); return scontext->finished; } static void* librdf_query_virtuoso_query_results_get_statement(void* context, int flags) { librdf_query_virtuoso_stream_context* scontext; scontext = (librdf_query_virtuoso_stream_context*)context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_query_results_get_statement \n"); #endif switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return scontext->statement; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return scontext->graph; default: librdf_log(scontext->query->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_query_virtuoso_query_results_finished(void* context) { librdf_query_virtuoso_stream_context* scontext; scontext = (librdf_query_virtuoso_stream_context*)context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_query_results_finished \n"); #endif if(scontext) { if(scontext->statement) librdf_free_statement(scontext->statement); if(scontext->graph) librdf_free_node(scontext->graph); LIBRDF_FREE(librdf_query_virtuoso_stream_context, scontext); } } /** * librdf_query_results_as_stream: * @query_results: #librdf_query_results query_results * * Get a query result as an RDF graph in #librdf_stream form * * The return value is only meaningful if this is an RDF graph * query result - see #librdf_query_results_is_graph * * Return value: a new #librdf_stream result or NULL on error */ static librdf_stream* librdf_query_virtuoso_results_as_stream(librdf_query_results* query_results) { librdf_query *query = query_results->query; librdf_query_virtuoso_context *context; librdf_query_virtuoso_stream_context* scontext; librdf_stream *stream; int col; context = (librdf_query_virtuoso_context*)query->context; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_as_stream \n"); #endif if(context->failed || context->numCols < 3 || context->eof) return NULL; if((context->result_type & VQUERY_RESULTS_GRAPH) == 0) return NULL; scontext = LIBRDF_CALLOC(librdf_query_virtuoso_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; scontext->query = query; scontext->qcontext=context; scontext->numCols=context->numCols; scontext->statement= librdf_new_statement(query->world); if(!scontext->statement) { LIBRDF_FREE(librdf_query_virtuoso_stream_context, scontext); return NULL; } col = 0; if(scontext->numCols > 3) { scontext->graph=context->colValues[col]; context->colValues[col] = NULL; col++; } librdf_statement_set_subject(scontext->statement, context->colValues[col]); context->colValues[col] = NULL; col++; if(col > scontext->numCols) goto fail; librdf_statement_set_predicate(scontext->statement, context->colValues[col]); context->colValues[col] = NULL; col++; if(col > scontext->numCols) goto fail; librdf_statement_set_object(scontext->statement, context->colValues[col]); context->colValues[col] = NULL; col++; if(col > scontext->numCols) goto fail; stream=librdf_new_stream(query->world, (void*)scontext, &librdf_query_virtuoso_query_results_end_of_stream, &librdf_query_virtuoso_query_results_next_statement, &librdf_query_virtuoso_query_results_get_statement, &librdf_query_virtuoso_query_results_finished); if(!stream) { librdf_query_virtuoso_query_results_finished((void*)scontext); return NULL; } return stream; fail: librdf_free_statement(scontext->statement); scontext->statement = NULL; librdf_query_virtuoso_query_results_finished((void*)scontext); return NULL; } static librdf_query_results_formatter* librdf_query_virtuoso_new_results_formatter(librdf_query_results* query_results, const char *name, const char *mime_type, librdf_uri* format_uri) { rasqal_world* rasqal_world_ptr; rasqal_query_results_formatter* formatter; librdf_query_results_formatter* qrf; rasqal_world_ptr = query_results->query->world->rasqal_world_ptr; formatter = rasqal_new_query_results_formatter(rasqal_world_ptr, name, mime_type, (raptor_uri*)format_uri); if(!formatter) return NULL; qrf = LIBRDF_MALLOC(librdf_query_results_formatter*, sizeof(*qrf)); if(!qrf) { rasqal_free_query_results_formatter(formatter); return NULL; } qrf->query_results = query_results; qrf->formatter = formatter; return qrf; } static void librdf_query_virtuoso_free_results_formatter(librdf_query_results_formatter* qrf) { rasqal_free_query_results_formatter(qrf->formatter); LIBRDF_FREE(librdf_query_results, qrf); } /** * librdf_query_results_formatter_write: * @iostr: #raptor_iostream to write the query to * @formatter: #librdf_query_results_formatter object * @results: #librdf_query_results query results format * @base_uri: #librdf_uri base URI of the output format * * Write the query results using the given formatter to an iostream * * See librdf_query_results_formats_enumerate() to get the * list of syntax URIs and their description. * * Return value: non-0 on failure **/ static int librdf_query_virtuoso_results_formatter_write(raptor_iostream *iostr, librdf_query_results_formatter* qrf, librdf_query_results* query_results, librdf_uri *base_uri) { librdf_query *query = query_results->query; rasqal_variables_table *vt; rasqal_query_results *rasqal_qr; int rc = 0; int row_size; int i; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_query_virtuoso_results_formatter_write \n"); #endif row_size = librdf_query_results_get_bindings_count(query_results); /* Set up query results variables table */ vt = rasqal_new_variables_table(query->world->rasqal_world_ptr); for(i = 0 ; i < row_size; i++) { const char *name; size_t name_len; unsigned char *name_copy; name = librdf_query_results_get_binding_name(query_results, i); name_len = strlen(name); name_copy = LIBRDF_MALLOC(unsigned char*, name_len + 1); memcpy(name_copy, name, name_len + 1); rasqal_variables_table_add(vt, RASQAL_VARIABLE_TYPE_NORMAL, name_copy, NULL); } rasqal_qr = rasqal_new_query_results(query->world->rasqal_world_ptr, NULL, RASQAL_QUERY_RESULTS_BINDINGS, vt); while(!librdf_query_results_finished(query_results)) { rasqal_row* row; int offset; row = rasqal_new_row_for_size(query->world->rasqal_world_ptr, row_size); if(!row) { rc = 1; break; } for(offset = 0 ; offset < row_size; offset++) { librdf_node *node; rasqal_literal* literal; node = librdf_query_results_get_binding_value(query_results, offset); if(!node) { rc = 1; break; } literal = redland_node_to_rasqal_literal(query->world, node); if(!literal) { rc = 1; break; } rasqal_row_set_value_at(row, offset, literal); rasqal_free_literal(literal); } if(rc) break; rasqal_query_results_add_row(rasqal_qr, row); librdf_query_results_next(query_results); } if(!rc) rc = rasqal_query_results_formatter_write(iostr, qrf->formatter, rasqal_qr, (raptor_uri*)base_uri); rasqal_free_query_results(rasqal_qr); rasqal_free_variables_table(vt); return rc; } /* local function to register list query functions */ static void librdf_query_virtuoso_register_factory(librdf_query_factory *factory) { factory->context_length = sizeof(librdf_query_virtuoso_context); factory->init = librdf_query_virtuoso_init; factory->terminate = librdf_query_virtuoso_terminate; factory->execute = librdf_query_virtuoso_execute; factory->get_limit = librdf_query_virtuoso_get_limit; factory->set_limit = librdf_query_virtuoso_set_limit; factory->get_offset = librdf_query_virtuoso_get_offset; factory->set_offset = librdf_query_virtuoso_set_offset; factory->results_get_count = librdf_query_virtuoso_results_get_count; factory->results_next = librdf_query_virtuoso_results_next; factory->results_finished = librdf_query_virtuoso_results_finished; factory->results_get_bindings = librdf_query_virtuoso_results_get_bindings; factory->results_get_binding_value = librdf_query_virtuoso_results_get_binding_value; factory->results_get_binding_name = librdf_query_virtuoso_results_get_binding_name; factory->results_get_binding_value_by_name = librdf_query_virtuoso_results_get_binding_value_by_name; factory->results_get_bindings_count = librdf_query_virtuoso_results_get_bindings_count; factory->free_results = librdf_query_virtuoso_free_results; factory->results_is_bindings = librdf_query_virtuoso_results_is_bindings; factory->results_is_boolean = librdf_query_virtuoso_results_is_boolean; factory->results_is_graph = librdf_query_virtuoso_results_is_graph; factory->results_is_syntax = librdf_query_virtuoso_results_is_syntax; factory->results_get_boolean = librdf_query_virtuoso_results_get_boolean; factory->results_as_stream = librdf_query_virtuoso_results_as_stream; factory->new_results_formatter = librdf_query_virtuoso_new_results_formatter; factory->free_results_formatter = librdf_query_virtuoso_free_results_formatter; factory->results_formatter_write = librdf_query_virtuoso_results_formatter_write; } void librdf_init_query_virtuoso(librdf_world *world) { librdf_query_register_factory(world, "vsparql", (const unsigned char*)"http://www.w3.org/TR/rdf-vsparql-query/", &librdf_query_virtuoso_register_factory); } redland-1.0.17/src/rdf_log.c0000644000175000017500000001732111773152772012521 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_log.c - Kids love log * * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef WITH_THREADS #include #endif #ifdef HAVE_STDLIB_H #include #endif /* for gettimeofday */ #if TIME_WITH_SYS_TIME #include #include #else #if HAVE_SYS_TIME_H #include #else #include #endif #endif #include static const char * const log_level_names[LIBRDF_LOG_LAST+1]={ "none", "debug", "info", "warning", "error", "fatal" }; /** * librdf_log_simple: * @world: redland world object or NULL * @code: error code * @level: #librdf_log_level log level * @facility: #librdf_log_facility log facility * @locator: raptor_locator if available or NULL * @message: message to record * * Log a message. * * If world is NULL, the error ocurred in redland startup before * the world was created. **/ void librdf_log_simple(librdf_world* world, int code, librdf_log_level level, librdf_log_facility facility, void *locator, const char *message) { if(level > LIBRDF_LOG_LAST) level=LIBRDF_LOG_NONE; if(facility > LIBRDF_FROM_LAST) facility=LIBRDF_FROM_NONE; if(world) { if(world->log_handler) { world->log.code=code; world->log.level=level; world->log.facility=facility; world->log.message=message; world->log.locator=(raptor_locator*)locator; if(world->log_handler(world->log_user_data, &world->log)) return; } else { va_list null_valist; memset(&null_valist, '\0', sizeof(va_list)); switch(level) { case LIBRDF_LOG_ERROR: if(world->error_handler) { if(world->error_handler(world->error_user_data, message, null_valist)) return; } break; case LIBRDF_LOG_WARN: if(world->warning_handler) { if(world->warning_handler(world->warning_user_data, message, null_valist)) return; } break; case LIBRDF_LOG_NONE: case LIBRDF_LOG_DEBUG: case LIBRDF_LOG_INFO: case LIBRDF_LOG_FATAL: default: break; } } } fputs("librdf ", stderr); fputs(log_level_names[level], stderr); if(locator) { int locator_len; locator_len = raptor_locator_format(NULL, 0, (raptor_locator*)locator); if(locator_len > 0) { size_t slocator_len = LIBRDF_GOOD_CAST(size_t, locator_len); char *buffer = LIBRDF_MALLOC(char*, slocator_len + 2); *buffer=' '; raptor_locator_format(buffer + 1, slocator_len, (raptor_locator*)locator); fputs(buffer, stderr); LIBRDF_FREE(char*, buffer); } } fputs(" - ", stderr); fputs((message ? message : "(no message)"), stderr); fputc('\n', stderr); } /** * librdf_log: * @world: redland world object or NULL * @code: error code * @level: #librdf_log_level log level * @facility: #librdf_log_facility log facility * @locator: raptor_locator if available or NULL * @message: message to record * @...: message parameters * * Log a message. * * If world is NULL, the error ocurred in redland startup before * the world was created. **/ void librdf_log(librdf_world* world, int code, librdf_log_level level, librdf_log_facility facility, void *locator, const char *message, ...) { va_list arguments; char *buffer; va_start(arguments, message); #if RAPTOR_VERSION >= 20005 buffer = NULL; if(raptor_vasprintf(&buffer, message, arguments) < 0) buffer = NULL; #else buffer = raptor_vsnprintf(message, arguments); #endif librdf_log_simple(world, code, level, facility, locator, buffer); if(buffer) raptor_free_memory(buffer); va_end(arguments); } /** * librdf_fatal: * @world: redland world object or NULL * @message: message arguments * * INTERNAL - Fatal error. * * If world is NULL, the error ocurred in redland startup before * the world was created. **/ REDLAND_NORETURN void librdf_fatal(librdf_world* world, int facility, const char *file, int line, const char *function, const char *message) { char empty_buffer[1]; char *buffer; int length; size_t slength; /* Not passing NULL to snprintf since that seems to not be portable */ length = snprintf(empty_buffer, 1, "%s:%d:%s: fatal error: %s", file, line, function, message); slength = LIBRDF_GOOD_CAST(size_t, length); slength++; /* add the length 1 passed in */ buffer = LIBRDF_MALLOC(char*, slength + 1); /* for \0 */ if(buffer) snprintf(buffer, slength, "%s:%d:%s: fatal error: %s", file, line, function, message); librdf_log_simple(world, /* code */ 0, LIBRDF_LOG_FATAL, (librdf_log_facility)facility, NULL, (buffer ? (const char*)buffer : message)); if(buffer) LIBRDF_FREE(char*, buffer); abort(); } /** * librdf_log_message_code: * @message: log message * * Retrieve error code from log message. * * Return value: int error code **/ int librdf_log_message_code(librdf_log_message *message) { return message->code; } /** * librdf_log_message_level: * @message: log message * * Retrieve severity of log message. * * The log message severity level is defined in rdf_log.h as values * of enum #librdf_log_level * * Return value: severity level **/ librdf_log_level librdf_log_message_level(librdf_log_message *message) { return message->level; } /** * librdf_log_message_facility: * @message: log message * * Retrieve facility that generated the message. * * The log message facility is defined in rdf_log.h as values * of enum #librdf_log_facility * * Return value: ID of Redland facility that generated the log message. **/ librdf_log_facility librdf_log_message_facility(librdf_log_message *message) { return message->facility; } /** * librdf_log_message_message: * @message: log message * * Retrieve text message from log entry. * * The string returned is shared and must be copied by the caller * if required to be retained. * * Return value: shared pointer to the log message string **/ const char * librdf_log_message_message(librdf_log_message *message) { return message->message; } /** * librdf_log_message_locator: * @message: log message * * Retrieve locator of log entry. * * Return value: pointer to an appropriate raptor_locator* or NULL if not available **/ raptor_locator* librdf_log_message_locator(librdf_log_message *message) { return message->locator; } /* prototypes for testing errors only - NOT PART OF API */ void librdf_test_error(librdf_world* world, const char *message) { librdf_log_simple(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_NONE, NULL, message); } void librdf_test_warning(librdf_world* world, const char *message) { librdf_log_simple(world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_NONE, NULL, message); } redland-1.0.17/src/rdf_serializer.h0000644000175000017500000001070511610752761014107 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_serializer.h - RDF Serializer Factory / Serializer interfaces and definition * * Copyright (C) 2002-2009, David Beckett http://www.dajobe.org/ * Copyright (C) 2002-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_SERIALIZER_H #define LIBRDF_SERIALIZER_H #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif #include /* class methods */ REDLAND_API void librdf_serializer_register_factory(librdf_world *world, const char *name, const char *label, const char *mime_type, const unsigned char *uri_string, void (*factory) (librdf_serializer_factory*)); REDLAND_API REDLAND_DEPRECATED int librdf_serializer_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label); REDLAND_API const raptor_syntax_description* librdf_serializer_get_description(librdf_world* world, unsigned int counter); REDLAND_API int librdf_serializer_check_name(librdf_world* world, const char *name); /* constructor */ REDLAND_API librdf_serializer* librdf_new_serializer(librdf_world* world, const char *name, const char *mime_type, librdf_uri *type_uri); REDLAND_API librdf_serializer* librdf_new_serializer_from_factory(librdf_world* world, librdf_serializer_factory *factory); /* destructor */ REDLAND_API void librdf_free_serializer(librdf_serializer *serializer); /* methods */ REDLAND_API REDLAND_DEPRECATED int librdf_serializer_serialize_model(librdf_serializer* serializer, FILE *handle, librdf_uri* base_uri, librdf_model* model); REDLAND_API int librdf_serializer_serialize_stream_to_file_handle(librdf_serializer* serializer, FILE *handle, librdf_uri* base_uri, librdf_stream *stream); REDLAND_API int librdf_serializer_serialize_model_to_file_handle(librdf_serializer* serializer, FILE *handle, librdf_uri* base_uri, librdf_model* model); REDLAND_API int librdf_serializer_serialize_stream_to_file(librdf_serializer* serializer, const char *name, librdf_uri* base_uri, librdf_stream* stream); REDLAND_API int librdf_serializer_serialize_model_to_file(librdf_serializer* serializer, const char *name, librdf_uri* base_uri, librdf_model* model); REDLAND_API unsigned char* librdf_serializer_serialize_stream_to_string(librdf_serializer* serializer, librdf_uri* base_uri, librdf_stream* stream); REDLAND_API unsigned char* librdf_serializer_serialize_model_to_string(librdf_serializer* serializer, librdf_uri* base_uri, librdf_model* model); REDLAND_API unsigned char* librdf_serializer_serialize_stream_to_counted_string(librdf_serializer* serializer, librdf_uri* base_uri, librdf_stream* stream, size_t *length_p); REDLAND_API unsigned char* librdf_serializer_serialize_model_to_counted_string(librdf_serializer* serializer, librdf_uri* base_uri, librdf_model* model, size_t *length_p); REDLAND_API int librdf_serializer_serialize_stream_to_iostream(librdf_serializer* serializer, librdf_uri* base_uri, librdf_stream *stream, raptor_iostream* iostr); REDLAND_API int librdf_serializer_serialize_model_to_iostream(librdf_serializer* serializer, librdf_uri* base_uri, librdf_model *model, raptor_iostream* iostr); REDLAND_API void librdf_serializer_set_error(librdf_serializer* serializer, void *user_data, void (*error_fn)(void *user_data, const char *msg, ...)); REDLAND_API void librdf_serializer_set_warning(librdf_serializer* serializer, void *user_data, void (*warning_fn)(void *user_data, const char *msg, ...)); REDLAND_API librdf_node* librdf_serializer_get_feature(librdf_serializer* serializer, librdf_uri *feature); REDLAND_API int librdf_serializer_set_feature(librdf_serializer* serializer, librdf_uri *feature, librdf_node* value); REDLAND_API int librdf_serializer_set_namespace(librdf_serializer* serializer, librdf_uri *uri, const char *prefix); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_concepts_internal.h0000644000175000017500000000246711167024222015445 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_concepts_internal.h - Internal RDF concept URIs and nodes definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_CONCEPTS_INTERNAL_H #define LIBRDF_CONCEPTS_INTERNAL_H #ifdef __cplusplus extern "C" { #endif /* class methods */ void librdf_init_concepts(librdf_world *world); void librdf_finish_concepts(librdf_world *world); void librdf_get_concept_by_name(librdf_world *world, int is_ms, const char *name, librdf_uri **uri_p, librdf_node **node_p); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_model_internal.h0000644000175000017500000001554711167024222014732 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_model_internal.h - Internal RDF Model definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_MODEL_INTERNAL_H #define LIBRDF_MODEL_INTERNAL_H #ifdef __cplusplus extern "C" { #endif struct librdf_model_s { librdf_world *world; /* usage: usage count of this instance * * Used by other redland classes such as iterator, stream * via librdf_model_add_reference librdf_model_remove_reference * The usage count of model after construction is 1. */ int usage; /* sub_models: list of sub librdf_model* */ librdf_list* sub_models; /* supports_contexts : does the storage model support redland contexts? */ int supports_contexts; /* context : model implementation user data */ void *context; struct librdf_model_factory_s* factory; }; /* A Model Factory */ struct librdf_model_factory_s { char* name; char* label; /* the rest of this structure is populated by the model-specific register function */ size_t context_length; /* init the factory */ void (*init)(void); /* terminate the factory */ void (*terminate)(void); /* create a new model */ int (*create)(librdf_model* model, librdf_storage* storage, librdf_hash* options); /* copy a model */ /* clone is assumed to do leave the new model in the same state * after an init() method on an existing model - i.e ready to * use but closed. */ librdf_model* (*clone)(librdf_model* new_model); /* destroy model */ void (*destroy)(librdf_model* model); /* return the number of statements in the model for model */ int (*size)(librdf_model* model); /* add a statement to the model from the given model */ int (*add_statement)(librdf_model* model, librdf_statement* statement); /* add a statement to the model from the given model */ int (*add_statements)(librdf_model* model, librdf_stream* statement_stream); /* remove a statement from the model */ int (*remove_statement)(librdf_model* model, librdf_statement* statement); /* check if statement in model */ int (*contains_statement)(librdf_model* model, librdf_statement* statement); /* check for [node, property, ?] */ int (*has_arc_in)(librdf_model *model, librdf_node *node, librdf_node *property); /* check for [?, property, node] */ int (*has_arc_out)(librdf_model *model, librdf_node *node, librdf_node *property); /* serialise the model in model */ librdf_stream* (*serialise)(librdf_model* model); /* serialise the results of a query */ librdf_stream* (*find_statements)(librdf_model* model, librdf_statement* statement); librdf_stream* (*find_statements_with_options)(librdf_model* model, librdf_statement* statement, librdf_node* context_node, librdf_hash* options); /* return a list of Nodes marching given arc, target */ librdf_iterator* (*get_sources)(librdf_model* model, librdf_node *arc, librdf_node *target); /* return a list of Nodes marching given source, target */ librdf_iterator* (*get_arcs)(librdf_model* model, librdf_node *source, librdf_node *target); /* return a list of Nodes marching given source, target */ librdf_iterator* (*get_targets)(librdf_model* model, librdf_node *source, librdf_node *target); /* return list of properties to/from a node */ librdf_iterator* (*get_arcs_in)(librdf_model *model, librdf_node *node); librdf_iterator* (*get_arcs_out)(librdf_model *model, librdf_node *node); /* add a statement to the model from the context */ int (*context_add_statement)(librdf_model* model, librdf_node* context, librdf_statement *statement); /* remove a statement from the context */ int (*context_remove_statement)(librdf_model* model, librdf_node* context, librdf_statement *statement); /* list statements in a context */ librdf_stream* (*context_serialize)(librdf_model* model, librdf_node* context); /* query the model */ librdf_query_results* (*query_execute)(librdf_model* model, librdf_query* query); /* sync the model to the storage - OPTIONAL */ int (*sync)(librdf_model* model); /* add a statement from the context - OPTIONAL (librdf_model will * implement using context_add_statement if missing) */ int (*context_add_statements)(librdf_model* model, librdf_node* context, librdf_stream *stream); /* remove a statement from the context - OPTIONAL (librdf_model will * implement using context_remove_statement if missing) */ int (*context_remove_statements)(librdf_model* model, librdf_node* context); /* get the single storage for this model if there is one - OPTIONAL */ librdf_storage* (*get_storage)(librdf_model* model); /* search for statement in a context - OPTIONAL (rdf_model will do * it using find_statements if missing) */ librdf_stream* (*find_statements_in_context)(librdf_model* model, librdf_statement* statement, librdf_node* context_node); /* return an iterator of context nodes in the store - OPTIONAL * (returning NULL) */ librdf_iterator* (*get_contexts)(librdf_model* model); /* features - OPTIONAL */ librdf_node* (*get_feature)(librdf_model* model, librdf_uri* feature); int (*set_feature)(librdf_model* model, librdf_uri* feature, librdf_node* value); /* transactions - OPTIONAL */ int (*transaction_start)(librdf_model* model); int (*transaction_start_with_handle)(librdf_model* model, void* handle); int (*transaction_commit)(librdf_model* model); int (*transaction_rollback)(librdf_model* model); void* (*transaction_get_handle)(librdf_model* model); }; /* module init */ void librdf_init_model(librdf_world *world); /* module terminate */ void librdf_finish_model(librdf_world *world); /* class methods */ void librdf_model_register_factory(librdf_world *world, const char *name, const char *label, void (*factory) (librdf_model_factory*)); librdf_model_factory* librdf_get_model_factory(librdf_world* world, const char *name); void librdf_model_add_reference(librdf_model *model); void librdf_model_remove_reference(librdf_model *model); /* model storage factory initialise (the only model factory at present) */ void librdf_init_model_storage(librdf_world *world); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_model.h0000644000175000017500000001750211447226412013035 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_model.h - RDF Model definition * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_MODEL_H #define LIBRDF_MODEL_H #ifndef LIBRDF_OBJC_FRAMEWORK #include #else #include #endif #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif /* class methods */ REDLAND_API int librdf_model_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label); /* constructors */ /* Create a new Model */ REDLAND_API librdf_model* librdf_new_model(librdf_world *world, librdf_storage *storage, const char* options_string); REDLAND_API librdf_model* librdf_new_model_with_options(librdf_world *world, librdf_storage *storage, librdf_hash* options); /* Create a new Model from an existing Model - CLONE */ REDLAND_API librdf_model* librdf_new_model_from_model(librdf_model* model); /* destructor */ REDLAND_API void librdf_free_model(librdf_model *model); /* functions / methods */ REDLAND_API int librdf_model_size(librdf_model* model); /* add statements */ REDLAND_API int librdf_model_add(librdf_model* model, librdf_node* subject, librdf_node* predicate, librdf_node* object); REDLAND_API int librdf_model_add_string_literal_statement(librdf_model* model, librdf_node* subject, librdf_node* predicate, const unsigned char* literal, const char *xml_language, int is_wf_xml); REDLAND_API int librdf_model_add_typed_literal_statement(librdf_model* model, librdf_node* subject, librdf_node* predicate, const unsigned char* literal, const char *xml_language, librdf_uri *datatype_uri); REDLAND_API int librdf_model_add_statement(librdf_model* model, librdf_statement* statement); REDLAND_API int librdf_model_add_statements(librdf_model* model, librdf_stream* statement_stream); /* remove statements */ REDLAND_API int librdf_model_remove_statement(librdf_model* model, librdf_statement* statement); /* containment */ /* check for exact statement match */ REDLAND_API int librdf_model_contains_statement(librdf_model* model, librdf_statement* statement); /* check for [node, property, ?] */ REDLAND_API int librdf_model_has_arc_in(librdf_model *model, librdf_node *node, librdf_node *property); /* check for [?, property, node] */ REDLAND_API int librdf_model_has_arc_out(librdf_model *model, librdf_node *node, librdf_node *property); /* list the entire model as a stream of statements */ REDLAND_API librdf_stream* librdf_model_as_stream(librdf_model* model); /* DEPRECATED serialise the entire model */ REDLAND_API REDLAND_DEPRECATED librdf_stream* librdf_model_serialise(librdf_model* model); /* queries */ REDLAND_API librdf_stream* librdf_model_find_statements(librdf_model* model, librdf_statement* statement); /** * LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL: * * Model find statement option. * * If set, the find statement uses substring matching. */ #define LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL "http://feature.librdf.org/model-find-match-substring-literal" REDLAND_API librdf_stream* librdf_model_find_statements_with_options(librdf_model* model, librdf_statement* statement, librdf_node* context_node, librdf_hash* options); REDLAND_API librdf_iterator* librdf_model_get_sources(librdf_model *model, librdf_node *arc, librdf_node *target); REDLAND_API librdf_iterator* librdf_model_get_arcs(librdf_model *model, librdf_node *source, librdf_node *target); REDLAND_API librdf_iterator* librdf_model_get_targets(librdf_model *model, librdf_node *source, librdf_node *arc); REDLAND_API librdf_node* librdf_model_get_source(librdf_model *model, librdf_node *arc, librdf_node *target); REDLAND_API librdf_node* librdf_model_get_arc(librdf_model *model, librdf_node *source, librdf_node *target); REDLAND_API librdf_node* librdf_model_get_target(librdf_model *model, librdf_node *source, librdf_node *arc); /* return list of properties to/from a node */ REDLAND_API librdf_iterator* librdf_model_get_arcs_in(librdf_model *model, librdf_node *node); REDLAND_API librdf_iterator* librdf_model_get_arcs_out(librdf_model *model, librdf_node *node); /* submodels */ REDLAND_API int librdf_model_add_submodel(librdf_model* model, librdf_model* sub_model); REDLAND_API int librdf_model_remove_submodel(librdf_model* model, librdf_model* sub_model); REDLAND_API REDLAND_DEPRECATED void librdf_model_print(librdf_model *model, FILE *fh); REDLAND_API int librdf_model_write(librdf_model *model, raptor_iostream* iostr); /* statement contexts */ REDLAND_API int librdf_model_context_add_statement(librdf_model* model, librdf_node* context, librdf_statement* statement); REDLAND_API int librdf_model_context_add_statements(librdf_model* model, librdf_node* context, librdf_stream* stream); REDLAND_API int librdf_model_context_remove_statement(librdf_model* model, librdf_node* context, librdf_statement* statement); REDLAND_API int librdf_model_context_remove_statements(librdf_model* model, librdf_node* context); REDLAND_API librdf_stream* librdf_model_context_as_stream(librdf_model* model, librdf_node* context); REDLAND_API REDLAND_DEPRECATED librdf_stream* librdf_model_context_serialize(librdf_model* model, librdf_node* context); REDLAND_API int librdf_model_contains_context(librdf_model* model, librdf_node* context); REDLAND_API int librdf_model_supports_contexts(librdf_model* model); /* query language */ REDLAND_API librdf_query_results* librdf_model_query_execute(librdf_model* model, librdf_query* query); REDLAND_API int librdf_model_sync(librdf_model* model); REDLAND_API librdf_storage* librdf_model_get_storage(librdf_model *model); REDLAND_API int librdf_model_load(librdf_model* model, librdf_uri *uri, const char *name, const char *mime_type, librdf_uri *type_uri); REDLAND_API unsigned char* librdf_model_to_counted_string(librdf_model* model, librdf_uri *uri, const char *name, const char *mime_type, librdf_uri *type_uri, size_t* string_length_p); REDLAND_API unsigned char* librdf_model_to_string(librdf_model* model, librdf_uri *uri, const char *name, const char *mime_type, librdf_uri *type_uri); /* find statements in a given context */ REDLAND_API librdf_stream* librdf_model_find_statements_in_context(librdf_model* model, librdf_statement* statement, librdf_node* context_node); REDLAND_API librdf_iterator* librdf_model_get_contexts(librdf_model* model); REDLAND_API int librdf_model_transaction_start(librdf_model* model); REDLAND_API int librdf_model_transaction_start_with_handle(librdf_model* model, void* handle); REDLAND_API int librdf_model_transaction_commit(librdf_model* model); REDLAND_API int librdf_model_transaction_rollback(librdf_model* model); REDLAND_API void* librdf_model_transaction_get_handle(librdf_model* model); /** * LIBRDF_MODEL_FEATURE_CONTEXTS: * * Model feature contexts. * * If set, the model has redland contexts. */ #define LIBRDF_MODEL_FEATURE_CONTEXTS "http://feature.librdf.org/model-contexts" /* features */ REDLAND_API librdf_node* librdf_model_get_feature(librdf_model* model, librdf_uri* feature); REDLAND_API int librdf_model_set_feature(librdf_model* model, librdf_uri* feature, librdf_node* value); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_storage_trees.c0000644000175000017500000007724611773150065014613 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_trees.c - RDF Storage in memory using balanced trees * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif /* for ptrdiff_t */ #ifdef HAVE_STDDEF_H #include #endif #include #include /* Not yet fully implemented (namely iteration) */ /*#define RDF_STORAGE_TREES_WITH_CONTEXTS 1*/ typedef struct { #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS librdf_node* context; #endif raptor_avltree* spo_tree; /* Always present */ raptor_avltree* sop_tree; /* Optional */ raptor_avltree* ops_tree; /* Optional */ raptor_avltree* pso_tree; /* Optional */ } librdf_storage_trees_graph; typedef struct { librdf_storage_trees_graph* graph; /* Statements without a context */ #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS raptor_avltree* contexts; /* Tree of librdf_storage_trees_graph */ #endif int index_sop; int index_ops; int index_pso; } librdf_storage_trees_instance; /* prototypes for local functions */ static int librdf_storage_trees_init(librdf_storage* storage, const char *name, librdf_hash* options); static int librdf_storage_trees_open(librdf_storage* storage, librdf_model* model); static int librdf_storage_trees_close(librdf_storage* storage); static int librdf_storage_trees_size(librdf_storage* storage); static int librdf_storage_trees_add_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_trees_add_statements(librdf_storage* storage, librdf_stream* statement_stream); static int librdf_storage_trees_remove_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_trees_remove_statement_internal(librdf_storage_trees_graph* graph, librdf_statement* statement); static int librdf_storage_trees_contains_statement(librdf_storage* storage, librdf_statement* statement); static librdf_stream* librdf_storage_trees_serialise(librdf_storage* storage); static librdf_stream* librdf_storage_trees_find_statements(librdf_storage* storage, librdf_statement* statement); /* graph functions */ static librdf_storage_trees_graph* librdf_storage_trees_graph_new(librdf_storage* storage, librdf_node* context); static void librdf_storage_trees_graph_free(void* data); #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS static int librdf_storage_trees_graph_compare(const void* data1, const void* data2); #endif /* serialising implementing functions */ static int librdf_storage_trees_serialise_end_of_stream(void* context); static int librdf_storage_trees_serialise_next_statement(void* context); static void* librdf_storage_trees_serialise_get_statement(void* context, int flags); static void librdf_storage_trees_serialise_finished(void* context); /* context functions */ #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS static int librdf_storage_trees_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_trees_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static librdf_stream* librdf_storage_trees_context_serialise(librdf_storage* storage, librdf_node* context_node); #endif /* statement tree functions */ static int librdf_statement_compare_spo(const void* data1, const void* data2); static int librdf_statement_compare_sop(const void* data1, const void* data2); static int librdf_statement_compare_ops(const void* data1, const void* data2); static int librdf_statement_compare_pso(const void* data1, const void* data2); static void librdf_storage_trees_avl_free(void* data); static void librdf_storage_trees_register_factory(librdf_storage_factory *factory); /* functions implementing storage api */ static int librdf_storage_trees_init(librdf_storage* storage, const char *name, librdf_hash* options) { const int index_spo_option = librdf_hash_get_as_boolean(options, "index-spo") > 0; const int index_sop_option = librdf_hash_get_as_boolean(options, "index-sop") > 0; const int index_ops_option = librdf_hash_get_as_boolean(options, "index-ops") > 0; const int index_pso_option = librdf_hash_get_as_boolean(options, "index-pso") > 0; librdf_storage_trees_instance* context; context = LIBRDF_CALLOC(librdf_storage_trees_instance*, 1, sizeof(*context)); if(!context) { if(options) librdf_free_hash(options); return 1; } librdf_storage_set_instance(storage, context); #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS /* Support contexts if option given */ if (librdf_hash_get_as_boolean(options, "contexts") > 0) { context->contexts=librdf_new_avltree(librdf_storage_trees_graph_compare, librdf_storage_trees_graph_free); } else { context->contexts=NULL; } #endif /* No indexing options given, index all by default */ if (!index_spo_option && !index_sop_option && !index_ops_option && !index_pso_option) { context->index_sop=1; context->index_ops=1; context->index_pso=1; } else { /* spo is always indexed, option just exists so user can * specifically /only/ index spo */ context->index_sop=index_sop_option; context->index_ops=index_ops_option; context->index_pso=index_pso_option; } context->graph = librdf_storage_trees_graph_new(storage, NULL); /* no more options, might as well free them now */ if(options) librdf_free_hash(options); return 0; } static void librdf_storage_trees_terminate(librdf_storage* storage) { if (storage->instance != NULL) LIBRDF_FREE(librdf_storage_trees_instance, storage->instance); } static int librdf_storage_trees_open(librdf_storage* storage, librdf_model* model) { /* nop */ return 0; } /** * librdf_storage_trees_close: * @storage: the storage * * . * * Close the storage, and free all content since there is no persistance. * * Return value: non 0 on failure **/ static int librdf_storage_trees_close(librdf_storage* storage) { librdf_storage_trees_instance* context=(librdf_storage_trees_instance*)storage->instance; librdf_storage_trees_graph_free(context->graph); context->graph=NULL; #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS librdf_free_avltree(context->contexts); context->contexts=NULL; #endif return 0; } static int librdf_storage_trees_size(librdf_storage* storage) { librdf_storage_trees_instance* context=(librdf_storage_trees_instance*)storage->instance; return raptor_avltree_size(context->graph->spo_tree); } static int librdf_storage_trees_add_statement_internal(librdf_storage* storage, librdf_storage_trees_graph* graph, librdf_statement* statement) { librdf_storage_trees_instance* context=(librdf_storage_trees_instance*)storage->instance; int status = 0; /* copy statement (store single copy in all trees) */ statement = librdf_new_statement_from_statement(statement); /* spo_tree owns statement */ status = raptor_avltree_add(graph->spo_tree, statement); if (status > 0) /* item already exists; old item remains in tree */ return 0; else if (status < 0) /* failure */ return status; /* others have null deleters */ /* (XXX: corrupt model if insertions fail) */ if (context->index_sop) raptor_avltree_add(graph->sop_tree, statement); if (context->index_ops) raptor_avltree_add(graph->ops_tree, statement); if (context->index_pso) raptor_avltree_add(graph->pso_tree, statement); return status; } /** * librdf_storage_trees_add_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to add * * Add a statement (with no context) to the storage. * * Return value: non 0 on failure (negative if error, positive if statement * already exists). **/ static int librdf_storage_trees_add_statement(librdf_storage* storage, librdf_statement* statement) { librdf_storage_trees_instance* context=(librdf_storage_trees_instance*)storage->instance; return librdf_storage_trees_add_statement_internal(storage, context->graph, statement); } static int librdf_storage_trees_add_statements(librdf_storage* storage, librdf_stream* statement_stream) { int status=0; for(; !librdf_stream_end(statement_stream); librdf_stream_next(statement_stream)) { librdf_statement* statement=librdf_stream_get_object(statement_stream); if (statement) { status=librdf_storage_trees_add_statement(storage, statement); if (status) break; } else { status=1; break; } } return status; } static int librdf_storage_trees_remove_statement_internal(librdf_storage_trees_graph* graph, librdf_statement* statement) { if (graph->sop_tree) raptor_avltree_delete(graph->sop_tree, statement); if (graph->ops_tree) raptor_avltree_delete(graph->ops_tree, statement); if (graph->pso_tree) raptor_avltree_delete(graph->pso_tree, statement); raptor_avltree_delete(graph->spo_tree, statement); return 0; } /** * librdf_storage_trees_remove_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to remove * * Remove a statement (without context) from the storage. * * Return value: non 0 on failure **/ static int librdf_storage_trees_remove_statement(librdf_storage* storage, librdf_statement* statement) { librdf_storage_trees_instance* context=(librdf_storage_trees_instance*)storage->instance; return librdf_storage_trees_remove_statement_internal(context->graph, statement); } static int librdf_storage_trees_contains_statement(librdf_storage* storage, librdf_statement* statement) { librdf_storage_trees_instance* context=(librdf_storage_trees_instance*)storage->instance; return (raptor_avltree_search(context->graph->spo_tree, statement) != NULL); } typedef struct { librdf_storage *storage; raptor_avltree_iterator *avltree_iterator; #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS librdf_node *context_node; #endif } librdf_storage_trees_serialise_stream_context; static librdf_stream* librdf_storage_trees_serialise_range(librdf_storage* storage, librdf_statement* range) { librdf_storage_trees_instance* context=(librdf_storage_trees_instance*)storage->instance; librdf_storage_trees_serialise_stream_context* scontext; librdf_stream* stream; int filter = 0; scontext = LIBRDF_CALLOC(librdf_storage_trees_serialise_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; scontext->avltree_iterator = NULL; /* ?s ?p ?o */ if (!range || (!range->subject && !range->predicate && !range->object)) { scontext->avltree_iterator = raptor_new_avltree_iterator(context->graph->spo_tree, /* range */ NULL, /* range free */ NULL, 1); if (range) { librdf_free_statement(range); range=NULL; } /* s ?p o */ } else if (range->subject && !range->predicate && range->object) { if (context->index_sop) scontext->avltree_iterator = raptor_new_avltree_iterator(context->graph->sop_tree, range, librdf_storage_trees_avl_free, 1); else filter=1; /* s _ _ */ } else if (range->subject) { scontext->avltree_iterator = raptor_new_avltree_iterator(context->graph->spo_tree, range, librdf_storage_trees_avl_free, 1); /* ?s _ o */ } else if (range->object) { if (context->index_ops) scontext->avltree_iterator = raptor_new_avltree_iterator(context->graph->ops_tree, range, librdf_storage_trees_avl_free, 1); else filter=1; /* ?s p ?o */ } else { /* range->predicate != NULL */ if (context->index_pso) scontext->avltree_iterator = raptor_new_avltree_iterator(context->graph->pso_tree, range, librdf_storage_trees_avl_free, 1); else filter=1; } /* If filter is set, we're missing the required index. * Iterate over the entire model and filter the stream. * (With a fully indexed store, this will never happen) */ if (filter) { scontext->avltree_iterator = raptor_new_avltree_iterator(context->graph->spo_tree, range, librdf_storage_trees_avl_free, 1); } #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS scontext->context_node=NULL; #endif if(!scontext->avltree_iterator) { LIBRDF_FREE(librdf_storage_trees_serialise_stream_context, scontext); return librdf_new_empty_stream(storage->world); } scontext->storage=storage; librdf_storage_add_reference(scontext->storage); stream=librdf_new_stream(storage->world, (void*)scontext, &librdf_storage_trees_serialise_end_of_stream, &librdf_storage_trees_serialise_next_statement, &librdf_storage_trees_serialise_get_statement, &librdf_storage_trees_serialise_finished); if(!stream) { librdf_storage_trees_serialise_finished((void*)scontext); return NULL; } if(filter) { if(librdf_stream_add_map(stream, &librdf_stream_statement_find_map, NULL, (void*)range)) { /* error - stream_add_map failed */ librdf_free_stream(stream); stream=NULL; } } return stream; } static librdf_stream* librdf_storage_trees_serialise(librdf_storage* storage) { return librdf_storage_trees_serialise_range(storage, NULL); } static int librdf_storage_trees_serialise_end_of_stream(void* context) { librdf_storage_trees_serialise_stream_context* scontext=(librdf_storage_trees_serialise_stream_context*)context; return raptor_avltree_iterator_is_end(scontext->avltree_iterator); } static int librdf_storage_trees_serialise_next_statement(void* context) { librdf_storage_trees_serialise_stream_context* scontext=(librdf_storage_trees_serialise_stream_context*)context; return raptor_avltree_iterator_next(scontext->avltree_iterator); } static void* librdf_storage_trees_serialise_get_statement(void* context, int flags) { librdf_storage_trees_serialise_stream_context* scontext=(librdf_storage_trees_serialise_stream_context*)context; if(!scontext->avltree_iterator) return NULL; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return (librdf_statement*)raptor_avltree_iterator_get(scontext->avltree_iterator); #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return scontext->context_node; #endif default: return NULL; } } static void librdf_storage_trees_serialise_finished(void* context) { librdf_storage_trees_serialise_stream_context* scontext=(librdf_storage_trees_serialise_stream_context*)context; if(scontext->avltree_iterator) raptor_free_avltree_iterator(scontext->avltree_iterator); if(scontext->storage) librdf_storage_remove_reference(scontext->storage); LIBRDF_FREE(librdf_storage_trees_serialise_stream_context, scontext); } #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS /** * librdf_storage_trees_context_add_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to add * * Add a statement to a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_trees_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { librdf_storage_trees_instance* context=(librdf_storage_trees_instance*)storage->instance; librdf_storage_trees_graph* key=librdf_storage_trees_graph_new(storage, context_node); librdf_storage_trees_graph* graph=(librdf_storage_trees_graph*) raptor_avltree_search(context->contexts, key); if(graph) { librdf_storage_trees_graph_free(key); } else { raptor_avltree_add(context->contexts, key); graph=key; } return librdf_storage_trees_add_statement_internal(storage, graph, statement); } /** * librdf_storage_trees_context_remove_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to remove * * Remove a statement from a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_trees_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { librdf_storage_trees_instance* context=(librdf_storage_trees_instance*)storage->instance; librdf_storage_trees_graph* key=librdf_storage_trees_graph_new(storage, context_node); librdf_storage_trees_graph* graph=(librdf_storage_trees_graph*) raptor_avltree_search(context->contexts, &key); librdf_storage_trees_graph_free(key); if (graph) { return librdf_storage_trees_remove_statement_internal(graph, statement); } else { return -1; } } /** * librdf_storage_trees_context_serialise: * @storage: #librdf_storage object * @context_node: #librdf_node object * * List all statements in a storage context. * * Return value: #librdf_stream of statements or NULL on failure or context is empty **/ static librdf_stream* librdf_storage_trees_context_serialise(librdf_storage* storage, librdf_node* context_node) { return NULL; } /** * librdf_storage_trees_context_get_contexts: * @storage: #librdf_storage object * * List all context nodes in a storage. * * Return value: #librdf_iterator of context_nodes or NULL on failure or no contexts **/ static librdf_iterator* librdf_storage_trees_get_contexts(librdf_storage* storage) { return NULL; } #endif /** * librdf_storage_trees_find_statements: * @storage: the storage * @statement: the statement to match * * . * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * Uses #librdf_statement_match to do the matching. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_trees_find_statements(librdf_storage* storage, librdf_statement* statement) { librdf_stream* stream; librdf_statement* range=librdf_new_statement_from_statement(statement); if(!range) return NULL; stream=librdf_storage_trees_serialise_range(storage, range); return stream; } /* statement tree functions */ static int librdf_storage_trees_node_compare(librdf_node* n1, librdf_node* n2) { if (n1 == n2) { return 0; } else if (n1->type != n2->type) { return LIBRDF_GOOD_CAST(int, n2->type) - LIBRDF_GOOD_CAST(int, n1->type); } else { switch (n1->type) { case RAPTOR_TERM_TYPE_URI: return librdf_uri_compare(n1->value.uri, n2->value.uri); case RAPTOR_TERM_TYPE_LITERAL: if(1) { const unsigned char l1 = n1->value.literal.language_len; const unsigned char l2 = n2->value.literal.language_len; const unsigned char l = (l1 < l2) ? l1 : l2; /* compare first by data type */ int r = raptor_uri_compare(n1->value.literal.datatype, n2->value.literal.datatype); if(r) return r; /* if data type is equal, compare by value */ r = strcmp((const char*)n1->value.literal.string, (const char*)n2->value.literal.string); if(r) return r; /* if both data type and value are equal, compare by language */ if(l) { return strncmp((const char*)n1->value.literal.language, (const char*)n2->value.literal.language, (size_t)l); } else { /* if l == 0 strncmp will always return 0; in that case * consider the node with no language to be lesser. */ return l1 - l2; } } case RAPTOR_TERM_TYPE_BLANK: return strcmp((char*)n1->value.blank.string, (char*)n2->value.blank.string); case RAPTOR_TERM_TYPE_UNKNOWN: default: if(1) { ptrdiff_t d; d = LIBRDF_GOOD_CAST(char*, n2) - LIBRDF_GOOD_CAST(char*, n1); return (d > 0) - (d < 0); } } } } /* Compare two statements in (s, p, o) order. * NULL fields act as wildcards. */ static int librdf_statement_compare_spo(const void* data1, const void* data2) { librdf_statement* a = (librdf_statement*)data1; librdf_statement* b = (librdf_statement*)data2; int cmp = 0; /* Subject */ if (a->subject == NULL || b->subject == NULL) return 0; /* wildcard subject match */ else cmp = librdf_storage_trees_node_compare(a->subject, b->subject); if (cmp != 0) return cmp; /* Predicate */ if (a->predicate == NULL || b->predicate == NULL) return 0; /* wildcard predicate match */ else cmp = librdf_storage_trees_node_compare(a->predicate, b->predicate); if (cmp != 0) return cmp; /* Object */ if (a->object == NULL || b->object == NULL) return 0; /* wildcard object match */ else cmp = librdf_storage_trees_node_compare(a->object, b->object); return cmp; } /* Compare two statements in (o, s, p) order. * NULL fields act as wildcards. */ static int librdf_statement_compare_sop(const void* data1, const void* data2) { librdf_statement* a = (librdf_statement*)data1; librdf_statement* b = (librdf_statement*)data2; int cmp = 0; /* Subject */ if (a->subject == NULL || b->subject == NULL) return 0; /* wildcard subject match */ else cmp = librdf_storage_trees_node_compare(a->subject, b->subject); if (cmp != 0) return cmp; /* Object */ if (a->object == NULL || b->object == NULL) return 0; /* wildcard object match */ else cmp = librdf_storage_trees_node_compare(a->object, b->object); if (cmp != 0) return cmp; /* Predicate */ if (a->predicate == NULL || b->predicate == NULL) return 0; /* wildcard predicate match */ else cmp = librdf_storage_trees_node_compare(a->predicate, b->predicate); return cmp; } /* Compare two statements in (o, p, s) order. * NULL fields act as wildcards. */ static int librdf_statement_compare_ops(const void* data1, const void* data2) { librdf_statement* a = (librdf_statement*)data1; librdf_statement* b = (librdf_statement*)data2; int cmp = 0; /* Object */ if (a->object == NULL || b->object == NULL) return 0; /* wildcard object match */ else cmp = librdf_storage_trees_node_compare(a->object, b->object); if (cmp != 0) return cmp; /* Predicate */ if (a->predicate == NULL || b->predicate == NULL) return 0; /* wildcard predicate match */ else cmp = librdf_storage_trees_node_compare(a->predicate, b->predicate); if (cmp != 0) return cmp; /* Subject */ if (a->subject == NULL || b->subject == NULL) return 0; /* wildcard subject match */ else cmp = librdf_storage_trees_node_compare(a->subject, b->subject); return cmp; } /* Compare two statements in (p, s, o) order. * NULL fields act as wildcards. */ static int librdf_statement_compare_pso(const void* data1, const void* data2) { librdf_statement* a = (librdf_statement*)data1; librdf_statement* b = (librdf_statement*)data2; int cmp = 0; /* Predicate */ if (a->predicate == NULL || b->predicate == NULL) return 0; /* wildcard predicate match */ else cmp = librdf_storage_trees_node_compare(a->predicate, b->predicate); if (cmp != 0) return cmp; /* Subject */ if (a->subject == NULL || b->subject == NULL) return 0; /* wildcard subject match */ else cmp = librdf_storage_trees_node_compare(a->subject, b->subject); if (cmp != 0) return cmp; /* Object */ if (a->object == NULL || b->object == NULL) return 0; /* wildcard object match */ else cmp = librdf_storage_trees_node_compare(a->object, b->object); return cmp; } static void librdf_storage_trees_avl_free(void* data) { librdf_statement* stmnt=(librdf_statement*)data; librdf_free_statement(stmnt); } /* graph functions */ static librdf_storage_trees_graph* librdf_storage_trees_graph_new(librdf_storage* storage, librdf_node* context_node) { librdf_storage_trees_instance* context=(librdf_storage_trees_instance*)storage->instance; librdf_storage_trees_graph* graph; graph = LIBRDF_MALLOC(librdf_storage_trees_graph*, sizeof(*graph)); #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS graph->context=(context_node ? librdf_new_node_from_node(context_node) : NULL); #endif /* Always create SPO index */ graph->spo_tree = raptor_new_avltree(librdf_statement_compare_spo, librdf_storage_trees_avl_free, /* flags */ 0); if(!graph->spo_tree) { LIBRDF_FREE(librdf_storage_trees_graph, graph); return NULL; } if(context->index_sop) graph->sop_tree = raptor_new_avltree(librdf_statement_compare_sop, NULL, /* flags */ 0); else graph->sop_tree=NULL; if(context->index_ops) graph->ops_tree = raptor_new_avltree(librdf_statement_compare_ops, NULL, /* flags */ 0); else graph->ops_tree=NULL; if(context->index_pso) graph->pso_tree = raptor_new_avltree(librdf_statement_compare_pso, NULL, /* flags */ 0); else graph->pso_tree=NULL; return graph; } #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS static int librdf_storage_trees_graph_compare(const void* data1, const void* data2) { librdf_storage_trees_graph* a = (librdf_storage_trees_graph*)data1; librdf_storage_trees_graph* b = (librdf_storage_trees_graph*)data2; return librdf_storage_trees_node_compare(a->context, b->context); } #endif static void librdf_storage_trees_graph_free(void* data) { librdf_storage_trees_graph* graph = (librdf_storage_trees_graph*)data; #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS librdf_free_node(graph->context); #endif /* Extra index trees have null deleters (statements are shared) */ if (graph->sop_tree) raptor_free_avltree(graph->sop_tree); if (graph->ops_tree) raptor_free_avltree(graph->ops_tree); if (graph->pso_tree) raptor_free_avltree(graph->pso_tree); /* Free spo tree and statements */ raptor_free_avltree(graph->spo_tree); graph->spo_tree = NULL; graph->sop_tree = NULL; graph->ops_tree = NULL; graph->pso_tree = NULL; LIBRDF_FREE(librdf_storage_trees_graph, graph); } /** * librdf_storage_trees_get_feature: * @storage: #librdf_storage object * @feature: #librdf_uri feature property * * Get the value of a storage feature. * * Return value: #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ static librdf_node* librdf_storage_trees_get_feature(librdf_storage* storage, librdf_uri* feature) { #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS librdf_storage_trees_instance* scontext=(librdf_storage_trees_instance*)storage->instance; unsigned char *uri_string; if(!feature) return NULL; uri_string=librdf_uri_as_string(feature); if(!uri_string) return NULL; if(!strcmp((const char*)uri_string, LIBRDF_MODEL_FEATURE_CONTEXTS)) { unsigned char value[2]; sprintf((char*)value, "%d", (scontext->contexts != NULL)); return librdf_new_node_from_typed_literal(storage->world, value, NULL, NULL); } #endif return NULL; } /** Local entry point for dynamically loaded storage module */ static void librdf_storage_trees_register_factory(librdf_storage_factory *factory) { LIBRDF_ASSERT_CONDITION(!strncmp(factory->name, "trees", 5)); factory->version = LIBRDF_STORAGE_INTERFACE_VERSION; factory->init = librdf_storage_trees_init; factory->clone = NULL; factory->terminate = librdf_storage_trees_terminate; factory->open = librdf_storage_trees_open; factory->close = librdf_storage_trees_close; factory->size = librdf_storage_trees_size; factory->add_statement = librdf_storage_trees_add_statement; factory->add_statements = librdf_storage_trees_add_statements; factory->remove_statement = librdf_storage_trees_remove_statement; factory->contains_statement = librdf_storage_trees_contains_statement; factory->serialise = librdf_storage_trees_serialise; factory->find_statements = librdf_storage_trees_find_statements; /* These could be implemented, but only if all indexes are available. * If they returned NULL if the indexes weren't available, * librdf_storage_find_statements would break, unfortunately. * Since these are exposed by model methods, the storage interface * needs to be fixed so these can be exposed but find_statements * still work */ factory->find_sources = NULL; factory->find_arcs = NULL; factory->find_targets = NULL; #ifdef RDF_STORAGE_TREES_WITH_CONTEXTS factory->context_add_statement = librdf_storage_trees_context_add_statement; factory->context_remove_statement = librdf_storage_trees_context_remove_statement; factory->context_serialise = librdf_storage_trees_context_serialise; factory->get_contexts = librdf_storage_trees_get_contexts; #else factory->context_add_statement = NULL; factory->context_remove_statement = NULL; factory->context_serialise = NULL; factory->get_contexts = NULL; #endif factory->sync = NULL; factory->get_feature = librdf_storage_trees_get_feature; } /* * librdf_init_storage_trees: * @world: world object * * INTERNAL - Initialise the built-in storage_trees module. */ void librdf_init_storage_trees(librdf_world *world) { librdf_storage_register_factory(world, "trees", "Balanced trees", &librdf_storage_trees_register_factory); } redland-1.0.17/src/rdf_model.c0000644000175000017500000021334111773150065013031 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_model.c - RDF Graph (Model) interface * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include /* for exit() */ #endif #include #ifndef STANDALONE /** * librdf_init_model: * @world: redland world object * * INTERNAL - Initialise the model module. * **/ void librdf_init_model(librdf_world *world) { /* Always have model storage - must always be the default model */ librdf_init_model_storage(world); } /** * librdf_finish_model: * @world: redland world object * * INTERNAL - Terminate the model module. * **/ void librdf_finish_model(librdf_world *world) { if(world->models) { raptor_free_sequence(world->models); world->models=NULL; } } /** * librdf_model_supports_contexts: * @model: the model object * * Check if this model supports contexts * * Return value: non-0 if contexts are supported **/ int librdf_model_supports_contexts(librdf_model* model) { return model->supports_contexts; } /* class methods */ static void librdf_free_model_factory(librdf_model_factory* factory) { if(factory->name) LIBRDF_FREE(librdf_model_factory, factory->name); if(factory->label) LIBRDF_FREE(librdf_model_factory, factory->label); LIBRDF_FREE(librdf_model_factory, factory); } /** * librdf_model_register_factory: * @world: redland world object * @name: the model factory name * @label: the storage factory label * @factory: pointer to function to call to register the factory * * Register a model factory. * **/ REDLAND_EXTERN_C void librdf_model_register_factory(librdf_world *world, const char *name, const char *label, void (*factory) (librdf_model_factory*)) { librdf_model_factory *model; int i; librdf_world_open(world); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG2("Received registration for model %s\n", name); #endif if(!world->models) { world->models = raptor_new_sequence((raptor_data_free_handler)librdf_free_model_factory, NULL); if(!world->models) goto oom; } for(i=0; (model=(librdf_model_factory*)raptor_sequence_get_at(world->models, i)); i++) { if(!strcmp(model->name, name)) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_MODEL, NULL, "model %s already registered", model->name); return; } } model = LIBRDF_CALLOC(librdf_model_factory*, 1, sizeof(*model)); if(!model) goto oom; model->name = LIBRDF_MALLOC(char*, strlen(name) + 1); if(!model->name) goto oom_tidy; strcpy(model->name, name); model->label = LIBRDF_MALLOC(char*, strlen(label) + 1); if(!model->label) goto oom_tidy; strcpy(model->label, label); if(raptor_sequence_push(world->models, model)) goto oom; /* Call the model registration function on the new object */ (*factory)(model); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("%s has context size %d\n", name, model->context_length); #endif return; oom_tidy: librdf_free_model_factory(model); oom: LIBRDF_FATAL1(world, LIBRDF_FROM_MODEL, "Out of memory"); } /** * librdf_get_model_factory: * @world: redland world object * @name: the factory name or NULL for the default factory * * Get a model factory by name. * * Return value: the factory object or NULL if there is no such factory **/ librdf_model_factory* librdf_get_model_factory(librdf_world* world, const char *name) { librdf_model_factory *factory; librdf_world_open(world); /* return 1st model if no particular one wanted - why? */ if(!name) { factory=(librdf_model_factory *)raptor_sequence_get_at(world->models, 0); if(!factory) { LIBRDF_DEBUG1("No (default) models registered\n"); return NULL; } } else { int i; for(i=0; (factory=(librdf_model_factory*)raptor_sequence_get_at(world->models, i)); i++) { if(!strcmp(factory->name, name)) break; } /* else FACTORY name not found */ if(!factory) { LIBRDF_DEBUG2("No model with name %s found\n", name); return NULL; } } return factory; } /** * librdf_model_enumerate: * @world: redland world object * @counter: index into the list of models * @name: pointer to store the name of the model (or NULL) * @label: pointer to store syntax readable label (or NULL) * * Get information on models. * * Return value: non 0 on failure of if counter is out of range **/ int librdf_model_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label) { librdf_model_factory *factory; int ioffset = LIBRDF_GOOD_CAST(int, counter); librdf_world_open(world); factory = (librdf_model_factory*)raptor_sequence_get_at(world->models, ioffset); if(!factory) return 1; if(name) *name = factory->name; if(label) *label = factory->label; return 0; } /** * librdf_new_model: * @world: redland world object * @storage: #librdf_storage to use * @options_string: options to initialise model * * Constructor - create a new storage #librdf_model object. * * The options are encoded as described in librdf_hash_from_string() * and can be NULL if none are required. * * Return value: a new #librdf_model object or NULL on failure */ librdf_model* librdf_new_model (librdf_world *world, librdf_storage *storage, const char *options_string) { librdf_hash* options_hash; librdf_model *model; librdf_world_open(world); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); if(!storage) return NULL; options_hash=librdf_new_hash(world, NULL); if(!options_hash) return NULL; if(librdf_hash_from_string(options_hash, options_string)) { librdf_free_hash(options_hash); return NULL; } model=librdf_new_model_with_options(world, storage, options_hash); librdf_free_hash(options_hash); return model; } /** * librdf_new_model_with_options: * @world: redland world object * @storage: #librdf_storage storage to use * @options: #librdf_hash of options to use * * Constructor - Create a new #librdf_model with storage. * * Options are presently not used. * * Return value: a new #librdf_model object or NULL on failure **/ librdf_model* librdf_new_model_with_options(librdf_world *world, librdf_storage *storage, librdf_hash* options) { librdf_model *model; librdf_uri *uri; librdf_world_open(world); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); if(!storage) return NULL; model = LIBRDF_CALLOC(librdf_model*, 1, sizeof(*model)); if(!model) return NULL; model->world=world; model->factory=librdf_get_model_factory(world, "storage"); if(!model->factory) { LIBRDF_FREE(librdf_model, model); return NULL; } model->context = LIBRDF_CALLOC(void*, 1, model->factory->context_length); if(!model->context || model->factory->create(model, storage, options)) { if(model->context) LIBRDF_FREE(data, model->context); LIBRDF_FREE(librdf_model, model); return NULL; } uri=librdf_new_uri(world, (const unsigned char*)LIBRDF_MODEL_FEATURE_CONTEXTS); if(uri) { librdf_node *node=librdf_model_get_feature(model, uri); if(node) { model->supports_contexts=atoi((const char*)librdf_node_get_literal_value(node)); librdf_free_node(node); } librdf_free_uri(uri); } model->usage=1; return model; } /** * librdf_new_model_from_model: * @model: the existing #librdf_model * * Copy constructor - create a new librdf_model from an existing one. * * Creates a new model as a copy of the existing model in the same * storage context. * * Return value: a new #librdf_model or NULL on failure **/ librdf_model* librdf_new_model_from_model(librdf_model* model) { librdf_model *new_model; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); new_model=model->factory->clone(model); if(new_model) { new_model->supports_contexts=model->supports_contexts; new_model->usage=1; } return new_model; } /** * librdf_free_model: * @model: #librdf_model model to destroy * * Destructor - Destroy a #librdf_model object. * **/ void librdf_free_model(librdf_model *model) { librdf_iterator* iterator; librdf_model* m; if(!model) return; LIBRDF_ASSERT_OBJECT_POINTER_RETURN(model, librdf_model); if(--model->usage) return; if(model->sub_models) { iterator=librdf_list_get_iterator(model->sub_models); if(iterator) { while(!librdf_iterator_end(iterator)) { m=(librdf_model*)librdf_iterator_get_object(iterator); if(m) librdf_free_model(m); librdf_iterator_next(iterator); } librdf_free_iterator(iterator); } librdf_free_list(model->sub_models); } else { model->factory->destroy(model); } LIBRDF_FREE(data, model->context); LIBRDF_FREE(librdf_model, model); } void librdf_model_add_reference(librdf_model *model) { model->usage++; } void librdf_model_remove_reference(librdf_model *model) { model->usage--; } /* methods */ /** * librdf_model_size: * @model: #librdf_model object * * Get the number of statements in the model. * * WARNING: Not all underlying stores can return the size of the graph * In which case the return value will be negative. * * Return value: the number of statements or <0 if not possible **/ int librdf_model_size(librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, -1); return model->factory->size(model); } /** * librdf_model_add_statement: * @model: model object * @statement: statement object * * Add a statement to the model. * * The passed-in statement is copied when added to the model, not * shared with the model. It must be a complete statement - all * of subject, predicate, object parts must be present. * * Only statements that are legal RDF can be added: URI or blank subject, * URI predicate and URI or blank or literal object (i.e. anything). * * If the statement already exists in the model, it is not added. * Duplicate statements can be added when used with Redland Contexts * such as with #librdf_model_context_add_statement * * Return value: non 0 on failure **/ int librdf_model_add_statement(librdf_model* model, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if(!librdf_statement_is_complete(statement)) return 1; return model->factory->add_statement(model, statement); } /** * librdf_model_add_statements: * @model: model object * @statement_stream: stream of statements to use * * Add a stream of statements to the model. * * If any of the statements are illegal RDF statements they will * be skipped and not added. See #librdf_model_add_statement for the detail. * * If any of the statements already exists in the store, they are not * added unless Redland contexts are being used. See also * #librdf_model_context_add_statements * * Return value: non 0 on failure **/ int librdf_model_add_statements(librdf_model* model, librdf_stream* statement_stream) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement_stream, librdf_statement, 1); return model->factory->add_statements(model, statement_stream); } /** * librdf_model_add: * @model: model object * @subject: #librdf_node of subject * @predicate: #librdf_node of predicate * @object: #librdf_node of object (literal or resource) * * Create and add a new statement about a resource to the model. * * After this method, the #librdf_node objects become owned by the model. * All of subject, predicate and object must be non-NULL. * * Return value: non 0 on failure **/ int librdf_model_add(librdf_model* model, librdf_node* subject, librdf_node* predicate, librdf_node* object) { librdf_statement *statement; int result; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(subject, librdf_node, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(predicate, librdf_node, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(object, librdf_node, 1); if(!subject || (!librdf_node_is_resource(subject) && !librdf_node_is_blank(subject))) return 1; if(!predicate || !librdf_node_is_resource(predicate)) return 1; if(!object) return 1; statement=librdf_new_statement(model->world); if(!statement) return 1; librdf_statement_set_subject(statement, subject); librdf_statement_set_predicate(statement, predicate); librdf_statement_set_object(statement, object); result=librdf_model_add_statement(model, statement); librdf_free_statement(statement); return result; } /** * librdf_model_add_typed_literal_statement: * @model: model object * @subject: #librdf_node of subject * @predicate: #librdf_node of predicate * @literal: string literal content * @xml_language: language of literal * @datatype_uri: datatype #librdf_uri * * Create and add a new statement about a typed literal to the model. * * After this method, the #librdf_node subject and predicate become * owned by the model. * * The language can be set to NULL if not used. * All of subject, predicate and literal must be non-NULL. * * Return value: non 0 on failure **/ int librdf_model_add_typed_literal_statement(librdf_model* model, librdf_node* subject, librdf_node* predicate, const unsigned char* literal, const char *xml_language, librdf_uri *datatype_uri) { librdf_node* object; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(subject, librdf_node, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(predicate, librdf_node, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(literal, string, 1); if(!subject || (!librdf_node_is_resource(subject) && !librdf_node_is_blank(subject))) return 1; if(!predicate || !librdf_node_is_resource(predicate)) return 1; if(!literal) return 1; object=librdf_new_node_from_typed_literal(model->world, literal, xml_language, datatype_uri); if(!object) return 1; return librdf_model_add(model, subject, predicate, object); } /** * librdf_model_add_string_literal_statement: * @model: model object * @subject: #librdf_node of subject * @predicate: #librdf_node of predicate * @literal: string literal conten * @xml_language: language of literal * @is_wf_xml: literal is XML * * Create and add a new statement about a literal to the model. * * The language can be set to NULL if not used. * All of subject, predicate and literal must be non-NULL. * * 0.9.12: xml_space argument deleted * * Return value: non 0 on failure **/ int librdf_model_add_string_literal_statement(librdf_model* model, librdf_node* subject, librdf_node* predicate, const unsigned char* literal, const char *xml_language, int is_wf_xml) { librdf_node* object; int result; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(subject, librdf_node, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(predicate, librdf_node, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(literal, string, 1); if(!subject || (!librdf_node_is_resource(subject) && !librdf_node_is_blank(subject))) return 1; if(!predicate || !librdf_node_is_resource(predicate)) return 1; if(!literal) return 1; object=librdf_new_node_from_literal(model->world, literal, xml_language, is_wf_xml); if(!object) return 1; result=librdf_model_add(model, subject, predicate, object); if(result) librdf_free_node(object); return result; } /** * librdf_model_remove_statement: * @model: the model object * @statement: the statement * * Remove a known statement from the model. * * It must be a complete statement - all of subject, predicate, object * parts must be present and a legal RDF triple. * * Return value: non 0 on failure **/ int librdf_model_remove_statement(librdf_model* model, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if(!librdf_statement_is_complete(statement)) return 1; return model->factory->remove_statement(model, statement); } /** * librdf_model_contains_statement: * @model: the model object * @statement: the statement * * Check for a statement in the model. * * It must be a complete statement - all of subject, predicate, * object parts must be present and a legal RDF triple. Use * librdf_model_find_statements to search for partial statement * matches. * * WARNING: librdf_model_contains_statement may not work correctly * with stores using contexts. In this case, a search using * librdf_model_find_statements for a non-empty list will * return the correct result. * * Return value: non 0 if the model contains the statement (>0 if the statement is illegal) **/ int librdf_model_contains_statement(librdf_model* model, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if(!librdf_statement_is_complete(statement)) return 1; return model->factory->contains_statement(model, statement) ? -1 : 0; } /** * librdf_model_as_stream: * @model: the model object * * List the model contents as a stream of statements. * * Return value: a #librdf_stream or NULL on failure **/ librdf_stream* librdf_model_as_stream(librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); return model->factory->serialise(model); } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_model_serialise: * @model: the model object * * Serialise the entire model as a stream (DEPRECATED). * * DEPRECATED to reduce confusion with the librdf_serializer class. * Please use librdf_model_as_stream. * * Return value: a #librdf_stream or NULL on failure **/ librdf_stream* librdf_model_serialise(librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); return model->factory->serialise(model); } #endif /** * librdf_model_find_statements: * @model: the model object * @statement: the partial statement to match * * Find matching statements in the model. * * The partial statement is a statement where the subject, predicate * and/or object can take the value NULL which indicates a match with * any value in the model * * Return value: a #librdf_stream of statements (can be empty) or NULL * on failure. **/ librdf_stream* librdf_model_find_statements(librdf_model* model, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); return model->factory->find_statements(model, statement); } /** * librdf_model_get_sources: * @model: #librdf_model object * @arc: #librdf_node arc * @target: #librdf_node target * * Return the sources (subjects) of arc in an RDF graph given arc (predicate) and target (object). * * Searches the model for arcs matching the given arc and target * and returns a list of the source #librdf_node objects as an iterator * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ librdf_iterator* librdf_model_get_sources(librdf_model *model, librdf_node *arc, librdf_node *target) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(arc, librdf_node, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(target, librdf_node, NULL); return model->factory->get_sources(model, arc, target); } /** * librdf_model_get_arcs: * @model: #librdf_model object * @source: #librdf_node source * @target: #librdf_node target * * Return the arcs (predicates) of an arc in an RDF graph given source (subject) and target (object). * * Searches the model for arcs matching the given source and target * and returns a list of the arc #librdf_node objects as an iterator * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ librdf_iterator* librdf_model_get_arcs(librdf_model *model, librdf_node *source, librdf_node *target) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(source, librdf_node, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(target, librdf_node, NULL); return model->factory->get_arcs(model, source, target); } /** * librdf_model_get_targets: * @model: #librdf_model object * @source: #librdf_node source * @arc: #librdf_node arc * * Return the targets (objects) of an arc in an RDF graph given source (subject) and arc (predicate). * * Searches the model for targets matching the given source and arc * and returns a list of the source #librdf_node objects as an iterator * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ librdf_iterator* librdf_model_get_targets(librdf_model *model, librdf_node *source, librdf_node *arc) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(source, librdf_node, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(arc, librdf_node, NULL); return model->factory->get_targets(model, source, arc); } /** * librdf_model_get_source: * @model: #librdf_model object * @arc: #librdf_node arc * @target: #librdf_node target * * Return one source (subject) of arc in an RDF graph given arc (predicate) and target (object). * * Searches the model for arcs matching the given arc and target * and returns one #librdf_node object * * Return value: a new #librdf_node object or NULL on failure **/ librdf_node* librdf_model_get_source(librdf_model *model, librdf_node *arc, librdf_node *target) { librdf_iterator *iterator; librdf_node *node; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(arc, librdf_node, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(target, librdf_node, NULL); iterator=librdf_model_get_sources(model, arc, target); if(!iterator) return NULL; node=(librdf_node*)librdf_iterator_get_object(iterator); if(node) node=librdf_new_node_from_node(node); librdf_free_iterator(iterator); return node; } /** * librdf_model_get_arc: * @model: #librdf_model object * @source: #librdf_node source * @target: #librdf_node target * * Return one arc (predicate) of an arc in an RDF graph given source (subject) and target (object). * * Searches the model for arcs matching the given source and target * and returns one #librdf_node object * * Return value: a new #librdf_node object or NULL on failure **/ librdf_node* librdf_model_get_arc(librdf_model *model, librdf_node *source, librdf_node *target) { librdf_iterator *iterator; librdf_node *node; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(source, librdf_node, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(target, librdf_node, NULL); iterator=librdf_model_get_arcs(model, source, target); if(!iterator) return NULL; node=(librdf_node*)librdf_iterator_get_object(iterator); if(node) node=librdf_new_node_from_node(node); librdf_free_iterator(iterator); return node; } /** * librdf_model_get_target: * @model: #librdf_model object * @source: #librdf_node source * @arc: #librdf_node arc * * Return one target (object) of an arc in an RDF graph given source (subject) and arc (predicate). * * Searches the model for targets matching the given source and arc * and returns one #librdf_node object * * Return value: a new #librdf_node object or NULL on failure **/ librdf_node* librdf_model_get_target(librdf_model *model, librdf_node *source, librdf_node *arc) { librdf_iterator *iterator; librdf_node *node; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(source, librdf_node, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(arc, librdf_node, NULL); iterator=librdf_model_get_targets(model, source, arc); if(!iterator) return NULL; node=(librdf_node*)librdf_iterator_get_object(iterator); if(node) node=librdf_new_node_from_node(node); librdf_free_iterator(iterator); return node; } /** * librdf_model_add_submodel: * @model: the model object * @sub_model: the sub model to add * * Add a sub-model to the model. * * FIXME: Not tested * * Return value: non 0 on failure **/ int librdf_model_add_submodel(librdf_model* model, librdf_model* sub_model) { librdf_list *l=model->sub_models; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(sub_model, librdf_model, 1); if(!l) { l=librdf_new_list(model->world); if(!l) return 1; model->sub_models=l; } if(librdf_list_add(l, sub_model)) return 1; return 0; } /** * librdf_model_remove_submodel: * @model: the model object * @sub_model: the sub model to remove * * Remove a sub-model from the model. * * FIXME: Not tested * * Return value: non 0 on failure **/ int librdf_model_remove_submodel(librdf_model* model, librdf_model* sub_model) { librdf_list *l=model->sub_models; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(sub_model, librdf_model, 1); if(!l) return 1; if(!librdf_list_remove(l, sub_model)) return 1; return 0; } /** * librdf_model_get_arcs_in: * @model: #librdf_model object * @node: #librdf_node resource node * * Return the properties pointing to the given resource. * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ librdf_iterator* librdf_model_get_arcs_in(librdf_model *model, librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); return model->factory->get_arcs_in(model, node); } /** * librdf_model_get_arcs_out: * @model: #librdf_model object * @node: #librdf_node resource node * * Return the properties pointing from the given resource. * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ librdf_iterator* librdf_model_get_arcs_out(librdf_model *model, librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); return model->factory->get_arcs_out(model, node); } /** * librdf_model_has_arc_in: * @model: #librdf_model object * @node: #librdf_node resource node * @property: #librdf_node property node * * Check if a node has a given property pointing to it. * * Return value: non 0 if arc property does point to the resource node **/ int librdf_model_has_arc_in(librdf_model *model, librdf_node *node, librdf_node *property) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(property, librdf_node, 0); return model->factory->has_arc_in(model, node, property); } /** * librdf_model_has_arc_out: * @model: #librdf_model object * @node: #librdf_node resource node * @property: #librdf_node property node * * Check if a node has a given property pointing from it. * * Return value: non 0 if arc property does point from the resource node **/ int librdf_model_has_arc_out(librdf_model *model, librdf_node *node, librdf_node *property) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(property, librdf_node, 0); return model->factory->has_arc_out(model, node, property); } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_model_print: * @model: the model object * @fh: the FILE stream to print to * * Print the model. * * This method is for debugging and the format of the output should * not be relied on. * * @Deprecated: Use librdf_model_write() to write to #raptor_iostream * which can be made to write to a string. Use a #librdf_serializer * to write proper syntax formats. * **/ void librdf_model_print(librdf_model *model, FILE *fh) { raptor_iostream *iostr; LIBRDF_ASSERT_OBJECT_POINTER_RETURN(model, librdf_model); LIBRDF_ASSERT_OBJECT_POINTER_RETURN(fh, FILE*); iostr = raptor_new_iostream_to_file_handle(model->world->raptor_world_ptr, fh); if(!iostr) return; librdf_model_write(model, iostr); raptor_free_iostream(iostr); } #endif /** * librdf_model_write: * @model: the model object * @iostr: the iostream to write to * * Write a model to an iostream in a debug format. * * This method is for debugging and the format of the output should * not be relied on. In particular, when contexts are used the * result may be 4 nodes. * * Return value: non-0 on failure **/ int librdf_model_write(librdf_model *model, raptor_iostream* iostr) { int rc = 1; librdf_stream* stream; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(iostr, raptor_iostream, 1); stream = librdf_model_as_stream(model); if(!stream) goto tidy; if(raptor_iostream_counted_string_write("[[\n", 3, iostr)) goto tidy; if(librdf_stream_write(stream, iostr)) goto tidy; if(raptor_iostream_counted_string_write("]]\n", 3, iostr)) goto tidy; /* success */ rc = 0; tidy: if(stream) librdf_free_stream(stream); return rc; } /** * librdf_model_context_add_statement: * @model: #librdf_model object * @context: #librdf_node context * @statement: #librdf_statement statement object * * Add a statement to a model with a context. * * It must be a complete statement - all * of subject, predicate, object parts must be present. * * If @context is NULL, this is equivalent to librdf_model_add_statement * * Return value: Non 0 on failure **/ int librdf_model_context_add_statement(librdf_model* model, librdf_node* context, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if(!librdf_statement_is_complete(statement)) return 1; if(!librdf_model_supports_contexts(model)) { librdf_log(model->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_MODEL, NULL, "Model does not support contexts"); return 1; } return model->factory->context_add_statement(model, context, statement); } /** * librdf_model_context_add_statements: * @model: #librdf_model object * @context: #librdf_node context * @stream: #librdf_stream stream object * * Add statements to a model with a context. * * If @context is NULL, this is equivalent to librdf_model_add_statements * * Return value: Non 0 on failure **/ int librdf_model_context_add_statements(librdf_model* model, librdf_node* context, librdf_stream* stream) { int status=0; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(stream, librdf_stream, 1); if(!stream) return 1; if(!librdf_model_supports_contexts(model)) { librdf_log(model->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_MODEL, NULL, "Model does not support contexts"); return 1; } if(model->factory->context_add_statements) return model->factory->context_add_statements(model, context, stream); while(!librdf_stream_end(stream)) { librdf_statement* statement=librdf_stream_get_object(stream); if(!statement) break; status=librdf_model_context_add_statement(model, context, statement); if(status) break; librdf_stream_next(stream); } return status; } /** * librdf_model_context_remove_statement: * @model: #librdf_model object * @context: #librdf_node context * @statement: #librdf_statement statement * * Remove a statement from a model in a context. * * It must be a complete statement - all of subject, predicate, object * parts must be present. * * If @context is NULL, this is equivalent to librdf_model_remove_statement * * Return value: Non 0 on failure **/ int librdf_model_context_remove_statement(librdf_model* model, librdf_node* context, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if(!librdf_statement_is_complete(statement)) return 1; if(!librdf_model_supports_contexts(model)) { librdf_log(model->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_MODEL, NULL, "Model does not support contexts"); return 1; } return model->factory->context_remove_statement(model, context, statement); } /** * librdf_model_context_remove_statements: * @model: #librdf_model object * @context: #librdf_node context * * Remove statements from a model with the given context. * * Return value: Non 0 on failure **/ int librdf_model_context_remove_statements(librdf_model* model, librdf_node* context) { librdf_stream *stream; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(context, librdf_node, 1); if(!librdf_model_supports_contexts(model)) { librdf_log(model->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_MODEL, NULL, "Model does not support contexts"); return 1; } if(model->factory->context_remove_statements) return model->factory->context_remove_statements(model, context); stream=librdf_model_context_as_stream(model, context); if(!stream) return 1; while(!librdf_stream_end(stream)) { librdf_statement *statement=librdf_stream_get_object(stream); if(!statement) break; librdf_model_context_remove_statement(model, context, statement); librdf_stream_next(stream); } librdf_free_stream(stream); return 0; } /** * librdf_model_context_as_stream: * @model: #librdf_model object * @context: #librdf_node context * * List all statements in a model context. * * Return value: #librdf_stream of statements or NULL on failure **/ librdf_stream* librdf_model_context_as_stream(librdf_model* model, librdf_node* context) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(context, librdf_node, NULL); if(!librdf_model_supports_contexts(model)) { librdf_log(model->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_MODEL, NULL, "Model does not support contexts"); return NULL; } return model->factory->context_serialize(model, context); } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_model_context_serialize: * @model: #librdf_model object * @context: #librdf_node context * * List all statements in a model context. * * DEPRECATED to reduce confusion with the librdf_serializer class. * Please use librdf_model_context_as_stream. * * Return value: #librdf_stream of statements or NULL on failure **/ librdf_stream* librdf_model_context_serialize(librdf_model* model, librdf_node* context) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(context, librdf_node, NULL); if(!librdf_model_supports_contexts(model)) { librdf_log(model->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_MODEL, NULL, "Model does not support contexts"); return NULL; } return model->factory->context_serialize(model, context); } #endif /** * librdf_model_query_execute: * @model: #librdf_model object * @query: #librdf_query object * * Execute a query against the model. * * Run the given query against the model and return a #librdf_stream of * matching #librdf_statement objects * * Return value: #librdf_query_results or NULL on failure **/ librdf_query_results* librdf_model_query_execute(librdf_model* model, librdf_query* query) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query, librdf_query, NULL); return model->factory->query_execute(model, query); } /** * librdf_model_sync: * @model: #librdf_model object * * Synchronise the model to the model implementation. * * Return value: non-0 on failure **/ int librdf_model_sync(librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); if(model->factory->sync) return model->factory->sync(model); return 0; } /** * librdf_model_get_storage: * @model: #librdf_model object * * Return the storage of this model. * * Note: this can only return one storage, so model implementations * that have multiple #librdf_storage internally may chose not to * implement this. * * Return value: #librdf_storage or NULL if this has no store **/ librdf_storage* librdf_model_get_storage(librdf_model *model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); if(model->factory->get_storage) return model->factory->get_storage(model); else return NULL; } /** * librdf_model_find_statements_in_context: * @model: #librdf_model object * @statement: #librdf_statement partial statement to find * @context_node: context #librdf_node (or NULL) * * Search the model for matching statements in a given context. * * Searches the model for a (partial) statement as described in * librdf_statement_match() in the given context and returns a * #librdf_stream of matching #librdf_statement objects. If * context is NULL, this is equivalent to librdf_model_find_statements. * * Return value: #librdf_stream of matching statements (may be empty) or NULL on failure **/ librdf_stream* librdf_model_find_statements_in_context(librdf_model* model, librdf_statement* statement, librdf_node* context_node) { librdf_stream *stream; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); if(!librdf_model_supports_contexts(model)) { librdf_log(model->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_MODEL, NULL, "Model does not support contexts"); return NULL; } if(model->factory->find_statements_in_context) return model->factory->find_statements_in_context(model, statement, context_node); statement=librdf_new_statement_from_statement(statement); if(!statement) return NULL; stream=librdf_model_context_as_stream(model, context_node); if(!stream) { librdf_free_statement(statement); return librdf_new_empty_stream(model->world); } librdf_stream_add_map(stream, &librdf_stream_statement_find_map, (librdf_stream_map_free_context_handler)&librdf_free_statement, (void*)statement); return stream; } /** * librdf_model_get_contexts: * @model: #librdf_model object * * Return the list of contexts in the graph. * * Returns an iterator of #librdf_node context nodes for each * context in the graph. * * Return value: #librdf_iterator of context nodes or NULL on failure or if contexts are not supported **/ librdf_iterator* librdf_model_get_contexts(librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); if(!librdf_model_supports_contexts(model)) { librdf_log(model->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_MODEL, NULL, "Model does not support contexts"); return NULL; } if(model->factory->get_contexts) return model->factory->get_contexts(model); else return NULL; } /** * librdf_model_get_feature: * @model: #librdf_model object * @feature: #librdf_uri feature property * * Get the value of a graph feature . * * Return value: new #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ librdf_node* librdf_model_get_feature(librdf_model* model, librdf_uri* feature) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(feature, librdf_uri, NULL); if(model->factory->get_feature) return model->factory->get_feature(model, feature); return NULL; } /** * librdf_model_set_feature: * @model: #librdf_model object * @feature: #librdf_uri feature property * @value: #librdf_node feature property value * * Set the value of a graph feature. * * Return value: non 0 on failure (negative if no such feature) **/ int librdf_model_set_feature(librdf_model* model, librdf_uri* feature, librdf_node* value) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, -1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(feature, librdf_uri, -1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(value, librdf_node, -1); if(model->factory->set_feature) return model->factory->set_feature(model, feature, value); return -1; } /** * librdf_model_find_statements_with_options: * @model: #librdf_model object * @statement: #librdf_statement partial statement to find * @context_node: #librdf_node context node or NULL. * @options: #librdf_hash of matching options or NULL * * Search the model for matching statements with match options. * * Searches the model for a (partial) statement as described in * librdf_statement_match() and returns a #librdf_stream of * matching #librdf_statement objects. * * If options is given then the match is made according to * the given options. If options is NULL, this is equivalent * to librdf_model_find_statements_in_context. * * Return value: #librdf_stream of matching statements (may be empty) or NULL on failure **/ librdf_stream* librdf_model_find_statements_with_options(librdf_model* model, librdf_statement* statement, librdf_node* context_node, librdf_hash* options) { if(context_node && !librdf_model_supports_contexts(model)) { librdf_log(model->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_MODEL, NULL, "Model does not support contexts"); return NULL; } if(model->factory->find_statements_with_options) return model->factory->find_statements_with_options(model, statement, context_node, options); else return librdf_model_find_statements_in_context(model, statement, context_node); } /** * librdf_model_load: * @model: #librdf_model object * @uri: the URI to read the content * @name: the name of the parser (or NULL) * @mime_type: the MIME type of the syntax (NULL if not used) * @type_uri: URI identifying the syntax (NULL if not used) * * Load content from a URI into the model. * * If the name field is NULL, the library will try to guess * the parser to use from the uri, mime_type and type_uri fields. * This is done via the raptor_guess_parser_name function. * * Return value: non 0 on failure **/ int librdf_model_load(librdf_model* model, librdf_uri *uri, const char *name, const char *mime_type, librdf_uri *type_uri) { int rc=0; librdf_parser* parser; if(name && !*name) name=NULL; if(mime_type && !*mime_type) mime_type=NULL; if(!name) name = raptor_world_guess_parser_name(model->world->raptor_world_ptr, (raptor_uri*)type_uri, mime_type, NULL, 0, librdf_uri_as_string(uri)); parser=librdf_new_parser(model->world, name, NULL, NULL); if(!parser) return 1; rc=librdf_parser_parse_into_model(parser, uri, NULL, model); librdf_free_parser(parser); return rc; } /** * librdf_model_to_counted_string: * @model: #librdf_model object * @uri: base URI to use in serializing (or NULL if not used) * @name: the name of the serializer (or NULL for default) * @mime_type: the MIME type of the syntax (NULL if not used) * @type_uri: URI identifying the syntax (NULL if not used) * @string_length_p: pointer to location to store string length (or NULL) * * Write serialized model to a string. * * If the name field is NULL, the default serializer will be used. * * Note: the returned string must be freed by the caller using librdf_free_memory(). * * Return value: new string or NULL on failure **/ unsigned char* librdf_model_to_counted_string(librdf_model* model, librdf_uri *uri, const char *name, const char *mime_type, librdf_uri *type_uri, size_t* string_length_p) { unsigned char *string=NULL; librdf_serializer* serializer; if(name && !*name) name=NULL; if(mime_type && !*mime_type) mime_type=NULL; serializer=librdf_new_serializer(model->world, name, mime_type, type_uri); if(!serializer) return NULL; string=librdf_serializer_serialize_model_to_counted_string(serializer, uri, model, string_length_p); librdf_free_serializer(serializer); return string; } /** * librdf_model_to_string: * @model: #librdf_model object * @uri: base URI to use in serializing (or NULL if not used) * @name: the name of the serializer (or NULL for default) * @mime_type: the MIME type of the syntax (NULL if not used) * @type_uri: URI identifying the syntax (NULL if not used) * * Write serialized model to a string. * * If the name field is NULL, the default serializer will be used. * * Note: the returned string must be freed by the caller. * * Return value: new string or NULL on failure **/ unsigned char* librdf_model_to_string(librdf_model* model, librdf_uri *uri, const char *name, const char *mime_type, librdf_uri *type_uri) { return librdf_model_to_counted_string(model, uri, name, mime_type, type_uri, NULL); } /** * librdf_model_contains_context: * @model: the model object * @context: the contest * * Check for a context in the model. * * Return value: non 0 if the model contains the context node **/ int librdf_model_contains_context(librdf_model* model, librdf_node* context) { librdf_stream* stream; int result; stream=librdf_model_context_as_stream(model, context); if(!stream) return 0; result=!librdf_stream_end(stream); librdf_free_stream(stream); return result; } /** * librdf_model_transaction_start: * @model: the model object * * Start a transaction * * Return value: non-0 on failure **/ int librdf_model_transaction_start(librdf_model* model) { if(model->factory->transaction_start) return model->factory->transaction_start(model); else return 1; } /** * librdf_model_transaction_start_with_handle: * @model: the model object * @handle: the transaction object * * Start a transaction using an existing external transaction object. * * Return value: non-0 on failure **/ int librdf_model_transaction_start_with_handle(librdf_model* model, void* handle) { if(model->factory->transaction_start_with_handle) return model->factory->transaction_start_with_handle(model, handle); else return 1; } /** * librdf_model_transaction_commit: * @model: the model object * * Commit a transaction. * * Return value: non-0 on failure **/ int librdf_model_transaction_commit(librdf_model* model) { if(model->factory->transaction_commit) return model->factory->transaction_commit(model); else return 1; } /** * librdf_model_transaction_rollback: * @model: the model object * * Rollback a transaction. * * Return value: non-0 on failure **/ int librdf_model_transaction_rollback(librdf_model* model) { if(model->factory->transaction_rollback) return model->factory->transaction_rollback(model); else return 1; } /** * librdf_model_transaction_get_handle: * @model: the model object * * Get the current transaction handle. * * Return value: non-0 on failure **/ void* librdf_model_transaction_get_handle(librdf_model* model) { if(model->factory->transaction_get_handle) return model->factory->transaction_get_handle(model); else return NULL; } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); #define EX1_CONTENT \ "\n" \ "\n" \ " \n" \ " Dave Beckett's Home Page\n" \ " Dave Beckett\n" \ " The generic home page of Dave Beckett.\n" \ " \n" \ "" #define EX2_CONTENT \ "\n" \ "\n" \ " \n" \ " Dave Beckett's Home Page\n" \ " Dave Beckett\n" \ " I do development-based research on RDF, metadata and web searching.\n" \ " Copyright © 2002 Dave Beckett\n" \ " \n" \ "" int test_model_cloning(char const *program, librdf_world *); int test_model(librdf_world *world, const char *program, const char *storage_type, const char *storage_name, const char* storage_options); int main(int argc, char *argv[]) { const char *program=librdf_basename((const char*)argv[0]); /* initialise dependent modules - all of them! */ librdf_world *world=librdf_new_world(); const char* storage_type; const char* storage_name; const char* storage_options; int i; int status=0; librdf_world_open(world); /* Test model cloning first */ if(test_model_cloning(program, world)) { status = 1; goto tidy; } /* Get storage configuration */ storage_type=getenv("REDLAND_TEST_STORAGE_TYPE"); storage_name=getenv("REDLAND_TEST_STORAGE_NAME"); storage_options=getenv("REDLAND_TEST_STORAGE_OPTIONS"); if(!(storage_type && storage_name && storage_options)) { /* test all storages */ const char* const storages[] = { "memory", NULL, "write='yes',new='yes',contexts='yes'", #ifdef STORAGE_HASHES #ifdef HAVE_BDB_HASH "hashes", "test", "hash-type='bdb',dir='.',write='yes',new='yes',contexts='yes'", #else "hashes", "test", "hash-type='memory',write='yes',new='yes',contexts='yes'", #endif #endif #ifdef STORAGE_TREES "trees", "test", "contexts='yes'", #endif #ifdef STORAGE_FILE "file", "test.rdf", NULL, #endif #ifdef STORAGE_MYSQL "mysql", "test", "host='localhost',database='test'", #endif #ifdef STORAGE_POSTGRESQL "postgresql", "test", "host='localhost',database='test'", #endif #ifdef STORAGE_TSTORE "tstore", "test", "host='localhost',database='test'", #endif #ifdef STORAGE_SQLITE "sqlite", "test", "new='yes'", #endif NULL, NULL, NULL }; for (i=0; storages[i]; i += 3) { if (test_model(world, program, storages[i], storages[i+1], storages[i+2])) { status = 1; break; } } } else { status = test_model(world, program, storage_type, storage_name, storage_options); } tidy: librdf_free_world(world); return status; } int test_model(librdf_world *world, const char *program, const char *storage_type, const char *storage_name, const char *storage_options) { librdf_storage* storage; librdf_model* model; librdf_statement *statement; librdf_parser* parser; librdf_stream* stream; const char *parser_name="rdfxml"; #define URI_STRING_COUNT 2 const unsigned char *file_uri_strings[URI_STRING_COUNT]={(const unsigned char*)"http://example.org/test1.rdf", (const unsigned char*)"http://example.org/test2.rdf"}; const unsigned char *file_content[URI_STRING_COUNT]={(const unsigned char*)EX1_CONTENT, (const unsigned char*)EX2_CONTENT}; librdf_uri* uris[URI_STRING_COUNT]; librdf_node* nodes[URI_STRING_COUNT]; int i; librdf_iterator *iterator; librdf_node *n1, *n2; int count; int expected_count; #define EXPECTED_BAD_STRING_LENGTH 1139 librdf_uri* base_uri; unsigned char *string; size_t string_length=0; int remove_count=0; int status=0; raptor_iostream* iostr; librdf_node* literal_node; char literal[6]; iostr = raptor_new_iostream_to_file_handle(world->raptor_world_ptr, stderr); fprintf(stderr, "%s: Creating new %s storage\n", program, storage_type); storage=librdf_new_storage(world, storage_type, storage_name, storage_options); if(!storage) { fprintf(stderr, "%s: WARNING: Failed to create new %s storage name %s with options %s\n", program, storage_type, storage_name, storage_options); raptor_free_iostream(iostr); return(0); } fprintf(stderr, "%s: Creating model\n", program); model=librdf_new_model(world, storage, NULL); if(!model) { fprintf(stderr, "%s: Failed to create new model\n", program); return(1); } statement=librdf_new_statement(world); /* after this, nodes become owned by model */ librdf_statement_set_subject(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://www.dajobe.org/")); librdf_statement_set_predicate(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/creator")); if(!librdf_model_add_statement(model, statement)) { fprintf(stderr, "%s: librdf_model_add_statement unexpectedly succeeded adding a partial statement\n", program); return(1); } librdf_statement_set_object(statement, librdf_new_node_from_literal(world, (const unsigned char*)"Dave Beckett", NULL, 0)); librdf_model_add_statement(model, statement); librdf_free_statement(statement); /* make it illegal */ statement=librdf_new_statement(world); librdf_statement_set_subject(statement, librdf_new_node_from_literal(world, (const unsigned char*)"Bad Subject", NULL, 0)); librdf_statement_set_predicate(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/pred")); librdf_statement_set_object(statement, librdf_new_node_from_literal(world, (const unsigned char*)"Good Object", NULL, 0)); if(!librdf_model_add_statement(model, statement)) { fprintf(stderr, "%s: librdf_model_add_statement unexpectedly succeeded adding an illegal triple\n", program); return(1); } librdf_free_statement(statement); fprintf(stderr, "%s: Printing model\n", program); librdf_model_write(model, iostr); #define TEST_SIMILAR_COUNT 9 /* add some similar statements */ fprintf(stderr, "%s: Adding %d similar statements\n", program, TEST_SIMILAR_COUNT); for(i=0; i < TEST_SIMILAR_COUNT; i++) { char literal[6]; strncpy(literal, "DaveX", 6); literal[4]='0'+i; statement=librdf_new_statement(world); librdf_statement_set_subject(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/")); librdf_statement_set_predicate(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/creator")); librdf_statement_set_object(statement, librdf_new_node_from_literal(world, (const unsigned char*)literal, NULL, 0)); librdf_model_add_statement(model, statement); librdf_free_statement(statement); } /* targets */ fprintf(stderr, "%s: iterating similar statements\n", program); n1=librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/"); n2=librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/creator"); iterator=librdf_model_get_targets(model, n1, n2); if(!iterator) { fprintf(stderr, "%s: librdf_model_get_targets failed\n", program); status=1; } fprintf(stderr, "%s: iterating similar statements again\n", program); for(count=0; !librdf_iterator_end(iterator); librdf_iterator_next(iterator), count++) { librdf_node* n=(librdf_node*)librdf_iterator_get_object(iterator); fputs(" ", stderr); librdf_node_print(n, stderr); fputs("\n", stderr); } librdf_free_iterator(iterator); /* delete first, last, and another statement */ statement=librdf_new_statement(world); librdf_statement_set_subject(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/")); librdf_statement_set_predicate(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/creator")); strncpy(literal, "DaveX", 6); literal[4]='0'; fprintf(stderr, "%s: Removing statement with literal '%s'\n", program, literal); literal_node = librdf_new_node_from_literal(world, (const unsigned char*)literal, NULL, 0); librdf_statement_set_object(statement, literal_node); librdf_model_remove_statement(model, statement); librdf_statement_set_object(statement, NULL); librdf_free_node(literal_node); literal[4]='0' + (TEST_SIMILAR_COUNT / 2); fprintf(stderr, "%s: Removing statement with literal '%s'\n", program, literal); literal_node = librdf_new_node_from_literal(world, (const unsigned char*)literal, NULL, 0); librdf_statement_set_object(statement, literal_node); librdf_model_remove_statement(model, statement); librdf_statement_set_object(statement, NULL); librdf_free_node(literal_node); literal[4]='0' + (TEST_SIMILAR_COUNT - 1); fprintf(stderr, "%s: Removing statement with literal '%s'\n", program, literal); literal_node = librdf_new_node_from_literal(world, (const unsigned char*)literal, NULL, 0); librdf_statement_set_object(statement, literal_node); librdf_model_remove_statement(model, statement); librdf_statement_set_object(statement, NULL); librdf_free_node(literal_node); librdf_free_statement(statement); iterator=librdf_model_get_targets(model, n1, n2); fprintf(stderr, "%s: iterating similar statements again\n", program); for(count=0; !librdf_iterator_end(iterator); librdf_iterator_next(iterator), count++) { librdf_node* n=(librdf_node*)librdf_iterator_get_object(iterator); fputs(" ", stderr); librdf_node_print(n, stderr); fputs("\n", stderr); } librdf_free_iterator(iterator); expected_count=TEST_SIMILAR_COUNT - 3; if(count != expected_count) { fprintf(stderr, "%s: model has %d similar statements, expected %d\n", program, count, expected_count); status=1; } librdf_free_node(n1); librdf_free_node(n2); if (!model->supports_contexts) goto done; parser=librdf_new_parser(world, parser_name, NULL, NULL); if(!parser) { fprintf(stderr, "%s: Failed to create new parser type %s\n", program, parser_name); exit(1); } for (i=0; i #endif #ifdef WIN32 #include #endif #include #include #include #include #ifdef HAVE_STDLIB_H #include #ifdef HAVE_ERRNO_H #include #endif #endif #include #include /** * librdf_query_results_get_count: * @query_results: #librdf_query_results query results * * Get number of bindings so far. * * Return value: number of bindings found so far **/ int librdf_query_results_get_count(librdf_query_results *query_results) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, 1); if(query_results->query->factory->results_get_count) return query_results->query->factory->results_get_count(query_results); else return 1; } /** * librdf_query_results_next: * @query_results: #librdf_query_results query results * * Move to the next result. * * Return value: non-0 if failed or results exhausted **/ int librdf_query_results_next(librdf_query_results *query_results) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, 1); if(query_results->query->factory->results_next) return query_results->query->factory->results_next(query_results); else return 1; } /** * librdf_query_results_finished: * @query_results: #librdf_query_results query results * * Find out if binding results are exhausted. * * Return value: non-0 if results are finished or query failed **/ int librdf_query_results_finished(librdf_query_results *query_results) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, 1); if(query_results->query->factory->results_finished) return query_results->query->factory->results_finished(query_results); else return 1; } /** * librdf_query_results_get_bindings: * @query_results: #librdf_query_results query results * @names: pointer to an array of binding names (or NULL) * @values: pointer to an array of binding value #librdf_node (or NULL) * * Get all binding names, values for current result. * * If names is not NULL, it is set to the address of a shared array * of names of the bindings (an output parameter). These names * are shared and must not be freed by the caller * * If values is not NULL, it is used as an array to store pointers * to the librdf_node* of the results. These nodes must be freed * by the caller. The size of the array is determined by the * number of names of bindings, returned by * librdf_query_results_get_bindings_count dynamically or * will be known in advanced if hard-coded into the query string. * * Example * * const char **names=NULL; * librdf_node* values[10]; * * if(librdf_query_results_get_bindings(results, &names, values)) * ... * * Return value: non-0 if the assignment failed **/ int librdf_query_results_get_bindings(librdf_query_results *query_results, const char ***names, librdf_node **values) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, 1); if(query_results->query->factory->results_get_bindings) return query_results->query->factory->results_get_bindings(query_results, names, values); else return 1; } /** * librdf_query_results_get_binding_value: * @query_results: #librdf_query_results query results * @offset: offset of binding name into array of known names * * Get one binding value for the current result. * * Return value: a new #librdf_node binding value or NULL on failure **/ librdf_node* librdf_query_results_get_binding_value(librdf_query_results *query_results, int offset) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, NULL); /* FIXME - offset really should be an unsigned int */ if(offset < 0) return NULL; if(query_results->query->factory->results_get_binding_value) return query_results->query->factory->results_get_binding_value(query_results, offset); else return NULL; } /** * librdf_query_results_get_binding_name: * @query_results: #librdf_query_results query results * @offset: offset of binding name into array of known names * * Get binding name for the current result. * * Return value: a pointer to a shared copy of the binding name or NULL on failure **/ const char* librdf_query_results_get_binding_name(librdf_query_results *query_results, int offset) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, NULL); /* FIXME - offset really should be an unsigned int */ if(offset < 0) return NULL; if(query_results->query->factory->results_get_binding_name) return query_results->query->factory->results_get_binding_name(query_results, offset); else return NULL; } /** * librdf_query_results_get_binding_value_by_name: * @query_results: #librdf_query_results query results * @name: variable name * * Get one binding value for a given name in the current result. * * Return value: a new #librdf_node binding value or NULL on failure **/ librdf_node* librdf_query_results_get_binding_value_by_name(librdf_query_results *query_results, const char *name) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, NULL); if(query_results->query->factory->results_get_binding_value_by_name) return query_results->query->factory->results_get_binding_value_by_name(query_results, name); else return NULL; } /** * librdf_query_results_get_bindings_count: * @query_results: #librdf_query_results query results * * Get the number of bound variables in the result. * * Return value: <0 if failed or results exhausted **/ int librdf_query_results_get_bindings_count(librdf_query_results *query_results) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, 1); if(query_results->query->factory->results_get_bindings_count) return query_results->query->factory->results_get_bindings_count(query_results); else return -1; } /** * librdf_free_query_results: * @query_results: #librdf_query_results object * * Destructor - destroy a #librdf_query_results object. * **/ void librdf_free_query_results(librdf_query_results* query_results) { if(!query_results) return; if(query_results->query->factory->free_results) query_results->query->factory->free_results(query_results); librdf_query_remove_query_result(query_results->query, query_results); LIBRDF_FREE(librdf_query_results, query_results); } /** * librdf_query_results_to_counted_string2: * @query_results: #librdf_query_results object * @name: name of syntax to format to * @mime_type: mime type of syntax to format to (or NULL) * @format_uri: URI of syntax to format to (or NULL) * @base_uri: Base URI of output formatted syntax (or NULL) * @length_p: Pointer to where to store length of string (or NULL) * * Turn a query results into a string. * * A query results format can be named, have a mime type, or * identified by a URI, all of which are optional. The default * query results format will be used if @name, @mime_type and * @format_uri are all NULL. * * librdf_query_results_formats_enumerate() returns information on * the known query results names, labels and URIs. * * The @base_uri may be used for as the base URI the generated * syntax, depending on the format. * * The returned string must be freed by the caller using * librdf_free_memory(). * * Return value: new string value or NULL on failure **/ unsigned char* librdf_query_results_to_counted_string2(librdf_query_results *query_results, const char *name, const char *mime_type, librdf_uri *format_uri, librdf_uri *base_uri, size_t *length_p) { librdf_query_results_formatter *formatter; void *string=NULL; size_t string_length=0; raptor_iostream *iostr; int error=0; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, NULL); iostr = raptor_new_iostream_to_string(query_results->query->world->raptor_world_ptr, &string, &string_length, malloc); if(!iostr) return NULL; formatter = librdf_new_query_results_formatter2(query_results, name, mime_type, format_uri); if(!formatter) { error=1; goto tidy; } if(librdf_query_results_formatter_write(iostr, formatter, query_results, base_uri)) error=1; librdf_free_query_results_formatter(formatter); tidy: raptor_free_iostream(iostr); /* string is available only after the iostream is finished * - clean it up here on error */ if(error) { if(string) { raptor_free_memory(string); string=NULL; } } else if(length_p) *length_p = string_length; return (unsigned char *)string; } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_query_results_to_counted_string: * @query_results: #librdf_query_results object * @format_uri: URI of syntax to format to (or NULL) * @base_uri: Base URI of output formatted syntax (or NULL) * @length_p: Pointer to where to store length of string (or NULL) * * Turn a query results into a string. * * The default query results format will be used if @format_uri is * NULL. * * librdf_query_results_formats_enumerate() returns information on * the known query results names, labels and URIs. * * The @base_uri may be used for as the base URI the generated * syntax, depending on the format. * * The returned string must be freed by the caller using * librdf_free_memory(). * * @deprecated: Use librdf_query_results_to_counted_string2() with extra * name and mime-type args. * * Return value: new string value or NULL on failure **/ unsigned char* librdf_query_results_to_counted_string(librdf_query_results *query_results, librdf_uri *format_uri, librdf_uri *base_uri, size_t *length_p) { return librdf_query_results_to_counted_string2(query_results, NULL /* name */, NULL /* mime type */, format_uri, base_uri, length_p); } #endif /** * librdf_query_results_to_string2: * @query_results: #librdf_query_results object * @name: format name * @mime_type: format mime type (or NULL) * @format_uri: URI of syntax to format to (or NULL) * @base_uri: Base URI of output formatted syntax (or NULL) * * Turn a query results into a string. * * A query results format can be named, have a mime type, or * identified by a URI, all of which are optional. The default * query results format will be used if @name, @mime_type and @format_uri * are all NULL. * * librdf_query_results_formats_enumerate() returns information on * the known query results names, labels and URIs. * * The @base_uri may be used for as the base URI the generated * syntax, depending on the format. * * The returned string must be freed by the caller using * librdf_free_memory(). * * Return value: new string value or NULL on failure **/ unsigned char* librdf_query_results_to_string2(librdf_query_results *query_results, const char* name, const char* mime_type, librdf_uri *format_uri, librdf_uri *base_uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, NULL); return librdf_query_results_to_counted_string2(query_results, name, mime_type, format_uri, base_uri, NULL); } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_query_results_to_string: * @query_results: #librdf_query_results object * @format_uri: URI of syntax to format to * @base_uri: Base URI of output formatted syntax (or NULL) * * Turn a query results into a string. * * A query results format can be named, have a mime type, or * identified by a URI, all of which are optional. The default * query results format will be used if @format_uri is NULL. * * librdf_query_results_formats_enumerate() returns information on * the known query results names, labels and URIs. * * The @base_uri may be used for as the base URI the generated * syntax, depending on the format. * * The returned string must be freed by the caller using * librdf_free_memory(). * * @Deprecated: use librdf_query_results_to_string2() with extra name * and mime_type args. * * Return value: new string value or NULL on failure **/ unsigned char* librdf_query_results_to_string(librdf_query_results *query_results, librdf_uri *format_uri, librdf_uri *base_uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, NULL); return librdf_query_results_to_string2(query_results, NULL, NULL, format_uri, base_uri); } #endif /** * librdf_query_results_to_file_handle2: * @query_results: #librdf_query_results object * @handle: file handle to write to * @name: result format name (or NULL) * @mime_type: result mime type (or NULL) * @format_uri: URI of syntax to format to (or NULL) * @base_uri: Base URI of output formatted syntax * * Write a query results to a FILE*. * * A query results format can be named, have a mime type, or * identified by a URI, all of which are optional. The default * query results format will be used if @name, @mime_type and @format_uri * are all NULL. * * librdf_query_results_formats_enumerate() returns information on * the known query results names, labels and URIs. * * The @base_uri may be used for as the base URI the generated syntax, depending * on the format. * * Return value: non 0 on failure **/ int librdf_query_results_to_file_handle2(librdf_query_results *query_results, FILE *handle, const char *name, const char *mime_type, librdf_uri *format_uri, librdf_uri *base_uri) { raptor_iostream *iostr; librdf_query_results_formatter *formatter; int status; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, query_results, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(handle, FILE*, 1); iostr = raptor_new_iostream_to_file_handle(query_results->query->world->raptor_world_ptr, handle); if(!iostr) return 1; formatter = librdf_new_query_results_formatter2(query_results, name, mime_type, format_uri); if(!formatter) { raptor_free_iostream(iostr); return 1; } status = librdf_query_results_formatter_write(iostr, formatter, query_results, base_uri); librdf_free_query_results_formatter(formatter); raptor_free_iostream(iostr); return status; } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_query_results_to_file_handle: * @query_results: #librdf_query_results object * @handle: file handle to write to * @format_uri: URI of syntax to format to * @base_uri: Base URI of output formatted syntax (or NULL) * * Write a query results to a FILE*. * * A query results format can be named, have a mime type, or * identified by a URI, all of which are optional. The default * query results format will be used if @format_uri is NULL. * * librdf_query_results_formats_enumerate() returns information on * the known query results names, labels and URIs. * * The @base_uri may be used for as the base URI the generated * syntax, depending on the format. * * @Deprecated: use librdf_query_results_to_file_handle() with extra * name and mime_type args. * * Return value: non 0 on failure **/ int librdf_query_results_to_file_handle(librdf_query_results *query_results, FILE *handle, librdf_uri *format_uri, librdf_uri *base_uri) { return librdf_query_results_to_file_handle2(query_results, handle, NULL /* name */, NULL /* mime type */, format_uri, base_uri); } #endif /** * librdf_query_results_to_file2: * @query_results: #librdf_query_results object * @name: filename to write to * @mime_type: mime type (or NULL) * @format_uri: URI of syntax to format to (or NULL) * @base_uri: Base URI of output formatted syntax (or NULL) * * Write a query results to a file. * * A query results format can be named, have a mime type, or * identified by a URI, all of which are optional. The default * query results format will be used if @name, @mime_type and @format_uri * are all NULL. * * librdf_query_results_formats_enumerate() returns information on * the known query results names, labels and URIs. * * The @base_uri may be used for as the base URI the generated * syntax, depending on the format. * * Return value: non 0 on failure **/ int librdf_query_results_to_file2(librdf_query_results *query_results, const char *name, const char *mime_type, librdf_uri *format_uri, librdf_uri *base_uri) { FILE* fh; int status; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, query_results, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(name, string, 1); fh = fopen(name, "w+"); if(!fh) { librdf_log(query_results->query->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "failed to open file '%s' for writing - %s", name, strerror(errno)); return 1; } status = librdf_query_results_to_file_handle2(query_results, fh, name, mime_type, format_uri, base_uri); fclose(fh); return status; } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_query_results_to_file: * @query_results: #librdf_query_results object * @name: filename to write to * @format_uri: URI of syntax to format to * @base_uri: Base URI of output formatted syntax (or NULL) * * Write a query results to a file. * * A query results format can be named, have a mime type, or * identified by a URI, all of which are optional. The default * query results format will be used if @format_uri is NULL. * * librdf_query_results_formats_enumerate() returns information on * the known query results names, labels and URIs. * * The @base_uri may be used for as the base URI the generated * syntax, depending on the format. * * @Deprecated: use librdf_query_results_to_file2() with extra mime_type * arg. * * Return value: non 0 on failure **/ int librdf_query_results_to_file(librdf_query_results *query_results, const char *name, librdf_uri *format_uri, librdf_uri *base_uri) { return librdf_query_results_to_file2(query_results, name, NULL /* mime type */, format_uri, base_uri); } #endif /** * librdf_query_results_is_bindings: * @query_results: #librdf_query_results object * * Test if librdf_query_results is variable bindings format. * * Return value: non-0 if true **/ int librdf_query_results_is_bindings(librdf_query_results* query_results) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, query_results, -1); if(query_results->query->factory->results_is_bindings) return query_results->query->factory->results_is_bindings(query_results); else return -1; } /** * librdf_query_results_is_boolean: * @query_results: #librdf_query_results object * * Test if librdf_query_results is boolean format. * * If this function returns true, the result can be retrieved by * librdf_query_results_get_boolean(). * * Return value: non-0 if true **/ int librdf_query_results_is_boolean(librdf_query_results* query_results) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, query_results, -1); if(query_results->query->factory->results_is_boolean) return query_results->query->factory->results_is_boolean(query_results); else return -1; } /** * librdf_query_results_is_graph: * @query_results: #librdf_query_results object * * Test if librdf_query_results is RDF graph format. * * Return value: non-0 if true **/ int librdf_query_results_is_graph(librdf_query_results* query_results) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, query_results, -1); if(query_results->query->factory->results_is_graph) return query_results->query->factory->results_is_graph(query_results); else return -1; } /** * librdf_query_results_is_syntax: * @query_results: #librdf_query_results object * * Test if librdf_query_results is a syntax. * * If this function returns true, the ONLY result available * from this query is a syntax that can be serialized using * one of the #query_result_formatter class methods or with * librdf_query_results_to_counted_string(), librdf_query_results_to_string(), * librdf_query_results_to_file_handle() or librdf_query_results_to_file() * * Return value: non-0 if true **/ int librdf_query_results_is_syntax(librdf_query_results* query_results) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, query_results, -1); if(query_results->query->factory->results_is_syntax) return query_results->query->factory->results_is_syntax(query_results); else return -1; } /** * librdf_query_results_get_boolean: * @query_results: #librdf_query_results query_results * * Get boolean query result. * * The return value is only meaningful if this is a boolean * query result - see librdf_query_results_is_boolean() * * Return value: boolean query result - >0 is true, 0 is false, <0 on error or finished */ int librdf_query_results_get_boolean(librdf_query_results* query_results) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, query_results, -1); if(query_results->query->factory->results_get_boolean) return query_results->query->factory->results_get_boolean(query_results); else return -1; } /** * librdf_query_results_as_stream: * @query_results: #librdf_query_results query_results * * Get a query result as an RDF graph in #librdf_stream form * * The return value is only meaningful if this is an RDF graph * query result - see librdf_query_results_is_graph(). * * Return value: a new #librdf_stream result or NULL on error */ librdf_stream* librdf_query_results_as_stream(librdf_query_results* query_results) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, query_results, NULL); if(query_results->query->factory->results_as_stream) return query_results->query->factory->results_as_stream(query_results); else return NULL; } /** * librdf_new_query_results_formatter2: * @query_results: #librdf_query_results query_results * @name: the query results format name (or NULL) * @mime_type: the query results format mime type (or NULL) * @uri: #librdf_uri query results format uri (or NULL) * * Constructor - create a new librdf_query_results_formatter object by identified format. * * A query results format can be named, have a mime type, or * identified by a URI, all of which are optional. The default query * results format will be used if @name, @mime_type and @uri are all * NULL. * * librdf_query_results_formats_enumerate() returns information on * the known query results names, labels and URIs. * * Return value: a new #librdf_query_results_formatter object or NULL on failure */ librdf_query_results_formatter* librdf_new_query_results_formatter2(librdf_query_results* query_results, const char *name, const char *mime_type, librdf_uri* uri) { if(query_results->query->factory->new_results_formatter) return query_results->query->factory->new_results_formatter(query_results, name, mime_type, uri); else return NULL; } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_new_query_results_formatter: * @query_results: #librdf_query_results query_results * @name: the query results format name (or NULL) * @uri: #librdf_uri query results format uri (or NULL) * * Constructor - create a new librdf_query_results_formatter object by identified format. * * A query results format can be named or identified by a URI, both * of which are optional. The default query results format will be used * if @name and @uri are both NULL. * * librdf_query_results_formats_enumerate() returns information on * the known query results names, labels and URIs. * * @Deprecated: for librdf_new_query_results_formatter2() with the * name, mime_type and format_uri args. * * Return value: a new #librdf_query_results_formatter object or NULL on failure */ librdf_query_results_formatter* librdf_new_query_results_formatter(librdf_query_results* query_results, const char *name, librdf_uri* uri) { if(query_results->query->factory->new_results_formatter) return query_results->query->factory->new_results_formatter(query_results, name, NULL, uri); else return NULL; } #endif #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_new_query_results_formatter_by_mime_type: * @query_results: #librdf_query_results query_results * @mime_type: mime type name * * Constructor - create a new librdf_query_results_formatter object by mime type. * * A query results format generates a syntax with a mime type which * may be requested with this constructor. * Note that there may be several formatters that generate the same * MIME Type (such as SPARQL XML results format drafts) and in thot * case the librdf_new_query_results_formatter() constructor allows * selecting of a specific one by name or URI. * * @Deprecated: for librdf_new_query_results_formatter2() with the * name, mime_type and format_uri args. * * Return value: a new #librdf_query_results_formatter object or NULL on failure */ librdf_query_results_formatter* librdf_new_query_results_formatter_by_mime_type(librdf_query_results* query_results, const char *mime_type) { if(query_results->query->factory->new_results_formatter) return query_results->query->factory->new_results_formatter(query_results, NULL, mime_type, NULL); else return NULL; } #endif /** * librdf_free_query_results_formatter: * @formatter: #librdf_query_results_formatter object * * Destructor - destroy a #librdf_query_results_formatter object. **/ void librdf_free_query_results_formatter(librdf_query_results_formatter* formatter) { if(!formatter) return; if(formatter->query_results->query->factory->free_results_formatter) formatter->query_results->query->factory->free_results_formatter(formatter); } /** * librdf_query_results_formatter_write: * @iostr: #raptor_iostream to write the query to * @formatter: #librdf_query_results_formatter object * @query_results: #librdf_query_results query results format * @base_uri: #librdf_uri base URI of the output format * * Write the query results using the given formatter to an iostream * * Note that after calling this method, the query results will be * empty and librdf_query_results_finished() will return true (non-0) * * See librdf_query_results_formats_enumerate() to get the * list of syntax URIs and their description. * * Return value: non-0 on failure **/ int librdf_query_results_formatter_write(raptor_iostream *iostr, librdf_query_results_formatter* formatter, librdf_query_results* query_results, librdf_uri *base_uri) { if(query_results->query->factory->results_formatter_write) return query_results->query->factory->results_formatter_write(iostr, formatter, query_results, base_uri); else return 1; } /** * librdf_query_results_formats_check: * @world: #librdf_world * @name: the query results format name (or NULL) * @uri: #librdf_uri query results format uri (or NULL) * @mime_type: mime type name * * Check if a query results formatter exists for the requested format. * * Return value: non-0 if a formatter exists. **/ int librdf_query_results_formats_check(librdf_world* world, const char *name, librdf_uri* uri, const char *mime_type) { int flags = RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER; librdf_world_open(world); /* FIXME - this should use some kind of registration but for now * it is safe to assume Rasqal does it all */ return rasqal_query_results_formats_check(world->rasqal_world_ptr, name, (raptor_uri*)uri, mime_type, flags); } /** * librdf_query_results_formats_enumerate: * @world: #librdf_world * @counter: index into the list of query result syntaxes * @name: pointer to store the name of the query result syntax (or NULL) * @label: pointer to store query result syntax readable label (or NULL) * @uri_string: pointer to store query result syntax URI string (or NULL) * @mime_type: pointer to store query result syntax mime type string (or NULL) * * Get information on query result syntaxes. * * All returned strings are shared and must be copied if needed to be * used dynamically. * * @Deprecated: use librdf_query_results_formats_get_description() to * return more information in a static structure. * * Return value: non 0 on failure of if counter is out of range */ int librdf_query_results_formats_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label, const unsigned char **uri_string, const char **mime_type) { const raptor_syntax_description *desc; librdf_world_open(world); /* FIXME - this should use some kind of registration but for now * it is safe to assume Rasqal does it all */ desc = rasqal_world_get_query_results_format_description(world->rasqal_world_ptr, counter); if(!desc) return -1; /* First element of names, uri_strings, mime_types arrays is always * the main one */ if(name && desc->names) *name = desc->names[0]; if(label) *label = desc->label; if(uri_string && desc->uri_strings) *uri_string = (const unsigned char *)desc->uri_strings[0]; if(mime_type && desc->mime_types) *mime_type = desc->mime_types[0].mime_type; return 0; } /** * librdf_query_results_formats_get_description: * @world: world object * @counter: index into the list of query results formats * * Get query result formats descriptive syntax information * * Return value: description or NULL if counter is out of range **/ const raptor_syntax_description* librdf_query_results_formats_get_description(librdf_world* world, unsigned int counter) { librdf_world_open(world); return rasqal_world_get_query_results_format_description(world->rasqal_world_ptr, counter); } redland-1.0.17/src/rdf_node_common.c0000644000175000017500000001050511615421777014231 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_node_common.c - RDF Node / Term class common code * * Copyright (C) 2010, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include /* iterator over a static array of nodes; - mostly for testing */ static int librdf_node_static_iterator_is_end(void* iterator); static int librdf_node_static_iterator_next_method(void* iterator); static void* librdf_node_static_iterator_get_method(void* iterator, int flags); static void librdf_node_static_iterator_finished(void* iterator); typedef struct { librdf_world *world; librdf_node** nodes; /* static array of nodes; shared */ int size; /* size of above array */ int current; /* index into above array */ } librdf_node_static_iterator_context; static int librdf_node_static_iterator_is_end(void* iterator) { librdf_node_static_iterator_context* context; context = (librdf_node_static_iterator_context*)iterator; return (context->current > context->size-1); } static int librdf_node_static_iterator_next_method(void* iterator) { librdf_node_static_iterator_context* context; context = (librdf_node_static_iterator_context*)iterator; if(context->current > context->size-1) return 1; context->current++; return 0; } static void* librdf_node_static_iterator_get_method(void* iterator, int flags) { librdf_node_static_iterator_context* context; context = (librdf_node_static_iterator_context*)iterator; if(context->current > context->size-1) return NULL; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return (void*)context->nodes[context->current]; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return NULL; default: librdf_log(context->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_NODE, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_node_static_iterator_finished(void* iterator) { librdf_node_static_iterator_context* context; context = (librdf_node_static_iterator_context*)iterator; LIBRDF_FREE(librdf_node_static_iterator_context, context); } /** * librdf_node_new_static_node_iterator: * @world: world object * @nodes: static array of #librdf_node objects * @size: size of array * * Create an iterator over an array of nodes. * * This creates an iterator for an existing static array of librdf_node * objects. It is mostly intended for testing iterator code. * * Return value: a #librdf_iterator serialization of the nodes or NULL on failure **/ librdf_iterator* librdf_node_new_static_node_iterator(librdf_world* world, librdf_node** nodes, int size) { librdf_node_static_iterator_context* context; librdf_iterator* iterator; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(nodes, librdf_node**, NULL); context = LIBRDF_CALLOC(librdf_node_static_iterator_context*, 1, sizeof(*context)); if(!context) return NULL; context->nodes = nodes; context->size = size; context->current = 0; iterator = librdf_new_iterator(world, (void*)context, librdf_node_static_iterator_is_end, librdf_node_static_iterator_next_method, librdf_node_static_iterator_get_method, librdf_node_static_iterator_finished); if(!iterator) librdf_node_static_iterator_finished(context); return iterator; } redland-1.0.17/src/rdf_storage_list.c0000644000175000017500000007351511772502107014434 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_list.c - RDF Storage in memory as a list implementation * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include #include typedef struct { librdf_list* list; /* If this is non-0, contexts are being used */ int index_contexts; librdf_hash* contexts; } librdf_storage_list_instance; /* These are stored in the list */ typedef struct { librdf_statement *statement; librdf_node *context; } librdf_storage_list_node; /* prototypes for local functions */ static int librdf_storage_list_init(librdf_storage* storage, const char *name, librdf_hash* options); static int librdf_storage_list_open(librdf_storage* storage, librdf_model* model); static int librdf_storage_list_close(librdf_storage* storage); static int librdf_storage_list_size(librdf_storage* storage); static int librdf_storage_list_add_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_list_add_statements(librdf_storage* storage, librdf_stream* statement_stream); static int librdf_storage_list_remove_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_list_contains_statement(librdf_storage* storage, librdf_statement* statement); static librdf_stream* librdf_storage_list_serialise(librdf_storage* storage); static librdf_stream* librdf_storage_list_find_statements(librdf_storage* storage, librdf_statement* statement); /* serialising implementing functions */ static int librdf_storage_list_serialise_end_of_stream(void* context); static int librdf_storage_list_serialise_next_statement(void* context); static void* librdf_storage_list_serialise_get_statement(void* context, int flags); static void librdf_storage_list_serialise_finished(void* context); /* context functions */ static int librdf_storage_list_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_list_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static librdf_stream* librdf_storage_list_context_serialise(librdf_storage* storage, librdf_node* context_node); /* context list statement stream methods */ static int librdf_storage_list_context_serialise_end_of_stream(void* context); static int librdf_storage_list_context_serialise_next_statement(void* context); static void* librdf_storage_list_context_serialise_get_statement(void* context, int flags); static void librdf_storage_list_context_serialise_finished(void* context); /* helper functions for contexts */ static int librdf_storage_list_node_equals(librdf_storage_list_node *first, librdf_storage_list_node *second); static librdf_iterator* librdf_storage_list_get_contexts(librdf_storage* storage); /* get_context iterator functions */ static int librdf_storage_list_get_contexts_is_end(void* iterator); static int librdf_storage_list_get_contexts_next_method(void* iterator); static void* librdf_storage_list_get_contexts_get_method(void* iterator, int); static void librdf_storage_list_get_contexts_finished(void* iterator); static void librdf_storage_list_register_factory(librdf_storage_factory *factory); /* functions implementing storage api */ static int librdf_storage_list_init(librdf_storage* storage, const char *name, librdf_hash* options) { int index_contexts=0; librdf_storage_list_instance* context; context = LIBRDF_CALLOC(librdf_storage_list_instance*, 1, sizeof(*context)); if(!context) { if(options) librdf_free_hash(options); return 1; } librdf_storage_set_instance(storage, context); if((index_contexts=librdf_hash_get_as_boolean(options, "contexts"))<0) index_contexts=0; /* default is no contexts */ context->index_contexts=index_contexts; /* no more options, might as well free them now */ if(options) librdf_free_hash(options); return 0; } static void librdf_storage_list_terminate(librdf_storage* storage) { if (storage->instance == NULL) return; LIBRDF_FREE(librdf_storage_list_instance, storage->instance); } /* Helper for comparing list nodes when using contexts */ static int librdf_storage_list_node_equals(librdf_storage_list_node *first, librdf_storage_list_node *second) { if(!librdf_statement_equals(first->statement, second->statement)) return 0; if(!first->context && !second->context) return 1; if(!first->context || !second->context) return 0; if(!librdf_node_equals(first->context, second->context)) return 0; return 1; } static int librdf_storage_list_open(librdf_storage* storage, librdf_model* model) { librdf_storage_list_instance* context=(librdf_storage_list_instance*)storage->instance; context->list=librdf_new_list(storage->world); if(!context->list) return 1; if(context->index_contexts) { /* create a new memory hash */ context->contexts=librdf_new_hash(storage->world, NULL); if(librdf_hash_open(context->contexts, NULL, 0, 1, 1, NULL)) { librdf_free_list(context->list); context->list=NULL; return 1; } } librdf_list_set_equals(context->list, (int (*)(void*, void*))&librdf_storage_list_node_equals); return 0; } /** * librdf_storage_list_close: * @storage: the storage * * . * * Close the storage list storage, and free all content since there is no * persistance. * * Return value: non 0 on failure **/ static int librdf_storage_list_close(librdf_storage* storage) { librdf_storage_list_instance* context=(librdf_storage_list_instance*)storage->instance; if(context->list) { librdf_storage_list_node* sln; while((sln=(librdf_storage_list_node*)librdf_list_pop(context->list))) { librdf_free_statement(sln->statement); if(sln->context) librdf_free_node(sln->context); LIBRDF_FREE(librdf_storage_list_node, sln); } librdf_free_list(context->list); context->list=NULL; } if(context->index_contexts) { if(context->contexts) { librdf_free_hash(context->contexts); context->contexts=NULL; } } return 0; } static int librdf_storage_list_size(librdf_storage* storage) { librdf_storage_list_instance* context=(librdf_storage_list_instance*)storage->instance; return librdf_list_size(context->list); } static int librdf_storage_list_add_statement(librdf_storage* storage, librdf_statement* statement) { /* Do not add duplicate statements */ if(librdf_storage_list_contains_statement(storage, statement)) return 0; return librdf_storage_list_context_add_statement(storage, NULL, statement); } static int librdf_storage_list_add_statements(librdf_storage* storage, librdf_stream* statement_stream) { librdf_storage_list_instance* context=(librdf_storage_list_instance*)storage->instance; int status=0; for(; !librdf_stream_end(statement_stream); librdf_stream_next(statement_stream)) { librdf_statement* statement=librdf_stream_get_object(statement_stream); librdf_storage_list_node* sln; if(!statement) { status=1; break; } /* Do not add duplicate statements */ if(librdf_storage_list_contains_statement(storage, statement)) continue; sln = LIBRDF_MALLOC(librdf_storage_list_node*, sizeof(*sln)); if(!sln) { status=1; break; } /* copy shared statement */ sln->statement=librdf_new_statement_from_statement(statement); if(!sln->statement) { LIBRDF_FREE(librdf_storage_list_node, sln); status=1; break; } sln->context=NULL; librdf_list_add(context->list, sln); } return status; } static int librdf_storage_list_remove_statement(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_list_context_remove_statement(storage, NULL, statement); } static int librdf_storage_list_contains_statement(librdf_storage* storage, librdf_statement* statement) { librdf_storage_list_instance* context=(librdf_storage_list_instance*)storage->instance; librdf_storage_list_node sln; /* STATIC */ sln.statement=statement; sln.context=NULL; if(context->index_contexts) { /* When we have contexts, we have to use find_statements for contains * since we do not know what context node may be stored for a statement */ librdf_stream *stream=librdf_storage_list_find_statements(storage, statement); int status; if(!stream) return 0; /* librdf_stream_end returns 0 if have more, non-0 at end */ status=!librdf_stream_end(stream); /* convert to 0 if at end (not found) and non-zero otherwise (found) */ librdf_free_stream(stream); return status; } return librdf_list_contains(context->list, &sln); } typedef struct { librdf_storage *storage; int index_contexts; librdf_iterator* iterator; } librdf_storage_list_serialise_stream_context; static librdf_stream* librdf_storage_list_serialise(librdf_storage* storage) { librdf_storage_list_instance* context=(librdf_storage_list_instance*)storage->instance; librdf_storage_list_serialise_stream_context* scontext; librdf_stream* stream; scontext = LIBRDF_CALLOC(librdf_storage_list_serialise_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; scontext->index_contexts=context->index_contexts; scontext->iterator=librdf_list_get_iterator(context->list); if(!scontext->iterator) { LIBRDF_FREE(librdf_storage_list_serialise_stream_context, scontext); return librdf_new_empty_stream(storage->world); } scontext->storage=storage; librdf_storage_add_reference(scontext->storage); stream=librdf_new_stream(storage->world, (void*)scontext, &librdf_storage_list_serialise_end_of_stream, &librdf_storage_list_serialise_next_statement, &librdf_storage_list_serialise_get_statement, &librdf_storage_list_serialise_finished); if(!stream) { librdf_storage_list_serialise_finished((void*)scontext); return NULL; } return stream; } static int librdf_storage_list_serialise_end_of_stream(void* context) { librdf_storage_list_serialise_stream_context* scontext=(librdf_storage_list_serialise_stream_context*)context; return librdf_iterator_end(scontext->iterator); } static int librdf_storage_list_serialise_next_statement(void* context) { librdf_storage_list_serialise_stream_context* scontext=(librdf_storage_list_serialise_stream_context*)context; return librdf_iterator_next(scontext->iterator); } static void* librdf_storage_list_serialise_get_statement(void* context, int flags) { librdf_storage_list_serialise_stream_context* scontext=(librdf_storage_list_serialise_stream_context*)context; librdf_storage_list_node* sln=(librdf_storage_list_node*)librdf_iterator_get_object(scontext->iterator); switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return sln->statement; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: if(scontext->index_contexts) return sln->context; else return NULL; default: librdf_log(scontext->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_storage_list_serialise_finished(void* context) { librdf_storage_list_serialise_stream_context* scontext=(librdf_storage_list_serialise_stream_context*)context; if(scontext->iterator) librdf_free_iterator(scontext->iterator); if(scontext->storage) librdf_storage_remove_reference(scontext->storage); LIBRDF_FREE(librdf_storage_list_serialise_stream_context, scontext); } /** * librdf_storage_list_find_statements: * @storage: the storage * @statement: the statement to match * * . * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * Uses #librdf_statement_match to do the matching. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_list_find_statements(librdf_storage* storage, librdf_statement* statement) { librdf_stream* stream; statement=librdf_new_statement_from_statement(statement); if(!statement) return NULL; stream=librdf_storage_list_serialise(storage); if(stream) { if(librdf_stream_add_map(stream, &librdf_stream_statement_find_map, (librdf_stream_map_free_context_handler)&librdf_free_statement, (void*)statement)) { /* error - stream_add_map failed */ librdf_free_stream(stream); stream=NULL; } } else librdf_free_statement(statement); return stream; } /** * librdf_storage_list_context_add_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to add * * Add a statement to a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_list_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { librdf_storage_list_instance* context=(librdf_storage_list_instance*)storage->instance; librdf_hash_datum key, value; /* on stack - not allocated */ size_t size; librdf_storage_list_node* sln; int status; librdf_world* world; world = storage->world; if(context_node && !context->index_contexts) { librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, "Storage was created without context support"); return 1; } /* Store statement + node in the storage_list */ sln = LIBRDF_MALLOC(librdf_storage_list_node*, sizeof(*sln)); if(!sln) return 1; sln->statement=librdf_new_statement_from_statement(statement); if(!sln->statement) { LIBRDF_FREE(librdf_storage_list_node, sln); return 1; } if(context->index_contexts && context_node) { sln->context=librdf_new_node_from_node(context_node); if(!sln->context) { librdf_free_statement(sln->statement); LIBRDF_FREE(librdf_storage_list_node, sln); return 1; } } else sln->context=NULL; status=librdf_list_add(context->list, sln); if(status) { if(context_node) librdf_free_node(sln->context); librdf_free_statement(sln->statement); LIBRDF_FREE(librdf_storage_list_node, sln); return 1; } if(!context->index_contexts || !context_node) return 0; /* Store (context => statement) in the context hash */ size=librdf_node_encode(context_node, NULL, 0); key.data = LIBRDF_MALLOC(char*, size); key.size=librdf_node_encode(context_node, (unsigned char*)key.data, size); size=librdf_statement_encode2(world, statement, NULL, 0); value.data = LIBRDF_MALLOC(char*, size); value.size=librdf_statement_encode2(world, statement, (unsigned char*)value.data, size); status=librdf_hash_put(context->contexts, &key, &value); LIBRDF_FREE(data, key.data); LIBRDF_FREE(data, value.data); return status; } /** * librdf_storage_list_context_remove_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to remove * * Remove a statement from a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_list_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { librdf_storage_list_instance* context=(librdf_storage_list_instance*)storage->instance; librdf_hash_datum key, value; /* on stack - not allocated */ librdf_storage_list_node* sln; librdf_storage_list_node search_sln; /* on stack - not allocated */ size_t size; int status; librdf_world* world; world = storage->world; if(context_node && !context->index_contexts) { librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, "Storage was created without context support"); return 1; } search_sln.statement=statement; search_sln.context=context_node; /* Remove stored statement+context */ sln=(librdf_storage_list_node*)librdf_list_remove(context->list, &search_sln); if(!sln) return 1; librdf_free_statement(sln->statement); if(sln->context) librdf_free_node(sln->context); LIBRDF_FREE(librdf_storage_list_node, sln); if(!context->index_contexts || !context_node) return 0; /* Remove (context => statement) in the context hash */ size=librdf_node_encode(context_node, NULL, 0); key.data = LIBRDF_MALLOC(char*, size); key.size=librdf_node_encode(context_node, (unsigned char*)key.data, size); size=librdf_statement_encode2(world, statement, NULL, 0); value.data = LIBRDF_MALLOC(char*, size); value.size=librdf_statement_encode2(world, statement, (unsigned char*)value.data, size); status=librdf_hash_delete(context->contexts, &key, &value); LIBRDF_FREE(data, key.data); LIBRDF_FREE(data, value.data); return status; } typedef struct { librdf_storage *storage; librdf_iterator* iterator; librdf_hash_datum *key; librdf_hash_datum *value; librdf_statement current; /* static, shared statement */ librdf_node *context_node; char *context_node_data; } librdf_storage_list_context_serialise_stream_context; /** * librdf_storage_list_context_serialise: * @storage: #librdf_storage object * @context_node: #librdf_node object * * List all statements in a storage context. * * Return value: #librdf_stream of statements or NULL on failure or context is empty **/ static librdf_stream* librdf_storage_list_context_serialise(librdf_storage* storage, librdf_node* context_node) { librdf_storage_list_instance* context=(librdf_storage_list_instance*)storage->instance; librdf_storage_list_context_serialise_stream_context* scontext; librdf_stream* stream; size_t size; if(!context->index_contexts) { librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, "Storage was created without context support"); return NULL; } scontext = LIBRDF_CALLOC(librdf_storage_list_context_serialise_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; librdf_statement_init(storage->world, &scontext->current); scontext->key=librdf_new_hash_datum(storage->world, NULL, 0); if(!scontext->key) return NULL; scontext->value=librdf_new_hash_datum(storage->world, NULL, 0); if(!scontext->value) { librdf_free_hash_datum(scontext->key); return NULL; } scontext->context_node=librdf_new_node_from_node(context_node); size=librdf_node_encode(scontext->context_node, NULL, 0); scontext->key->data = scontext->context_node_data=LIBRDF_MALLOC(char*, size); scontext->key->size=librdf_node_encode(scontext->context_node, (unsigned char*)scontext->key->data, size); scontext->iterator=librdf_hash_get_all(context->contexts, scontext->key, scontext->value); if(!scontext->iterator) return librdf_new_empty_stream(storage->world); scontext->storage=storage; librdf_storage_add_reference(scontext->storage); stream=librdf_new_stream(storage->world, (void*)scontext, &librdf_storage_list_context_serialise_end_of_stream, &librdf_storage_list_context_serialise_next_statement, &librdf_storage_list_context_serialise_get_statement, &librdf_storage_list_context_serialise_finished); if(!stream) { librdf_storage_list_context_serialise_finished((void*)scontext); return NULL; } return stream; } static int librdf_storage_list_context_serialise_end_of_stream(void* context) { librdf_storage_list_context_serialise_stream_context* scontext=(librdf_storage_list_context_serialise_stream_context*)context; return librdf_iterator_end(scontext->iterator); } static int librdf_storage_list_context_serialise_next_statement(void* context) { librdf_storage_list_context_serialise_stream_context* scontext=(librdf_storage_list_context_serialise_stream_context*)context; return librdf_iterator_next(scontext->iterator); } static void* librdf_storage_list_context_serialise_get_statement(void* context, int flags) { librdf_storage_list_context_serialise_stream_context* scontext=(librdf_storage_list_context_serialise_stream_context*)context; librdf_hash_datum* v; librdf_world* world; world = scontext->storage->world; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: if(!(v=(librdf_hash_datum*)librdf_iterator_get_value(scontext->iterator))) return NULL; librdf_statement_clear(&scontext->current); /* decode value content */ if(!librdf_statement_decode2(world, &scontext->current, NULL, (unsigned char*)v->data, v->size)) { return NULL; } return &scontext->current; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return scontext->context_node; default: librdf_log(scontext->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_storage_list_context_serialise_finished(void* context) { librdf_storage_list_context_serialise_stream_context* scontext=(librdf_storage_list_context_serialise_stream_context*)context; if(scontext->context_node) librdf_free_node(scontext->context_node); if(scontext->iterator) librdf_free_iterator(scontext->iterator); if(scontext->key) { scontext->key->data=NULL; librdf_free_hash_datum(scontext->key); } if(scontext->value) { scontext->value->data=NULL; librdf_free_hash_datum(scontext->value); } if(scontext->context_node_data) LIBRDF_FREE(char*, scontext->context_node_data); librdf_statement_clear(&scontext->current); if(scontext->storage) librdf_storage_remove_reference(scontext->storage); LIBRDF_FREE(librdf_storage_list_context_serialise_stream_context, scontext); } typedef struct { librdf_storage *storage; librdf_iterator *iterator; librdf_hash_datum *key; librdf_node *current; } librdf_storage_list_get_contexts_iterator_context; static int librdf_storage_list_get_contexts_is_end(void* iterator) { librdf_storage_list_get_contexts_iterator_context* icontext=(librdf_storage_list_get_contexts_iterator_context*)iterator; return librdf_iterator_end(icontext->iterator); } static int librdf_storage_list_get_contexts_next_method(void* iterator) { librdf_storage_list_get_contexts_iterator_context* icontext=(librdf_storage_list_get_contexts_iterator_context*)iterator; return librdf_iterator_next(icontext->iterator); } static void* librdf_storage_list_get_contexts_get_method(void* iterator, int flags) { librdf_storage_list_get_contexts_iterator_context* icontext=(librdf_storage_list_get_contexts_iterator_context*)iterator; void *result=NULL; librdf_hash_datum* k; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: if(!(k=(librdf_hash_datum*)librdf_iterator_get_key(icontext->iterator))) return NULL; if(icontext->current) librdf_free_node(icontext->current); /* decode value content */ icontext->current=librdf_node_decode(icontext->storage->world, NULL, (unsigned char*)k->data, k->size); result=icontext->current; break; case LIBRDF_ITERATOR_GET_METHOD_GET_KEY: case LIBRDF_ITERATOR_GET_METHOD_GET_VALUE: result=NULL; break; default: librdf_log(icontext->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); result=NULL; break; } return result; } static void librdf_storage_list_get_contexts_finished(void* iterator) { librdf_storage_list_get_contexts_iterator_context* icontext=(librdf_storage_list_get_contexts_iterator_context*)iterator; if(icontext->iterator) librdf_free_iterator(icontext->iterator); librdf_free_hash_datum(icontext->key); if(icontext->current) librdf_free_node(icontext->current); if(icontext->storage) librdf_storage_remove_reference(icontext->storage); LIBRDF_FREE(librdf_storage_list_get_contexts_iterator_context, icontext); } /** * librdf_storage_list_context_get_contexts: * @storage: #librdf_storage object * * List all context nodes in a storage. * * Return value: #librdf_iterator of context_nodes or NULL on failure or no contexts **/ static librdf_iterator* librdf_storage_list_get_contexts(librdf_storage* storage) { librdf_storage_list_instance* context=(librdf_storage_list_instance*)storage->instance; librdf_storage_list_get_contexts_iterator_context* icontext; librdf_iterator* iterator; if(!context->index_contexts) { librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, "Storage was created without context support"); return NULL; } icontext = LIBRDF_CALLOC(librdf_storage_list_get_contexts_iterator_context*, 1, sizeof(*icontext)); if(!icontext) return NULL; icontext->key = librdf_new_hash_datum(storage->world, NULL, 0); if(!icontext->key) { LIBRDF_FREE(librdf_storage_list_get_contexts_iterator_context, icontext); return NULL; } icontext->storage=storage; librdf_storage_add_reference(icontext->storage); icontext->iterator=librdf_hash_keys(context->contexts, icontext->key); if(!icontext->iterator) { librdf_storage_list_get_contexts_finished(icontext); return librdf_new_empty_iterator(storage->world); } iterator=librdf_new_iterator(storage->world, (void*)icontext, &librdf_storage_list_get_contexts_is_end, &librdf_storage_list_get_contexts_next_method, &librdf_storage_list_get_contexts_get_method, &librdf_storage_list_get_contexts_finished); if(!iterator) librdf_storage_list_get_contexts_finished(icontext); return iterator; } /** * librdf_storage_list_get_feature: * @storage: #librdf_storage object * @feature: #librdf_uri feature property * * Get the value of a storage feature. * * Return value: #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ static librdf_node* librdf_storage_list_get_feature(librdf_storage* storage, librdf_uri* feature) { librdf_storage_list_instance* scontext=(librdf_storage_list_instance*)storage->instance; unsigned char *uri_string; if(!feature) return NULL; uri_string=librdf_uri_as_string(feature); if(!uri_string) return NULL; if(!strcmp((const char*)uri_string, LIBRDF_MODEL_FEATURE_CONTEXTS)) { unsigned char value[2]; sprintf((char*)value, "%d", (scontext->index_contexts != 0)); return librdf_new_node_from_typed_literal(storage->world, value, NULL, NULL); } return NULL; } /** Local entry point for dynamically loaded storage module */ static void librdf_storage_list_register_factory(librdf_storage_factory *factory) { LIBRDF_ASSERT_CONDITION(!strcmp(factory->name, "memory")); factory->version = LIBRDF_STORAGE_INTERFACE_VERSION; factory->init = librdf_storage_list_init; factory->terminate = librdf_storage_list_terminate; factory->open = librdf_storage_list_open; factory->close = librdf_storage_list_close; factory->size = librdf_storage_list_size; factory->add_statement = librdf_storage_list_add_statement; factory->add_statements = librdf_storage_list_add_statements; factory->remove_statement = librdf_storage_list_remove_statement; factory->contains_statement = librdf_storage_list_contains_statement; factory->serialise = librdf_storage_list_serialise; factory->find_statements = librdf_storage_list_find_statements; factory->context_add_statement = librdf_storage_list_context_add_statement; factory->context_remove_statement = librdf_storage_list_context_remove_statement; factory->context_serialise = librdf_storage_list_context_serialise; factory->get_contexts = librdf_storage_list_get_contexts; factory->get_feature = librdf_storage_list_get_feature; } /* * librdf_init_storage_list: * @world: world object * * INTERNAL - Initialise the built-in storage_list module. */ void librdf_init_storage_list(librdf_world *world) { librdf_storage_register_factory(world, "memory", "In memory lists", &librdf_storage_list_register_factory); } redland-1.0.17/src/redland.h0000644000175000017500000000204611454471252012512 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * redland.h - Redland RDF Application Framework main header * * Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef REDLAND_H #define REDLAND_H #ifndef LIBRDF_OBJC_FRAMEWORK #include #else #include #endif #endif redland-1.0.17/src/rdf_storage_module.h0000644000175000017500000002502411434410201014727 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * librdf_storage_module.h - Interface for a Redland storage module * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. */ #ifndef LIBRDF_STORAGE_FACTORY_H #define LIBRDF_STORAGE_FACTORY_H #ifdef __cplusplus extern "C" { #endif /** * librdf_storage_instance: * * Opaque storage module instance handle. * * For use with a storage module and the librdf_storage_get_instance() * and librdf_storage_set_instance() functions. The instance handle * should be set in the #librdf_storage_factory init factory method. */ typedef void* librdf_storage_instance; /** * LIBRDF_STORAGE_MIN_INTERFACE_VERSION: * * Oldest support librdf storage module interface version. * */ #define LIBRDF_STORAGE_MIN_INTERFACE_VERSION 1 /** * LIBRDF_STORAGE_MAX_INTERFACE_VERSION: * * Newest supported librdf storage module interface version. * */ #define LIBRDF_STORAGE_MAX_INTERFACE_VERSION 1 /** * LIBRDF_STORAGE_INTERFACE_VERSION: * * Default librdf storage module interface version. * */ #define LIBRDF_STORAGE_INTERFACE_VERSION LIBRDF_STORAGE_MAX_INTERFACE_VERSION /** * librdf_storage_factory: * @version: Interface version. Only version 1 is defined. * @name: Name (ID) of this storage, e.g. "megastore" * @label: Label of this storage, e.g. "Megastore Storage" * @init: Create a new storage. * This method should create the required instance data and store it with * librdf_storage_set_instance() so it can be used in other methods. * @clone: Copy a storage. * This is assumed to leave the new storage in the same state as an existing * storage after an init() method - i.e ready to use but closed. * @terminate: Destroy a storage. * This method is responsible for freeing all memory allocated in the init method. * @open: Make storage be associated with model * @close: Close storage/model context * @size: Return the number of statements in the storage for model * @add_statement: Add a statement to the storage from the given model. OPTIONAL * @add_statements: Add a statement to the storage from the given model. OPTIONAL * @remove_statement: Remove a statement from the storage. OPTIONAL * @contains_statement: Check if statement is in storage * @has_arc_in: Check for [node, property, ?] * @has_arc_out: Check for [?, property, node] * @serialise: Serialise the model in storage * @find_statements: Return a stream of triples matching a triple pattern * @find_statements_with_options: Return a stream of triples matching a triple pattern with some options. OPTIONAL * @find_sources: Return a list of Nodes marching given arc, target * @find_arcs: Return a list of Nodes marching given source, target * @find_targets: Return a list of Nodes marching given source, target * @get_arcs_in: Return list of properties to a node (i.e. with node as the object) * @get_arcs_out: Return list of properties from a node (i.e. with node as the subject) * @context_add_statement: Add a statement to the storage from the context. * NOTE: If context is NULL, this MUST be equivalent to @add_statement. OPTIONAL. * @context_remove_statement: Remove a statement from a context. * NOTE: if context is NULL, this MUST be equivalent to remove_statement. OPTIONAL. * @context_serialise: Serialise statements in a context. OPTIONAL * @sync: Synchronise to underlying storage. OPTIONAL * @context_add_statements: Add statements to a context. storage core will do this using context_add_statement if missing. * NOTE: If context is NULL, this MUST be equivalent to add_statements. OPTIONAL * @context_remove_statements: Remove statements from a context. storage core will do this using context_remove_statement if missing). OPTIONAL * @find_statements_in_context: Search for statement in a context. storage core will do this using find_statements if missing. OPTIONAL * @get_contexts: Return an iterator of context nodes. Returns NULL if contexts not supported. OPTIONAL * @get_feature: Get a feature. OPTIONAL * @set_feature: Set a feature. OPTIONAL * @transaction_start: Begin a transaction. OPTIONAL * @transaction_start_with_handle: Begin a transaction with opaque data handle. OPTIONAL * @transaction_commit: Commit a transaction. OPTIONAL * @transaction_rollback: Rollback a transaction. OPTIONAL * @transaction_get_handle: Get opaque data handle passed to transaction_start_with_handle. OPTIONAL * * A Storage Factory */ struct librdf_storage_factory_s { /* Interface version */ int version; /* Name (ID) of this storage */ char* name; /* Label of this storage */ char* label; /* The rest of this structure is populated by the storage-specific * register function */ /* Create a new storage. */ int (*init)(librdf_storage* storage, const char *name, librdf_hash* options); /* Copy a storage. */ int (*clone)(librdf_storage* new_storage, librdf_storage* old_storage); /* Destroy a storage. */ void (*terminate)(librdf_storage* storage); /* Make storage be associated with model */ int (*open)(librdf_storage* storage, librdf_model* model); /* Close storage/model context */ int (*close)(librdf_storage* storage); /* Return the number of statements in the storage for model */ int (*size)(librdf_storage* storage); /* Add a statement to the storage from the given model */ int (*add_statement)(librdf_storage* storage, librdf_statement* statement); /* Add a statement to the storage from the given model */ int (*add_statements)(librdf_storage* storage, librdf_stream* statement_stream); /* Remove a statement from the storage */ int (*remove_statement)(librdf_storage* storage, librdf_statement* statement); /* Check if statement is in storage */ int (*contains_statement)(librdf_storage* storage, librdf_statement* statement); /* Check for [node, property, ?] */ int (*has_arc_in)(librdf_storage *storage, librdf_node *node, librdf_node *property); /* Check for [?, property, node] */ int (*has_arc_out)(librdf_storage *storage, librdf_node *node, librdf_node *property); /* Serialise the model in storage */ librdf_stream* (*serialise)(librdf_storage* storage); /* Return a stream of triples matching a triple pattern */ librdf_stream* (*find_statements)(librdf_storage* storage, librdf_statement* statement); /* Return a stream of triples matching a triple pattern with some options. */ librdf_stream* (*find_statements_with_options)(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options); /* Return a list of Nodes marching given arc, target */ librdf_iterator* (*find_sources)(librdf_storage* storage, librdf_node *arc, librdf_node *target); /* Return a list of Nodes marching given source, target */ librdf_iterator* (*find_arcs)(librdf_storage* storage, librdf_node *src, librdf_node *target); /* Return a list of Nodes marching given source, target */ librdf_iterator* (*find_targets)(librdf_storage* storage, librdf_node *src, librdf_node *target); /** Return list of properties to a node (i.e. with node as the object) */ librdf_iterator* (*get_arcs_in)(librdf_storage *storage, librdf_node *node); /* Return list of properties from a node (i.e. with node as the subject) */ librdf_iterator* (*get_arcs_out)(librdf_storage *storage, librdf_node *node); /* Add a statement to the storage from the context */ int (*context_add_statement)(librdf_storage* storage, librdf_node* context, librdf_statement *statement); /* Remove a statement from a context */ int (*context_remove_statement)(librdf_storage* storage, librdf_node* context, librdf_statement *statement); /* Serialise statements in a context */ librdf_stream* (*context_serialise)(librdf_storage* storage, librdf_node* context); /* Synchronise to underlying storage */ int (*sync)(librdf_storage* storage); /* Add statements to a context */ int (*context_add_statements)(librdf_storage* storage, librdf_node* context, librdf_stream *stream); /* Remove statements from a context */ int (*context_remove_statements)(librdf_storage* storage, librdf_node* context); /* Search for statement in a context */ librdf_stream* (*find_statements_in_context)(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node); /* Return an iterator of context nodes */ librdf_iterator* (*get_contexts)(librdf_storage* storage); /* Get a feature */ librdf_node* (*get_feature)(librdf_storage* storaage, librdf_uri* feature); /* Set a feature */ int (*set_feature)(librdf_storage* storage, librdf_uri* feature, librdf_node* value); /* Begin a transaction */ int (*transaction_start)(librdf_storage* storage); /* Begin a transaction with opaque data handle */ int (*transaction_start_with_handle)(librdf_storage* storage, void* handle); /* Commit a transaction */ int (*transaction_commit)(librdf_storage* storage); /* Rollback a transaction */ int (*transaction_rollback)(librdf_storage* storage); /* Get opaque data handle passed to transaction_start_with_handle */ void* (*transaction_get_handle)(librdf_storage* storage); /** Storage engine supports querying - OPTIONAL */ int (*supports_query)(librdf_storage* storage, librdf_query *query); /** Storage engine returns query results - OPTIONAL */ librdf_query_results* (*query_execute)(librdf_storage* storage, librdf_query *query); }; /** * librdf_storage_module_register_function: * @world: world object * * Registration function for storage * * A storage module must define and export a function named of this * type with function name "librdf_storage_module_register_factory". * * This function will be called by Redland and must call * librdf_storage_register_factory() to register whatever storage * backends are implemented in the module. */ typedef void (*librdf_storage_module_register_function)(librdf_world *world); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_storage_mysql.c0000644000175000017500000030443212067673075014634 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_mysql.c - RDF Storage in MySQL DB interface definition. * * Based in part on rdf_storage_list and rdf_storage_parka. * * Copyright (C) 2003-2005 Morten Frederiksen - http://purl.org/net/morten/ * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #include #include #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include #include #include #include #include #include /* Define to emit SQL: statements to stderr */ /* #define LIBRDF_DEBUG_SQL 1 */ typedef enum { TABLE_RESOURCES, TABLE_BNODES, TABLE_LITERALS, TABLE_STATEMENTS, TABLE_MODELS, TABLE_LAST = TABLE_MODELS } mysql_table_numbers; typedef enum { TRIPLE_URI =0, TRIPLE_BLANK =1, TRIPLE_LITERAL=2, TRIPLE_NONE =3, } triple_node_type; typedef struct { const char *name; const char *schema; const char *columns; /* Excluding key column, always called ID */ } table_info; typedef struct { /* how many ints form the primary key for this row. e.g. for statements=4 */ short key_len; u64 uints[4]; /* 4 is for Statements S,P,O,C, rest 1=ID, 2... */ char *strings[3]; /* 3 is for Literals longtext, text, text */ size_t strings_len[3]; int strings_count; } pending_row; static const table_info mysql_tables[TABLE_LAST+1]={ /* VALUES "(" UINT64_T_FMT ",'%s')" */ { "Resources", "ID bigint unsigned NOT NULL, URI text NOT NULL,", "URI" }, /* VALUES "(" UINT64_T_FMT ",'%s')" */ { "Bnodes", "ID bigint unsigned NOT NULL, Name text NOT NULL,", "Name" }, /* VALUES "(" UINT64_T_FMT ",'%s','%s','%s')" */ { "Literals", "ID bigint unsigned NOT NULL, Value longtext NOT NULL, Language text NOT NULL, Datatype text NOT NULL", "Value, Language, Datatype" }, /* VALUES "(" UINT64_T_FMT "," UINT64_T_FMT "," UINT64_T_FMT "," UINT64_T_FMT ")" */ { NULL /* Statements%d" */, "", "Subject, Predicate, Object, Context" }, /* VALUES "(" UINT64_T_FMT ",'%s')" */ { "Models", "ID bigint unsigned NOT NULL, Name text NOT NULL,", "Name" } }; typedef enum { /* Status of individual MySQL connections */ LIBRDF_STORAGE_MYSQL_CONNECTION_CLOSED = 0, LIBRDF_STORAGE_MYSQL_CONNECTION_OPEN = 1, LIBRDF_STORAGE_MYSQL_CONNECTION_BUSY = 2 } librdf_storage_mysql_connection_status; typedef struct { /* A MySQL connection */ librdf_storage_mysql_connection_status status; MYSQL *handle; } librdf_storage_mysql_connection; typedef struct { /* MySQL connection parameters */ char *host; unsigned int port; char *database; char *user; char *password; /* Array of virtual MySQL connections */ librdf_storage_mysql_connection *connections; int connections_count; /* hash of model name in the database (table Models, column ID) */ u64 model; /* if inserts should be optimized by locking and index optimizations */ int bulk; /* if a table with merged models should be maintained */ int merge; /* if mysql MYSQL_OPT_RECONNECT should be set on new connections */ int reconnect; /* digest object for node hashes */ librdf_digest *digest; MYSQL* transaction_handle; raptor_sequence* pending_inserts[4]; librdf_hash* pending_insert_hash_nodes; raptor_sequence* pending_statements; /* SQL config */ librdf_sql_config* config; /* configuration variables */ librdf_hash* vars; /* SQL schema layout - default is "v1" */ char *layout; /* SQL config directory - default is defined in * librdf_new_sql_config_for_storage */ char *config_dir; } librdf_storage_mysql_instance; /* prototypes for local functions */ static int librdf_storage_mysql_init(librdf_storage* storage, const char *name, librdf_hash* options); static int librdf_storage_mysql_merge(librdf_storage* storage); static void librdf_storage_mysql_terminate(librdf_storage* storage); static int librdf_storage_mysql_open(librdf_storage* storage, librdf_model* model); static int librdf_storage_mysql_close(librdf_storage* storage); static int librdf_storage_mysql_sync(librdf_storage* storage); static int librdf_storage_mysql_size(librdf_storage* storage); static int librdf_storage_mysql_add_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_mysql_add_statements(librdf_storage* storage, librdf_stream* statement_stream); static int librdf_storage_mysql_remove_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_mysql_contains_statement(librdf_storage* storage, librdf_statement* statement); static librdf_stream* librdf_storage_mysql_serialise(librdf_storage* storage); static librdf_stream* librdf_storage_mysql_find_statements(librdf_storage* storage, librdf_statement* statement); static librdf_stream* librdf_storage_mysql_find_statements_with_options(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options); /* context functions */ static int librdf_storage_mysql_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_mysql_context_add_statements(librdf_storage* storage, librdf_node* context_node, librdf_stream* statement_stream); static int librdf_storage_mysql_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_mysql_context_remove_statements(librdf_storage* storage, librdf_node* context_node); static librdf_stream* librdf_storage_mysql_context_serialise(librdf_storage* storage, librdf_node* context_node); static librdf_stream* librdf_storage_mysql_find_statements_in_context(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node); static librdf_iterator* librdf_storage_mysql_get_contexts(librdf_storage* storage); /* "private" helper definitions */ typedef struct { librdf_storage *storage; librdf_statement *current_statement; librdf_node *current_context; librdf_statement *query_statement; librdf_node *query_context; MYSQL *handle; MYSQL_RES *results; int is_literal_match; } librdf_storage_mysql_sos_context; typedef struct { librdf_storage *storage; librdf_node *current_context; MYSQL *handle; MYSQL_RES *results; } librdf_storage_mysql_get_contexts_context; static u64 librdf_storage_mysql_hash(librdf_storage* storage, const char *type, const char *string, size_t length); #define NODE_HASH_MODE_GET_HASH 0 #define NODE_HASH_MODE_STORE_NODE 1 static u64 librdf_storage_mysql_node_hash_common(librdf_storage* storage, librdf_node* node, int mode); static u64 librdf_storage_mysql_get_node_hash(librdf_storage* storage, librdf_node* node); static u64 librdf_storage_mysql_store_node(librdf_storage* storage, librdf_node* node); static int librdf_storage_mysql_start_bulk(librdf_storage* storage); static int librdf_storage_mysql_stop_bulk(librdf_storage* storage); static int librdf_storage_mysql_context_add_statement_helper(librdf_storage* storage, u64 ctxt, librdf_statement* statement); static int librdf_storage_mysql_find_statements_in_context_augment_query(char **query, const char *addition); /* methods for stream of statements */ static int librdf_storage_mysql_find_statements_in_context_end_of_stream(void* context); static int librdf_storage_mysql_find_statements_in_context_next_statement(void* context); static void* librdf_storage_mysql_find_statements_in_context_get_statement(void* context, int flags); static void librdf_storage_mysql_find_statements_in_context_finished(void* context); /* methods for iterator for contexts */ static int librdf_storage_mysql_get_contexts_end_of_iterator(void* context); static int librdf_storage_mysql_get_contexts_next_context(void* context); static void* librdf_storage_mysql_get_contexts_get_context(void* context, int flags); static void librdf_storage_mysql_get_contexts_finished(void* context); static int librdf_storage_mysql_transaction_rollback(librdf_storage* storage); static void librdf_storage_mysql_register_factory(librdf_storage_factory *factory); #ifdef MODULAR_LIBRDF void librdf_storage_module_register_factory(librdf_world *world); #endif /* functions implementing storage api */ /* * librdf_storage_mysql_hash - Find hash value of string. * @storage: the storage * @type: character type of node to hash ("R", "L" or "B") * @string: a string to get hash for * @length: length of string * * Find hash value of string. * * Return value: Non-zero on succes. **/ static u64 librdf_storage_mysql_hash(librdf_storage* storage, const char *type, const char *string, size_t length) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; u64 hash; byte* digest; uint i; /* (Re)initialize digest object */ librdf_digest_init(context->digest); /* Update digest with data */ if(type) librdf_digest_update(context->digest, (unsigned char*)type, 1); librdf_digest_update(context->digest, (unsigned char*)string, length); librdf_digest_final(context->digest); /* Copy first 8 bytes of digest into unsigned 64bit hash * using a method portable across big/little endianness * * Fixes Issue#0000023 - http://bugs.librdf.org/mantis/view.php?id=23 */ digest = (byte*) librdf_digest_get_digest(context->digest); hash = 0; for(i=0; i<8; i++) hash += ((u64) digest[i]) << (i*8); return hash; } /* * librdf_storage_mysql_init_connections - Initialize MySQL connection pool. * @storage: the storage * * Return value: Non-zero on success. **/ static int librdf_storage_mysql_init_connections(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; /* Reset connection pool */ context->connections=NULL; context->connections_count=0; return 0; } /* * librdf_storage_mysql_finish_connections - Finish all connections in MySQL connection pool and free structures. * @storage: the storage * * Return value: None. **/ static void librdf_storage_mysql_finish_connections(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; int i; /* Loop through connections and close */ for(i=0; i < context->connections_count; i++) { if(LIBRDF_STORAGE_MYSQL_CONNECTION_CLOSED != context->connections[i].status) #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("mysql_close connection handle %p\n", context->connections[i].handle); #endif mysql_close(context->connections[i].handle); } /* Free structure and reset */ if (context->connections_count) { LIBRDF_FREE(librdf_storage_mysql_connection*, context->connections); context->connections=NULL; context->connections_count=0; } } /* * librdf_storage_mysql_get_handle - get a connection handle to the MySQL server * @storage: the storage * * This attempts to reuses any existing available pooled connection * otherwise creates a new connection to the server. * * Return value: Non-zero on succes. **/ static MYSQL* librdf_storage_mysql_get_handle(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; librdf_storage_mysql_connection* connection= NULL; int i; if(context->transaction_handle) return context->transaction_handle; /* Look for an open connection handle to return */ for(i=0; i < context->connections_count; i++) { if(LIBRDF_STORAGE_MYSQL_CONNECTION_OPEN == context->connections[i].status) { context->connections[i].status=LIBRDF_STORAGE_MYSQL_CONNECTION_BUSY; return context->connections[i].handle; } } /* Look for a closed connection */ for(i=0; i < context->connections_count && !connection; i++) { if(LIBRDF_STORAGE_MYSQL_CONNECTION_CLOSED == context->connections[i].status) { connection=&context->connections[i]; break; } } /* Expand connection pool if no closed connection was found */ if (!connection) { /* Allocate new buffer with two extra slots */ librdf_storage_mysql_connection* connections; connections = LIBRDF_CALLOC(librdf_storage_mysql_connection*, LIBRDF_GOOD_CAST(size_t, context->connections_count + 2), sizeof(librdf_storage_mysql_connection)); if(!connections) return NULL; if (context->connections_count) { /* Copy old buffer to new */ memcpy(connections, context->connections, sizeof(librdf_storage_mysql_connection) * LIBRDF_GOOD_CAST(size_t, context->connections_count)); /* Free old buffer */ LIBRDF_FREE(librdf_storage_mysql_connection*, context->connections); } /* Update buffer size and reset new connections */ context->connections_count+=2; connection=&connections[context->connections_count-2]; connection->status=LIBRDF_STORAGE_MYSQL_CONNECTION_CLOSED; connection->handle=NULL; connections[context->connections_count-1].status=LIBRDF_STORAGE_MYSQL_CONNECTION_CLOSED; connections[context->connections_count-1].handle=NULL; context->connections=connections; } /* Initialize closed MySQL connection handle */ connection->handle=mysql_init(connection->handle); #ifdef HAVE_MYSQL_OPT_RECONNECT if(1) { my_bool value=(context->reconnect) ? 1 : 0; mysql_options(connection->handle, MYSQL_OPT_RECONNECT, &value); } #endif /* Create connection to database for handle */ if(!mysql_real_connect(connection->handle, context->host, context->user, context->password, context->database, context->port, NULL, 0)) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Connection to MySQL database %s:%d name %s as user %s failed: %s", context->host, context->port, context->database, context->user, mysql_error(connection->handle)); return NULL; } /* Update status and return */ connection->status=LIBRDF_STORAGE_MYSQL_CONNECTION_BUSY; return connection->handle; } /* * librdf_storage_mysql_release_handle - Release a connection handle to MySQL server back to the pool * @storage: the storage * @handle: the MySQL handle to release * * Return value: None. **/ static void librdf_storage_mysql_release_handle(librdf_storage* storage, MYSQL *handle) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; int i; if(handle == context->transaction_handle) return; /* Look for busy connection handle to drop */ for(i=0; i < context->connections_count; i++) { if(LIBRDF_STORAGE_MYSQL_CONNECTION_BUSY == context->connections[i].status && context->connections[i].handle == handle) { context->connections[i].status=LIBRDF_STORAGE_MYSQL_CONNECTION_OPEN; return; } } librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unable to find busy connection (in pool of %i connections) to drop for MySQL server thread: %lu", context->connections_count, mysql_thread_id(handle)); } /** * librdf_storage_mysql_init: * @storage: the storage * @name: model name * @options: host, port, database, user, password [, new] [, bulk] [, merge]. * * . * * Create connection to database. Defaults to port 3306 if not given. * * The boolean bulk option can be set to true if optimized inserts (table * locks and temporary key disabling) is wanted. Note that this will block * all other access, and requires table locking and alter table privileges. * * The boolean merge option can be set to true if a merged "view" of all * models should be maintained. This "view" will be a table with TYPE=MERGE. * * Return value: Non-zero on failure. **/ static int librdf_storage_mysql_init(librdf_storage* storage, const char *name, librdf_hash* options) { librdf_storage_mysql_instance* context; const char create_model[]="INSERT INTO Models (ID,Name) VALUES (" UINT64_T_FMT ",'%s')"; const char check_model[]="SELECT 1 FROM Models WHERE ID=" UINT64_T_FMT " AND Name='%s'"; int status=0; char *escaped_name=NULL; char *query=NULL; MYSQL_RES *res; MYSQL *handle; const char* default_layout="v1"; long lport; /* Must have connection parameters passed as options */ if(!options) return 1; context = LIBRDF_CALLOC(librdf_storage_mysql_instance*, 1, sizeof(librdf_storage_mysql_instance)); if(!context) { librdf_free_hash(options); return 1; } librdf_storage_set_instance(storage, context); /* Create digest */ if(!(context->digest = librdf_new_digest(storage->world,"MD5"))) { librdf_free_hash(options); return 1; } /* Save hash of model name */ context->model = librdf_storage_mysql_hash(storage, NULL, (char*)name, strlen(name)); /* Save connection parameters */ context->host = librdf_hash_get_del(options, "host"); if(!context->host) { context->host = LIBRDF_MALLOC(char*, 10); strcpy(context->host, "localhost"); } lport = librdf_hash_get_as_long(options, "port"); if(lport < 0 || lport > INT_MAX) context->port = 3306; /* default mysql port */ else context->port = LIBRDF_GOOD_CAST(unsigned int, lport); context->database = librdf_hash_get_del(options, "database"); context->user = librdf_hash_get_del(options, "user"); context->password = librdf_hash_get_del(options, "password"); if(!context->host || !context->database || !context->user || !context->port || !context->password) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "%s storage requires database, user and password in options", storage->factory->name); librdf_free_hash(options); return 1; } /* Maintain merge table? */ context->merge = (librdf_hash_get_as_boolean(options, "merge")>0); /* Reconnect? */ context->reconnect = (librdf_hash_get_as_boolean(options, "reconnect")>0); context->layout = librdf_hash_get_del(options, "layout"); if(!context->layout) { context->layout = LIBRDF_MALLOC(char*, strlen(default_layout) + 1); strcpy(context->layout, default_layout); } context->config_dir = librdf_hash_get_del(options, "config-dir"); /* Initialize MySQL connections */ librdf_storage_mysql_init_connections(storage); /* Get MySQL connection handle */ handle = librdf_storage_mysql_get_handle(storage); if(!handle) { librdf_free_hash(options); return 1; } /* Read SQL configuration */ context->config = librdf_new_sql_config_for_storage(storage, context->layout, context->config_dir); if(!context->config) status = 1; if(!status) { char vars_str[50]; context->vars = librdf_new_hash(storage->world, NULL); sprintf(vars_str, "STATEMENTS_NAME='Statements" UINT64_T_FMT "'", context->model); librdf_hash_from_string(context->vars, vars_str); } /* Create tables, if new and not existing */ if(!status && (librdf_hash_get_as_boolean(options, "new")>0)) { int table; for(table= DBCONFIG_CREATE_TABLE_STATEMENTS; table <= DBCONFIG_CREATE_TABLE_MODELS; table++) { query = (char*)librdf_hash_interpret_template((const unsigned char*)context->config->values[table], context->vars, (const unsigned char*)"$(", (const unsigned char*)")"); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, (const char*)query, strlen((const char*)query))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL table creation failed: %s", mysql_error(handle)); status = -1; break; } LIBRDF_FREE(char*, query); } /* end for */ } /* Create model if new and not existing, or check for existence */ if(!status) { escaped_name = LIBRDF_MALLOC(char*, strlen(name) * 2 + 1); if(!escaped_name) status = 1; mysql_real_escape_string(handle, escaped_name, (const char*)name, strlen(name)); } if(!status && (librdf_hash_get_as_boolean(options, "new")>0)) { /* Create new model */ query = LIBRDF_MALLOC(char*,strlen(create_model) + 20 + strlen(escaped_name)+1); if(!query) status = 1; sprintf(query, create_model, context->model, escaped_name); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(!status && mysql_real_query(handle, query, strlen(query)) && mysql_errno(handle) != ER_DUP_ENTRY) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL insert into Models table failed: %s", mysql_error(handle)); status = -1; } /* Maintain merge table? */ if(!status && context->merge) status = librdf_storage_mysql_merge(storage); } else if(!status) { /* Check for model existence */ query = LIBRDF_MALLOC(char*, strlen(check_model) + 20 + strlen(escaped_name)+1); if(!query) status = 1; sprintf(query, check_model, context->model, name); res = NULL; #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(!status && (mysql_real_query(handle, query, strlen(query)) || !(res=mysql_store_result(handle)))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL select from Models table failed: %s", mysql_error(handle)); status = -1; } if(!status && !(mysql_fetch_row(res))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown model: %s",name); status = 1; } if(res) mysql_free_result(res); } if(query) LIBRDF_FREE(char*, query); if(escaped_name) LIBRDF_FREE(char*, escaped_name); /* Optimize loads? */ context->bulk = (librdf_hash_get_as_boolean(options, "bulk")>0); /* Truncate model? */ if(!status && (librdf_hash_get_as_boolean(options, "new")>0)) status = librdf_storage_mysql_context_remove_statements(storage, NULL); /* Unused options: write (always...) */ librdf_free_hash(options); librdf_storage_mysql_release_handle(storage, handle); return status; } /* * librdf_storage_mysql_merge - (re)create merged "view" of all models * @storage: the storage * * Return value: Non-zero on failure. */ static int librdf_storage_mysql_merge(librdf_storage* storage) { const char get_models[]="SELECT ID FROM Models"; const char drop_table_statements[]="DROP TABLE IF EXISTS Statements"; const char create_table_statements[]="\ CREATE TABLE Statements (\ Subject bigint unsigned NOT NULL,\ Predicate bigint unsigned NOT NULL,\ Object bigint unsigned NOT NULL,\ Context bigint unsigned NOT NULL,\ KEY Context (Context),\ KEY SubjectPredicate (Subject,Predicate),\ KEY PredicateObject (Predicate,Object),\ KEY ObjectSubject (Object,Subject)\ ) TYPE=MERGE INSERT_METHOD=NO UNION=("; char *query=NULL; MYSQL_RES *res; MYSQL_ROW row; MYSQL *handle; /* Get MySQL connection handle */ handle=librdf_storage_mysql_get_handle(storage); if(!handle) return 1; /* Query for list of models. */ #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", get_models); #endif if(mysql_real_query(handle, get_models, strlen(get_models)) || !(res=mysql_store_result(handle))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL query for model list failed: %s", mysql_error(handle)); librdf_storage_mysql_release_handle(storage, handle); return -1; } /* Allocate space for merge table generation query. */ query = LIBRDF_MALLOC(char*, strlen(create_table_statements) + mysql_num_rows(res)*31+2); if(!query) { librdf_storage_mysql_release_handle(storage, handle); return 1; } /* Generate CSV list of models. */ strcpy(query,create_table_statements); while((row=mysql_fetch_row(res))) { strcat(query,"Statements"); strcat(query,row[0]); strcat(query,","); } mysql_free_result(res); query[strlen(query)-1]=')'; /* Drop and create merge table. */ #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", drop_table_statements); LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, drop_table_statements, strlen(drop_table_statements)) || mysql_real_query(handle, query, strlen(query))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL merge table creation failed: %s", mysql_error(handle)); LIBRDF_FREE(char*, query); librdf_storage_mysql_release_handle(storage, handle); return -1; } LIBRDF_FREE(char*, query); librdf_storage_mysql_release_handle(storage, handle); return 0; } /** * librdf_storage_mysql_terminate: * @storage: the storage * * . * * Close the storage and database connections. * * Return value: None. **/ static void librdf_storage_mysql_terminate(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; if (context == NULL) return; librdf_storage_mysql_finish_connections(storage); if(context->config_dir) LIBRDF_FREE(char*, context->config_dir); if(context->layout) LIBRDF_FREE(char*, context->layout); if(context->vars) librdf_free_hash(context->vars); if(context->config) librdf_free_sql_config(context->config); if(context->password) LIBRDF_FREE(char*, context->password); if(context->user) LIBRDF_FREE(char*, context->user); if(context->database) LIBRDF_FREE(char*, context->database); if(context->host) LIBRDF_FREE(char*, context->host); if(context->digest) librdf_free_digest(context->digest); if(context->transaction_handle) librdf_storage_mysql_transaction_rollback(storage); LIBRDF_FREE(librdf_storage_mysql_instance, storage->instance); } /** * librdf_storage_mysql_open: * @storage: the storage * @model: the model * * . * * Create or open model in database (nop). * * Return value: Non-zero on failure. **/ static int librdf_storage_mysql_open(librdf_storage* storage, librdf_model* model) { return 0; } /** * librdf_storage_mysql_close: * @storage: the storage * * . * * Close model (nop). * * Return value: Non-zero on failure. **/ static int librdf_storage_mysql_close(librdf_storage* storage) { librdf_storage_mysql_transaction_rollback(storage); return librdf_storage_mysql_sync(storage); } /** * librdf_storage_mysql_sync: * @storage: the storage * * Flush all tables, making sure they are saved on disk. * * Return value: Non-zero on failure. **/ static int librdf_storage_mysql_sync(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; /* Make sure optimizing for bulk operations is stopped? */ if(context->bulk) librdf_storage_mysql_stop_bulk(storage); return 0; } /** * librdf_storage_mysql_size: * @storage: the storage * * . * * Close model (nop). * * Return value: Negative on failure. **/ static int librdf_storage_mysql_size(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; char model_size[]="SELECT COUNT(*) FROM Statements" UINT64_T_FMT; char *query; MYSQL_RES *res; MYSQL_ROW row; int count; MYSQL *handle; /* Get MySQL connection handle */ handle=librdf_storage_mysql_get_handle(storage); if(!handle) return -1; /* Query for number of statements */ query = LIBRDF_MALLOC(char*, strlen(model_size) + 21); if(!query) { librdf_storage_mysql_release_handle(storage, handle); return -1; } sprintf(query, model_size, context->model); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, query, strlen(query)) || !(res=mysql_store_result(handle)) || !(row=mysql_fetch_row(res))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL query for model size failed: %s", mysql_error(handle)); LIBRDF_FREE(char*, query); librdf_storage_mysql_release_handle(storage, handle); return -1; } count=atol(row[0]); mysql_free_result(res); LIBRDF_FREE(char*, query); librdf_storage_mysql_release_handle(storage, handle); return count; } static int librdf_storage_mysql_add_statement(librdf_storage* storage, librdf_statement* statement) { /* Do not add duplicate statements */ if(librdf_storage_mysql_contains_statement(storage, statement)) return 0; return librdf_storage_mysql_context_add_statement_helper(storage, 0, statement); } /** * librdf_storage_mysql_add_statements: * @storage: the storage * @statement_stream: the stream of statements * * . * * Add statements in stream to storage, without context. * * Return value: Non-zero on failure. **/ static int librdf_storage_mysql_add_statements(librdf_storage* storage, librdf_stream* statement_stream) { int helper=0; while(!helper && !librdf_stream_end(statement_stream)) { librdf_statement* statement=librdf_stream_get_object(statement_stream); /* Do not add duplicate statements */ if(!librdf_storage_mysql_contains_statement(storage, statement)) helper=librdf_storage_mysql_context_add_statement_helper(storage, 0, statement); librdf_stream_next(statement_stream); } return helper; } static int compare_pending_rows(const void *a, const void *b) { pending_row* prow_a=*(pending_row**)a; pending_row* prow_b=*(pending_row**)b; int i; for(i=0; i< prow_a->key_len; i++) { /* These are u64 <> u64 compares - DO NOT USE 'int' here */ if(prow_b->uints[i] > prow_a->uints[i]) return -1; else if(prow_b->uints[i] < prow_a->uints[i]) return 1; } return 0; } static void free_pending_row(pending_row* prow) { int i; for(i=0; i < prow->strings_count; i++) LIBRDF_FREE(char*, prow->strings[i]); LIBRDF_FREE(pending_row, prow); } static raptor_stringbuffer* format_pending_row_sequence(const table_info *table, raptor_sequence* seq) { int i; raptor_stringbuffer* sb; if(!raptor_sequence_size(seq)) return NULL; #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG3("Format pending row for table %s with %d entries\n", table->name, raptor_sequence_size(seq)); #endif sb=raptor_new_stringbuffer(); raptor_stringbuffer_append_string(sb, (const unsigned char*)"REPLACE INTO ", 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)table->name, 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)" (ID, ", 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)table->columns, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)") VALUES ", 9, 1); for(i=0; i< raptor_sequence_size(seq); i++) { pending_row* prow; char uint64_buffer[64]; int j; if(i > 0) raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)", ", 2, 1); prow=(pending_row*)raptor_sequence_get_at(seq, i); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)"(", 1, 1); /* First column is always the ID */ sprintf(uint64_buffer, UINT64_T_FMT, prow->uints[0]); raptor_stringbuffer_append_string(sb, (const unsigned char*)uint64_buffer, 1); for(j=0; j < prow->strings_count; j++) { raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)", '", 3, 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)prow->strings[j], 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)"'", 1, 1); } raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)")", 1, 1); } #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG3("Format pending row for table %s returning query size %d\n", table->name, raptor_stringbuffer_length(sb)); #endif return sb; } /* * librdf_storage_mysql_node_hash_common - Create/get hash value for node * @storage: the storage * @node: a node to get hash for (and possibly create in database) * @mode: mode to do: 0=just do hash, 1=add them * * Return value: Non-zero on succes. **/ static u64 librdf_storage_mysql_node_hash_common(librdf_storage* storage, librdf_node* node, int mode) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance* )storage->instance; librdf_node_type type=librdf_node_get_type(node); u64 hash; size_t nodelen; char *query; triple_node_type node_type; const table_info *table; MYSQL *handle; unsigned char *uri=NULL; unsigned char *value=NULL, *datatype=NULL; char *lang=NULL, *nodestring; librdf_uri *dt; size_t valuelen, langlen=0, datatypelen=0; unsigned char *name=NULL; /* Escape URI for db query */ char *escaped_uri; /* Escape value, lang and datatype for db query */ char *escaped_value, *escaped_lang, *escaped_datatype; /* Escape name for db query */ char *escaped_name; raptor_sequence *seq=NULL; librdf_hash_datum hd_key, hd_value; /* on stack - not allocated */ librdf_hash_datum* old_value; pending_row* prow; /* Get MySQL connection handle */ handle=librdf_storage_mysql_get_handle(storage); if(!handle) return 0; /* Get hash */ switch(type) { case LIBRDF_NODE_TYPE_RESOURCE: node_type=TRIPLE_URI; uri=librdf_uri_as_counted_string(librdf_node_get_uri(node), &nodelen); hash=librdf_storage_mysql_hash(storage, "R", (char*)uri, nodelen); break; case LIBRDF_NODE_TYPE_LITERAL: node_type=TRIPLE_LITERAL; value=librdf_node_get_literal_value_as_counted_string(node, &valuelen); lang=librdf_node_get_literal_value_language(node); if(lang) langlen=strlen(lang); dt=librdf_node_get_literal_value_datatype_uri(node); if(dt) datatype=librdf_uri_as_counted_string(dt, &datatypelen); /* Create composite node string for hash generation */ nodestring = LIBRDF_MALLOC(char*, valuelen + langlen + datatypelen + 3); if(!nodestring) { librdf_storage_mysql_release_handle(storage, handle); return 0; } strcpy(nodestring, (const char*)value); strcat(nodestring, "<"); if(lang) strcat(nodestring, lang); strcat(nodestring, ">"); if(datatype) strcat(nodestring, (const char*)datatype); nodelen=valuelen+langlen+datatypelen+2; hash=librdf_storage_mysql_hash(storage, "L", nodestring, nodelen); LIBRDF_FREE(char*, nodestring); break; case LIBRDF_NODE_TYPE_BLANK: node_type=TRIPLE_BLANK; name=librdf_node_get_blank_identifier(node); nodelen=strlen((const char*)name); hash=librdf_storage_mysql_hash(storage, "B", (char*)name, nodelen); break; case LIBRDF_NODE_TYPE_UNKNOWN: default: librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Do not know how to store node type %d", node->type); hash=0; goto tidy; } if(mode != NODE_HASH_MODE_STORE_NODE) goto tidy; table=&mysql_tables[node_type]; if(context->transaction_handle) { /* In a transaction, check this node has not already been handled */ /* Store the new */ hd_key.data=&hash; hd_key.size=sizeof(u64); /* if existing hash found, do not add it */ if((old_value=librdf_hash_get_one(context->pending_insert_hash_nodes, &hd_key))) { #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("Already seen node with hash " UINT64_T_FMT " - not inserting\n", hash); #endif librdf_free_hash_datum(old_value); goto tidy; } hd_value.data=(void*)"1"; hd_value.size=2; /* store in hash: 'hash'(u64) => "1" */ if(librdf_hash_put(context->pending_insert_hash_nodes, &hd_key, &hd_value)) { hash=0; goto tidy; } /* Store in pending inserts sequence */ seq=context->pending_inserts[node_type]; } else { /* not a transaction - store in temporary sequence */ seq = raptor_new_sequence((raptor_data_free_handler)free_pending_row, NULL); } prow = LIBRDF_CALLOC(pending_row*, 1, sizeof(*prow)); prow->key_len=1; prow->uints[0]=hash; switch(type) { case LIBRDF_NODE_TYPE_RESOURCE: escaped_uri = LIBRDF_MALLOC(char*, nodelen * 2 + 1); if(!escaped_uri) { hash=0; goto tidy; } mysql_real_escape_string(handle, escaped_uri, (const char*)uri, nodelen); prow->strings[0]=escaped_uri; prow->strings_len[0]=strlen(escaped_uri); prow->strings_count=1; break; case LIBRDF_NODE_TYPE_LITERAL: escaped_value = LIBRDF_MALLOC(char*, valuelen * 2 + 1); escaped_lang = LIBRDF_MALLOC(char*, langlen * 2 + 1); escaped_datatype = LIBRDF_MALLOC(char*, datatypelen * 2 + 1); if(!escaped_value || !escaped_lang || !escaped_datatype) { hash=0; goto tidy; } mysql_real_escape_string(handle, escaped_value, (const char*)value, valuelen); if(lang) mysql_real_escape_string(handle, escaped_lang, (const char*)lang, langlen); else strcpy(escaped_lang,""); if(datatype) mysql_real_escape_string(handle, escaped_datatype, (const char*)datatype, datatypelen); else strcpy(escaped_datatype,""); prow->strings[0]=escaped_value; prow->strings_len[0]=strlen(escaped_value); prow->strings[1]=escaped_lang; prow->strings_len[1]=strlen(escaped_lang); prow->strings[2]=escaped_datatype; prow->strings_len[2]=strlen(escaped_datatype); prow->strings_count=3; break; case LIBRDF_NODE_TYPE_BLANK: escaped_name = LIBRDF_MALLOC(char*, nodelen * 2 + 1); if(!escaped_name) { hash=0; goto tidy; } mysql_real_escape_string(handle, escaped_name, (const char*)name, nodelen); prow->strings[0]=escaped_name; prow->strings_len[0]=strlen(escaped_name); prow->strings_count=1; break; case LIBRDF_NODE_TYPE_UNKNOWN: default: librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Do not know how to store node type %d", node->type); hash=0; goto tidy; } raptor_sequence_push(seq, prow); if(context->transaction_handle) { /* in a transaction */ } else { /* not in a transaction so run it now */ raptor_stringbuffer *sb=NULL; size_t query_len; sb=format_pending_row_sequence(table, seq); query_len=raptor_stringbuffer_length(sb); query=(char*)raptor_stringbuffer_as_string(sb); if(query) { #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, query, query_len) && mysql_errno(handle) != ER_DUP_ENTRY) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL insert into %s failed with error %s", table->name, mysql_error(handle)); raptor_free_stringbuffer(sb); hash=0; goto tidy; } } raptor_free_stringbuffer(sb); } tidy: if(!context->transaction_handle) { /* if not in a transaction, lose this */ if(seq) raptor_free_sequence(seq); } if(handle) { librdf_storage_mysql_release_handle(storage, handle); } return hash; } static u64 librdf_storage_mysql_get_node_hash(librdf_storage* storage, librdf_node* node) { return librdf_storage_mysql_node_hash_common(storage, node, NODE_HASH_MODE_GET_HASH); } static u64 librdf_storage_mysql_store_node(librdf_storage* storage, librdf_node* node) { return librdf_storage_mysql_node_hash_common(storage, node, NODE_HASH_MODE_STORE_NODE); } /* * librdf_storage_mysql_start_bulk - Prepare for bulk insert operation * @storage: the storage * * Return value: Non-zero on failure. */ static int librdf_storage_mysql_start_bulk(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; char disable_statement_keys[]="ALTER TABLE Statements" UINT64_T_FMT " DISABLE KEYS"; char disable_literal_keys[]="ALTER TABLE Literals DISABLE KEYS"; char lock_tables[]="LOCK TABLES Statements" UINT64_T_FMT " WRITE, Resources WRITE, Bnodes WRITE, Literals WRITE"; char lock_tables_extra[]=", Statements WRITE"; char *query=NULL; MYSQL *handle; /* Get MySQL connection handle */ handle=librdf_storage_mysql_get_handle(storage); if(!handle) return 1; query = LIBRDF_MALLOC(char*, strlen(disable_statement_keys) + 21); if(!query) { librdf_storage_mysql_release_handle(storage, handle); return 1; } sprintf(query, disable_statement_keys, context->model); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, query, strlen(query))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL statement key disabling failed: %s", mysql_error(handle)); librdf_storage_mysql_release_handle(storage, handle); return -1; } LIBRDF_FREE(char*, query); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, disable_literal_keys, strlen(disable_literal_keys))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL literal key disabling failed: %s", mysql_error(handle)); librdf_storage_mysql_release_handle(storage, handle); return -1; } query = LIBRDF_MALLOC(char*, strlen(lock_tables) + strlen(lock_tables_extra) + 21); if(!query) { librdf_storage_mysql_release_handle(storage, handle); return 1; } sprintf(query, lock_tables, context->model); if(context->merge) strcat(query, lock_tables_extra); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, query, strlen(query))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL table locking failed: %s", mysql_error(handle)); LIBRDF_FREE(char*, query); librdf_storage_mysql_release_handle(storage, handle); return -1; } LIBRDF_FREE(char*, query); librdf_storage_mysql_release_handle(storage, handle); return 0; } /* * librdf_storage_mysql_stop_bulk - End bulk insert operation * @storage: the storage * * Return value: Non-zero on failure. */ static int librdf_storage_mysql_stop_bulk(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; char enable_statement_keys[]="ALTER TABLE Statements" UINT64_T_FMT " ENABLE KEYS"; char enable_literal_keys[]="ALTER TABLE Literals ENABLE KEYS"; char unlock_tables[]="UNLOCK TABLES"; char flush_statements[]="FLUSH TABLE Statements"; char *query=NULL; MYSQL *handle; /* Get MySQL connection handle */ handle=librdf_storage_mysql_get_handle(storage); if(!handle) return 1; #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", unlock_tables); #endif if(mysql_real_query(handle, unlock_tables, strlen(unlock_tables))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL table unlocking failed: %s", mysql_error(handle)); librdf_storage_mysql_release_handle(storage, handle); return 1; } query = LIBRDF_MALLOC(char*, strlen(enable_statement_keys) + 21); if(!query) { librdf_storage_mysql_release_handle(storage, handle); return 1; } sprintf(query, enable_statement_keys, context->model); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, query, strlen(query))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL statement key re-enabling failed: %s", mysql_error(handle)); librdf_storage_mysql_release_handle(storage, handle); return -1; } LIBRDF_FREE(char*, query); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", enable_literal_keys); #endif if(mysql_real_query(handle, enable_literal_keys, strlen(enable_literal_keys))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL literal key re-enabling failed: %s", mysql_error(handle)); librdf_storage_mysql_release_handle(storage, handle); return -1; } #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", flush_statements); #endif if(context->merge && mysql_real_query(handle, flush_statements, strlen(flush_statements))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL table flush failed: %s", mysql_error(handle)); librdf_storage_mysql_release_handle(storage, handle); return -1; } librdf_storage_mysql_release_handle(storage, handle); return 0; } /** * librdf_storage_mysql_context_add_statements: * @storage: the storage * @context_node: #librdf_node object * @statement_stream: the stream of statements * * . * * Add statements in stream to storage, with context. * * Return value: Non-zero on failure. **/ static int librdf_storage_mysql_context_add_statements(librdf_storage* storage, librdf_node* context_node, librdf_stream* statement_stream) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; u64 ctxt=0; int helper=0; /* Optimize for bulk loads? */ if(context->bulk) { if(librdf_storage_mysql_start_bulk(storage)) return 1; } /* Find hash for context, creating if necessary */ if(context_node) { ctxt=librdf_storage_mysql_store_node(storage,context_node); if(!ctxt) return 1; } while(!helper && !librdf_stream_end(statement_stream)) { librdf_statement* statement=librdf_stream_get_object(statement_stream); helper=librdf_storage_mysql_context_add_statement_helper(storage, ctxt, statement); librdf_stream_next(statement_stream); } return helper; } /** * librdf_storage_mysql_context_add_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to add * * Add a statement to a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_mysql_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { u64 ctxt=0; /* Find hash for context, creating if necessary */ if(context_node) { ctxt=librdf_storage_mysql_store_node(storage,context_node); if(!ctxt) return 1; } return librdf_storage_mysql_context_add_statement_helper(storage, ctxt, statement); } /* * librdf_storage_mysql_context_add_statement_helper - Perform actual addition of a statement to a storage context * @storage: #librdf_storage object * @ctxt: u64 context hash * @statement: #librdf_statement statement to add * * Return value: non-zero on failure **/ static int librdf_storage_mysql_context_add_statement_helper(librdf_storage* storage, u64 ctxt, librdf_statement* statement) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; char insert_statement[]="INSERT INTO Statements" UINT64_T_FMT " (Subject,Predicate,Object,Context) VALUES (" UINT64_T_FMT "," UINT64_T_FMT "," UINT64_T_FMT "," UINT64_T_FMT ")"; u64 subject, predicate, object; char *query=NULL; MYSQL *handle=NULL; int rc=0; /* Get MySQL connection handle */ handle=librdf_storage_mysql_get_handle(storage); if(!handle) return 1; /* Find hashes for nodes, creating if necessary */ subject=librdf_storage_mysql_store_node(storage, librdf_statement_get_subject(statement)); predicate=librdf_storage_mysql_store_node(storage, librdf_statement_get_predicate(statement)); object=librdf_storage_mysql_store_node(storage, librdf_statement_get_object(statement)); if(!subject || !predicate || !object) { rc=1; goto tidy; } if(context->transaction_handle) { /* in a transaction */ pending_row* prow; prow = LIBRDF_CALLOC(pending_row*, 1, sizeof(*prow)); prow->key_len=4; prow->uints[0]=subject; prow->uints[1]=predicate; prow->uints[2]=object; prow->uints[3]=ctxt; raptor_sequence_push(context->pending_statements, prow); } else { /* not a transaction - add statement to storage */ query = LIBRDF_MALLOC(char*, strlen(insert_statement) + 101); if(!query) { rc=1; goto tidy; } sprintf(query, insert_statement, context->model, subject, predicate, object, ctxt); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, query, strlen(query))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL insert into Statements failed: %s", mysql_error(handle)); rc=-1; goto tidy; } } tidy: if(query) LIBRDF_FREE(char*, query); if(handle) { librdf_storage_mysql_release_handle(storage, handle); } return rc; } /** * librdf_storage_mysql_contains_statement: * @storage: the storage * @statement: a complete statement * * Test if a given complete statement is present in the model. * * Return value: Non-zero if the model contains the statement. **/ static int librdf_storage_mysql_contains_statement(librdf_storage* storage, librdf_statement* statement) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; char find_statement[]="SELECT 1 FROM Statements" UINT64_T_FMT " WHERE Subject=" UINT64_T_FMT " AND Predicate=" UINT64_T_FMT " AND Object=" UINT64_T_FMT " limit 1"; u64 subject, predicate, object; char *query; MYSQL_RES *res; MYSQL *handle; /* Get MySQL connection handle */ handle=librdf_storage_mysql_get_handle(storage); if(!handle) return 0; /* Find hashes for nodes */ subject=librdf_storage_mysql_get_node_hash(storage, librdf_statement_get_subject(statement)); predicate=librdf_storage_mysql_get_node_hash(storage, librdf_statement_get_predicate(statement)); object=librdf_storage_mysql_get_node_hash(storage, librdf_statement_get_object(statement)); if(!subject || !predicate || !object) { librdf_storage_mysql_release_handle(storage, handle); return 0; } /* Check for statement */ query = LIBRDF_MALLOC(char*, strlen(find_statement) + 81); if(!query) { librdf_storage_mysql_release_handle(storage, handle); return 0; } sprintf(query, find_statement, context->model, subject, predicate, object); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, query, strlen(query))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL query for statement failed: %s", mysql_error(handle)); LIBRDF_FREE(char*, query); librdf_storage_mysql_release_handle(storage, handle); return 0; } LIBRDF_FREE(char*, query); if(!(res=mysql_store_result(handle)) || !(mysql_fetch_row(res))) { if(res) mysql_free_result(res); librdf_storage_mysql_release_handle(storage, handle); return 0; } if(res) mysql_free_result(res); librdf_storage_mysql_release_handle(storage, handle); return 1; } /** * librdf_storage_mysql_remove_statement: * @storage: #librdf_storage object * @statement: #librdf_statement statement to remove * * Remove a statement from storage. * * Return value: non-zero on failure **/ static int librdf_storage_mysql_remove_statement(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_mysql_context_remove_statement(storage,NULL,statement); } /** * librdf_storage_mysql_context_remove_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to remove * * Remove a statement from a storage context. * * Return value: non-zero on failure **/ static int librdf_storage_mysql_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; char delete_statement[]="DELETE FROM Statements" UINT64_T_FMT " WHERE Subject=" UINT64_T_FMT " AND Predicate=" UINT64_T_FMT " AND Object=" UINT64_T_FMT; char delete_statement_with_context[]="DELETE FROM Statements" UINT64_T_FMT " WHERE Subject=" UINT64_T_FMT " AND Predicate=" UINT64_T_FMT " AND Object=" UINT64_T_FMT " AND Context=" UINT64_T_FMT; u64 subject, predicate, object, ctxt=0; char *query; MYSQL *handle; /* Get MySQL connection handle */ handle=librdf_storage_mysql_get_handle(storage); if(!handle) return 1; /* Find hashes for nodes */ subject=librdf_storage_mysql_get_node_hash(storage, librdf_statement_get_subject(statement)); predicate=librdf_storage_mysql_get_node_hash(storage, librdf_statement_get_predicate(statement)); object=librdf_storage_mysql_get_node_hash(storage, librdf_statement_get_object(statement)); if(context_node) { ctxt=librdf_storage_mysql_get_node_hash(storage,context_node); if(!ctxt) { librdf_storage_mysql_release_handle(storage, handle); return 1; } } if(!subject || !predicate || !object || (context_node && !ctxt)) { librdf_storage_mysql_release_handle(storage, handle); return 1; } /* Remove statement(s) from storage */ if(context_node) { query = LIBRDF_MALLOC(char*, strlen(delete_statement_with_context) + 101); if(!query) { librdf_storage_mysql_release_handle(storage, handle); return 1; } sprintf(query, delete_statement_with_context, context->model, subject, predicate, object, ctxt); } else { query = LIBRDF_MALLOC(char*, strlen(delete_statement) + 81); if(!query) { librdf_storage_mysql_release_handle(storage, handle); return 1; } sprintf(query, delete_statement, context->model, subject, predicate, object); } #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, query, strlen(query))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL delete from Statements failed: %s", mysql_error(handle)); LIBRDF_FREE(char*, query); librdf_storage_mysql_release_handle(storage, handle); return -1; } LIBRDF_FREE(char*, query); librdf_storage_mysql_release_handle(storage, handle); return 0; } /** * librdf_storage_mysql_context_remove_statements: * @storage: #librdf_storage object * @context_node: #librdf_node object * * Remove all statement from a storage context. * * Return value: non-zero on failure **/ static int librdf_storage_mysql_context_remove_statements(librdf_storage* storage, librdf_node* context_node) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; char delete_context[]="DELETE FROM Statements" UINT64_T_FMT " WHERE Context=" UINT64_T_FMT; char delete_model[]="DELETE FROM Statements" UINT64_T_FMT; char flush_statements[]="FLUSH TABLE Statements"; u64 ctxt=0; char *query; MYSQL *handle; /* Get MySQL connection handle */ handle=librdf_storage_mysql_get_handle(storage); if(!handle) return 1; /* Find hash for context */ if(context_node) { ctxt=librdf_storage_mysql_get_node_hash(storage,context_node); if(!ctxt) { librdf_storage_mysql_release_handle(storage, handle); return 1; } } /* Remove statement(s) from storage */ if(context_node) { query = LIBRDF_MALLOC(char*, strlen(delete_context) + 61); if(!query) { librdf_storage_mysql_release_handle(storage, handle); return 1; } sprintf(query, delete_context, context->model, ctxt); } else { query = LIBRDF_MALLOC(char*, strlen(delete_model) + 21); if(!query) { librdf_storage_mysql_release_handle(storage, handle); return 1; } sprintf(query, delete_model, context->model); } #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle,query,strlen(query))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL delete of context from Statements failed: %s", mysql_error(handle)); LIBRDF_FREE(char*, query); librdf_storage_mysql_release_handle(storage, handle); return -1; } LIBRDF_FREE(char*, query); /* Flush merge table when using delete without where... */ #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", flush_statements); #endif if(context->merge && !context_node && mysql_real_query(handle, flush_statements, strlen(flush_statements))) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL table flush failed: %s", mysql_error(handle)); librdf_storage_mysql_release_handle(storage, handle); return -1; } librdf_storage_mysql_release_handle(storage, handle); return 0; } /** * librdf_storage_mysql_serialise: * @storage: the storage * * Return a stream of all statements in a storage. * * Return a stream of all statements in a storage. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_mysql_serialise(librdf_storage* storage) { return librdf_storage_mysql_find_statements_in_context(storage,NULL,NULL); } /** * librdf_storage_mysql_find_statements: * @storage: the storage * @statement: the statement to match * * Find a graph of statements in storage. * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_mysql_find_statements(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_mysql_find_statements_in_context(storage,statement,NULL); } /** * librdf_storage_mysql_context_serialise: * @storage: #librdf_storage object * @context_node: #librdf_node object * * List all statements in a storage context. * * Return value: #librdf_stream of statements or NULL on failure or context is empty **/ static librdf_stream* librdf_storage_mysql_context_serialise(librdf_storage* storage, librdf_node* context_node) { return librdf_storage_mysql_find_statements_in_context(storage,NULL,context_node); } /** * librdf_storage_mysql_find_statements_in_context: * @storage: the storage * @statement: the statement to match * @context_node: the context to search * * Find a graph of statements in a storage context. * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_mysql_find_statements_in_context(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node) { return librdf_storage_mysql_find_statements_with_options(storage, statement, context_node, NULL); } /** * librdf_storage_mysql_find_statements_with_options: * @storage: the storage * @statement: the statement to match * @context_node: the context to search * @options: #librdf_hash of match options or NULL * * Find a graph of statements in a storage context with options. * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_mysql_find_statements_with_options(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; librdf_storage_mysql_sos_context* sos; librdf_node *subject=NULL, *predicate=NULL, *object=NULL; char *query; char tmp[64]; char where[256]; char joins[640]; librdf_stream *stream; /* Initialize sos context */ sos = LIBRDF_CALLOC(librdf_storage_mysql_sos_context*, 1, sizeof(*sos)); if(!sos) return NULL; sos->storage=storage; librdf_storage_add_reference(sos->storage); if(statement) sos->query_statement=librdf_new_statement_from_statement(statement); if(context_node) sos->query_context=librdf_new_node_from_node(context_node); sos->current_statement=NULL; sos->current_context=NULL; sos->results=NULL; if(options) { sos->is_literal_match=librdf_hash_get_as_boolean(options, "match-substring"); } /* Get MySQL connection handle */ sos->handle=librdf_storage_mysql_get_handle(storage); if(!sos->handle) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } /* Construct query */ query = LIBRDF_MALLOC(char*, 21); if(!query) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } strcpy(query, "SELECT"); *where='\0'; if(sos->is_literal_match) sprintf(joins, " FROM Literals AS L LEFT JOIN Statements" UINT64_T_FMT " as S ON L.ID=S.Object", context->model); else sprintf(joins, " FROM Statements" UINT64_T_FMT " AS S", context->model); if(statement) { subject=librdf_statement_get_subject(statement); predicate=librdf_statement_get_predicate(statement); object=librdf_statement_get_object(statement); } /* Subject */ if(statement && subject) { sprintf(tmp, "S.Subject=" UINT64_T_FMT "", librdf_storage_mysql_get_node_hash(storage,subject)); if(!strlen(where)) strcat(where, " WHERE "); else strcat(where, " AND "); strcat(where, tmp); } else { if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, " SubjectR.URI AS SuR, SubjectB.Name AS SuB")) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } strcat(joins," LEFT JOIN Resources AS SubjectR ON S.Subject=SubjectR.ID"); strcat(joins," LEFT JOIN Bnodes AS SubjectB ON S.Subject=SubjectB.ID"); } /* Predicate */ if(statement && predicate) { sprintf(tmp, "S.Predicate=" UINT64_T_FMT "", librdf_storage_mysql_get_node_hash(storage, predicate)); if(!strlen(where)) strcat(where, " WHERE "); else strcat(where, " AND "); strcat(where, tmp); } else { if(!statement || !subject) { if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, ",")) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } } if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, " PredicateR.URI AS PrR")) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } strcat(joins," LEFT JOIN Resources AS PredicateR ON S.Predicate=PredicateR.ID"); } /* Object */ if(statement && object) { if(!sos->is_literal_match) { sprintf(tmp,"S.Object=" UINT64_T_FMT "", librdf_storage_mysql_get_node_hash(storage, object)); if(!strlen(where)) strcat(where, " WHERE "); else strcat(where, " AND "); strcat(where, tmp); } else { /* MATCH literal, not hash_id */ if(!statement || !subject || !predicate) { if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, ",")) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } } if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, " ObjectR.URI AS ObR, ObjectB.Name AS ObB, ObjectL.Value AS ObV, ObjectL.Language AS ObL, ObjectL.Datatype AS ObD")) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } strcat(joins," LEFT JOIN Resources AS ObjectR ON S.Object=ObjectR.ID"); strcat(joins," LEFT JOIN Bnodes AS ObjectB ON S.Object=ObjectB.ID"); strcat(joins," LEFT JOIN Literals AS ObjectL ON S.Object=ObjectL.ID"); sprintf(tmp, "MATCH(L.Value) AGAINST ('%s')", librdf_node_get_literal_value(object)); /* NOTE: This is NOT USED but could be if FULLTEXT wasn't enabled */ /* sprintf(tmp, " L.Value LIKE '%%%s%%'", librdf_node_get_literal_value(object)); */ if(!strlen(where)) strcat(where, " WHERE "); else strcat(where, " AND "); strcat(where, tmp); } } else { if(!statement || !subject || !predicate) { if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, ",")) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } } if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, " ObjectR.URI AS ObR, ObjectB.Name AS ObB, ObjectL.Value AS ObV, ObjectL.Language AS ObL, ObjectL.Datatype AS ObD")) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } strcat(joins," LEFT JOIN Resources AS ObjectR ON S.Object=ObjectR.ID"); strcat(joins," LEFT JOIN Bnodes AS ObjectB ON S.Object=ObjectB.ID"); strcat(joins," LEFT JOIN Literals AS ObjectL ON S.Object=ObjectL.ID"); } /* Context */ if(context_node) { sprintf(tmp,"S.Context=" UINT64_T_FMT "", librdf_storage_mysql_get_node_hash(storage,context_node)); if(!strlen(where)) strcat(where, " WHERE "); else strcat(where, " AND "); strcat(where, tmp); } else { if(!statement || !subject || !predicate || !object) { if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, ",")) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } } if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, " ContextR.URI AS CoR, ContextB.Name AS CoB, ContextL.Value AS CoV, ContextL.Language AS CoL, ContextL.Datatype AS CoD")) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } strcat(joins," LEFT JOIN Resources AS ContextR ON S.Context=ContextR.ID"); strcat(joins," LEFT JOIN Bnodes AS ContextB ON S.Context=ContextB.ID"); strcat(joins," LEFT JOIN Literals AS ContextL ON S.Context=ContextL.ID"); } /* Query without variables? */ if(statement && subject && predicate && object && context_node) { if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, " 1")) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } } /* Complete query string */ if(librdf_storage_mysql_find_statements_in_context_augment_query(&query, joins) || librdf_storage_mysql_find_statements_in_context_augment_query(&query, where)) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } /* Start query... */ #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(sos->handle, query, strlen(query)) || !(sos->results=mysql_use_result(sos->handle))) { librdf_log(sos->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL query failed: %s", mysql_error(sos->handle)); librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } LIBRDF_FREE(char*, query); /* Get first statement, if any, and initialize stream */ if(librdf_storage_mysql_find_statements_in_context_next_statement(sos) || !sos->current_statement) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return librdf_new_empty_stream(storage->world); } stream=librdf_new_stream(storage->world,(void*)sos, &librdf_storage_mysql_find_statements_in_context_end_of_stream, &librdf_storage_mysql_find_statements_in_context_next_statement, &librdf_storage_mysql_find_statements_in_context_get_statement, &librdf_storage_mysql_find_statements_in_context_finished); if(!stream) { librdf_storage_mysql_find_statements_in_context_finished((void*)sos); return NULL; } return stream; } static int librdf_storage_mysql_find_statements_in_context_augment_query(char **query, const char *addition) { char *newquery; /* Augment existing query, returning 0 on success. */ newquery = LIBRDF_MALLOC(char*, strlen(*query) + strlen(addition) + 1); if(!newquery) return 1; strcpy(newquery,*query); strcat(newquery,addition); LIBRDF_FREE(char*, *query); *query=newquery; return 0; } static int librdf_storage_mysql_find_statements_in_context_end_of_stream(void* context) { librdf_storage_mysql_sos_context* sos=(librdf_storage_mysql_sos_context*)context; return sos->current_statement==NULL; } static int librdf_storage_mysql_find_statements_in_context_next_statement(void* context) { librdf_storage_mysql_sos_context* sos=(librdf_storage_mysql_sos_context*)context; MYSQL_ROW row; librdf_node *subject=NULL, *predicate=NULL, *object=NULL; librdf_node *node; /* Get next statement */ row=mysql_fetch_row(sos->results); if(row) { /* Get ready for context */ if(sos->current_context) librdf_free_node(sos->current_context); sos->current_context=NULL; /* Is this a query with statement parts? */ if(sos->query_statement) { subject=librdf_statement_get_subject(sos->query_statement); predicate=librdf_statement_get_predicate(sos->query_statement); if(sos->is_literal_match) object=NULL; else object=librdf_statement_get_object(sos->query_statement); } /* Make sure we have a statement object to return */ if(!sos->current_statement) { if(!(sos->current_statement=librdf_new_statement(sos->storage->world))) return 1; } librdf_statement_clear(sos->current_statement); /* Query without variables? */ if(subject && predicate && object && sos->query_context) { librdf_statement_set_subject(sos->current_statement,librdf_new_node_from_node(subject)); librdf_statement_set_predicate(sos->current_statement,librdf_new_node_from_node(predicate)); librdf_statement_set_object(sos->current_statement,librdf_new_node_from_node(object)); sos->current_context=librdf_new_node_from_node(sos->query_context); } else { /* Turn row parts into statement and context */ int part=0; /* Subject - constant or from row? */ if(subject) { librdf_statement_set_subject(sos->current_statement,librdf_new_node_from_node(subject)); } else { /* Resource or Bnode? */ if(row[part]) { if(!(node=librdf_new_node_from_uri_string(sos->storage->world, (const unsigned char*)row[part]))) return 1; } else if(row[part+1]) { if(!(node=librdf_new_node_from_blank_identifier(sos->storage->world, (const unsigned char*)row[part+1]))) return 1; } else return 1; librdf_statement_set_subject(sos->current_statement,node); part+=2; } /* Predicate - constant or from row? */ if(predicate) { librdf_statement_set_predicate(sos->current_statement,librdf_new_node_from_node(predicate)); } else { /* Resource? */ if(row[part]) { if(!(node=librdf_new_node_from_uri_string(sos->storage->world, (const unsigned char*)row[part]))) return 1; } else return 1; librdf_statement_set_predicate(sos->current_statement,node); part+=1; } /* Object - constant or from row? */ if(object) { librdf_statement_set_object(sos->current_statement,librdf_new_node_from_node(object)); } else { /* Resource, Bnode or Literal? */ if(row[part]) { if(!(node=librdf_new_node_from_uri_string(sos->storage->world, (const unsigned char*)row[part]))) return 1; } else if(row[part+1]) { if(!(node=librdf_new_node_from_blank_identifier(sos->storage->world, (const unsigned char*)row[part+1]))) return 1; } else if(row[part+2]) { /* Typed literal? */ librdf_uri *datatype=NULL; if(row[part+4] && strlen(row[part+4])) datatype=librdf_new_uri(sos->storage->world, (const unsigned char*)row[part+4]); if(!(node=librdf_new_node_from_typed_literal(sos->storage->world, (const unsigned char*)row[part+2], row[part+3], datatype))) return 1; } else return 1; librdf_statement_set_object(sos->current_statement,node); part+=5; } /* Context - constant or from row? */ if(sos->query_context) { sos->current_context=librdf_new_node_from_node(sos->query_context); } else { /* Resource, Bnode or Literal? */ if(row[part]) { if(!(node=librdf_new_node_from_uri_string(sos->storage->world, (const unsigned char*)row[part]))) return 1; } else if(row[part+1]) { if(!(node=librdf_new_node_from_blank_identifier(sos->storage->world, (const unsigned char*)row[part+1]))) return 1; } else if(row[part+2]) { /* Typed literal? */ librdf_uri *datatype=NULL; if(row[part+4] && strlen(row[part+4])) datatype=librdf_new_uri(sos->storage->world, (const unsigned char*)row[part+4]); if(!(node=librdf_new_node_from_typed_literal(sos->storage->world, (const unsigned char*)row[part+2], row[part+3], datatype))) return 1; } else /* no context */ node=NULL; sos->current_context=node; } } } else { if(sos->current_statement) librdf_free_statement(sos->current_statement); sos->current_statement=NULL; if(sos->current_context) librdf_free_node(sos->current_context); sos->current_context=NULL; } return 0; } static void* librdf_storage_mysql_find_statements_in_context_get_statement(void* context, int flags) { librdf_storage_mysql_sos_context* sos=(librdf_storage_mysql_sos_context*)context; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return sos->current_statement; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return sos->current_context; default: LIBRDF_DEBUG2("Unknown flags %d\n", flags); return NULL; } } static void librdf_storage_mysql_find_statements_in_context_finished(void* context) { librdf_storage_mysql_sos_context* sos=(librdf_storage_mysql_sos_context*)context; if(sos->results) mysql_free_result(sos->results); if(sos->handle) { librdf_storage_mysql_release_handle(sos->storage, sos->handle); } if(sos->current_statement) librdf_free_statement(sos->current_statement); if(sos->current_context) librdf_free_node(sos->current_context); if(sos->query_statement) librdf_free_statement(sos->query_statement); if(sos->query_context) librdf_free_node(sos->query_context); if(sos->storage) librdf_storage_remove_reference(sos->storage); LIBRDF_FREE(librdf_storage_mysql_sos_context, sos); } /** * librdf_storage_mysql_get_contexts: * @storage: the storage * * Return an iterator with the context nodes present in storage. * * Return value: a #librdf_iterator or NULL on failure **/ static librdf_iterator* librdf_storage_mysql_get_contexts(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance*)storage->instance; librdf_storage_mysql_get_contexts_context* gccontext; const char select_contexts[]="\ SELECT DISTINCT R.URI AS CoR, B.Name AS CoB, \ L.Value AS CoV, L.Language AS CoL, L.Datatype AS CoD \ FROM Statements" UINT64_T_FMT " as S \ LEFT JOIN Resources AS R ON S.Context=R.ID \ LEFT JOIN Bnodes AS B ON S.Context=B.ID \ LEFT JOIN Literals AS L ON S.Context=L.ID"; char *query; librdf_iterator* iterator; /* Initialize get_contexts context */ gccontext = LIBRDF_CALLOC(librdf_storage_mysql_get_contexts_context*, 1, sizeof(*gccontext)); if(!gccontext) return NULL; gccontext->storage=storage; librdf_storage_add_reference(gccontext->storage); gccontext->current_context=NULL; gccontext->results=NULL; /* Get MySQL connection handle */ gccontext->handle=librdf_storage_mysql_get_handle(storage); if(!gccontext->handle) { librdf_storage_mysql_get_contexts_finished((void*)gccontext); return NULL; } /* Construct query */ query = LIBRDF_MALLOC(char*, strlen(select_contexts) + 21); if(!query) { librdf_storage_mysql_get_contexts_finished((void*)gccontext); return NULL; } sprintf(query, select_contexts, context->model); /* Start query... */ #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(gccontext->handle, query, strlen(query)) || !(gccontext->results=mysql_use_result(gccontext->handle))) { librdf_log(gccontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL query failed: %s", mysql_error(gccontext->handle)); librdf_storage_mysql_get_contexts_finished((void*)gccontext); return NULL; } LIBRDF_FREE(char*, query); /* Get first context, if any, and initialize iterator */ if(librdf_storage_mysql_get_contexts_next_context(gccontext) || !gccontext->current_context) { librdf_storage_mysql_get_contexts_finished((void*)gccontext); return librdf_new_empty_iterator(storage->world); } iterator=librdf_new_iterator(storage->world,(void*)gccontext, &librdf_storage_mysql_get_contexts_end_of_iterator, &librdf_storage_mysql_get_contexts_next_context, &librdf_storage_mysql_get_contexts_get_context, &librdf_storage_mysql_get_contexts_finished); if(!iterator) librdf_storage_mysql_get_contexts_finished(gccontext); return iterator; } static int librdf_storage_mysql_get_contexts_end_of_iterator(void* context) { librdf_storage_mysql_get_contexts_context* gccontext=(librdf_storage_mysql_get_contexts_context*)context; return gccontext->current_context==NULL; } static int librdf_storage_mysql_get_contexts_next_context(void* context) { librdf_storage_mysql_get_contexts_context* gccontext=(librdf_storage_mysql_get_contexts_context*)context; MYSQL_ROW row; librdf_node *node; /* Get next statement */ row=mysql_fetch_row(gccontext->results); if(row) { /* Free old context node, if allocated */ if(gccontext->current_context) librdf_free_node(gccontext->current_context); /* Resource, Bnode or Literal? */ if(row[0]) { if(!(node=librdf_new_node_from_uri_string(gccontext->storage->world, (const unsigned char*)row[0]))) return 1; } else if(row[1]) { if(!(node=librdf_new_node_from_blank_identifier(gccontext->storage->world, (const unsigned char*)row[1]))) return 1; } else if(row[2]) { /* Typed literal? */ librdf_uri *datatype=NULL; if(row[4] && strlen(row[4])) datatype=librdf_new_uri(gccontext->storage->world, (const unsigned char*)row[4]); if(!(node=librdf_new_node_from_typed_literal(gccontext->storage->world, (const unsigned char*)row[2], row[3], datatype))) return 1; } else return 1; gccontext->current_context=node; } else { if(gccontext->current_context) librdf_free_node(gccontext->current_context); gccontext->current_context=NULL; } return 0; } static void* librdf_storage_mysql_get_contexts_get_context(void* context, int flags) { librdf_storage_mysql_get_contexts_context* gccontext=(librdf_storage_mysql_get_contexts_context*)context; return gccontext->current_context; } static void librdf_storage_mysql_get_contexts_finished(void* context) { librdf_storage_mysql_get_contexts_context* gccontext=(librdf_storage_mysql_get_contexts_context*)context; if(gccontext->results) mysql_free_result(gccontext->results); if(gccontext->handle) { librdf_storage_mysql_release_handle(gccontext->storage, gccontext->handle); } if(gccontext->current_context) librdf_free_node(gccontext->current_context); if(gccontext->storage) librdf_storage_remove_reference(gccontext->storage); LIBRDF_FREE(librdf_storage_mysql_get_contexts_context, gccontext); } /** * librdf_storage_mysql_get_feature: * @storage: #librdf_storage object * @feature: #librdf_uri feature property * * Get the value of a storage feature. * * Return value: #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ static librdf_node* librdf_storage_mysql_get_feature(librdf_storage* storage, librdf_uri* feature) { unsigned char *uri_string; if(!feature) return NULL; uri_string=librdf_uri_as_string(feature); if(!uri_string) return NULL; if(!strcmp((const char*)uri_string, (const char*)LIBRDF_MODEL_FEATURE_CONTEXTS)) { /* Always have contexts */ static const unsigned char value[2]="1"; return librdf_new_node_from_typed_literal(storage->world, value, NULL, NULL); } return NULL; } /** * librdf_storage_mysql_transaction_start: * @storage: the storage object * * Start a transaction * * Return value: non-0 on failure **/ static int librdf_storage_mysql_transaction_start(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance* )storage->instance; int i; if(context->transaction_handle) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL transaction already started"); return 1; } context->transaction_handle=librdf_storage_mysql_get_handle(storage); if(!context->transaction_handle) return 1; for(i=0; i<= TABLE_STATEMENTS; i++) context->pending_inserts[i] = raptor_new_sequence((raptor_data_free_handler)free_pending_row, NULL); context->pending_insert_hash_nodes=librdf_new_hash(storage->world, NULL); if(!context->pending_insert_hash_nodes) LIBRDF_FATAL1(storage->world, LIBRDF_FROM_STORAGE, "Failed to create MySQL seen nodes hash from factory"); if(librdf_hash_open(context->pending_insert_hash_nodes, NULL, 0, 1, 1, NULL)) LIBRDF_FATAL1(storage->world, LIBRDF_FROM_STORAGE, "Failed to open MySQL seen nodes hash"); context->pending_statements = raptor_new_sequence((raptor_data_free_handler)free_pending_row, NULL); return 0; } /** * librdf_storage_mysql_transaction_start_with_handle: * @storage: the storage object * @handle: the transaction object * * Start a transaction using an existing external transaction object. * * Return value: non-0 on failure **/ static int librdf_storage_mysql_transaction_start_with_handle(librdf_storage* storage, void* handle) { return librdf_storage_mysql_transaction_start(storage); } /* * librdf_storage_mysql_transaction_terminate: * @storage: storage object * * INTERNAL - free transaction state */ static void librdf_storage_mysql_transaction_terminate(librdf_storage *storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance* )storage->instance; MYSQL* handle=context->transaction_handle; int i; if(!handle) return; context->transaction_handle=NULL; librdf_storage_mysql_release_handle(storage, handle); for(i=0; i<= TABLE_STATEMENTS; i++) { raptor_sequence* seq; seq=context->pending_inserts[i]; if(seq) raptor_free_sequence(seq); context->pending_inserts[i]=NULL; } if(context->pending_insert_hash_nodes) { librdf_free_hash(context->pending_insert_hash_nodes); context->pending_insert_hash_nodes=NULL; } if(context->pending_statements) { raptor_free_sequence(context->pending_statements); context->pending_statements=NULL; } } /** * librdf_storage_mysql_transaction_commit: * @storage: the storage object * * Commit a transaction. * * Return value: non-0 on failure **/ static int librdf_storage_mysql_transaction_commit(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance* )storage->instance; const char* query; MYSQL* handle; int status; int i; size_t query_len; const char start_query[]="START TRANSACTION"; const table_info *table; raptor_stringbuffer* sb=NULL; int count=0; handle=context->transaction_handle; if(!handle) return 1; /* Take a look to see if there is anything at all to commit */ count=raptor_sequence_size(context->pending_statements); for(i=0; i< TABLE_STATEMENTS; i++) count += raptor_sequence_size(context->pending_inserts[i]); if(!count) { #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG1("Nothing pending to commit\n"); #endif librdf_storage_mysql_transaction_terminate(storage); return 0; } #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("%d items pending to commit\n", count); #endif /* START TRANSACTION */ query=start_query; query_len=strlen(query); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(context->transaction_handle, query, query_len)) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL query failed: %s", mysql_error(context->transaction_handle)); librdf_storage_mysql_transaction_rollback(storage); return 1; } /* INSERT node values */ for(i=0; i< TABLE_STATEMENTS; i++) { raptor_sequence* seq; raptor_stringbuffer* tsb; seq=context->pending_inserts[i]; table=&mysql_tables[i]; /* sort pending nodes to always be inserted in same order */ raptor_sequence_sort(seq, compare_pending_rows); tsb=format_pending_row_sequence(table, seq); if(!tsb) continue; query_len=raptor_stringbuffer_length(tsb); query=(char*)raptor_stringbuffer_as_string(tsb); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(context->transaction_handle, query, query_len)) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL query to table %s failed: %s", table->name, mysql_error(context->transaction_handle)); raptor_free_stringbuffer(tsb); librdf_storage_mysql_transaction_rollback(storage); return 1; } raptor_free_stringbuffer(tsb); } /* INSERT STATEMENT* */ if(raptor_sequence_size(context->pending_statements)) { char uint64_buffer[64]; raptor_sequence* seq; table=&mysql_tables[TABLE_STATEMENTS]; /* sort pending statements to always be inserted in same order */ raptor_sequence_sort(context->pending_statements, compare_pending_rows); sb=raptor_new_stringbuffer(); raptor_stringbuffer_append_string(sb, (const unsigned char*)"REPLACE INTO Statements", 1); sprintf(uint64_buffer, UINT64_T_FMT, context->model); raptor_stringbuffer_append_string(sb, (const unsigned char*)uint64_buffer, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)" (", 2, 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)table->columns, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)") VALUES ", 9, 1); seq=context->pending_statements; for(i=0; i< raptor_sequence_size(seq); i++) { pending_row* prow=(pending_row*)raptor_sequence_get_at(seq, i); int j; if(i > 0) raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)", ", 2, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)"(", 1, 1); for(j=0; j < 4; j++) { if(j > 0) raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)", ", 2, 1); sprintf(uint64_buffer, UINT64_T_FMT, prow->uints[j]); raptor_stringbuffer_append_string(sb, (const unsigned char*)uint64_buffer, 1); } raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)")", 1, 1); } query=(char*)raptor_stringbuffer_as_string(sb); if(query) { #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif if(mysql_real_query(handle, query, strlen(query)) && mysql_errno(handle) != ER_DUP_ENTRY) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "MySQL insert into %s failed with error %s", table->name, mysql_error(handle)); raptor_free_stringbuffer(sb); librdf_storage_mysql_transaction_rollback(storage); return 1; } } } /* COMMIT */ #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG1("SQL: mysql_commit()\n"); #endif status=mysql_commit(handle); librdf_storage_mysql_transaction_terminate(storage); if(sb) raptor_free_stringbuffer(sb); return (status != 0); } /** * librdf_storage_mysql_transaction_rollback: * @storage: the storage object * * Rollback a transaction. * * Return value: non-0 on failure **/ static int librdf_storage_mysql_transaction_rollback(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance* )storage->instance; MYSQL* handle; int status; handle=context->transaction_handle; if(!handle) return 1; #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG1("SQL: mysql_rollback()\n"); #endif status=mysql_rollback(handle); librdf_storage_mysql_transaction_terminate(storage); return (status != 0); } /** * librdf_storage_mysql_transaction_get_handle: * @storage: the storage object * * Get the current transaction handle. * * Return value: non-0 on failure **/ static void* librdf_storage_mysql_transaction_get_handle(librdf_storage* storage) { librdf_storage_mysql_instance* context=(librdf_storage_mysql_instance* )storage->instance; return context->transaction_handle; } /** Local entry point for dynamically loaded storage module */ static void librdf_storage_mysql_register_factory(librdf_storage_factory *factory) { LIBRDF_ASSERT_CONDITION(!strcmp(factory->name, "mysql")); factory->version = LIBRDF_STORAGE_INTERFACE_VERSION; factory->init = librdf_storage_mysql_init; factory->terminate = librdf_storage_mysql_terminate; factory->open = librdf_storage_mysql_open; factory->close = librdf_storage_mysql_close; factory->sync = librdf_storage_mysql_sync; factory->size = librdf_storage_mysql_size; factory->add_statement = librdf_storage_mysql_add_statement; factory->add_statements = librdf_storage_mysql_add_statements; factory->remove_statement = librdf_storage_mysql_remove_statement; factory->contains_statement = librdf_storage_mysql_contains_statement; factory->serialise = librdf_storage_mysql_serialise; factory->find_statements = librdf_storage_mysql_find_statements; factory->find_statements_with_options = librdf_storage_mysql_find_statements_with_options; factory->context_add_statement = librdf_storage_mysql_context_add_statement; factory->context_add_statements = librdf_storage_mysql_context_add_statements; factory->context_remove_statement = librdf_storage_mysql_context_remove_statement; factory->context_remove_statements = librdf_storage_mysql_context_remove_statements; factory->context_serialise = librdf_storage_mysql_context_serialise; factory->find_statements_in_context = librdf_storage_mysql_find_statements_in_context; factory->get_contexts = librdf_storage_mysql_get_contexts; factory->get_feature = librdf_storage_mysql_get_feature; factory->transaction_start = librdf_storage_mysql_transaction_start; factory->transaction_start_with_handle = librdf_storage_mysql_transaction_start_with_handle; factory->transaction_commit = librdf_storage_mysql_transaction_commit; factory->transaction_rollback = librdf_storage_mysql_transaction_rollback; factory->transaction_get_handle = librdf_storage_mysql_transaction_get_handle; } #ifdef MODULAR_LIBRDF /** Entry point for dynamically loaded storage module */ void librdf_storage_module_register_factory(librdf_world *world) { librdf_storage_register_factory(world, "mysql", "MySQL database store", &librdf_storage_mysql_register_factory); } #else /* * librdf_init_storage_mysql: * @world: world object * * INTERNAL - Initialise the built-in storage_mysql module. */ void librdf_init_storage_mysql(librdf_world *world) { librdf_storage_register_factory(world, "mysql", "MySQL database store", &librdf_storage_mysql_register_factory); } #endif redland-1.0.17/src/rdf_hash_cursor.c0000644000175000017500000000707211615421777014261 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_hash.c - RDF Hash Cursor Implementation * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include #include /* private structure */ struct librdf_hash_cursor_s { librdf_hash *hash; void *context; }; /** * librdf_new_hash_cursor: * @hash: the hash object * * Constructor - Create a new #librdf_hash_cursor over a #librdf_hash. * * Return value: a new #librdf_hash_cursor or NULL on failure **/ librdf_hash_cursor* librdf_new_hash_cursor (librdf_hash* hash) { librdf_hash_cursor* cursor; void *cursor_context; cursor = LIBRDF_CALLOC(librdf_hash_cursor*, 1, sizeof(*cursor)); if(!cursor) return NULL; cursor_context = LIBRDF_CALLOC(void*, 1, hash->factory->cursor_context_length); if(!cursor_context) { LIBRDF_FREE(librdf_hash_cursor, cursor); return NULL; } cursor->hash=hash; cursor->context=cursor_context; if(hash->factory->cursor_init(cursor->context, hash->context)) { librdf_free_hash_cursor(cursor); cursor=NULL; } return cursor; } /** * librdf_free_hash_cursor: * * Destructor - destroy a #librdf_hash_cursor object. * * @cursor: hash cursor object **/ void librdf_free_hash_cursor (librdf_hash_cursor* cursor) { if(!cursor) return; if(cursor->context) { cursor->hash->factory->cursor_finish(cursor->context); LIBRDF_FREE(librdf_hash_cursor_context, cursor->context); } LIBRDF_FREE(librdf_hash_cursor, cursor); } int librdf_hash_cursor_set(librdf_hash_cursor *cursor, librdf_hash_datum *key, librdf_hash_datum *value) { return cursor->hash->factory->cursor_get(cursor->context, key, value, LIBRDF_HASH_CURSOR_SET); } int librdf_hash_cursor_get_next_value(librdf_hash_cursor *cursor, librdf_hash_datum *key, librdf_hash_datum *value) { return cursor->hash->factory->cursor_get(cursor->context, key, value, LIBRDF_HASH_CURSOR_NEXT_VALUE); } int librdf_hash_cursor_get_first(librdf_hash_cursor *cursor, librdf_hash_datum *key, librdf_hash_datum *value) { return cursor->hash->factory->cursor_get(cursor->context, key, value, LIBRDF_HASH_CURSOR_FIRST); } int librdf_hash_cursor_get_next(librdf_hash_cursor *cursor, librdf_hash_datum *key, librdf_hash_datum *value) { return cursor->hash->factory->cursor_get(cursor->context, key, value, LIBRDF_HASH_CURSOR_NEXT); } redland-1.0.17/src/rdf_stream.c0000644000175000017500000005623411655006762013235 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_stream.c - RDF Statement Stream Implementation * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include #ifndef STANDALONE /* prototypes of local helper functions */ static librdf_statement* librdf_stream_update_current_statement(librdf_stream* stream); /** * librdf_new_stream: * @world: redland world object * @context: context to pass to the stream implementing objects * @is_end_method: pointer to function to test for end of stream * @next_method: pointer to function to move to the next statement in stream * @get_method: pointer to function to get the current statement * @finished_method: pointer to function to finish the stream. * * Constructor - create a new #librdf_stream. * * Creates a new stream with an implementation based on the passed in * functions. The functions next_statement and end_of_stream will be called * multiple times until either of them signify the end of stream by * returning NULL or non 0 respectively. The finished function is called * once only when the stream object is destroyed with librdf_free_stream() * * A mapping function can be set for the stream using librdf_stream_add_map() * function which allows the statements generated by the stream to be * filtered and/or altered as they are generated before passing back * to the user. * * Return value: a new #librdf_stream object or NULL on failure **/ REDLAND_EXTERN_C librdf_stream* librdf_new_stream(librdf_world *world, void* context, int (*is_end_method)(void*), int (*next_method)(void*), void* (*get_method)(void*, int), void (*finished_method)(void*)) { librdf_stream* new_stream; librdf_world_open(world); new_stream = LIBRDF_CALLOC(librdf_stream*, 1, sizeof(*new_stream)); if(!new_stream) return NULL; new_stream->world=world; new_stream->context=context; new_stream->is_end_method=is_end_method; new_stream->next_method=next_method; new_stream->get_method=get_method; new_stream->finished_method=finished_method; new_stream->is_finished=0; new_stream->current=NULL; return new_stream; } /* helper function for deleting list map */ static void librdf_stream_free_stream_map(void *list_data, void *user_data) { librdf_stream_map* map=(librdf_stream_map*)list_data; if(map->free_context) map->free_context(map->context); LIBRDF_FREE(librdf_stream_map, map); } /** * librdf_free_stream: * @stream: #librdf_stream object * * Destructor - destroy an #libdf_stream object. * **/ void librdf_free_stream(librdf_stream* stream) { if(!stream) return; if(stream->finished_method) stream->finished_method(stream->context); if(stream->map_list) { librdf_list_foreach(stream->map_list, librdf_stream_free_stream_map, NULL); librdf_free_list(stream->map_list); } LIBRDF_FREE(librdf_stream, stream); } /* * librdf_stream_update_current_statement - helper function to get the next element with map applied * @stream: #librdf_stream object * * A helper function that gets the next element subject to the user * defined map function, if set by librdf_stream_add_map(), * * Return value: the next statement or NULL at end of stream */ static librdf_statement* librdf_stream_update_current_statement(librdf_stream* stream) { librdf_statement* statement=NULL; if(stream->is_updated) return stream->current; stream->is_updating=1; /* find next statement subject to map */ while(!stream->is_end_method(stream->context)) { librdf_iterator* map_iterator; /* Iterator over stream->map_list librdf_list */ statement=(librdf_statement*)stream->get_method(stream->context, LIBRDF_STREAM_GET_METHOD_GET_OBJECT); if(!statement) break; if(!stream->map_list || !librdf_list_size(stream->map_list)) break; map_iterator=librdf_list_get_iterator(stream->map_list); if(!map_iterator) { statement=NULL; break; } while(!librdf_iterator_end(map_iterator)) { librdf_stream_map *map=(librdf_stream_map*)librdf_iterator_get_object(map_iterator); if(!map) break; /* apply the map to the element */ statement=map->fn(stream, map->context, statement); if(!statement) break; librdf_iterator_next(map_iterator); } librdf_free_iterator(map_iterator); /* found something, return it */ if(statement) break; stream->next_method(stream->context); } stream->current=statement; if(!stream->current) stream->is_finished=1; stream->is_updated=1; stream->is_updating=0; return statement; } /** * librdf_stream_end: * @stream: #librdf_stream object * * Test if the stream has ended. * * Return value: non 0 at end of stream. **/ int librdf_stream_end(librdf_stream* stream) { /* always end of NULL stream */ if(!stream || stream->is_finished) return 1; librdf_stream_update_current_statement(stream); return stream->is_finished; } /** * librdf_stream_next: * @stream: #librdf_stream object * * Move to the next librdf_statement in the stream. * * Return value: non 0 if the stream has finished **/ int librdf_stream_next(librdf_stream* stream) { if(!stream || stream->is_finished) return 1; if(stream->next_method(stream->context)) { stream->is_finished=1; return 1; } stream->is_updated=0; librdf_stream_update_current_statement(stream); return stream->is_finished; } /** * librdf_stream_get_object: * @stream: #librdf_stream object * * Get the current librdf_statement in the stream. * * This method returns a SHARED pointer to the current statement object * which should be copied by the caller to preserve it if the stream * is moved on librdf_stream_next() or if it should last after the * stream is closed. librdf_new_statement_from_statement() can be used * for copying the statement. * * Return value: the current #librdf_statement object or NULL at end of stream. **/ librdf_statement* librdf_stream_get_object(librdf_stream* stream) { if(stream->is_finished) return NULL; return librdf_stream_update_current_statement(stream); } /** * librdf_stream_get_context2: * @stream: the #librdf_stream object * * Get the context of the current object on the stream. * * This method returns a SHARED pointer to the current context node object * which should be copied by the caller to preserve it if the stream * is moved on librdf_stream_next or if it should last after the * stream is closed. * * Return value: The context node (can be NULL) or NULL if the stream has finished. **/ librdf_node* librdf_stream_get_context2(librdf_stream* stream) { if(stream->is_finished) return NULL; /* Update current statement only if we are not already in the middle of the statement update process. Allows inspection of context nodes in stream map callbacks. */ if(!stream->is_updating && !librdf_stream_update_current_statement(stream)) return NULL; return (librdf_node*)stream->get_method(stream->context, LIBRDF_STREAM_GET_METHOD_GET_CONTEXT); } /** * librdf_stream_get_context: * @stream: the #librdf_stream object * * Get the context of the current object on the stream. * * This method returns a SHARED pointer to the current context node object * which should be copied by the caller to preserve it if the stream * is moved on librdf_stream_next or if it should last after the * stream is closed. * * @Deprecated: Use librdf_stream_get_context2() which returns a #librdf_node * * Return value: The context node (can be NULL) or NULL if the stream has finished. **/ void* librdf_stream_get_context(librdf_stream* stream) { return librdf_stream_get_context2(stream); } /** * librdf_stream_add_map: * @stream: the stream * @map_function: the function to perform the mapping * @free_context: the function to use to free the context (or NULL) * @map_context: the context to pass to the map function * * Add a librdf_stream mapping function. * * Adds an stream mapping function which operates over the stream to * select which elements are returned; it will be applied as soon as * this method is called. * * Several mapping functions can be added and they are applied in * the order given. * * The mapping function should return the statement to return, or NULL * to remove it from the stream. * * Return value: Non 0 on failure **/ int librdf_stream_add_map(librdf_stream* stream, librdf_stream_map_handler map_function, librdf_stream_map_free_context_handler free_context, void *map_context) { librdf_stream_map *map; if(!stream->map_list) { stream->map_list=librdf_new_list(stream->world); if(!stream->map_list) { if(free_context && map_context) (*free_context)(map_context); return 1; } } map = LIBRDF_CALLOC(librdf_stream_map*, 1, sizeof(*map)); if(!map) { if(free_context && map_context) (*free_context)(map_context); return 1; } map->fn=map_function; map->free_context=free_context; map->context=map_context; if(librdf_list_add(stream->map_list, map)) { LIBRDF_FREE(librdf_stream_map, map); if(free_context && map_context) (*free_context)(map_context); return 1; } return 0; } static int librdf_stream_from_node_iterator_end_of_stream(void* context); static int librdf_stream_from_node_iterator_next_statement(void* context); static void* librdf_stream_from_node_iterator_get_statement(void* context, int flags); static void librdf_stream_from_node_iterator_finished(void* context); typedef struct { librdf_iterator *iterator; librdf_statement *current; /* shared statement */ librdf_statement_part field; } librdf_stream_from_node_iterator_stream_context; /** * librdf_new_stream_from_node_iterator: * @iterator: #librdf_iterator of #librdf_node objects * @statement: #librdf_statement prototype with one NULL node space * @field: node part of statement * * Constructor - create a new #librdf_stream from an iterator of nodes. * * Creates a new #librdf_stream using the passed in #librdf_iterator * which generates a series of #librdf_node objects. The resulting * nodes are then inserted into the given statement and returned. * The field attribute indicates which statement node is being generated. * * Return value: a new #librdf_stream object or NULL on failure **/ librdf_stream* librdf_new_stream_from_node_iterator(librdf_iterator* iterator, librdf_statement* statement, librdf_statement_part field) { librdf_stream_from_node_iterator_stream_context *scontext; librdf_stream *stream; scontext = LIBRDF_CALLOC(librdf_stream_from_node_iterator_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; /* copy the prototype statement */ statement=librdf_new_statement_from_statement(statement); if(!statement) { LIBRDF_FREE(librdf_stream_from_node_iterator_stream_context, scontext); return NULL; } scontext->iterator=iterator; scontext->current=statement; scontext->field=field; stream=librdf_new_stream(iterator->world, (void*)scontext, &librdf_stream_from_node_iterator_end_of_stream, &librdf_stream_from_node_iterator_next_statement, &librdf_stream_from_node_iterator_get_statement, &librdf_stream_from_node_iterator_finished); if(!stream) { librdf_stream_from_node_iterator_finished((void*)scontext); return NULL; } return stream; } static int librdf_stream_from_node_iterator_end_of_stream(void* context) { librdf_stream_from_node_iterator_stream_context* scontext=(librdf_stream_from_node_iterator_stream_context*)context; return librdf_iterator_end(scontext->iterator); } static int librdf_stream_from_node_iterator_next_statement(void* context) { librdf_stream_from_node_iterator_stream_context* scontext=(librdf_stream_from_node_iterator_stream_context*)context; return librdf_iterator_next(scontext->iterator); } static void* librdf_stream_from_node_iterator_get_statement(void* context, int flags) { librdf_stream_from_node_iterator_stream_context* scontext=(librdf_stream_from_node_iterator_stream_context*)context; librdf_node* node; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: if(!(node=(librdf_node*)librdf_iterator_get_object(scontext->iterator))) return NULL; /* The node object above is shared, no need to free it before * assigning to the statement, which is also shared, and * return to the user. */ switch(scontext->field) { case LIBRDF_STATEMENT_SUBJECT: librdf_statement_set_subject(scontext->current, node); break; case LIBRDF_STATEMENT_PREDICATE: librdf_statement_set_predicate(scontext->current, node); break; case LIBRDF_STATEMENT_OBJECT: librdf_statement_set_object(scontext->current, node); break; case LIBRDF_STATEMENT_ALL: default: librdf_log(scontext->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STREAM, NULL, "Illegal statement field %d seen", scontext->field); return NULL; } return scontext->current; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return librdf_iterator_get_context(scontext->iterator); default: librdf_log(scontext->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STREAM, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_stream_from_node_iterator_finished(void* context) { librdf_stream_from_node_iterator_stream_context* scontext=(librdf_stream_from_node_iterator_stream_context*)context; librdf_world* world = scontext->iterator ? scontext->iterator->world : NULL; if(scontext->iterator) librdf_free_iterator(scontext->iterator); if(scontext->current) { switch(scontext->field) { case LIBRDF_STATEMENT_SUBJECT: librdf_statement_set_subject(scontext->current, NULL); break; case LIBRDF_STATEMENT_PREDICATE: librdf_statement_set_predicate(scontext->current, NULL); break; case LIBRDF_STATEMENT_OBJECT: librdf_statement_set_object(scontext->current, NULL); break; case LIBRDF_STATEMENT_ALL: default: librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STREAM, NULL, "Illegal statement field %d seen", scontext->field); } librdf_free_statement(scontext->current); } LIBRDF_FREE(librdf_stream_from_node_iterator_stream_context, scontext); } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_stream_print: * @stream: the stream object * @fh: the FILE stream to print to * * Print the stream. * * This prints the remaining statements of the stream to the given * file handle. Note that after this method is called the stream * will be empty so that librdf_stream_end() will always be true * and librdf_stream_next() will always return NULL. The only * useful operation is to dispose of the stream with the * librdf_free_stream() destructor. * * This method is for debugging and the format of the output should * not be relied on. * * @Deprecated: Use librdf_stream_write() to write to * #raptor_iostream which can be made to write to a string. Use a * #librdf_serializer to write proper syntax formats. * **/ void librdf_stream_print(librdf_stream *stream, FILE *fh) { raptor_iostream *iostr; if(!stream) return; iostr = raptor_new_iostream_to_file_handle(stream->world->raptor_world_ptr, fh); if(!iostr) return; while(!librdf_stream_end(stream)) { librdf_statement* statement = librdf_stream_get_object(stream); librdf_node* context_node = librdf_stream_get_context2(stream); if(!statement) break; fputs(" ", fh); librdf_statement_write(statement, iostr); if(context_node) { fputs(" with context ", fh); librdf_node_print(context_node, fh); } fputs("\n", fh); librdf_stream_next(stream); } raptor_free_iostream(iostr); } #endif /** * librdf_stream_write: * @stream: the stream object * @iostr: the iostream to write to * * Write a stream of triples to an iostream in a debug format. * * This prints the remaining statements of the stream to the given * #raptor_iostream in a debug format. * * Note that after this method is called the stream will be empty so * that librdf_stream_end() will always be true and * librdf_stream_next() will always return NULL. The only useful * operation is to dispose of the stream with the * librdf_free_stream() destructor. * * This method is for debugging and the format of the output should * not be relied on. In particular, when contexts are used the * result may be 4 nodes. * * Return value: non-0 on failure **/ int librdf_stream_write(librdf_stream *stream, raptor_iostream *iostr) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(stream, librdf_stream, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(iostr, raptor_iostream, 1); while(!librdf_stream_end(stream)) { librdf_statement* statement; librdf_node* context_node; statement = librdf_stream_get_object(stream); if(!statement) break; raptor_iostream_counted_string_write(" ", 2, iostr); if(librdf_statement_write(statement, iostr)) return 1; context_node = librdf_stream_get_context2(stream); if(context_node) { raptor_iostream_counted_string_write(" with context ", 14, iostr); librdf_node_write(context_node, iostr); } raptor_iostream_counted_string_write(". \n", 3, iostr); librdf_stream_next(stream); } return 0; } librdf_statement* librdf_stream_statement_find_map(librdf_stream *stream, void* context, librdf_statement* statement) { librdf_statement* partial_statement=(librdf_statement*)context; /* any statement matches when no partial statement is given */ if(!partial_statement) return statement; if (librdf_statement_match(statement, partial_statement)) { return statement; } /* not suitable */ return NULL; } /** * librdf_new_empty_stream: * @world: redland world object * * Constructor - create a new #librdf_stream with no content. * * Return value: a new #librdf_stream object or NULL on failure **/ librdf_stream* librdf_new_empty_stream(librdf_world *world) { librdf_stream* new_stream; librdf_world_open(world); new_stream = LIBRDF_CALLOC(librdf_stream*, 1, sizeof(*new_stream)); if(!new_stream) return NULL; new_stream->world=world; /* This ensures end, next, get_object, get_context factory methods * never get called and the methods always return finished. */ new_stream->is_finished=1; return new_stream; } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); #define STREAM_NODES_COUNT 6 #define NODE_URI_PREFIX "http://example.org/node" int main(int argc, char *argv[]) { librdf_statement *statement; librdf_stream* stream; const char *program=librdf_basename((const char*)argv[0]); librdf_world *world; librdf_uri* prefix_uri; librdf_node* nodes[STREAM_NODES_COUNT]; int i; librdf_iterator* iterator; int count; world=librdf_new_world(); librdf_world_open(world); prefix_uri=librdf_new_uri(world, (const unsigned char*)NODE_URI_PREFIX); if(!prefix_uri) { fprintf(stderr, "%s: Failed to create prefix URI\n", program); return(1); } for(i=0; i < STREAM_NODES_COUNT; i++) { unsigned char buf[2]; buf[0]='a'+i; buf[1]='\0'; nodes[i]=librdf_new_node_from_uri_local_name(world, prefix_uri, buf); if(!nodes[i]) { fprintf(stderr, "%s: Failed to create node %i (%s)\n", program, i, buf); return(1); } } fprintf(stdout, "%s: Creating static node iterator\n", program); iterator = librdf_node_new_static_node_iterator(world, nodes, STREAM_NODES_COUNT); if(!iterator) { fprintf(stderr, "%s: Failed to create static node iterator\n", program); return(1); } statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/resource"), librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/property"), NULL); if(!statement) { fprintf(stderr, "%s: Failed to create statement\n", program); return(1); } fprintf(stdout, "%s: Creating stream from node iterator\n", program); stream=librdf_new_stream_from_node_iterator(iterator, statement, LIBRDF_STATEMENT_OBJECT); if(!stream) { fprintf(stderr, "%s: Failed to createstatic node stream\n", program); return(1); } /* This is to check that the stream_from_node_iterator code * *really* takes a copy of what it needs from statement */ fprintf(stdout, "%s: Freeing statement\n", program); librdf_free_statement(statement); fprintf(stdout, "%s: Listing static node stream\n", program); count=0; while(!librdf_stream_end(stream)) { librdf_statement* s_statement=librdf_stream_get_object(stream); if(!s_statement) { fprintf(stderr, "%s: librdf_stream_current returned NULL when not end of stream\n", program); return(1); } fprintf(stdout, "%s: statement %d is: ", program, count); librdf_statement_print(s_statement, stdout); fputc('\n', stdout); librdf_stream_next(stream); count++; } if(count != STREAM_NODES_COUNT) { fprintf(stderr, "%s: Stream returned %d statements, expected %d\n", program, count, STREAM_NODES_COUNT); return(1); } fprintf(stdout, "%s: stream from node iterator worked ok\n", program); fprintf(stdout, "%s: Freeing stream\n", program); librdf_free_stream(stream); fprintf(stdout, "%s: Freeing nodes\n", program); for (i=0; i . @prefix dbconfig: . @prefix rdfs: . mysql: rdfs:label "Redland MySQL Schema V2 InnoDB"; dbconfig:createTableStatements """ CREATE TABLE IF NOT EXISTS $(STATEMENTS_NAME) ( Subject bigint unsigned NOT NULL, Predicate bigint unsigned NOT NULL, Object bigint unsigned NOT NULL, Context bigint unsigned NOT NULL, KEY Context (Context), KEY SubjectPredicate (Subject,Predicate), KEY PredicateObject (Predicate,Object), KEY ObjectSubject (Object,Subject) ) ENGINE=InnoDB DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=33 """; dbconfig:createTableLiterals """ CREATE TABLE IF NOT EXISTS Literals ( ID bigint unsigned NOT NULL, Value longtext NOT NULL, Language text NOT NULL, Datatype text NOT NULL, PRIMARY KEY ID (ID) ) ENGINE=InnoDB DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=44 """; dbconfig:createTableResources """ CREATE TABLE IF NOT EXISTS Resources ( ID bigint unsigned NOT NULL, URI text NOT NULL, PRIMARY KEY ID (ID) ) ENGINE=InnoDB DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=63 """; dbconfig:createTableBnodes """ CREATE TABLE IF NOT EXISTS Bnodes ( ID bigint unsigned NOT NULL, Name text NOT NULL, PRIMARY KEY ID (ID) ) ENGINE=InnoDB DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=33 """; dbconfig:createTableModels """ CREATE TABLE IF NOT EXISTS Models ( ID bigint unsigned NOT NULL, Name text NOT NULL, PRIMARY KEY ID (ID) ) ENGINE=InnoDB DELAY_KEY_WRITE=1 """; . redland-1.0.17/src/rdf_digest.c0000644000175000017500000003044311772470733013216 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_digest.c - RDF Digest Factory / Digest implementation * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, Copyright (C) 2000-2006, Copyright (C) 2000-2006, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #ifdef HAVE_STDLIB_H #include #endif #include #ifndef STANDALONE /* prototypes for helper functions */ static void librdf_delete_digest_factories(librdf_world* world); /* helper functions */ static void librdf_delete_digest_factories(librdf_world *world) { librdf_digest_factory *factory, *next; for(factory=world->digests; factory; factory=next) { next=factory->next; LIBRDF_FREE(librdf_digest_factory, factory->name); LIBRDF_FREE(librdf_digest_factory, factory); } world->digests=NULL; } /** * librdf_digest_register_factory: * @world: redland world object * @name: the name of the hash * @factory: function to be called to register the factory parameters * * Register a hash factory. * **/ void librdf_digest_register_factory(librdf_world *world, const char *name, void (*factory) (librdf_digest_factory*)) { librdf_digest_factory *digest; librdf_world_open(world); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG2("Received registration for digest %s\n", name); #endif for(digest = world->digests; digest; digest = digest->next ) { if(!strcmp(digest->name, name)) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_DIGEST, NULL, "digest %s already registered", digest->name); return; } } digest = LIBRDF_CALLOC(librdf_digest_factory*, 1, sizeof(*digest)); if(!digest) goto oom; digest->name = LIBRDF_MALLOC(char*, strlen(name) + 1); if(!digest->name) goto oom_tidy; strcpy(digest->name, name); digest->next = world->digests; world->digests = digest; /* Call the digest registration function on the new object */ (*factory)(digest); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG4("%s has context size %d and digest size %d\n", name, digest->context_length, digest->digest_length); #endif return; oom_tidy: LIBRDF_FREE(librdf_digest, digest); oom: LIBRDF_FATAL1(world, LIBRDF_FROM_DIGEST, "Out of memory"); } /** * librdf_get_digest_factory: * @world: redland world object * @name: the name of the factory * * Get a digest factory. * * Return value: the factory or NULL if not found **/ librdf_digest_factory* librdf_get_digest_factory(librdf_world *world, const char *name) { librdf_digest_factory *factory; librdf_world_open(world); /* return 1st digest if no particular one wanted - why? */ if(!name) { factory=world->digests; if(!factory) { LIBRDF_DEBUG1("No digests available\n"); return NULL; } } else { for(factory=world->digests; factory; factory=factory->next) { if(!strcmp(factory->name, name)) break; } /* else FACTORY with name digest_name not found -> return NULL */ } return factory; } /** * librdf_new_digest: * @world: redland world object * @name: the digest name to use to create this digest * * Constructor - create a new #librdf_digest object. * * After construction, data should be added to the digest using * #librdf_digest_update or #librdf_digest_update_string with * #librdf_digest_final to signify finishing. Then the digest * value can be returned directly with #librdf_digest_get_digest * of #librdf_digest_get_digest_length bytes or as a hex encoded * string with #librdf_digest_to_string. The digest can be * re-initialised for new data with #librdf_digest_init. * * Return value: new #librdf_digest object or NULL **/ librdf_digest* librdf_new_digest(librdf_world *world, const char *name) { librdf_digest_factory* factory; librdf_world_open(world); factory=librdf_get_digest_factory(world, name); if(!factory) return NULL; return librdf_new_digest_from_factory(world, factory); } /** * librdf_new_digest_from_factory: * @world: redland world object * @factory: the digest factory to use to create this digest * * Constructor - create a new #librdf_digest object. * * After construction, data should be added to the digest using * #librdf_digest_update or #librdf_digest_update_string with * #librdf_digest_final to signify finishing. Then the digest * value can be returned directly with #librdf_digest_get_digest * of #librdf_digest_get_digest_length bytes or as a hex encoded * string with #librdf_digest_to_string. The digest can be * re-initialised for new data with #librdf_digest_init. * * Return value: new #librdf_digest object or NULL **/ librdf_digest* librdf_new_digest_from_factory(librdf_world *world, librdf_digest_factory *factory) { librdf_digest* d; librdf_world_open(world); d = LIBRDF_CALLOC(librdf_digest*, 1, sizeof(*d)); if(!d) return NULL; d->world=world; d->context = LIBRDF_CALLOC(void*, 1, factory->context_length); if(!d->context) { librdf_free_digest(d); return NULL; } d->digest = LIBRDF_CALLOC(unsigned char*, 1, factory->digest_length); if(!d->digest) { librdf_free_digest(d); return NULL; } d->factory=factory; d->factory->init(d->context); return d; } /** * librdf_free_digest: * @digest: the digest * * Destructor - destroy a #librdf_digest object. * **/ void librdf_free_digest(librdf_digest *digest) { if(!digest) return; if(digest->context) LIBRDF_FREE(digest_context, digest->context); if(digest->digest) LIBRDF_FREE(digest_digest, digest->digest); LIBRDF_FREE(librdf_digest, digest); } /* methods */ /** * librdf_digest_init: * @digest: the digest * * (Re)initialise the librdf_digest object. * * This is automatically called on construction but can be used to * re-initialise the digest to the initial state for digesting new * data. **/ void librdf_digest_init(librdf_digest* digest) { digest->factory->init(digest->context); } /** * librdf_digest_update: * @digest: the digest * @buf: the data buffer * @length: the length of the data * * Add more data to the librdf_digest object. * **/ void librdf_digest_update(librdf_digest* digest, const unsigned char *buf, size_t length) { digest->factory->update(digest->context, buf, length); } /** * librdf_digest_update_string: * @digest: the digest * @string: string to add * * Add a string to the librdf_digest object. * **/ void librdf_digest_update_string(librdf_digest* digest, const unsigned char *string) { digest->factory->update(digest->context, string, strlen((const char*)string)); } /** * librdf_digest_final: * @digest: the digest * * Finish the digesting of data. * * The digest can now be returned via librdf_digest_get_digest(). **/ void librdf_digest_final(librdf_digest* digest) { void* digest_data; digest->factory->final(digest->context); digest_data=(*(digest->factory->get_digest))(digest->context); memcpy(digest->digest, digest_data, digest->factory->digest_length); } /** * librdf_digest_get_digest: * @digest: the digest * * Get the calculated digested value. * * Return value: pointer to the memory containing the digest. It will * be #librdf_digest_get_digest_length bytes in length. * **/ void* librdf_digest_get_digest(librdf_digest* digest) { return digest->digest; } /** * librdf_digest_get_digest_length: * @digest: the digest * * Get length of the calculated digested. * * Return value: size of the digest in bytes * **/ size_t librdf_digest_get_digest_length(librdf_digest* digest) { return digest->factory->digest_length; } /** * librdf_digest_to_string: * @digest: the digest * * Get a string representation of the digest object. * * Return value: a newly allocated string that represents the digest. * This must be released by the caller using librdf_free_memory(). **/ char* librdf_digest_to_string(librdf_digest* digest) { unsigned char* data = digest->digest; size_t mdlen = digest->factory->digest_length; char* b; size_t i; b = (char *)librdf_alloc_memory(1 + (mdlen<<1)); if(!b) { LIBRDF_FATAL1(digest->world, LIBRDF_FROM_DIGEST, "Out of memory"); return NULL; } for(i = 0; i < mdlen; i++) sprintf(b+(i<<1), "%02x", (unsigned int)data[i]); b[i<<1] = '\0'; return b; } /** * librdf_digest_print: * @digest: the digest * @fh: file handle * * Print the digest to a FILE handle. * **/ void librdf_digest_print(librdf_digest* digest, FILE* fh) { char *s=librdf_digest_to_string(digest); if(!s) return; fputs(s, fh); LIBRDF_FREE(char*, s); } /** * librdf_init_digest: * @world: redland world object * * INTERNAL - Initialise the digest module. * **/ void librdf_init_digest(librdf_world *world) { #ifdef HAVE_OPENSSL_DIGESTS librdf_digest_openssl_constructor(world); #endif #ifdef HAVE_LOCAL_MD5_DIGEST librdf_digest_md5_constructor(world); #endif #ifdef HAVE_LOCAL_RIPEMD160_DIGEST librdf_digest_rmd160_constructor(world); #endif #ifdef HAVE_LOCAL_SHA1_DIGEST librdf_digest_sha1_constructor(world); #endif /* set default */ world->digest_factory=librdf_get_digest_factory(world, world->digest_factory_name); } /** * librdf_finish_digest: * @world: redland world object * * INTERNAL - Terminate the digest module. * **/ void librdf_finish_digest(librdf_world *world) { librdf_delete_digest_factories(world); } #endif #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); struct t { const char *type; const char *result; }; int main(int argc, char *argv[]) { librdf_digest* d; const char *test_data="http://purl.org/net/dajobe/"; struct t test_data_answers[]={ {"MD5", "80b52def747e8748199c1a0cf66cb35c"}, {"SHA1", "67d6a7b73504ce5c6b47fd6db9b7c4939bfe5174"}, {"RIPEMD160", "83ce259f0c23642a95fc92fade583e6d8e15784d"}, {NULL, NULL}, }; int failures=0; int i; struct t *answer=NULL; const char *program=librdf_basename((const char*)argv[0]); librdf_world *world; world=librdf_new_world(); for(i=0; ((answer= &test_data_answers[i]) && answer->type != NULL) ; i++) { char *s; fprintf(stdout, "%s: Trying to create new %s digest\n", program, answer->type); d=librdf_new_digest(world, answer->type); if(!d) { fprintf(stderr, "%s: Failed to create new digest type %s\n", program, answer->type); continue; } fprintf(stdout, "%s: Initialising digest type %s\n", program, answer->type); librdf_digest_init(d); fprintf(stdout, "%s: Writing data into digest\n", program); librdf_digest_update(d, (unsigned char*)test_data, strlen(test_data)); fprintf(stdout, "%s: Finishing digesting\n", program); librdf_digest_final(d); fprintf(stdout, "%s: %s digest of data is: ", program, answer->type); librdf_digest_print(d, stdout); fputc('\n', stdout); s=librdf_digest_to_string(d); if(strcmp(s, answer->result)) { fprintf(stderr, "%s: %s digest is wrong - expected: %s\n", program, answer->type, answer->result); failures++; } else fprintf(stderr, "%s: %s digest is correct\n", program, answer->type); LIBRDF_FREE(char*, s); fprintf(stdout, "%s: Freeing digest\n", program); librdf_free_digest(d); } librdf_free_world(world); /* keep gcc -Wall happy */ return failures; } #endif redland-1.0.17/src/rdf_hash_memory.c0000644000175000017500000006441611773152772014262 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_hash_memory.c - RDF Hash In Memory Implementation * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include #ifdef HAVE_STDLIB_H #include #endif #include #include /* private structures */ struct librdf_hash_memory_node_value_s { struct librdf_hash_memory_node_value_s* next; void *value; size_t value_len; }; typedef struct librdf_hash_memory_node_value_s librdf_hash_memory_node_value; struct librdf_hash_memory_node_s { struct librdf_hash_memory_node_s* next; void *key; size_t key_len; u32 hash_key; librdf_hash_memory_node_value *values; int values_count; }; typedef struct librdf_hash_memory_node_s librdf_hash_memory_node; typedef struct { /* the hash object */ librdf_hash* hash; /* An array pointing to a list of nodes (buckets) */ librdf_hash_memory_node** nodes; /* this many buckets used */ int size; /* this many keys */ int keys; /* this many values */ int values; /* total array size */ int capacity; /* array load factor expressed out of 1000. * Always true: (size/capacity * 1000) < load_factor, * or in the code: size * 1000 < load_factor * capacity */ int load_factor; } librdf_hash_memory_context; /* default load_factor out of 1000 */ static const int librdf_hash_default_load_factor=750; /* starting capacity - MUST BE POWER OF 2 */ static const int librdf_hash_initial_capacity=8; /* prototypes for local functions */ static librdf_hash_memory_node* librdf_hash_memory_find_node(librdf_hash_memory_context* hash, void *key, size_t key_len, int *bucket, librdf_hash_memory_node** prev); static void librdf_free_hash_memory_node(librdf_hash_memory_node* node); static int librdf_hash_memory_expand_size(librdf_hash_memory_context* hash); /* Implementing the hash cursor */ static int librdf_hash_memory_cursor_init(void *cursor_context, void *hash_context); static int librdf_hash_memory_cursor_get(void* context, librdf_hash_datum* key, librdf_hash_datum* value, unsigned int flags); static void librdf_hash_memory_cursor_finish(void* context); /* functions implementing the API */ static int librdf_hash_memory_create(librdf_hash* new_hash, void* context); static int librdf_hash_memory_destroy(void* context); static int librdf_hash_memory_open(void* context, const char *identifier, int mode, int is_writable, int is_new, librdf_hash* options); static int librdf_hash_memory_close(void* context); static int librdf_hash_memory_clone(librdf_hash* new_hash, void *new_context, char *new_identifier, void* old_context); static int librdf_hash_memory_values_count(void *context); static int librdf_hash_memory_put(void* context, librdf_hash_datum *key, librdf_hash_datum *data); static int librdf_hash_memory_exists(void* context, librdf_hash_datum *key, librdf_hash_datum *value); static int librdf_hash_memory_delete_key(void* context, librdf_hash_datum *key); static int librdf_hash_memory_delete_key_value(void* context, librdf_hash_datum *key, librdf_hash_datum *value); static int librdf_hash_memory_sync(void* context); static int librdf_hash_memory_get_fd(void* context); static void librdf_hash_memory_register_factory(librdf_hash_factory *factory); /* * perldelta 5.8.0 says under *Performance Enhancements* * * Hashes now use Bob Jenkins "One-at-a-Time" hashing key algorithm * http://burtleburtle.net/bob/hash/doobs.html This algorithm is * reasonably fast while producing a much better spread of values * than the old hashing algorithm ... * * Changed here to hash the string backwards to help do URIs better * */ #define ONE_AT_A_TIME_HASH(hash,str,len) \ do { \ register const unsigned char *c_oneat = (unsigned char*)str+len-1; \ register size_t i_oneat = len; \ register u32 hash_oneat = 0; \ while (i_oneat--) { \ hash_oneat += *c_oneat--; \ hash_oneat += (hash_oneat << 10); \ hash_oneat ^= (hash_oneat >> 6); \ } \ hash_oneat += (hash_oneat << 3); \ hash_oneat ^= (hash_oneat >> 11); \ (hash) = (hash_oneat + (hash_oneat << 15)); \ } while(0) /* helper functions */ /** * librdf_hash_memory_find_node: * @hash: the memory hash context * @key: key string * @key_len: key string length * @user_bucket: pointer to store bucket * @prev: pointer to store previous node * * Find the node for the given key or value. * * If value is not NULL and value_len is non 0, the value will also be * compared in the search. * * If user_bucket is not NULL, the bucket used will be returned. if * prev is no NULL, the previous node in the list will be returned. * * Return value: #librdf_hash_memory_node of content or NULL on failure **/ static librdf_hash_memory_node* librdf_hash_memory_find_node(librdf_hash_memory_context* hash, void *key, size_t key_len, int *user_bucket, librdf_hash_memory_node** prev) { librdf_hash_memory_node* node; int bucket; u32 hash_key; /* empty hash */ if(!hash->capacity) return NULL; ONE_AT_A_TIME_HASH(hash_key, key, key_len); if(prev) *prev=NULL; /* find slot in table */ bucket=hash_key & (hash->capacity - 1); if(user_bucket) *user_bucket=bucket; /* check if there is a list present */ node=hash->nodes[bucket]; if(!node) /* no list there */ return NULL; /* walk the list */ while(node) { if(key_len == node->key_len && !memcmp(key, node->key, key_len)) break; if(prev) *prev=node; node=node->next; } return node; } static void librdf_free_hash_memory_node(librdf_hash_memory_node* node) { if(node->key) LIBRDF_FREE(char*, node->key); if(node->values) { librdf_hash_memory_node_value *vnode, *next; /* Empty the list of values */ for(vnode=node->values; vnode; vnode=next) { next=vnode->next; if(vnode->value) LIBRDF_FREE(char*, vnode->value); LIBRDF_FREE(librdf_hash_memory_node_value, vnode); } } LIBRDF_FREE(librdf_hash_memory_node, node); } static int librdf_hash_memory_expand_size(librdf_hash_memory_context* hash) { int required_capacity=0; librdf_hash_memory_node **new_nodes; int i; if (hash->capacity) { /* big enough */ if((1000 * hash->keys) < (hash->load_factor * hash->capacity)) return 0; /* grow hash (keeping it a power of two) */ required_capacity=hash->capacity << 1; } else { required_capacity=librdf_hash_initial_capacity; } /* allocate new table */ new_nodes = LIBRDF_CALLOC(librdf_hash_memory_node**, required_capacity, sizeof(librdf_hash_memory_node*)); if(!new_nodes) return 1; /* it is a new hash empty hash - we are done */ if(!hash->size) { hash->capacity=required_capacity; hash->nodes=new_nodes; return 0; } for(i=0; icapacity; i++) { librdf_hash_memory_node *node=hash->nodes[i]; /* walk all attached nodes */ while(node) { librdf_hash_memory_node *next; int bucket; next=node->next; /* find slot in new table */ bucket=node->hash_key & (required_capacity - 1); node->next=new_nodes[bucket]; new_nodes[bucket]=node; node=next; } } /* now free old table */ LIBRDF_FREE(librdf_hash_memory_nodes, hash->nodes); /* attach new one */ hash->capacity=required_capacity; hash->nodes=new_nodes; return 0; } /* functions implementing hash api */ /** * librdf_hash_memory_create: * @hash: #librdf_hash hash * @context: memory hash contxt * * Create a new memory hash. * * Return value: non 0 on failure **/ static int librdf_hash_memory_create(librdf_hash* hash, void* context) { librdf_hash_memory_context* hcontext=(librdf_hash_memory_context*)context; hcontext->hash=hash; hcontext->load_factor=librdf_hash_default_load_factor; return librdf_hash_memory_expand_size(hcontext); } /** * librdf_hash_memory_destroy: * @context: memory hash context * * Destroy a memory hash. * * Return value: non 0 on failure **/ static int librdf_hash_memory_destroy(void* context) { librdf_hash_memory_context* hcontext=(librdf_hash_memory_context*)context; if(hcontext->nodes) { int i; for(i=0; icapacity; i++) { librdf_hash_memory_node *node=hcontext->nodes[i]; /* this entry is used */ if(node) { librdf_hash_memory_node *next; /* free all attached nodes */ while(node) { next=node->next; librdf_free_hash_memory_node(node); node=next; } } } LIBRDF_FREE(librdf_hash_memory_nodes, hcontext->nodes); } return 0; } /** * librdf_hash_memory_open: * @context: memory hash context * @identifier: identifier - not used * @mode: access mode - not used * @is_writable: is hash writable? - not used * @is_new: is hash new? - not used * @options: #librdf_hash of options - not used * * Open memory hash with given parameters. * * Return value: non 0 on failure **/ static int librdf_hash_memory_open(void* context, const char *identifier, int mode, int is_writable, int is_new, librdf_hash* options) { /* NOP */ return 0; } /** * librdf_hash_memory_close: * @context: memory hash context * * Close the hash. * * Return value: non 0 on failure **/ static int librdf_hash_memory_close(void* context) { /* NOP */ return 0; } static int librdf_hash_memory_clone(librdf_hash *hash, void* context, char *new_identifer, void *old_context) { librdf_hash_memory_context* hcontext=(librdf_hash_memory_context*)context; librdf_hash_memory_context* old_hcontext=(librdf_hash_memory_context*)old_context; librdf_hash_datum *key, *value; librdf_iterator *iterator; int status=0; /* copy data fields that might change */ hcontext->hash=hash; hcontext->load_factor=old_hcontext->load_factor; /* Don't need to deal with new_identifier - not used for memory hashes */ /* Use higher level functions to iterator this data * on the other hand, maybe this is a good idea since that * code is tested and works */ key=librdf_new_hash_datum(hash->world, NULL, 0); value=librdf_new_hash_datum(hash->world, NULL, 0); iterator=librdf_hash_get_all(old_hcontext->hash, key, value); while(!librdf_iterator_end(iterator)) { librdf_hash_datum* k= (librdf_hash_datum*)librdf_iterator_get_key(iterator); librdf_hash_datum* v= (librdf_hash_datum*)librdf_iterator_get_value(iterator); if(librdf_hash_memory_put(hcontext, k, v)) { status=1; break; } librdf_iterator_next(iterator); } if(iterator) librdf_free_iterator(iterator); librdf_free_hash_datum(value); librdf_free_hash_datum(key); return status; } /** * librdf_hash_memory_values_count: * @context: memory hash cursor context * * Get the number of values in the hash. * * Return value: number of values in the hash or <0 on failure **/ static int librdf_hash_memory_values_count(void *context) { librdf_hash_memory_context* hash=(librdf_hash_memory_context*)context; return hash->values; } typedef struct { librdf_hash_memory_context* hash; int current_bucket; librdf_hash_memory_node* current_node; librdf_hash_memory_node_value *current_value; } librdf_hash_memory_cursor_context; /** * librdf_hash_memory_cursor_init: * @cursor_context: hash cursor context * @hash_context: hash to operate over * * Initialise a new hash cursor. * * Return value: non 0 on failure **/ static int librdf_hash_memory_cursor_init(void *cursor_context, void *hash_context) { librdf_hash_memory_cursor_context *cursor=(librdf_hash_memory_cursor_context*)cursor_context; cursor->hash = (librdf_hash_memory_context*)hash_context; return 0; } /** * librdf_hash_memory_cursor_get: * @context: memory hash cursor context * @key: pointer to key to use * @value: pointer to value to use * @flags: flags * * Retrieve a hash value for the given key. * * Return value: non 0 on failure **/ static int librdf_hash_memory_cursor_get(void* context, librdf_hash_datum *key, librdf_hash_datum *value, unsigned int flags) { librdf_hash_memory_cursor_context *cursor=(librdf_hash_memory_cursor_context*)context; librdf_hash_memory_node_value *vnode=NULL; librdf_hash_memory_node *node; /* First step, make sure cursor->current_node points to a valid node, if possible */ /* Move to start of hash if necessary */ if(flags == LIBRDF_HASH_CURSOR_FIRST) { int i; cursor->current_node=NULL; /* find first used bucket (with keys) */ cursor->current_bucket=0; for(i=0; i< cursor->hash->capacity; i++) if((cursor->current_node=cursor->hash->nodes[i])) { cursor->current_bucket=i; break; } if(cursor->current_node) cursor->current_value=cursor->current_node->values; } /* If still have no current node, try to find it from the key */ if(!cursor->current_node && key && key->data) { cursor->current_node=librdf_hash_memory_find_node(cursor->hash, (char*)key->data, key->size, NULL, NULL); if(cursor->current_node) cursor->current_value=cursor->current_node->values; } /* If still have no node, failed */ if(!cursor->current_node) return 1; /* Check for end of values */ switch(flags) { case LIBRDF_HASH_CURSOR_SET: /* If key does not exist, failed above, so test if there are values */ /* FALLTHROUGH */ case LIBRDF_HASH_CURSOR_NEXT_VALUE: /* If want values and have reached end of values list, end */ if(!cursor->current_value) return 1; break; case LIBRDF_HASH_CURSOR_FIRST: case LIBRDF_HASH_CURSOR_NEXT: /* If have reached last bucket, end */ if(cursor->current_bucket >= cursor->hash->capacity) return 1; break; default: librdf_log(cursor->hash->hash->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_HASH, NULL, "Unknown hash method flag %d", flags); return 1; } /* Ok, there is data, retrieve it */ switch(flags) { case LIBRDF_HASH_CURSOR_SET: /* FALLTHROUGH */ case LIBRDF_HASH_CURSOR_NEXT_VALUE: vnode=cursor->current_value; /* copy value */ value->data=vnode->value; value->size=vnode->value_len; /* move on */ cursor->current_value=vnode->next; break; case LIBRDF_HASH_CURSOR_FIRST: case LIBRDF_HASH_CURSOR_NEXT: node=cursor->current_node; /* get key */ key->data= node->key; key->size= node->key_len; /* if want values, walk through them */ if(value) { vnode=cursor->current_value; /* get value */ value->data=vnode->value; value->size=vnode->value_len; /* move on */ cursor->current_value=vnode->next; /* stop here if there are more values, otherwise need next * key & values so drop through and move to the next node */ if(cursor->current_value) break; } /* move on to next node in current bucket */ if(!(node=cursor->current_node->next)) { int i; /* end of list - move to next used bucket */ for(i=cursor->current_bucket+1; i< cursor->hash->capacity; i++) if((node=cursor->hash->nodes[i])) { cursor->current_bucket=i; break; } } if((cursor->current_node=node)) cursor->current_value=node->values; break; default: librdf_log(cursor->hash->hash->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_HASH, NULL, "Unknown hash method flag %d", flags); return 1; } return 0; } /** * librdf_hash_memory_cursor_finished: * @context: hash memory get iterator context * * Finish the serialisation of the hash memory get. * **/ static void librdf_hash_memory_cursor_finish(void* context) { /* librdf_hash_memory_cursor_context *cursor=(librdf_hash_memory_cursor_context*)context; */ } /** * librdf_hash_memory_put: * @context: memory hash context * @key: pointer to key to store * @value: pointer to value to store * * - Store a key/value pair in the hash. * * Return value: non 0 on failure **/ static int librdf_hash_memory_put(void* context, librdf_hash_datum *key, librdf_hash_datum *value) { librdf_hash_memory_context* hash=(librdf_hash_memory_context*)context; librdf_hash_memory_node *node; librdf_hash_memory_node_value *vnode; u32 hash_key; void *new_key=NULL; void *new_value; int bucket= (-1); int is_new_node; /* ensure there is enough space in the hash */ if (librdf_hash_memory_expand_size(hash)) return 1; /* find node for key */ node=librdf_hash_memory_find_node(hash, key->data, key->size, NULL, NULL); is_new_node=(node == NULL); /* not found - new key */ if(is_new_node) { ONE_AT_A_TIME_HASH(hash_key, key->data, key->size); bucket=hash_key & (hash->capacity - 1); /* allocate new node */ node = LIBRDF_CALLOC(librdf_hash_memory_node*, 1, sizeof(*node)); if(!node) return 1; node->hash_key=hash_key; /* allocate key for new node */ new_key = LIBRDF_MALLOC(void*, key->size); if(!new_key) { LIBRDF_FREE(librdf_hash_memory_node, node); return 1; } /* copy new key */ memcpy(new_key, key->data, key->size); node->key=new_key; node->key_len=key->size; } /* always allocate new value */ new_value = LIBRDF_MALLOC(void*, value->size); if(!new_value) { if(is_new_node) { LIBRDF_FREE(char*, new_key); LIBRDF_FREE(librdf_hash_memory_node, node); } return 1; } /* always allocate new librdf_hash_memory_node_value */ vnode = LIBRDF_CALLOC(librdf_hash_memory_node_value*, 1, sizeof(*vnode)); if(!vnode) { LIBRDF_FREE(char*, new_value); if(is_new_node) { LIBRDF_FREE(char*, new_key); LIBRDF_FREE(librdf_hash_memory_node, node); } return 1; } /* if we get here, all allocations succeeded */ /* put new value node in list */ vnode->next=node->values; node->values=vnode; /* note that in counter */ node->values_count++; /* copy new value */ memcpy(new_value, value->data, value->size); vnode->value=new_value; vnode->value_len=value->size; /* now update buckets and hash counts */ if(is_new_node) { node->next=hash->nodes[bucket]; hash->nodes[bucket]=node; hash->keys++; } hash->values++; /* Only increase bucket count use when previous value was NULL */ if(!node->next) hash->size++; return 0; } /** * librdf_hash_memory_exists: * @context: memory hash context * @key: key * @value: value * * Test the existence of a key in the hash. * * Return value: >0 if the key/value exists in the hash, 0 if not, <0 on failure **/ static int librdf_hash_memory_exists(void* context, librdf_hash_datum *key, librdf_hash_datum *value) { librdf_hash_memory_context* hash=(librdf_hash_memory_context*)context; librdf_hash_memory_node* node; librdf_hash_memory_node_value *vnode; node=librdf_hash_memory_find_node(hash, (char*)key->data, key->size, NULL, NULL); /* key not found */ if(!node) return 0; /* no value wanted */ if(!value) return 1; /* search for value in list of values */ for(vnode=node->values; vnode; vnode=vnode->next) { if(value->size == vnode->value_len && !memcmp(value->data, vnode->value, value->size)) break; } return (vnode != NULL); } /** * librdf_hash_memory_delete_key_value: * @context: memory hash context * @key: pointer to key to delete * @value: pointer to value to delete * * - Delete a key/value pair from the hash. * * Return value: non 0 on failure **/ static int librdf_hash_memory_delete_key_value(void* context, librdf_hash_datum *key, librdf_hash_datum *value) { librdf_hash_memory_context* hash=(librdf_hash_memory_context*)context; librdf_hash_memory_node *node, *prev, *next; librdf_hash_memory_node_value *vnode, *vprev; int bucket; node=librdf_hash_memory_find_node(hash, (char*)key->data, key->size, &bucket, &prev); /* key not found anywhere */ if(!node) return 1; /* search for value in list of values */ vnode=node->values; vprev=NULL; while(vnode) { if(value->size == vnode->value_len && !memcmp(value->data, vnode->value, value->size)) break; vprev=vnode; vnode=vnode->next; } /* key/value combination not found */ if(!vnode) return 1; /* found - delete it from list */ if(!vprev) { /* at start of list so delete from there */ node->values=vnode->next; } else vprev->next=vnode->next; /* free value and value node */ if(vnode->value) LIBRDF_FREE(librdf_hash_memory_node_value, vnode->value); LIBRDF_FREE(librdf_hash_memory_node_value, vnode); /* update hash counts */ hash->values--; /* check if last value was removed */ if(node->values) /* no, so return success */ return 0; /* yes - all values gone so need to delete entire key node */ if(!prev) { /* is at start of list, so delete from there */ if(!(hash->nodes[bucket]=node->next)) /* hash bucket occupancy is one less if bucket is now empty */ hash->size--; next=NULL; } else next=prev->next=node->next; /* free node */ librdf_free_hash_memory_node(node); /* see if there are remaining values for this key */ if(!next) { /* no - so was last value for that key, reduce key count */ hash->keys--; } else { int found=0; node=next; while(node) { if(key->size == node->key_len && !memcmp(key, node->key, key->size)){ found=1; break; } node=node->next; } /* no further key values found - so was last value for that key */ if(!found) hash->keys--; } return 0; } /** * librdf_hash_memory_delete_key: * @context: memory hash context * @key: pointer to key to delete * * - Delete a key and all its values from the hash. * * Return value: non 0 on failure **/ static int librdf_hash_memory_delete_key(void* context, librdf_hash_datum *key) { librdf_hash_memory_context* hash=(librdf_hash_memory_context*)context; librdf_hash_memory_node *node, *prev; int bucket; node=librdf_hash_memory_find_node(hash, (char*)key->data, key->size, &bucket, &prev); /* not found anywhere */ if(!node) return 1; /* search list from here */ if(!prev) { /* is at start of list, so delete from there */ if(!(hash->nodes[bucket]=node->next)) /* hash bucket occupancy is one less if bucket is now empty */ hash->size--; } else prev->next=node->next; /* update hash counts */ hash->keys--; hash->values-= node->values_count; /* free node */ librdf_free_hash_memory_node(node); return 0; } /** * librdf_hash_memory_sync: * @context: memory hash context * * Flush the hash to disk. * * Not used * * Return value: 0 **/ static int librdf_hash_memory_sync(void* context) { /* Not applicable */ return 0; } /** * librdf_hash_memory_get_fd: * @context: memory hash context * * Get the file descriptor representing the hash. * * Not used * * Return value: -1 **/ static int librdf_hash_memory_get_fd(void* context) { /* Not applicable */ return -1; } /* local function to register memory hash functions */ /** * librdf_hash_memory_register_factory: * @factory: hash factory prototype * * Register the memory hash module with the hash factory. * **/ static void librdf_hash_memory_register_factory(librdf_hash_factory *factory) { factory->context_length = sizeof(librdf_hash_memory_context); factory->cursor_context_length = sizeof(librdf_hash_memory_cursor_context); factory->create = librdf_hash_memory_create; factory->destroy = librdf_hash_memory_destroy; factory->open = librdf_hash_memory_open; factory->close = librdf_hash_memory_close; factory->clone = librdf_hash_memory_clone; factory->values_count = librdf_hash_memory_values_count; factory->put = librdf_hash_memory_put; factory->exists = librdf_hash_memory_exists; factory->delete_key = librdf_hash_memory_delete_key; factory->delete_key_value = librdf_hash_memory_delete_key_value; factory->sync = librdf_hash_memory_sync; factory->get_fd = librdf_hash_memory_get_fd; factory->cursor_init = librdf_hash_memory_cursor_init; factory->cursor_get = librdf_hash_memory_cursor_get; factory->cursor_finish = librdf_hash_memory_cursor_finish; } /** * librdf_init_hash_memory: * @world: redland world object * * Initialise the memory hash module. * * Initialises the memory hash module and sets the default hash load factor. * * The recommended and current default value is 0.75, i.e. 750/1000. * To use the default value (whatever it is) use a value less than 0. **/ void librdf_init_hash_memory(librdf_world *world) { /* use default load factor */ if(world->hash_load_factor <= 0 || world->hash_load_factor > 999) world->hash_load_factor=librdf_hash_default_load_factor; librdf_hash_register_factory(world, "memory", &librdf_hash_memory_register_factory); } redland-1.0.17/src/rdf_parser_internal.h0000644000175000017500000001013611536446751015132 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_parser_internal.h - Internal RDF Parser Factory / Parser definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_PARSER_INTERNAL_H #define LIBRDF_PARSER_INTERNAL_H #ifdef __cplusplus extern "C" { #endif struct librdf_parser_factory_s { struct librdf_parser_factory_s* next; /* syntax name - required */ char *name; /* syntax label */ char *label; /* handle this MIME type/ Internet Media Type - optional */ char *mime_type; /* handles the syntax defined by this URI - optional */ librdf_uri *type_uri; /* the rest of this structure is populated by the parser-specific register function */ size_t context_length; /* create a new parser */ int (*init)(librdf_parser* parser, void *_context); /* destroy a parser */ void (*terminate)(void *_context); /* get/set features of parser (think of Java properties) */ librdf_node* (*get_feature)(void *_context, librdf_uri *feature); int (*set_feature)(void *_context, librdf_uri *feature, librdf_node *value); /* parsing methods - all are optional but the only * current implementation, raptor, implements all of them */ librdf_stream* (*parse_uri_as_stream)(void *_context, librdf_uri *uri, librdf_uri* base_uri); int (*parse_uri_into_model)(void *_context, librdf_uri *uri, librdf_uri* base_uri, librdf_model *model); librdf_stream* (*parse_file_as_stream)(void *_context, librdf_uri *uri, librdf_uri *base_uri); int (*parse_file_into_model)(void *_context, librdf_uri *uri, librdf_uri *base_uri, librdf_model *model); int (*parse_string_into_model)(void *_context, const unsigned char *string, librdf_uri* base_uri, librdf_model *model); librdf_stream* (*parse_string_as_stream)(void *_context, const unsigned char *string, librdf_uri *base_uri); int (*parse_counted_string_into_model)(void *_context, const unsigned char *string, size_t length, librdf_uri* base_uri, librdf_model *model); librdf_stream* (*parse_counted_string_as_stream)(void *_context, const unsigned char *string, size_t length, librdf_uri *base_uri); int (*parse_iostream_into_model)(void *_context, raptor_iostream *iostream, librdf_uri* base_uri, librdf_model *model); librdf_stream* (*parse_iostream_as_stream)(void *_context, raptor_iostream *iostream, librdf_uri *base_uri); char* (*get_accept_header)(void* context); const char* (*get_namespaces_seen_prefix)(void* context, int offset); librdf_uri* (*get_namespaces_seen_uri)(void* context, int offset); int (*get_namespaces_seen_count)(void* context); int (*parse_file_handle_into_model)(void *_context, FILE *fh, int close_fh, librdf_uri* base_uri, librdf_model *model); librdf_stream* (*parse_file_handle_as_stream)(void *_context, FILE *fh, int close_fh, librdf_uri *base_uri); }; struct librdf_parser_s { librdf_world *world; void *context; librdf_parser_factory* factory; void* uri_filter_user_data; librdf_uri_filter_func uri_filter; }; /* class methods */ librdf_parser_factory* librdf_get_parser_factory(librdf_world *world, const char *name, const char *mime_type, librdf_uri *type_uri); /* module init */ void librdf_init_parser(librdf_world *world); /* module finish */ void librdf_finish_parser(librdf_world *world); void librdf_parser_raptor_constructor(librdf_world* world); void librdf_parser_raptor_destructor(void); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_utf8.c0000644000175000017500000003141711773205103012613 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_utf8.c - RDF UTF8 / Unicode chars helper routines Implementation * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include /* for isprint() */ #ifdef HAVE_STDLIB_H #include #endif #include #include #ifndef STANDALONE /** * librdf_unicode_char_to_utf8: * @c: Unicode character * @output: UTF-8 string buffer or NULL * @length: buffer size (will be truncated to size_t) * * Convert a Unicode character to UTF-8 encoding. * * @deprecated: Use raptor_unicode_utf8_string_put_char() noting that * the length argument is a size_t. * * If buffer is NULL, then will calculate the length rather than * perform it. This can be used by the caller to allocate space * and then re-call this function with the new buffer. * * Return value: bytes written to output buffer or <0 on failure **/ int librdf_unicode_char_to_utf8(librdf_unichar c, unsigned char *output, int length) { return raptor_unicode_utf8_string_put_char(c, output, LIBRDF_BAD_CAST(size_t, length)); } /** * librdf_utf8_to_unicode_char: * @output: Pointer to the Unicode character or NULL * @input: UTF-8 string buffer * @length: buffer size (will be truncated to size_t) * * Convert an UTF-8 encoded buffer to a Unicode character. * * @deprecated: Use raptor_unicode_utf8_string_get_char() noting that * the arg order has changed to input, length (a size_t), output. * * If @output is NULL, then will calculate the number of bytes that * will be used from the input buffer and not perform the conversion. * * Return value: bytes used from input buffer or <0 on failure **/ int librdf_utf8_to_unicode_char(librdf_unichar *output, const unsigned char *input, int length) { return raptor_unicode_utf8_string_get_char(input, LIBRDF_BAD_CAST(size_t, length), output); } /** * librdf_utf8_to_latin1_2: * @input: UTF-8 string buffer * @length: buffer size * @discard: character to use to replace out of range characters or NUL (\0) to discard * @output_length: Pointer to variable to store resulting string length or NULL * * Convert a UTF-8 string to ISO Latin-1. * * Converts the given UTF-8 string to the ISO Latin-1 subset of * Unicode (characters 0x00-0xff). Out of range characters are * replaced with @discard unless it is NUL (\0). * * If @output_length is not NULL, the returned string length will be * stored there. * * Return value: pointer to new ISO Latin-1 string or NULL on failure **/ unsigned char* librdf_utf8_to_latin1_2(const unsigned char *input, size_t length, unsigned char discard, size_t *output_length) { size_t utf8_char_length = 0; size_t utf8_byte_length = 0; size_t i; size_t j; unsigned char *output; i = 0; while(input[i]) { int size = raptor_unicode_utf8_string_get_char(&input[i], length - i, NULL); if(size <= 0) return NULL; utf8_char_length++; i += LIBRDF_GOOD_CAST(size_t, size); } /* This is a maximal length; since chars may be discarded, the * actual length of the resulting can be shorter */ utf8_byte_length = i; output = LIBRDF_MALLOC(unsigned char*, utf8_byte_length + 1); if(!output) return NULL; i = 0; j = 0; while(i < utf8_byte_length) { librdf_unichar c; int size = raptor_unicode_utf8_string_get_char(&input[i], length - i, &c); if(size <= 0) { LIBRDF_FREE(byte_string, output); return NULL; } if(c < 0x100) output[j++] = c; else { if(discard) output[j++] = discard; } i += LIBRDF_GOOD_CAST(size_t, size); } output[j] = '\0'; if(output_length) *output_length = j; return output; } /** * librdf_utf8_to_latin1: * @input: UTF-8 string buffer * @length: buffer size (will be truncated to size_t) * @output_length: Pointer to variable to store resulting string length or NULL * * Convert a UTF-8 string to ISO Latin-1. * * Converts the given UTF-8 string to the ISO Latin-1 subset of * Unicode (characters 0x00-0xff), discarding any out of range * characters. * * @deprecated for librdf_utf8_to_latin1_2() that takes and returns * size_t sizes and allows replacing of out of range characters. * * If @output_length is not NULL, the returned string length * will be stored there. * * Return value: pointer to new ISO Latin-1 string or NULL on failure **/ unsigned char* librdf_utf8_to_latin1(const unsigned char *input, int length, int *output_length) { unsigned char* output_buffer; size_t soutput_length = 0; output_buffer = librdf_utf8_to_latin1_2(input, LIBRDF_BAD_CAST(size_t, length), '\0', &soutput_length); if(output_length) *output_length = LIBRDF_BAD_CAST(int, soutput_length); return output_buffer; } /** * librdf_latin1_to_utf8_2: * @input: ISO Latin-1 string buffer * @length: buffer size * @output_length: Pointer to variable to store resulting string length or NULL * * Convert an ISO Latin-1 encoded string to UTF-8. * * Converts the given ISO Latin-1 string to an UTF-8 encoded string * representing the same content. This is lossless. * * If @output_length is not NULL, the returned string length will be * stored there. * * Return value: pointer to new UTF-8 string or NULL on failure **/ unsigned char* librdf_latin1_to_utf8_2(const unsigned char *input, size_t length, size_t *output_length) { size_t utf8_length = 0; size_t i; size_t j; unsigned char *output; for(i = 0; input[i]; i++) { int size = raptor_unicode_utf8_string_put_char(input[i], NULL, length - i); if(size <= 0) return NULL; utf8_length += LIBRDF_GOOD_CAST(size_t, size); } output = LIBRDF_MALLOC(unsigned char*, utf8_length + 1); if(!output) return NULL; j = 0; for(i = 0; input[i]; i++) { int size = raptor_unicode_utf8_string_put_char(input[i], &output[j], length - i); if(size <= 0) { LIBRDF_FREE(byte_string, output); return NULL; } j += LIBRDF_GOOD_CAST(size_t, size); } output[j] = '\0'; if(output_length) *output_length = j; return output; } /** * librdf_latin1_to_utf8: * @input: ISO Latin-1 string buffer * @length: buffer size (will be truncated to size_t) * @output_length: Pointer to variable to store resulting string length or NULL * * Convert an ISO Latin-1 encoded string to UTF-8. * * Converts the given ISO Latin-1 string to an UTF-8 encoded string * representing the same content. This is lossless. * * @deprecated for librdf_latin1_to_utf8_2() that takes and returns * size_t sizes. * * If @output_length is not NULL, the returned string length will be * stored there. * * Return value: pointer to new UTF-8 string or NULL on failure **/ unsigned char* librdf_latin1_to_utf8(const unsigned char *input, int length, int *output_length) { unsigned char* output_buffer; size_t soutput_length = 0; output_buffer = librdf_latin1_to_utf8_2(input, LIBRDF_BAD_CAST(size_t, length), &soutput_length); if(output_length) *output_length = LIBRDF_BAD_CAST(int, soutput_length); return output_buffer; } /** * librdf_utf8_print: * @input: UTF-8 string buffer * @length: buffer size (will be truncated to size_t) * @stream: FILE* stream * * Print a UTF-8 string to a stream. * * Pretty prints the UTF-8 string in a pseudo-C character * format like \uhex digits when the characters fail * the isprint() test. **/ void librdf_utf8_print(const unsigned char *input, int length, FILE *stream) { int i = 0; while(i < length && *input) { librdf_unichar c; size_t slen = LIBRDF_BAD_CAST(size_t, length - i); int size = raptor_unicode_utf8_string_get_char(input, slen, &c); if(size <= 0) return; if(c < 0x100) { int cchar = (int)c; if(isprint(cchar)) fputc(cchar, stream); else fprintf(stream, "\\u%02X", cchar); } else if (c < 0x10000) fprintf(stream, "\\u%04X", (unsigned int)c); else fprintf(stream, "\\U%08X", (unsigned int)c); input += size; i += size; } } #endif /* TEST CODE */ #ifdef STANDALONE /* static prototypes */ void librdf_bad_string_print(const unsigned char *input, int length, FILE *stream); int main(int argc, char *argv[]); void librdf_bad_string_print(const unsigned char *input, int length, FILE *stream) { while(*input && length>0) { char c=*input; if(isprint(c)) fputc(c, stream); else fprintf(stream, "\\x%02X", (c & 0xff)); input++; length--; } } int main(int argc, char *argv[]) { const char *program = librdf_basename((const char*)argv[0]); librdf_unichar c; const unsigned char test_utf8_string[] = "Lib" "\xc3\xa9" "ration costs " "\xe2\x82\xac" "3.50"; int test_utf8_string_length = strlen((const char*)test_utf8_string); const unsigned char result_latin1_string[] = "Lib" "\xe9" "ration costs 3.50"; int result_latin1_string_length=strlen((const char*)result_latin1_string); const unsigned char result_utf8_string[] = "Lib" "\xc3\xa9" "ration costs 3.50"; int result_utf8_string_length = strlen((const char*)result_utf8_string); int i; unsigned char *latin1_string; size_t latin1_string_length; unsigned char *utf8_string; size_t utf8_string_length; int failures = 0; int verbose = 0; latin1_string = librdf_utf8_to_latin1_2(test_utf8_string, test_utf8_string_length, '\0', &latin1_string_length); if(!latin1_string) { fprintf(stderr, "%s: librdf_utf8_to_latin1 FAILED to convert UTF-8 string '", program); librdf_bad_string_print(test_utf8_string, test_utf8_string_length, stderr); fputs("' to Latin-1\n", stderr); failures++; } if(memcmp(latin1_string, result_latin1_string, result_latin1_string_length)) { fprintf(stderr, "%s: librdf_utf8_to_latin1 FAILED to convert UTF-8 string '", program); librdf_utf8_print(test_utf8_string, test_utf8_string_length, stderr); fprintf(stderr, "' to Latin-1 - returned '%s' but expected '%s'\n", latin1_string, result_latin1_string); failures++; } if(verbose) { fprintf(stderr, "%s: librdf_utf8_to_latin1 converted UTF-8 string '", program); librdf_utf8_print(test_utf8_string, test_utf8_string_length, stderr); fprintf(stderr, "' to Latin-1 string '%s' OK\n", latin1_string); } utf8_string = librdf_latin1_to_utf8_2(latin1_string, latin1_string_length, &utf8_string_length); if(!utf8_string) { fprintf(stderr, "%s: librdf_latin1_to_utf8 FAILED to convert Latin-1 string '%s' to UTF-8\n", program, latin1_string); failures++; } if(memcmp(utf8_string, result_utf8_string, result_utf8_string_length)) { fprintf(stderr, "%s: librdf_latin1_to_utf8 FAILED to convert Latin-1 string '%s' to UTF-8 - returned '", program, latin1_string); librdf_utf8_print(utf8_string, utf8_string_length, stderr); fputs("' but expected '", stderr); librdf_utf8_print(result_utf8_string, result_utf8_string_length, stderr); fputs("'\n", stderr); failures++; } if(verbose) { fprintf(stderr, "%s: librdf_latin1_to_utf8 converted Latin-1 string '%s' to UTF-8 string '", program, latin1_string); librdf_utf8_print(utf8_string, utf8_string_length, stderr); fputs("' OK\n", stderr); } LIBRDF_FREE(char*, latin1_string); LIBRDF_FREE(char*, utf8_string); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif return failures; } #endif redland-1.0.17/src/rdf_digest.h0000644000175000017500000000361611167024222013207 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_digest.h - RDF Digest Factory / Digest interfaces and definition * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_DIGEST_H #define LIBRDF_DIGEST_H #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif /* public constructor */ REDLAND_API librdf_digest* librdf_new_digest(librdf_world *world, const char *name); /* destructor */ REDLAND_API void librdf_free_digest(librdf_digest *digest); /* methods */ REDLAND_API void librdf_digest_init(librdf_digest* digest); REDLAND_API void librdf_digest_update(librdf_digest* digest, const unsigned char *buf, size_t length); REDLAND_API void librdf_digest_update_string(librdf_digest* digest, const unsigned char *string); REDLAND_API void librdf_digest_final(librdf_digest* digest); REDLAND_API void* librdf_digest_get_digest(librdf_digest* digest); REDLAND_API size_t librdf_digest_get_digest_length(librdf_digest* digest); REDLAND_API char* librdf_digest_to_string(librdf_digest* digest); REDLAND_API void librdf_digest_print(librdf_digest* digest, FILE* fh); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_query_rasqal.c0000644000175000017500000012354012137764722014450 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_query_rasqal.c - RDF Query with Rasqal * * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include typedef struct { librdf_query *query; /* librdf query object */ librdf_model *model; rasqal_query *rq; rasqal_query_results *results; char *language; /* rasqal query language name to use */ unsigned char *query_string; librdf_uri *uri; /* base URI or NULL */ int errors; int warnings; } librdf_query_rasqal_context; /* prototypes for local functions */ static int rasqal_redland_init_triples_match(rasqal_triples_match* rtm, rasqal_triples_source *rts, void *user_data, rasqal_triple_meta *m, rasqal_triple *t); static int rasqal_redland_triple_present(rasqal_triples_source *rts, void *user_data, rasqal_triple *t); static void rasqal_redland_free_triples_source(void *user_data); static void librdf_query_rasqal_log_handler(void *data, raptor_log_message *message) { librdf_world *world = (librdf_world *)data; librdf_log_level level; /* Map raptor2 fatal/error/warning log levels to librdf log levels, ignore others */ switch(message->level) { case RAPTOR_LOG_LEVEL_FATAL: level = LIBRDF_LOG_FATAL; break; case RAPTOR_LOG_LEVEL_ERROR: level = LIBRDF_LOG_ERROR; break; case RAPTOR_LOG_LEVEL_WARN: level = LIBRDF_LOG_WARN; break; case RAPTOR_LOG_LEVEL_INFO: case RAPTOR_LOG_LEVEL_DEBUG: case RAPTOR_LOG_LEVEL_TRACE: case RAPTOR_LOG_LEVEL_NONE: default: return; } librdf_log_simple(world, 0, level, LIBRDF_FROM_QUERY, message->locator, message->text); } /* functions implementing query api */ static int librdf_query_rasqal_init(librdf_query* query, const char *name, librdf_uri* uri, const unsigned char* query_string, librdf_uri *base_uri) { librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; size_t len; unsigned char *query_string_copy; context->query = query; context->language=context->query->factory->name; context->rq=rasqal_new_query(query->world->rasqal_world_ptr, context->language, NULL); if(!context->rq) return 1; rasqal_query_set_user_data(context->rq, query); rasqal_world_set_log_handler(query->world->rasqal_world_ptr, query->world, librdf_query_rasqal_log_handler); len = strlen((const char*)query_string); query_string_copy = LIBRDF_MALLOC(unsigned char*, len + 1); if(!query_string_copy) return 1; strcpy((char*)query_string_copy, (const char*)query_string); context->query_string=query_string_copy; if(base_uri) context->uri=librdf_new_uri_from_uri(base_uri); return 0; } static void librdf_query_rasqal_terminate(librdf_query* query) { librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(context->rq) rasqal_free_query(context->rq); if(context->query_string) LIBRDF_FREE(char*, context->query_string); if(context->uri) librdf_free_uri(context->uri); if(context->model) librdf_free_model(context->model); } /* * This function and RASQAL_LITERAL_UDT first appears in Rasqal 0.9.17 * * FIXME: Remove this code when minimum rasqal version >= 0.9.17 */ #ifndef RASQAL_LITERAL_UDT_DEFINED static rasqal_literal_type rasqal_literal_get_rdf_term_type(rasqal_literal* l) { rasqal_literal_type type = l->type; /* squash literal datatypes into one type: RDF Literal */ if(type >= RASQAL_LITERAL_FIRST_XSD && type <= RASQAL_LITERAL_LAST_XSD) type = RASQAL_LITERAL_STRING; if(type != RASQAL_LITERAL_URI && type != RASQAL_LITERAL_STRING && type != RASQAL_LITERAL_BLANK) type = RASQAL_LITERAL_UNKNOWN; return type; } #endif static librdf_node* rasqal_literal_to_redland_node(librdf_world *world, rasqal_literal* l) { rasqal_literal_type type; if(!l) return NULL; /* FIXME: Workaround for Issue #0000519 * http://bugs.librdf.org/mantis/view.php?id=519 * * Remove this 'if' when RASQAL_MIN_VERSION is 0.9.30 or larger */ if(l->type == RASQAL_LITERAL_INTEGER_SUBTYPE) type = RASQAL_LITERAL_STRING; else type = rasqal_literal_get_rdf_term_type(l); if(type == RASQAL_LITERAL_URI) return librdf_new_node_from_uri(world, (librdf_uri*)l->value.uri); else if (type == RASQAL_LITERAL_STRING) return librdf_new_node_from_typed_literal(world, (unsigned char*)l->string, l->language, (librdf_uri*)l->datatype); else if (type == RASQAL_LITERAL_BLANK) return librdf_new_node_from_blank_identifier(world, (unsigned char*)l->string); LIBRDF_DEBUG2("Could not convert literal type %d to librdf_node\n", type); return NULL; } rasqal_literal* redland_node_to_rasqal_literal(librdf_world* world, librdf_node *node) { rasqal_literal* l; if(librdf_node_is_resource(node)) { raptor_uri* uri=(raptor_uri*)librdf_new_uri_from_uri(librdf_node_get_uri(node)); l=rasqal_new_uri_literal(world->rasqal_world_ptr, uri); /* transfer uri ownership to literal */ } else if(librdf_node_is_literal(node)) { unsigned char *string; librdf_uri *uri; unsigned char *new_string; char *new_language=NULL; raptor_uri *new_datatype=NULL; size_t len; string=librdf_node_get_literal_value_as_counted_string(node, &len); new_string=(unsigned char*)rasqal_alloc_memory(len+1); if(!new_string) return NULL; strcpy((char*)new_string, (const char*)string); string=(unsigned char*)librdf_node_get_literal_value_language(node); if(string) { new_language=(char*)rasqal_alloc_memory(strlen((const char*)string)+1); if(!new_language) { rasqal_free_memory((void*)new_string); return NULL; } strcpy((char*)new_language, (const char*)string); } uri=librdf_node_get_literal_value_datatype_uri(node); if(uri) new_datatype=(raptor_uri*)librdf_new_uri_from_uri(uri); /* transfer new_string,new_language,new_datatype ownership to literal */ l = rasqal_new_string_literal(world->rasqal_world_ptr, (const unsigned char*)new_string, new_language, new_datatype, NULL); } else { unsigned char *blank=librdf_node_get_blank_identifier(node); unsigned char *new_blank; if(!blank) return NULL; new_blank=(unsigned char*)rasqal_alloc_memory(strlen((const char*)blank)+1); if(!new_blank) return NULL; strcpy((char*)new_blank, (const char*)blank); /* transfer new_blank ownership to literal */ l = rasqal_new_simple_literal(world->rasqal_world_ptr, RASQAL_LITERAL_BLANK, (const unsigned char*)new_blank); } return l; } typedef struct { librdf_world *world; librdf_query *query; librdf_model *model; } rasqal_redland_triples_source_user_data; static int rasqal_redland_new_triples_source(rasqal_query* rdf_query, void *factory_user_data, void *user_data, rasqal_triples_source *rts) { librdf_world *world=(librdf_world*)factory_user_data; rasqal_redland_triples_source_user_data* rtsc=(rasqal_redland_triples_source_user_data*)user_data; raptor_sequence *seq; librdf_query_rasqal_context *context; librdf_iterator* cit; rtsc->world = world; rtsc->query = (librdf_query*)rasqal_query_get_user_data(rdf_query); context = (librdf_query_rasqal_context*)rtsc->query->context; rtsc->model = context->model; seq = rasqal_query_get_data_graph_sequence(rdf_query); /* FIXME: queries with data graphs in them (such as FROM in SPARQL) * are deleted, so that there are no unexpected data loads */ if(seq) { while(raptor_sequence_size(seq)) { rasqal_data_graph* dg=(rasqal_data_graph*)raptor_sequence_pop(seq); rasqal_free_data_graph(dg); } } if(librdf_model_supports_contexts(rtsc->model)) { /* Add all contexts (named graphs) to the query so Rasqal can bind them */ cit = librdf_model_get_contexts(rtsc->model); while(!librdf_iterator_end(cit)) { librdf_node* node = (librdf_node*)librdf_iterator_get_object(cit); librdf_uri* uri; raptor_uri* source_uri; rasqal_data_graph* dg; uri = librdf_node_get_uri(node); source_uri = (raptor_uri*)raptor_new_uri(world->raptor_world_ptr, librdf_uri_as_string(uri)); dg = rasqal_new_data_graph_from_uri(world->rasqal_world_ptr, source_uri, source_uri, RASQAL_DATA_GRAPH_NAMED, NULL, NULL, NULL); rasqal_query_add_data_graph(rdf_query, dg); raptor_free_uri(source_uri); librdf_iterator_next(cit); } librdf_free_iterator(cit); } #ifdef RASQAL_TRIPLES_SOURCE_MIN_VERSION rts->version = 1; #endif rts->init_triples_match=rasqal_redland_init_triples_match; rts->triple_present=rasqal_redland_triple_present; rts->free_triples_source=rasqal_redland_free_triples_source; return 0; } static int rasqal_redland_triple_present(rasqal_triples_source *rts, void *user_data, rasqal_triple *t) { rasqal_redland_triples_source_user_data* rtsc=(rasqal_redland_triples_source_user_data*)user_data; librdf_node* nodes[3]; librdf_statement *s; int rc; /* ASSUMPTION: all the parts of the triple are not variables */ /* FIXME: and no error checks */ nodes[0]=rasqal_literal_to_redland_node(rtsc->world, t->subject); nodes[1]=rasqal_literal_to_redland_node(rtsc->world, t->predicate); nodes[2]=rasqal_literal_to_redland_node(rtsc->world, t->object); s=librdf_new_statement_from_nodes(rtsc->world, nodes[0], nodes[1], nodes[2]); rc=librdf_model_contains_statement(rtsc->model, s); librdf_free_statement(s); return rc; } static void rasqal_redland_free_triples_source(void *user_data) { /* rasqal_redland_triples_source_user_data* rtsc=(rasqal_redland_triples_source_user_data*)user_data; */ } #ifdef RASQAL_TRIPLES_SOURCE_FACTORY_MIN_VERSION #define RTS_RET int #else #define RTS_RET void #endif static RTS_RET rasqal_redland_register_triples_source_factory(rasqal_triples_source_factory *factory) { #ifdef RASQAL_TRIPLES_SOURCE_FACTORY_MIN_VERSION factory->version = 1; #endif factory->user_data_size=sizeof(rasqal_redland_triples_source_user_data); factory->new_triples_source=rasqal_redland_new_triples_source; #ifdef RASQAL_TRIPLES_SOURCE_FACTORY_MIN_VERSION return 0; #endif } typedef struct { librdf_node* nodes[3]; librdf_node* origin; /* query statement, made from the nodes above (even when exact) */ librdf_statement *qstatement; librdf_stream *stream; } rasqal_redland_triples_match_context; static rasqal_triple_parts rasqal_redland_bind_match(struct rasqal_triples_match_s* rtm, void *user_data, rasqal_variable* bindings[4], rasqal_triple_parts parts) { rasqal_redland_triples_match_context* rtmc=(rasqal_redland_triples_match_context*)rtm->user_data; rasqal_literal* l; librdf_statement* statement; rasqal_triple_parts result=(rasqal_triple_parts)0; librdf_world *world = rtmc->stream->world; statement=librdf_stream_get_object(rtmc->stream); if(!statement) return (rasqal_triple_parts)0; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1(" matched statement "); librdf_statement_print(statement, stderr); fputc('\n', stderr); #endif /* set 1 or 2 variable values from the fields of statement */ if(bindings[0] && (parts & RASQAL_TRIPLE_SUBJECT)) { #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("binding subject to variable\n"); #endif l = redland_node_to_rasqal_literal(world, librdf_statement_get_subject(statement)); rasqal_variable_set_value(bindings[0], l); result= RASQAL_TRIPLE_SUBJECT; } if(bindings[1] && (parts & RASQAL_TRIPLE_PREDICATE)) { if(bindings[0] == bindings[1]) { /* check matching(?x, ?x, ...) / subject=predicate */ if(!librdf_node_equals(librdf_statement_get_subject(statement), librdf_statement_get_predicate(statement))) return (rasqal_triple_parts)0; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("subject and predicate values match\n"); #endif } else { #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("binding predicate to variable\n"); #endif l = redland_node_to_rasqal_literal(world, librdf_statement_get_predicate(statement)); rasqal_variable_set_value(bindings[1], l); result= (rasqal_triple_parts)(result | RASQAL_TRIPLE_PREDICATE); } } if(bindings[2] && (parts & RASQAL_TRIPLE_OBJECT)) { int bind=1; if(bindings[0] == bindings[2]) { /* check matching (?x, ..., ?x) / subject=object */ if(!librdf_node_equals(librdf_statement_get_subject(statement), librdf_statement_get_object(statement))) return (rasqal_triple_parts)0; bind=0; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("subject and object values match\n"); #endif } if((bindings[1] == bindings[2]) && !(bindings[0] == bindings[1])) { /* check matching (..., ?x, ?x) / predicate=object * Don't do this if matching (?x, ?x, ...) / subject=predicate * was already done since that would mean the match was (?x, ?x, ?x) */ if(!librdf_node_equals(librdf_statement_get_predicate(statement), librdf_statement_get_object(statement))) return (rasqal_triple_parts)0; bind=0; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("predicate and object values match\n"); #endif } if(bind) { #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("binding object to variable\n"); #endif l = redland_node_to_rasqal_literal(world, librdf_statement_get_object(statement)); rasqal_variable_set_value(bindings[2], l); result= (rasqal_triple_parts)(result | RASQAL_TRIPLE_OBJECT); } } /* Contexts */ if(bindings[3] && (parts & RASQAL_TRIPLE_ORIGIN)) { int bind=1; librdf_node* context_node = librdf_stream_get_context2(rtmc->stream); if(bindings[0] == bindings[3]) { /* check matching (?x, ..., ...) in context ?x */ if(!librdf_node_equals(librdf_statement_get_subject(statement), context_node)) return (rasqal_triple_parts)0; bind=0; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("subject and context values match\n"); #endif } if(bindings[1] == bindings[3]) { /* check matching (..., ?x, ...) in context ?x */ if(!librdf_node_equals(librdf_statement_get_predicate(statement), context_node)) return (rasqal_triple_parts)0; bind=0; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("predicate and context values match\n"); #endif } if(bindings[2] == bindings[3]) { /* check matching (..., ..., ?x) in context ?x */ if(!librdf_node_equals(librdf_statement_get_object(statement), context_node)) return (rasqal_triple_parts)0; bind=0; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("object and context values match\n"); #endif } if(bind) { #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("binding origin to variable\n"); #endif if(context_node) l = redland_node_to_rasqal_literal(world, context_node); else l=NULL; rasqal_variable_set_value(bindings[3], l); result= (rasqal_triple_parts)(result | RASQAL_TRIPLE_ORIGIN); } } return result; } static void rasqal_redland_next_match(struct rasqal_triples_match_s* rtm, void *user_data) { rasqal_redland_triples_match_context* rtmc=(rasqal_redland_triples_match_context*)rtm->user_data; librdf_stream_next(rtmc->stream); } static int rasqal_redland_is_end(struct rasqal_triples_match_s* rtm, void *user_data) { rasqal_redland_triples_match_context* rtmc=(rasqal_redland_triples_match_context*)rtm->user_data; return librdf_stream_end(rtmc->stream); } static void rasqal_redland_finish_triples_match(struct rasqal_triples_match_s* rtm, void *user_data) { rasqal_redland_triples_match_context* rtmc=(rasqal_redland_triples_match_context*)rtm->user_data; if(rtmc) { if(rtmc->stream) { librdf_free_stream(rtmc->stream); rtmc->stream=NULL; } if(rtmc->qstatement) librdf_free_statement(rtmc->qstatement); LIBRDF_FREE(rasqal_redland_triples_match_context, rtmc); } } static int rasqal_redland_init_triples_match(rasqal_triples_match* rtm, rasqal_triples_source *rts, void *user_data, rasqal_triple_meta *m, rasqal_triple *t) { rasqal_redland_triples_source_user_data* rtsc=(rasqal_redland_triples_source_user_data*)user_data; rasqal_redland_triples_match_context* rtmc; rasqal_variable* var; rtm->bind_match=rasqal_redland_bind_match; rtm->next_match=rasqal_redland_next_match; rtm->is_end=rasqal_redland_is_end; rtm->finish=rasqal_redland_finish_triples_match; rtmc = LIBRDF_CALLOC(rasqal_redland_triples_match_context*, 1, sizeof(*rtmc)); if(!rtmc) return 1; rtm->user_data=rtmc; /* at least one of the triple terms is a variable and we need to * do a triplesMatching() aka librdf_model_find_statements * * redland find_statements will do the right thing and internally * pick the most efficient, indexed way to get the answer. */ if((var=rasqal_literal_as_variable(t->subject))) { if(var->value) rtmc->nodes[0]=rasqal_literal_to_redland_node(rtsc->world, var->value); else rtmc->nodes[0]=NULL; } else rtmc->nodes[0]=rasqal_literal_to_redland_node(rtsc->world, t->subject); m->bindings[0]=var; if((var=rasqal_literal_as_variable(t->predicate))) { if(var->value) rtmc->nodes[1]=rasqal_literal_to_redland_node(rtsc->world, var->value); else rtmc->nodes[1]=NULL; } else rtmc->nodes[1]=rasqal_literal_to_redland_node(rtsc->world, t->predicate); m->bindings[1]=var; if((var=rasqal_literal_as_variable(t->object))) { if(var->value) rtmc->nodes[2]=rasqal_literal_to_redland_node(rtsc->world, var->value); else rtmc->nodes[2]=NULL; } else rtmc->nodes[2]=rasqal_literal_to_redland_node(rtsc->world, t->object); m->bindings[2]=var; if(t->origin) { if((var=rasqal_literal_as_variable(t->origin))) { if(var->value) rtmc->origin=rasqal_literal_to_redland_node(rtsc->world, var->value); } else rtmc->origin=rasqal_literal_to_redland_node(rtsc->world, t->origin); m->bindings[3]=var; } rtmc->qstatement=librdf_new_statement_from_nodes(rtsc->world, rtmc->nodes[0], rtmc->nodes[1], rtmc->nodes[2]); if(!rtmc->qstatement) return 1; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("query statement: "); librdf_statement_print(rtmc->qstatement, stderr); if(rtmc->origin) { fput(" with context node: ", stderr); librdf_node_print(rtmc->origin, stderr); } fputc('\n', stderr); #endif if(rtmc->origin) rtmc->stream=librdf_model_find_statements_in_context(rtsc->model, rtmc->qstatement, rtmc->origin); else rtmc->stream=librdf_model_find_statements(rtsc->model, rtmc->qstatement); if(!rtmc->stream) return 1; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG1("rasqal_init_triples_match done\n"); #endif return 0; } static librdf_query_results* librdf_query_rasqal_execute(librdf_query* query, librdf_model* model) { librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; librdf_query_results* results; if (context->model) librdf_free_model(context->model); /* model is always non-NULL */ context->model = model; librdf_model_add_reference(model); /* This assumes raptor's URI implementation is librdf_uri */ if(rasqal_query_prepare(context->rq, context->query_string, (raptor_uri*)context->uri)) return NULL; if(context->results) rasqal_free_query_results(context->results); context->results=rasqal_query_execute(context->rq); if(!context->results) return NULL; results = LIBRDF_MALLOC(librdf_query_results*, sizeof(*results)); if(!results) { rasqal_free_query_results(context->results); context->results=NULL; } else { results->query=query; } return results; } static int librdf_query_rasqal_get_limit(librdf_query* query) { librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; return rasqal_query_get_limit(context->rq); } static int librdf_query_rasqal_set_limit(librdf_query* query, int limit) { librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; rasqal_query_set_limit(context->rq, limit); return 0; } static int librdf_query_rasqal_get_offset(librdf_query* query) { librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; return rasqal_query_get_offset(context->rq); } static int librdf_query_rasqal_set_offset(librdf_query* query, int offset) { librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; rasqal_query_set_offset(context->rq, offset); return 0; } static int librdf_query_rasqal_results_get_count(librdf_query_results *query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; return rasqal_query_results_get_count(context->results); } static int librdf_query_rasqal_results_next(librdf_query_results *query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(!context->results) return 1; return rasqal_query_results_next(context->results); } static int librdf_query_rasqal_results_finished(librdf_query_results *query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(!context->results) return 1; return rasqal_query_results_finished(context->results); } static int librdf_query_rasqal_results_get_bindings(librdf_query_results *query_results, const char ***names, librdf_node **values) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; rasqal_literal **literals; int rc; int i; if(!context->results) return 1; if(values) { rc=rasqal_query_results_get_bindings(context->results, (const unsigned char ***)names, &literals); } else rc=rasqal_query_results_get_bindings(context->results, (const unsigned char ***)names, NULL); if(rc || !values) return rc; for(i=0; iresults); i++) values[i]=rasqal_literal_to_redland_node(query->world, literals[i]); return 0; } static librdf_node* librdf_query_rasqal_results_get_binding_value(librdf_query_results *query_results, int offset) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; rasqal_literal* literal; literal=rasqal_query_results_get_binding_value(context->results, offset); return rasqal_literal_to_redland_node(query->world, literal); } static const char* librdf_query_rasqal_results_get_binding_name(librdf_query_results *query_results, int offset) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(!context->results) return NULL; return (const char*)rasqal_query_results_get_binding_name(context->results, offset); } static librdf_node* librdf_query_rasqal_results_get_binding_value_by_name(librdf_query_results *query_results, const char *name) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; rasqal_literal* literal; if(!context->results) return NULL; literal=rasqal_query_results_get_binding_value_by_name(context->results, (const unsigned char*)name); return rasqal_literal_to_redland_node(query->world, literal); } static int librdf_query_rasqal_results_get_bindings_count(librdf_query_results *query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(!context->results) return 1; return rasqal_query_results_get_bindings_count(context->results); } static void librdf_query_rasqal_free_results(librdf_query_results* query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(!context->results) return; rasqal_free_query_results(context->results); context->results=NULL; } static int librdf_query_rasqal_results_is_bindings(librdf_query_results* query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(!context->results) return 1; return rasqal_query_results_is_bindings(context->results); } static int librdf_query_rasqal_results_is_boolean(librdf_query_results* query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(!context->results) return 1; return rasqal_query_results_is_boolean(context->results); } static int librdf_query_rasqal_results_is_graph(librdf_query_results* query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(!context->results) return 1; return rasqal_query_results_is_graph(context->results); } static int librdf_query_rasqal_results_is_syntax(librdf_query_results* query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(!context->results) return 1; return rasqal_query_results_is_syntax(context->results); } static int librdf_query_rasqal_results_get_boolean(librdf_query_results* query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; if(!context->results) return -1; return rasqal_query_results_get_boolean(context->results); } typedef struct { librdf_query *query; librdf_query_rasqal_context* qcontext; /* query context */ librdf_statement* statement; /* current statement */ int finished; } librdf_query_rasqal_stream_context; static int librdf_query_rasqal_query_results_end_of_stream(void* context) { librdf_query_rasqal_stream_context* scontext=(librdf_query_rasqal_stream_context*)context; return scontext->finished; } static int librdf_query_rasqal_query_results_update_statement(void* context) { librdf_query_rasqal_stream_context* scontext=(librdf_query_rasqal_stream_context*)context; librdf_world* world=scontext->query->world; librdf_node* node; raptor_statement *rstatement=rasqal_query_results_get_triple(scontext->qcontext->results); if(!rstatement) return 1; scontext->statement=librdf_new_statement(world); if(!scontext->statement) return 1; /* subject */ if(rstatement->subject->type == RAPTOR_TERM_TYPE_BLANK) { node = librdf_new_node_from_blank_identifier(world, rstatement->subject->value.blank.string); } else if(rstatement->subject->type == RAPTOR_TERM_TYPE_URI) { node = librdf_new_node_from_uri_string(world, librdf_uri_as_string((librdf_uri*)rstatement->subject->value.uri)); } else { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "Unknown Raptor subject identifier type %d", rstatement->subject->type); goto fail; } if(!node) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "Could not create subject node"); goto fail; } librdf_statement_set_subject(scontext->statement, node); /* predicate */ if(rstatement->predicate->type == RAPTOR_TERM_TYPE_URI) { node = librdf_new_node_from_uri_string(world, librdf_uri_as_string((librdf_uri*)rstatement->predicate->value.uri)); } else { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "Unknown Raptor predicate identifier type %d", rstatement->predicate->type); goto fail; } if(!node) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "Could not create predicate node"); goto fail; } librdf_statement_set_predicate(scontext->statement, node); /* object */ if(rstatement->object->type == RAPTOR_TERM_TYPE_LITERAL) { node = librdf_new_node_from_typed_literal(world, rstatement->object->value.literal.string, (const char*)rstatement->object->value.literal.language, (librdf_uri*)rstatement->object->value.literal.datatype); } else if(rstatement->object->type == RAPTOR_TERM_TYPE_BLANK) { node = librdf_new_node_from_blank_identifier(world, rstatement->object->value.blank.string); } else if(rstatement->object->type == RAPTOR_TERM_TYPE_URI) { node = librdf_new_node_from_uri_string(world, librdf_uri_as_string((librdf_uri*)rstatement->object->value.uri)); } else { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Unknown Raptor object identifier type %d", rstatement->object->type); goto fail; } if(!node) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "Could not create object node"); goto fail; } librdf_statement_set_object(scontext->statement, node); return 0; /* success */ fail: librdf_free_statement(scontext->statement); scontext->statement=NULL; return 1; } static int librdf_query_rasqal_query_results_next_statement(void* context) { librdf_query_rasqal_stream_context* scontext=(librdf_query_rasqal_stream_context*)context; if(scontext->finished) return 1; if(scontext->statement) { librdf_free_statement(scontext->statement); scontext->statement=NULL; } scontext->finished = !scontext->qcontext->results; if(!scontext->finished) scontext->finished=rasqal_query_results_next_triple(scontext->qcontext->results); if(!scontext->finished) librdf_query_rasqal_query_results_update_statement(scontext); return scontext->finished; } static void* librdf_query_rasqal_query_results_get_statement(void* context, int flags) { librdf_query_rasqal_stream_context* scontext=(librdf_query_rasqal_stream_context*)context; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return scontext->statement; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return NULL; default: librdf_log(scontext->query->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_QUERY, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_query_rasqal_query_results_finished(void* context) { librdf_query_rasqal_stream_context* scontext=(librdf_query_rasqal_stream_context*)context; if(scontext) { if(scontext->statement) librdf_free_statement(scontext->statement); LIBRDF_FREE(librdf_query_rasqal_context, scontext); } } static librdf_stream* librdf_query_rasqal_results_as_stream(librdf_query_results* query_results) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; librdf_query_rasqal_stream_context* scontext; librdf_stream *stream; if(!context->results) return NULL; scontext = LIBRDF_CALLOC(librdf_query_rasqal_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; scontext->query=query; scontext->qcontext=context; librdf_query_rasqal_query_results_update_statement(scontext); stream=librdf_new_stream(query->world, (void*)scontext, &librdf_query_rasqal_query_results_end_of_stream, &librdf_query_rasqal_query_results_next_statement, &librdf_query_rasqal_query_results_get_statement, &librdf_query_rasqal_query_results_finished); if(!stream) { librdf_query_rasqal_query_results_finished((void*)scontext); return NULL; } return stream; } static librdf_query_results_formatter* librdf_query_rasqal_new_results_formatter(librdf_query_results* query_results, const char *name, const char *mime_type, librdf_uri* format_uri) { rasqal_world* rasqal_world_ptr; rasqal_query_results_formatter* formatter; librdf_query_results_formatter* qrf; rasqal_world_ptr = query_results->query->world->rasqal_world_ptr; formatter = rasqal_new_query_results_formatter(rasqal_world_ptr, name, mime_type, (raptor_uri*)format_uri); if(!formatter) return NULL; qrf = LIBRDF_MALLOC(librdf_query_results_formatter*, sizeof(*qrf)); if(!qrf) { rasqal_free_query_results_formatter(formatter); return NULL; } qrf->query_results = query_results; qrf->formatter = formatter; return qrf; } static void librdf_query_rasqal_free_results_formatter(librdf_query_results_formatter* qrf) { rasqal_free_query_results_formatter(qrf->formatter); LIBRDF_FREE(librdf_query_results, qrf); } static int librdf_query_rasqal_results_formatter_write(raptor_iostream *iostr, librdf_query_results_formatter* qrf, librdf_query_results* query_results, librdf_uri *base_uri) { librdf_query *query=query_results->query; librdf_query_rasqal_context *context=(librdf_query_rasqal_context*)query->context; return rasqal_query_results_formatter_write(iostr, qrf->formatter, context->results, (raptor_uri*)base_uri); } /* local function to register list query functions */ static void librdf_query_rasqal_register_factory(librdf_query_factory *factory) { factory->context_length = sizeof(librdf_query_rasqal_context); factory->init = librdf_query_rasqal_init; factory->terminate = librdf_query_rasqal_terminate; factory->execute = librdf_query_rasqal_execute; factory->get_limit = librdf_query_rasqal_get_limit; factory->set_limit = librdf_query_rasqal_set_limit; factory->get_offset = librdf_query_rasqal_get_offset; factory->set_offset = librdf_query_rasqal_set_offset; factory->results_get_count = librdf_query_rasqal_results_get_count; factory->results_next = librdf_query_rasqal_results_next; factory->results_finished = librdf_query_rasqal_results_finished; factory->results_get_bindings = librdf_query_rasqal_results_get_bindings; factory->results_get_binding_value = librdf_query_rasqal_results_get_binding_value; factory->results_get_binding_name = librdf_query_rasqal_results_get_binding_name; factory->results_get_binding_value_by_name = librdf_query_rasqal_results_get_binding_value_by_name; factory->results_get_bindings_count = librdf_query_rasqal_results_get_bindings_count; factory->free_results = librdf_query_rasqal_free_results; factory->results_is_bindings = librdf_query_rasqal_results_is_bindings; factory->results_is_boolean = librdf_query_rasqal_results_is_boolean; factory->results_is_graph = librdf_query_rasqal_results_is_graph; factory->results_is_syntax = librdf_query_rasqal_results_is_syntax; factory->results_get_boolean = librdf_query_rasqal_results_get_boolean; factory->results_as_stream = librdf_query_rasqal_results_as_stream; factory->new_results_formatter = librdf_query_rasqal_new_results_formatter; factory->free_results_formatter = librdf_query_rasqal_free_results_formatter; factory->results_formatter_write = librdf_query_rasqal_results_formatter_write; } int librdf_query_rasqal_constructor(librdf_world *world) { unsigned int i; if(!world->rasqal_world_ptr) { world->rasqal_world_ptr=rasqal_new_world(); world->rasqal_world_allocated_here = 1; if(!world->rasqal_world_ptr) { LIBRDF_FATAL1(world, LIBRDF_FROM_QUERY, "failed to initialize rasqal"); return 1; } /* Make sure rasqal works with the same raptor instance as everyone else. */ rasqal_world_set_raptor(world->rasqal_world_ptr, world->raptor_world_ptr); if(world->rasqal_world_ptr && world->rasqal_init_handler) { world->rasqal_init_handler(world->rasqal_init_handler_user_data, world->rasqal_world_ptr); } if(rasqal_world_open(world->rasqal_world_ptr)) { LIBRDF_FATAL1(world, LIBRDF_FROM_QUERY, "failed to initialize rasqal"); return 1; } } rasqal_set_triples_source_factory(world->rasqal_world_ptr, rasqal_redland_register_triples_source_factory, world); /* enumerate from query language 1, so the default query language 0 * is done last */ for(i = 1; 1; i++) { const raptor_syntax_description* desc = NULL; const char* uri_string = NULL; desc = rasqal_world_get_query_language_description(world->rasqal_world_ptr, i); if(!desc) { /* reached the end of the query languages, now register the default one */ i = 0; desc = rasqal_world_get_query_language_description(world->rasqal_world_ptr, i); if(!desc) { LIBRDF_FATAL1(world, LIBRDF_FROM_QUERY, "failed to initialize rasqal"); return 1; } } uri_string = desc->uri_strings_count ? desc->uri_strings[0] : NULL; librdf_query_register_factory(world, desc->names[0], (const unsigned char*)uri_string, &librdf_query_rasqal_register_factory); if(!i) /* registered default query, end */ break; } #if 0 /* FIXME - this should be used but for now it is safe to assume * all query is done by Rasqal */ /* enumerate query result formats */ for(i=0; 1; i++) { const char *format_name=NULL; const char *format_label=NULL; const unsigned char *format_uri_string=NULL; const char *format_mime_type=NULL; if(rasqal_query_results_formats_enumerate_full(i, &format_name, &format_label, &format_uri_string, &format_mime_type)) break; librdf_query_register_result_format(world, format_name, format_label, format_uri_string, format_mime_type, &librdf_query_rasqal_register_factory); } #endif return 0; } /** * librdf_world_set_rasqal_init_handler: * @world: librdf_world object * @user_data: user data * @handler: handler to call * * Set the rasqal initialization handler to be called if a new rasqal_world is constructed. */ void librdf_world_set_rasqal_init_handler(librdf_world* world, void* user_data, librdf_rasqal_init_handler handler) { world->rasqal_init_handler = handler; world->rasqal_init_handler_user_data = user_data; } void librdf_query_rasqal_destructor(librdf_world *world) { if(world->rasqal_world_ptr && world->rasqal_world_allocated_here) { rasqal_free_world(world->rasqal_world_ptr); world->rasqal_world_ptr=NULL; } } redland-1.0.17/src/rdf_list.h0000644000175000017500000000415011241015564012677 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_list.h - RDF List Interface definition * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_LIST_H #define LIBRDF_LIST_H #ifndef LIBRDF_OBJC_FRAMEWORK #include #else #include #endif #ifdef __cplusplus extern "C" { #endif REDLAND_API librdf_list* librdf_new_list(librdf_world *world); REDLAND_API void librdf_free_list(librdf_list* list); REDLAND_API void librdf_list_clear(librdf_list* list); /* add to end of list (push) */ REDLAND_API int librdf_list_add(librdf_list* list, void *data); /* add to start of list */ REDLAND_API int librdf_list_unshift(librdf_list* list, void *data); /* remove from start of list */ REDLAND_API void* librdf_list_shift(librdf_list* list); /* remove from end of list (pop) */ REDLAND_API void* librdf_list_pop(librdf_list* list); REDLAND_API void *librdf_list_remove(librdf_list* list, void *data); REDLAND_API int librdf_list_contains(librdf_list* list, void *data); REDLAND_API int librdf_list_size(librdf_list* list); REDLAND_API void librdf_list_set_equals(librdf_list* list, int (*equals) (void* data1, void *data2)); REDLAND_API librdf_iterator* librdf_list_get_iterator(librdf_list* list); REDLAND_API void librdf_list_foreach(librdf_list* list, void (*fn)(void *, void *), void *user_data); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_raptor.h0000644000175000017500000000223711447301773013247 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_raptor.h - librdf Raptor integration * * Copyright (C) 2008, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_RAPTOR_H #define LIBRDF_RAPTOR_H #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif REDLAND_API void librdf_world_set_raptor(librdf_world* world, raptor_world* raptor_world_ptr); REDLAND_API raptor_world* librdf_world_get_raptor(librdf_world* world); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_config.h.in0000644000175000017500000002270312257575730013620 00000000000000/* src/rdf_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* BDB has close method with 2 args */ #undef HAVE_BDB_CLOSE_2_ARGS /* BDB defines DBC */ #undef HAVE_BDB_CURSOR /* BDB cursor method has 4 arguments */ #undef HAVE_BDB_CURSOR_4_ARGS /* BDB defines DB_TXN */ #undef HAVE_BDB_DB_TXN /* BDB has fd method with 2 args */ #undef HAVE_BDB_FD_2_ARGS /* Have BDB hash support */ #undef HAVE_BDB_HASH /* BDB has open method with 6 args */ #undef HAVE_BDB_OPEN_6_ARGS /* BDB has open method with 7 args */ #undef HAVE_BDB_OPEN_7_ARGS /* BDB has set_flags method */ #undef HAVE_BDB_SET_FLAGS /* Define to 1 if the system has the type `byte'. */ #undef HAVE_BYTE /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* BDB has dbopen method */ #undef HAVE_DBOPEN /* BDB has db_create method */ #undef HAVE_DB_CREATE /* Define to 1 if you have the header file. */ #undef HAVE_DB_H /* BDB has db_open method */ #undef HAVE_DB_OPEN /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getenv' function. */ #undef HAVE_GETENV /* Define to 1 if you have the `getopt' function. */ #undef HAVE_GETOPT /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Define to 1 if you have the header file. */ #undef HAVE_LIBPQ_FE_H /* Have local MD5 digest */ #undef HAVE_LOCAL_MD5_DIGEST /* Have local RIPEMD160 digest */ #undef HAVE_LOCAL_RIPEMD160_DIGEST /* Have local SHA1 digest */ #undef HAVE_LOCAL_SHA1_DIGEST /* Define this if a modern libltdl is already installed */ #undef HAVE_LTDL /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the `memcmp' function. */ #undef HAVE_MEMCMP /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the `mktemp' function. */ #undef HAVE_MKTEMP /* have MYSQL_OPT_RECONNECT declared */ #undef HAVE_MYSQL_OPT_RECONNECT /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the header file. */ #undef HAVE_SQLITE3_H /* Define to 1 if you have the header file. */ #undef HAVE_SQLITE_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the `tmpnam' function. */ #undef HAVE_TMPNAM /* Define to 1 if the system has the type `u32'. */ #undef HAVE_U32 /* Define to 1 if the system has the type `u64'. */ #undef HAVE_U64 /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Run time assertion checks. */ #undef LIBRDF_ASSERT /* Print run time assertion check failure messages. */ #undef LIBRDF_ASSERT_MESSAGES /* Release version as a decimal */ #undef LIBRDF_VERSION_DECIMAL /* Major version number */ #undef LIBRDF_VERSION_MAJOR /* Minor version number */ #undef LIBRDF_VERSION_MINOR /* Release version number */ #undef LIBRDF_VERSION_RELEASE /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* Build storage backends as modules */ #undef MODULAR_LIBRDF /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `unsigned char', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_CHAR /* The size of `unsigned int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_INT /* The size of `unsigned long', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG /* The size of `unsigned long long', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG_LONG /* define to SQLINTEGER if not defined in the ODBC headers */ #undef SQLLEN /* define to SQLUINTEGER if not defined in the ODBC headers */ #undef SQLULEN /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Building file storage */ #undef STORAGE_FILE /* Building hashes storage */ #undef STORAGE_HASHES /* Building memory storage */ #undef STORAGE_MEMORY /* Building MySQL storage */ #undef STORAGE_MYSQL /* Building PostgreSQL storage */ #undef STORAGE_POSTGRESQL /* Building SQLite storage */ #undef STORAGE_SQLITE /* Building trees storage */ #undef STORAGE_TREES /* Building 3store storage */ #undef STORAGE_TSTORE /* Building Virtuoso storage */ #undef STORAGE_VIRTUOSO /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Use POSIX threads */ #undef WITH_THREADS /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to a type to use for `error_t' if it is not otherwise available. */ #undef error_t redland-1.0.17/src/rdf_parser_raptor.c0000644000175000017500000012772012063477676014636 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_parser_raptor.c - RDF Parser using Raptor * * Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include /* serialising implementing functions */ static int librdf_parser_raptor_serialise_end_of_stream(void* context); static int librdf_parser_raptor_serialise_next_statement(void* context); static void* librdf_parser_raptor_serialise_get_statement(void* context, int flags); static void librdf_parser_raptor_serialise_finished(void* context); typedef struct { librdf_parser *parser; /* librdf parser object */ raptor_parser *rdf_parser; /* source URI string (for raptor) */ const char *parser_name; /* raptor parser name to use */ raptor_sequence* nspace_prefixes; raptor_sequence* nspace_uris; int errors; int warnings; raptor_www *www; /* raptor stream */ void *stream_context; /* librdf_parser_raptor_stream_context* */ } librdf_parser_raptor_context; typedef struct { librdf_parser_raptor_context* pcontext; /* parser context */ /* when reading from a file */ FILE *fh; /* when true, this FH is closed on finish */ int close_fh; /* when finished */ int finished; /* when storing into a model - librdf_parser_raptor_parse_uri_into_model */ librdf_model *model; /* The set of statements pending is a sequence, with 'current' * as the first entry and any remaining ones held in 'statements'. * The latter are filled by the parser * sequence is empty := current=NULL and librdf_list_size(statements)=0 */ librdf_statement* current; /* current statement */ librdf_list* statements; } librdf_parser_raptor_stream_context; static int librdf_parser_raptor_relay_filter(void* user_data, raptor_uri* uri) { librdf_parser* parser=(librdf_parser*)user_data; return parser->uri_filter(parser->uri_filter_user_data, (librdf_uri*)uri); } /** * librdf_parser_raptor_init: * @parser: the parser * @context: context * * Initialise the raptor RDF parser. * * Return value: non 0 on failure **/ static int librdf_parser_raptor_init(librdf_parser *parser, void *context) { librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)context; pcontext->parser = parser; pcontext->parser_name=pcontext->parser->factory->name; /* legacy name - see librdf_parser_raptor_constructor * from when there was just one parser */ if(!strcmp(pcontext->parser_name, "raptor")) pcontext->parser_name = "rdfxml"; pcontext->rdf_parser = raptor_new_parser(parser->world->raptor_world_ptr, pcontext->parser_name); if(!pcontext->rdf_parser) return 1; librdf_raptor_reset_bnode_hash(parser->world); return 0; } /** * librdf_parser_raptor_terminate: * @context: context * * Terminate the raptor RDF parser. * **/ static void librdf_parser_raptor_terminate(void *context) { librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)context; librdf_raptor_free_bnode_hash(pcontext->parser->world); if(pcontext->stream_context) librdf_parser_raptor_serialise_finished(pcontext->stream_context); if(pcontext->www) raptor_free_www(pcontext->www); if(pcontext->rdf_parser) raptor_free_parser(pcontext->rdf_parser); if(pcontext->nspace_prefixes) raptor_free_sequence(pcontext->nspace_prefixes); if(pcontext->nspace_uris) raptor_free_sequence(pcontext->nspace_uris); } /* * librdf_parser_raptor_new_statement_handler - helper callback function for raptor RDF when a new triple is asserted * @context: context for callback * @statement: raptor_statement * * Adds the statement to the list of statements. */ static void librdf_parser_raptor_new_statement_handler(void *context, raptor_statement *rstatement) { librdf_parser_raptor_stream_context* scontext=(librdf_parser_raptor_stream_context*)context; librdf_node* node; librdf_statement* statement; librdf_world* world=scontext->pcontext->parser->world; int rc; statement=librdf_new_statement(world); if(!statement) return; if(rstatement->subject->type == RAPTOR_TERM_TYPE_BLANK) { node = librdf_new_node_from_blank_identifier(world, (const unsigned char*)rstatement->subject->value.blank.string); } else if (rstatement->subject->type == RAPTOR_TERM_TYPE_URI) { node = librdf_new_node_from_uri(world, (librdf_uri*)rstatement->subject->value.uri); } else { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Unknown Raptor subject identifier type %d", rstatement->subject->type); librdf_free_statement(statement); return; } if(!node) { librdf_log(world, 0, LIBRDF_LOG_FATAL, LIBRDF_FROM_PARSER, NULL, "Cannot create subject node"); librdf_free_statement(statement); return; } librdf_statement_set_subject(statement, node); if(rstatement->predicate->type == RAPTOR_TERM_TYPE_URI) { node = librdf_new_node_from_uri(world, (librdf_uri*)rstatement->predicate->value.uri); } else { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Unknown Raptor predicate identifier type %d", rstatement->predicate->type); librdf_free_statement(statement); return; } if(!node) { librdf_log(world, 0, LIBRDF_LOG_FATAL, LIBRDF_FROM_PARSER, NULL, "Cannot create predicate node"); librdf_free_statement(statement); return; } librdf_statement_set_predicate(statement, node); if(rstatement->object->type == RAPTOR_TERM_TYPE_LITERAL) { node = librdf_new_node_from_typed_literal(world, rstatement->object->value.literal.string, (const char *)rstatement->object->value.literal.language, (librdf_uri*)rstatement->object->value.literal.datatype); } else if(rstatement->object->type == RAPTOR_TERM_TYPE_BLANK) { node = librdf_new_node_from_blank_identifier(world, rstatement->object->value.blank.string); } else if(rstatement->object->type == RAPTOR_TERM_TYPE_URI) { node = librdf_new_node_from_uri(world, (librdf_uri*)rstatement->object->value.uri); } else { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Unknown Raptor object identifier type %d", rstatement->object->type); librdf_free_statement(statement); return; } if(!node) { librdf_log(world, 0, LIBRDF_LOG_FATAL, LIBRDF_FROM_PARSER, NULL, "Cannot create object node"); librdf_free_statement(statement); return; } librdf_statement_set_object(statement, node); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 if(1) { raptor_iostream *iostr; iostr = raptor_new_iostream_to_file_handle(world->raptor_world_ptr, stderr); librdf_statement_write(statement, iostr); raptor_free_iostream(iostr); } #endif if(scontext->model) { rc=librdf_model_add_statement(scontext->model, statement); librdf_free_statement(statement); } else { rc=librdf_list_add(scontext->statements, statement); if(rc) librdf_free_statement(statement); } if(rc) { librdf_log(world, 0, LIBRDF_LOG_FATAL, LIBRDF_FROM_PARSER, NULL, "Cannot add statement to model"); } } /* * librdf_parser_raptor_namespace_handler - helper callback function for raptor RDF when a namespace is seen * @context: context for callback * @statement: raptor_statement * * Adds the statement to the list of statements. */ static void librdf_parser_raptor_namespace_handler(void* user_data, raptor_namespace *nspace) { librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)user_data; const unsigned char* prefix; unsigned char* nprefix; size_t prefix_length; librdf_uri* uri; int i; uri=(librdf_uri*)raptor_namespace_get_uri(nspace); if(!uri) return; for(i=0; i < raptor_sequence_size(pcontext->nspace_uris); i++) { librdf_uri* u=(librdf_uri*)raptor_sequence_get_at(pcontext->nspace_uris, i); if(librdf_uri_equals(uri, u)) return; } /* new namespace */ uri=librdf_new_uri_from_uri(uri); raptor_sequence_push(pcontext->nspace_uris, uri); prefix=raptor_namespace_get_counted_prefix(nspace, &prefix_length); if(prefix) { nprefix = LIBRDF_MALLOC(unsigned char*, prefix_length + 1); /* FIXME: what if nprefix alloc failed? now just pushes NULL to sequence */ if(nprefix) strncpy((char*)nprefix, (const char*)prefix, prefix_length+1); } else nprefix=NULL; raptor_sequence_push(pcontext->nspace_prefixes, nprefix); } /* FIXME: Yeah? What about it? */ #define RAPTOR_IO_BUFFER_LEN 1024 /* * librdf_parser_raptor_get_next_statement - helper function to get the next statement * @context: serialisation context * * Return value: >0 if a statement found, 0 at end of file, or <0 on error */ static int librdf_parser_raptor_get_next_statement(librdf_parser_raptor_stream_context *context) { unsigned char buffer[RAPTOR_IO_BUFFER_LEN]; int status=0; if(context->finished || !context->fh) return 0; context->current=NULL; while(!feof(context->fh)) { size_t len; int ret; len = fread(buffer, 1, RAPTOR_IO_BUFFER_LEN, context->fh); ret = raptor_parser_parse_chunk(context->pcontext->rdf_parser, buffer, len, (len < RAPTOR_IO_BUFFER_LEN)); if(ret) { status=(-1); break; /* failed and done */ } /* parsing found at least 1 statement, return */ if(librdf_list_size(context->statements)) { context->current=(librdf_statement*)librdf_list_pop(context->statements); status=1; break; } if(len < RAPTOR_IO_BUFFER_LEN) break; } if(feof(context->fh) || status <1) context->finished=1; return status; } /* * librdf_parser_raptor_parse_file_handle_as_stream: * @context: parser context * @fh: FILE* of content source * @close_fh: if true to fclose(fh) on finish * @base_uri: #librdf_uri URI of the content location * * Retrieve content from FILE* @fh and parse it into a #librdf_stream. * **/ static librdf_stream* librdf_parser_raptor_parse_file_handle_as_stream(void *context, FILE *fh, int close_fh, librdf_uri *base_uri) { librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)context; librdf_parser_raptor_stream_context* scontext; librdf_stream *stream; int rc; int need_base_uri; const raptor_syntax_description *desc; librdf_world_open(pcontext->parser->world); desc = raptor_parser_get_description(pcontext->rdf_parser); if(!desc) { librdf_log(pcontext->parser->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Could not get description for %s parser", pcontext->parser_name); return NULL; } need_base_uri = desc->flags & RAPTOR_SYNTAX_NEED_BASE_URI; if(need_base_uri && !base_uri) { librdf_log(pcontext->parser->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Missing base URI for %s parser", pcontext->parser_name); return NULL; } pcontext->errors=0; pcontext->warnings=0; scontext = LIBRDF_CALLOC(librdf_parser_raptor_stream_context*, 1, sizeof(*scontext)); if(!scontext) goto oom; scontext->pcontext=pcontext; pcontext->stream_context=scontext; scontext->statements=librdf_new_list(pcontext->parser->world); if(!scontext->statements) goto oom; if(pcontext->nspace_prefixes) raptor_free_sequence(pcontext->nspace_prefixes); pcontext->nspace_prefixes=raptor_new_sequence(free, NULL); if(!pcontext->nspace_prefixes) goto oom; if(pcontext->nspace_uris) raptor_free_sequence(pcontext->nspace_uris); pcontext->nspace_uris = raptor_new_sequence((raptor_data_free_handler)librdf_free_uri, NULL); if(!pcontext->nspace_uris) goto oom; raptor_parser_set_statement_handler(pcontext->rdf_parser, scontext, librdf_parser_raptor_new_statement_handler); raptor_parser_set_namespace_handler(pcontext->rdf_parser, pcontext, librdf_parser_raptor_namespace_handler); scontext->fh=fh; scontext->close_fh=close_fh; if(pcontext->parser->uri_filter) raptor_parser_set_uri_filter(pcontext->rdf_parser, librdf_parser_raptor_relay_filter, pcontext->parser); /* Start the parse */ stream = NULL; rc = raptor_parser_parse_start(pcontext->rdf_parser, (raptor_uri*)base_uri); if(!rc) { /* start parsing; initialises scontext->statements, scontext->current */ librdf_parser_raptor_get_next_statement(scontext); stream=librdf_new_stream(pcontext->parser->world, (void*)scontext, &librdf_parser_raptor_serialise_end_of_stream, &librdf_parser_raptor_serialise_next_statement, &librdf_parser_raptor_serialise_get_statement, &librdf_parser_raptor_serialise_finished); } if(!stream) goto oom; return stream; /* Clean up and report an error on OOM */ oom: librdf_parser_raptor_serialise_finished((void*)scontext); librdf_log(pcontext->parser->world, 0, LIBRDF_LOG_FATAL, LIBRDF_FROM_PARSER, NULL, "Out of memory"); return NULL; } static void librdf_parser_raptor_parse_uri_as_stream_write_bytes_handler(raptor_www *www, void *userdata, const void *ptr, size_t size, size_t nmemb) { librdf_parser_raptor_stream_context* scontext = (librdf_parser_raptor_stream_context*)userdata; size_t len = size * nmemb; int rc; rc = raptor_parser_parse_chunk(scontext->pcontext->rdf_parser, (const unsigned char*)ptr, len, 0); if(rc) raptor_www_abort(www, "Parsing failed"); } /** * librdf_parser_raptor_parse_as_stream_common: * @context: parser context * @uri: #librdf_uri URI of RDF content source * @string: or content string * @length: length of the string or 0 if not yet counted * @iostream: an iostream to parse * @base_uri: #librdf_uri URI of the content location or NULL if the same * * Retrieve the content at URI/string and parse it into a #librdf_stream. * * Precisely one of uri, string, and iostream must be non-NULL * **/ static librdf_stream* librdf_parser_raptor_parse_as_stream_common(void *context, librdf_uri *uri, const unsigned char *string, size_t length, raptor_iostream *iostream, librdf_uri *base_uri) { librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)context; librdf_parser_raptor_stream_context* scontext; librdf_stream *stream; int need_base_uri; int status; const raptor_syntax_description *desc; if(!base_uri && uri) base_uri=uri; desc = raptor_parser_get_description(pcontext->rdf_parser); if(!desc) { librdf_log(pcontext->parser->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Could not get description for %s parser", pcontext->parser_name); return NULL; } need_base_uri = desc->flags & RAPTOR_SYNTAX_NEED_BASE_URI; if(need_base_uri && !base_uri) { librdf_log(pcontext->parser->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Missing base URI for %s parser", pcontext->parser_name); return NULL; } pcontext->errors=0; pcontext->warnings=0; if(uri && librdf_uri_is_file_uri(uri)) { char* filename=(char*)librdf_uri_to_filename(uri); FILE *fh; if(!filename) return NULL; fh=fopen(filename, "r"); if(!fh) { librdf_log(pcontext->parser->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "failed to open file '%s' - %s", filename, strerror(errno)); SYSTEM_FREE(filename); return NULL; } /* stream will close FH */ stream=librdf_parser_raptor_parse_file_handle_as_stream(context, fh, 1, base_uri); SYSTEM_FREE(filename); return stream; } scontext = LIBRDF_CALLOC(librdf_parser_raptor_stream_context*, 1, sizeof(*scontext)); if(!scontext) goto oom; scontext->pcontext=pcontext; pcontext->stream_context=scontext; scontext->statements=librdf_new_list(pcontext->parser->world); if(!scontext->statements) goto oom; if(pcontext->nspace_prefixes) raptor_free_sequence(pcontext->nspace_prefixes); pcontext->nspace_prefixes=raptor_new_sequence(free, NULL); if(!pcontext->nspace_prefixes) goto oom; if(pcontext->nspace_uris) raptor_free_sequence(pcontext->nspace_uris); pcontext->nspace_uris = raptor_new_sequence((raptor_data_free_handler)librdf_free_uri, NULL); if(!pcontext->nspace_uris) goto oom; raptor_parser_set_statement_handler(pcontext->rdf_parser, scontext, librdf_parser_raptor_new_statement_handler); raptor_parser_set_namespace_handler(pcontext->rdf_parser, pcontext, librdf_parser_raptor_namespace_handler); if(pcontext->parser->uri_filter) raptor_parser_set_uri_filter(pcontext->rdf_parser, librdf_parser_raptor_relay_filter, pcontext->parser); if(uri) { const char *accept_h; if(pcontext->www) raptor_free_www(pcontext->www); pcontext->www = raptor_new_www(pcontext->parser->world->raptor_world_ptr); if(!pcontext->www) goto oom; accept_h=raptor_parser_get_accept_header(pcontext->rdf_parser); if(accept_h) { raptor_www_set_http_accept(pcontext->www, accept_h); raptor_free_memory((void*)accept_h); } raptor_www_set_write_bytes_handler(pcontext->www, librdf_parser_raptor_parse_uri_as_stream_write_bytes_handler, scontext); status = raptor_parser_parse_start(pcontext->rdf_parser, (raptor_uri*)base_uri); if(status) { raptor_free_www(pcontext->www); pcontext->www = NULL; librdf_parser_raptor_serialise_finished((void*)scontext); return NULL; } raptor_www_fetch(pcontext->www, (raptor_uri*)uri); raptor_parser_parse_chunk(pcontext->rdf_parser, NULL, 0, 1); raptor_free_www(pcontext->www); pcontext->www = NULL; } else if (string) { status = raptor_parser_parse_start(pcontext->rdf_parser, (raptor_uri*)base_uri); if(status) { librdf_parser_raptor_serialise_finished((void*)scontext); return NULL; } if(!length) length = strlen((const char*)string); raptor_parser_parse_chunk(pcontext->rdf_parser, string, length, 1); } else if (iostream) { status = raptor_parser_parse_start(pcontext->rdf_parser, (raptor_uri*)base_uri); if(status) { librdf_parser_raptor_serialise_finished((void*)scontext); return NULL; } status = raptor_parser_parse_iostream(pcontext->rdf_parser, iostream, (raptor_uri*)base_uri); if(status) { librdf_parser_raptor_serialise_finished((void*)scontext); return NULL; } } else { /* All three of URI, string and iostream are null. That's a coding error. */ librdf_parser_raptor_serialise_finished((void*)scontext); return NULL; } /* get first statement, else is empty */ scontext->current=(librdf_statement*)librdf_list_pop(scontext->statements); stream=librdf_new_stream(pcontext->parser->world, (void*)scontext, &librdf_parser_raptor_serialise_end_of_stream, &librdf_parser_raptor_serialise_next_statement, &librdf_parser_raptor_serialise_get_statement, &librdf_parser_raptor_serialise_finished); if(!stream) goto oom; return stream; /* Clean up and report an error on OOM */ oom: librdf_parser_raptor_serialise_finished((void*)scontext); librdf_log(pcontext->parser->world, 0, LIBRDF_LOG_FATAL, LIBRDF_FROM_PARSER, NULL, "Out of memory"); return NULL; } /** * librdf_parser_raptor_parse_uri_as_stream: * @context: parser context * @uri: #librdf_uri URI of content source * @base_uri: #librdf_uri URI of the content location or NULL if the same * * Retrieve the content at URI and parse it into a librdf_stream. * * **/ static librdf_stream* librdf_parser_raptor_parse_uri_as_stream(void *context, librdf_uri *uri, librdf_uri *base_uri) { return librdf_parser_raptor_parse_as_stream_common(context, uri, NULL, 0, 0, base_uri); } /** * librdf_parser_raptor_parse_string_as_stream: * @context: parser context * @string: string content to parse * @base_uri: #librdf_uri URI of the content location or NULL if the same * * Parse the content in a string and return a librdf_stream. * * **/ static librdf_stream* librdf_parser_raptor_parse_string_as_stream(void *context, const unsigned char *string, librdf_uri *base_uri) { return librdf_parser_raptor_parse_as_stream_common(context, NULL, string, 0, 0, base_uri); } /** * librdf_parser_raptor_parse_counted_string_as_stream: * @context: parser context * @string: string content to parse * @length: length of the string content (must be >0) * @base_uri: the base URI to use * * Parse a counted string of content to a librdf_stream of statements. * * Return value: #librdf_stream of statements or NULL **/ static librdf_stream* librdf_parser_raptor_parse_counted_string_as_stream(void *context, const unsigned char *string, size_t length, librdf_uri* base_uri) { return librdf_parser_raptor_parse_as_stream_common(context, NULL, string, length, 0, base_uri); } /** * librdf_parser_raptor_parse_iostream_as_stream: * @context: parser context * @iostream: iostream content to parse * @base_uri: #librdf_uri URI of the content location or NULL if the same * * Parse the content in an iostream and return a librdf_stream. * * **/ static librdf_stream* librdf_parser_raptor_parse_iostream_as_stream(void *context, raptor_iostream *iostream, librdf_uri *base_uri) { return librdf_parser_raptor_parse_as_stream_common(context, NULL, 0, 0, iostream, base_uri); } /* * librdf_parser_raptor_parse_into_model_common: * @context: parser context * @uri: #librdf_uri URI of RDF content source, or NULL * @string: string content to parser, or NULL * @length: length of the string or 0 if not yet counted * @fh: FILE* content source, or NULL * @iostream: iostream content, or NULL * @base_uri: #librdf_uri URI of the content location or NULL * @model: #librdf_model of model * * Retrieve the RDF content at URI and store it into a librdf_model. * * Precisely one of uri, string, fh or iostream must be non-null. * * Parses the content at @uri, @string, @fh or @iostream and store it in the given model. * * Return value: non 0 on failure **/ static int librdf_parser_raptor_parse_into_model_common(void *context, librdf_uri *uri, const unsigned char *string, size_t length, FILE *fh, raptor_iostream *iostream, librdf_uri *base_uri, librdf_model* model) { int status=0; librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)context; librdf_parser_raptor_stream_context* scontext; int need_base_uri; const raptor_syntax_description *desc; if(!base_uri) base_uri=uri; desc = raptor_parser_get_description(pcontext->rdf_parser); if(!desc) { librdf_log(pcontext->parser->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Could not get description for %s parser", pcontext->parser_name); return -1; } need_base_uri = desc->flags & RAPTOR_SYNTAX_NEED_BASE_URI; if(need_base_uri && !base_uri) { librdf_log(pcontext->parser->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Missing base URI for %s parser", pcontext->parser_name); return 1; } pcontext->errors=0; pcontext->warnings=0; scontext = LIBRDF_CALLOC(librdf_parser_raptor_stream_context*, 1, sizeof(*scontext)); if(!scontext) goto oom; scontext->pcontext=pcontext; pcontext->stream_context=scontext; if(pcontext->nspace_prefixes) raptor_free_sequence(pcontext->nspace_prefixes); pcontext->nspace_prefixes=raptor_new_sequence(free, NULL); if(!pcontext->nspace_prefixes) goto oom; if(pcontext->nspace_uris) raptor_free_sequence(pcontext->nspace_uris); pcontext->nspace_uris = raptor_new_sequence((raptor_data_free_handler)librdf_free_uri, NULL); if(!pcontext->nspace_uris) goto oom; raptor_parser_set_statement_handler(pcontext->rdf_parser, scontext, librdf_parser_raptor_new_statement_handler); raptor_parser_set_namespace_handler(pcontext->rdf_parser, pcontext, librdf_parser_raptor_namespace_handler); /* direct into model */ scontext->model=model; if(pcontext->parser->uri_filter) raptor_parser_set_uri_filter(pcontext->rdf_parser, librdf_parser_raptor_relay_filter, pcontext->parser); if(uri) { status = raptor_parser_parse_uri(pcontext->rdf_parser, (raptor_uri*)uri, (raptor_uri*)base_uri); } else if (string != NULL) { status = raptor_parser_parse_start(pcontext->rdf_parser, (raptor_uri*)base_uri); if(!status) { if(!length) length = strlen((const char*)string); status = raptor_parser_parse_chunk(pcontext->rdf_parser, string, length, 1); } } else if(fh) { status = raptor_parser_parse_file_stream(pcontext->rdf_parser, fh, NULL, (raptor_uri*)base_uri); } else if(iostream) { status = raptor_parser_parse_iostream(pcontext->rdf_parser, iostream, (raptor_uri*)base_uri); } else { /* All four of URI, string, fh and iostream are null. That's a coding error. */ status = -1; } librdf_parser_raptor_serialise_finished((void*)scontext); return status; /* Clean up and report an error on OOM */ oom: librdf_parser_raptor_serialise_finished((void*)scontext); librdf_log(pcontext->parser->world, 0, LIBRDF_LOG_FATAL, LIBRDF_FROM_PARSER, NULL, "Out of memory"); return -1; } /** * librdf_parser_raptor_parse_uri_into_model: * @context: parser context * @uri: #librdf_uri URI of RDF content source * @base_uri: #librdf_uri URI of the content location (or NULL if the same as @uri) * @model: #librdf_model of model * * Retrieve the RDF content at URI and store it into a librdf_model. * * Retrieves all statements and stores them in the given model. * * Return value: non 0 on failure **/ static int librdf_parser_raptor_parse_uri_into_model(void *context, librdf_uri *uri, librdf_uri *base_uri, librdf_model* model) { return librdf_parser_raptor_parse_into_model_common(context, uri, NULL, 0, NULL, NULL, base_uri, model);} /** * librdf_parser_raptor_parse_string_into_model: * @context: parser context * @string: content to parse * @base_uri: #librdf_uri URI of the content location * @model: #librdf_model of model * * Parse the RDF content in a string and store it into a librdf_model. * * Stores the statements found parsing string and stores in the given model. * * Return value: non 0 on failure **/ static int librdf_parser_raptor_parse_string_into_model(void *context, const unsigned char *string, librdf_uri *base_uri, librdf_model* model) { return librdf_parser_raptor_parse_into_model_common(context, NULL, string, 0, NULL, NULL, base_uri, model); } /** * librdf_parser_raptor_parse_file_handle_into_model: * @context: parser context * @fh: FILE* of content source * @close_fh: non-0 to fclose(fh) on finish * @base_uri: #librdf_uri URI of the content location (or NULL) * @model: #librdf_model of model * * INTERNAL - Retrieve the RDF content from a FILE* handle and store it into a #librdf_model. * * Retrieves all statements and stores them in the given model. * * Return value: non 0 on failure **/ static int librdf_parser_raptor_parse_file_handle_into_model(void *context, FILE *fh, int close_fh, librdf_uri *base_uri, librdf_model* model) { int status=librdf_parser_raptor_parse_into_model_common(context, NULL, NULL, 0, fh, NULL, base_uri, model); if (close_fh) fclose(fh); return status; } /** * librdf_parser_raptor_parse_counted_string_into_model: * @context: parser context * @string: the content to parse * @length: length of content (must be >0) * @base_uri: the base URI to use * @model: the model to use * * INTERNAL - Parse a counted string of content into an #librdf_model. * * Return value: non 0 on failure **/ static int librdf_parser_raptor_parse_counted_string_into_model(void *context, const unsigned char *string, size_t length, librdf_uri* base_uri, librdf_model* model) { return librdf_parser_raptor_parse_into_model_common(context, NULL, string, length, NULL, NULL, base_uri, model); } /** * librdf_parser_raptor_parse_iostream_into_model: * @context: parser context * @iostream: the content to parse * @base_uri: the base URI to use * @model: the model to use * * INTERNAL - Parse an iostream of content into an #librdf_model. * * Return value: non 0 on failure **/ static int librdf_parser_raptor_parse_iostream_into_model(void *context, raptor_iostream *iostream, librdf_uri* base_uri, librdf_model* model) { return librdf_parser_raptor_parse_into_model_common(context, NULL, NULL, 0, NULL, iostream, base_uri, model); } /** * librdf_parser_raptor_serialise_end_of_stream: * @context: the context passed in by #librdf_stream * * Check for the end of the stream of statements from the raptor RDF parser. * * Return value: non 0 at end of stream **/ static int librdf_parser_raptor_serialise_end_of_stream(void* context) { librdf_parser_raptor_stream_context* scontext=(librdf_parser_raptor_stream_context*)context; return (!scontext->current && !librdf_list_size(scontext->statements)); } /** * librdf_parser_raptor_serialise_next_statement: * @context: the context passed in by #librdf_stream * * Move to the next librdf_statement in the stream of statements from the raptor RDF parse. * * Return value: non 0 at end of stream **/ static int librdf_parser_raptor_serialise_next_statement(void* context) { librdf_parser_raptor_stream_context* scontext=(librdf_parser_raptor_stream_context*)context; librdf_free_statement(scontext->current); scontext->current=NULL; /* get another statement if there is one */ while(!scontext->current) { scontext->current=(librdf_statement*)librdf_list_pop(scontext->statements); if(scontext->current) break; /* else get a new one */ /* 0 is end, <0 is error. Either way stop */ if(librdf_parser_raptor_get_next_statement(scontext) <=0) break; } return (scontext->current == NULL); } /** * librdf_parser_raptor_serialise_get_statement: * @context: the context passed in by #librdf_stream * @flags: the context get method flags * * Get the current librdf_statement from the stream of statements from the raptor RDF parse. * * Return value: a new #librdf_statement or NULL on error or if no statements found. **/ static void* librdf_parser_raptor_serialise_get_statement(void* context, int flags) { librdf_parser_raptor_stream_context* scontext=(librdf_parser_raptor_stream_context*)context; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return scontext->current; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return NULL; default: librdf_log(scontext->pcontext->parser->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Unknown iterator method flag %d", flags); return NULL; } } /** * librdf_parser_raptor_serialise_finished: * @context: the context passed in by #librdf_stream * * Finish the serialisation of the statement stream from the raptor RDF parse. * **/ static void librdf_parser_raptor_serialise_finished(void* context) { librdf_parser_raptor_stream_context* scontext=(librdf_parser_raptor_stream_context*)context; if(scontext) { librdf_statement* statement; librdf_world* world = scontext->pcontext->parser ? scontext->pcontext->parser->world : NULL; if(scontext->current) librdf_free_statement(scontext->current); if(scontext->statements) { while((statement=(librdf_statement*)librdf_list_pop(scontext->statements))) librdf_free_statement(statement); librdf_free_list(scontext->statements); } if(scontext->fh && scontext->close_fh) fclose(scontext->fh); if(scontext->pcontext) scontext->pcontext->stream_context = NULL; librdf_raptor_reset_bnode_hash(world); LIBRDF_FREE(librdf_parser_raptor_context, scontext); } } static librdf_node* librdf_parser_raptor_get_feature(void* context, librdf_uri *feature) { librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)context; unsigned char intbuffer[20]; /* FIXME */ unsigned char *uri_string; if(!feature) return NULL; uri_string=librdf_uri_as_string(feature); if(!uri_string) return NULL; if(!strcmp((const char*)uri_string, LIBRDF_PARSER_FEATURE_ERROR_COUNT)) { sprintf((char*)intbuffer, "%d", pcontext->errors); return librdf_new_node_from_typed_literal(pcontext->parser->world, intbuffer, NULL, NULL); } else if(!strcmp((const char*)uri_string, LIBRDF_PARSER_FEATURE_WARNING_COUNT)) { sprintf((char*)intbuffer, "%d", pcontext->warnings); return librdf_new_node_from_typed_literal(pcontext->parser->world, intbuffer, NULL, NULL); } else { /* raptor2: try a raptor option */ raptor_option feature_i; feature_i = raptor_world_get_option_from_uri(pcontext->parser->world->raptor_world_ptr, (raptor_uri*)feature); if((int)feature_i >= 0) { int value; raptor_parser_get_option(pcontext->rdf_parser, feature_i, NULL, &value); sprintf((char*)intbuffer, "%d", value); return librdf_new_node_from_typed_literal(pcontext->parser->world, intbuffer, NULL, NULL); } } return NULL; } static int librdf_parser_raptor_set_feature(void* context, librdf_uri *feature, librdf_node *value) { librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)context; raptor_option feature_i; const unsigned char* value_s; if(!feature) return 1; /* try a raptor feature */ feature_i = raptor_world_get_option_from_uri(pcontext->parser->world->raptor_world_ptr, (raptor_uri*)feature); if((int)feature_i < 0) return 1; if(!librdf_node_is_literal(value)) return 1; value_s=(const unsigned char*)librdf_node_get_literal_value(value); return raptor_parser_set_option(pcontext->rdf_parser, feature_i, (const char *)value_s, 0); } static char* librdf_parser_raptor_get_accept_header(void* context) { librdf_parser_raptor_context* pcontext = (librdf_parser_raptor_context*)context; const char* accept; char* r_accept; size_t length; accept = raptor_parser_get_accept_header(pcontext->rdf_parser); if(!accept) return NULL; length = strlen(accept); r_accept = (char *)librdf_alloc_memory(length + 1); strncpy(r_accept, accept, length+1); raptor_free_memory((void*)accept); return r_accept; } static const char* librdf_parser_raptor_get_namespaces_seen_prefix(void* context, int offset) { librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)context; if(!pcontext->nspace_prefixes) return NULL; if(offset < 0 || offset > raptor_sequence_size(pcontext->nspace_prefixes)) return NULL; return (const char*)raptor_sequence_get_at(pcontext->nspace_prefixes, offset); } static librdf_uri* librdf_parser_raptor_get_namespaces_seen_uri(void* context, int offset) { librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)context; if(!pcontext->nspace_uris) return NULL; if(offset < 0 || offset > raptor_sequence_size(pcontext->nspace_uris)) return NULL; return (librdf_uri*)raptor_sequence_get_at(pcontext->nspace_uris, offset); } static int librdf_parser_raptor_get_namespaces_seen_count(void* context) { librdf_parser_raptor_context* pcontext=(librdf_parser_raptor_context*)context; if(!pcontext->nspace_uris) return 0; return raptor_sequence_size(pcontext->nspace_uris); } /** * librdf_parser_raptor_register_factory: * @factory: factory * * Register the raptor RDF parser with the RDF parser factory. * **/ static void librdf_parser_raptor_register_factory(librdf_parser_factory *factory) { factory->context_length = sizeof(librdf_parser_raptor_context); factory->init = librdf_parser_raptor_init; factory->terminate = librdf_parser_raptor_terminate; factory->parse_uri_as_stream = librdf_parser_raptor_parse_uri_as_stream; factory->parse_uri_into_model = librdf_parser_raptor_parse_uri_into_model; factory->parse_string_as_stream = librdf_parser_raptor_parse_string_as_stream; factory->parse_string_into_model = librdf_parser_raptor_parse_string_into_model; factory->parse_counted_string_as_stream = librdf_parser_raptor_parse_counted_string_as_stream; factory->parse_counted_string_into_model = librdf_parser_raptor_parse_counted_string_into_model; factory->parse_iostream_as_stream = librdf_parser_raptor_parse_iostream_as_stream; factory->parse_iostream_into_model = librdf_parser_raptor_parse_iostream_into_model; factory->parse_file_handle_as_stream = librdf_parser_raptor_parse_file_handle_as_stream; factory->parse_file_handle_into_model = librdf_parser_raptor_parse_file_handle_into_model; factory->get_feature = librdf_parser_raptor_get_feature; factory->set_feature = librdf_parser_raptor_set_feature; factory->get_accept_header = librdf_parser_raptor_get_accept_header; factory->get_namespaces_seen_prefix = librdf_parser_raptor_get_namespaces_seen_prefix; factory->get_namespaces_seen_uri = librdf_parser_raptor_get_namespaces_seen_uri; factory->get_namespaces_seen_count = librdf_parser_raptor_get_namespaces_seen_count; } /** * librdf_parser_raptor_constructor: * @world: redland world object * * Initialise the raptor RDF parser module. * **/ void librdf_parser_raptor_constructor(librdf_world *world) { unsigned int i; /* enumerate from parser 1, so the default parser 0 is done last */ for(i = 1; 1; i++) { const char *syntax_name = NULL; const char *syntax_label = NULL; const char *mime_type = NULL; const unsigned char *uri_string = NULL; const raptor_syntax_description *desc; desc = raptor_world_get_parser_description(world->raptor_world_ptr, i); if(!desc) { /* reached the end of the parsers, now register the default one */ i = 0; desc = raptor_world_get_parser_description(world->raptor_world_ptr, i); if(!desc) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Failed to find any Raptor parsers - Raptor may not be initialised correctly"); break; } } syntax_name = desc->names[0]; syntax_label = desc->label; if(desc->mime_types) mime_type = desc->mime_types[0].mime_type; if(desc->uri_strings) uri_string = (const unsigned char *)desc->uri_strings[0]; if(!strcmp(syntax_name, "rdfxml")) { /* legacy name - see librdf_parser_raptor_init */ librdf_parser_register_factory(world, "raptor", NULL, mime_type, uri_string, &librdf_parser_raptor_register_factory); } librdf_parser_register_factory(world, syntax_name, syntax_label, mime_type, uri_string, &librdf_parser_raptor_register_factory); if(!i) /* registered default parser, end */ break; } } /** * librdf_parser_raptor_destructor: * @world: redland world object * * Terminate the raptor RDF parser module. * **/ void librdf_parser_raptor_destructor(void) { } redland-1.0.17/src/rdf_storage.c0000644000175000017500000016060412241001460013361 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage.c - RDF Storage (Triple store) interface * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef MODULAR_LIBRDF #include #endif #include #include #ifndef STANDALONE /* prototypes for functions implementing get_sources, arcs, targets * librdf_iterator via conversion from a librdf_stream of librdf_statement */ static int librdf_storage_stream_to_node_iterator_is_end(void* iterator); static int librdf_storage_stream_to_node_iterator_next_method(void* iterator); static void* librdf_storage_stream_to_node_iterator_get_method(void* iterator, int flags); static void librdf_storage_stream_to_node_iterator_finished(void* iterator); /* helper function for creating iterators for get sources, targets, arcs */ static librdf_iterator* librdf_storage_node_stream_to_node_create(librdf_storage* storage, librdf_node* node1, librdf_node *node2, librdf_statement_part want); /* helper functions for dynamically loading storage modules */ #ifdef MODULAR_LIBRDF void librdf_storage_load_all_modules(librdf_world *world); static lt_dlhandle librdf_storage_load_module(librdf_world *world, const char* lib_name, const char* init_func_name); #endif /** * librdf_init_storage: * @world: redland world object * * INTERNAL - Initialise the storage module. * * Initialises and registers all * compiled storage modules. Must be called before using any of the storage * factory functions such as librdf_get_storage_factory() **/ void librdf_init_storage(librdf_world *world) { /* built-in storages */ #ifdef STORAGE_HASHES librdf_init_storage_hashes(world); #endif #ifdef STORAGE_TREES librdf_init_storage_trees(world); #endif #ifdef STORAGE_MEMORY librdf_init_storage_list(world); #endif #ifdef STORAGE_FILE librdf_init_storage_file(world); #endif #ifdef MODULAR_LIBRDF if (!world->storage_modules) world->storage_modules = raptor_new_sequence( (raptor_data_free_handler)lt_dlclose, NULL); librdf_storage_load_all_modules(world); #else /* monolithic */ #ifdef STORAGE_MYSQL librdf_init_storage_mysql(world); #endif #ifdef STORAGE_VIRTUOSO librdf_init_storage_virtuoso(world); #endif #ifdef STORAGE_POSTGRESQL librdf_init_storage_postgresql(world); #endif #ifdef STORAGE_TSTORE librdf_init_storage_tstore(world); #endif #ifdef STORAGE_SQLITE librdf_init_storage_sqlite(world); #endif #endif } /** * librdf_finish_storage: * @world: redland world object * * INTERNAL - Terminate the storage module. * **/ void librdf_finish_storage(librdf_world *world) { if(world->storages) { raptor_free_sequence(world->storages); world->storages=NULL; } #ifdef MODULAR_LIBRDF if(world->storage_modules) { raptor_free_sequence(world->storage_modules); world->storage_modules=NULL; } #endif } /* helper functions */ static void librdf_free_storage_factory(librdf_storage_factory* factory) { if(factory->name) LIBRDF_FREE(librdf_storage_factory, factory->name); if(factory->label) LIBRDF_FREE(librdf_storage_factory, factory->label); LIBRDF_FREE(librdf_storage_factory, factory); } #ifdef MODULAR_LIBRDF static int ltdl_module_callback(const char* filename, void* data) { librdf_world* world = (librdf_world*)data; const char* name = librdf_basename(filename); size_t name_len = strlen(name); lt_dlhandle module; /* Currently require that storage module files to be loaded start * with the string "librdf_storage_". */ if(name_len < 15 || strncmp(name, "librdf_storage_", 15)) { #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 LIBRDF_DEBUG3("not storage module file %s (%s)\n", name, filename); #endif return 0; } /* * When compiling and testing against uninstalled modules, not all * files in .libs that contain librdf_storage are storage modules. * (Relevant when running "make check" locally before installing * the modules.) * * This check when debugging LIBRDF_DEBUG attempts to load .so * files when running in the source tree. This is likely very * libtool and unix specific. * * Rules: * - Must end in '.so' or have no suffix (no . in last 3 chars) * - Must not include "-" (libtool intermediate file such as * librdf_storage_mysql_la-rdf_storage_mysql) */ #ifdef LIBRDF_DEBUG if(!( strncmp(&name[name_len-3], ".so", 3) || (name[name_len-3]!='.' && name[name_len-2]!='.' && name[name_len-1]!='.') ) || strchr(name, '-') ) { #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 LIBRDF_DEBUG3("not storage module file %s (%s)\n", name, filename); #endif return 0; } #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("LOADING storage module file %s (%s)\n", name, filename); #endif #endif module = librdf_storage_load_module(world, filename, "librdf_storage_module_register_factory"); if(module) raptor_sequence_push(world->storage_modules, module); return 0; } /** * librdf_storage_load_all_modules: * @world: redland world object * * INTERNAL - Load and initialize/register all installed storage modules **/ void librdf_storage_load_all_modules(librdf_world *world) { char const *path; /* Figure out a path to load modules from */ /* Try environment variable first - required e.g. for local "make check" tests before install */ path = getenv("REDLAND_MODULE_PATH"); /* If path defined in env but empty, use libtool default paths (e.g. DYLD_LIBRARY_PATH) */ if (path && !*path) path = NULL; /* If path not defined in env, use libtool user-specified paths (install dir) */ else if (!path) path = lt_dlgetsearchpath(); lt_dlforeachfile(path, ltdl_module_callback, world); } /** * librdf_storage_load_module: * @world: redland world object * @lib_name: base name of shared library file * @init_func_name: name of initialization function in library * * INTERNAL - Load and initialize/register a storage module **/ static lt_dlhandle librdf_storage_load_module(librdf_world *world, const char* lib_name, const char* init_func_name) { typedef void init_func_t(librdf_world*); init_func_t* init; lt_dlhandle module = lt_dlopenext(lib_name); if(module) { const lt_dlinfo* info = lt_dlgetinfo(module); if(info->ref_count > 1) { /* Already loaded so ignore */ lt_dlclose(module); module = NULL; return module; } init = (init_func_t*)lt_dlsym(module, init_func_name); if(init) { init(world); } else { LIBRDF_DEBUG2("Failed to initialize storage module %s\n", lib_name); lt_dlclose(module); module = NULL; } } else { LIBRDF_DEBUG2("Failed to load storage module %s\n", lib_name); } return module; } #endif /* class methods */ /** * librdf_storage_register_factory: * @world: redland world object * @name: the storage factory name * @label: the storage factory label * @factory: pointer to function to call to register the factory * * Register a storage factory. * * Registration will fail if any of the parameters or NULL, if the factory * API version is out of the known range or if out of memory. * * Return value: non-0 on failure **/ REDLAND_EXTERN_C int librdf_storage_register_factory(librdf_world* world, const char *name, const char *label, void (*factory) (librdf_storage_factory*)) { librdf_storage_factory *storage; int i; if(!world) return 1; if(!name || !label || !factory){ librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "failed to register storage with missing parameters to librdf_storage_register_factory()"); return 1; } librdf_world_open(world); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG2("Received registration for storage %s\n", name); #endif if(!world->storages) { world->storages = raptor_new_sequence((raptor_data_free_handler)librdf_free_storage_factory, NULL); if(!world->storages) goto failed; } for(i=0; (storage=(librdf_storage_factory*)raptor_sequence_get_at(world->storages, i)); i++) { if(!strcmp(storage->name, name)) { #if 1 /* Choosing to ignore this error since it probably is caused by * scanning a directory of storage modules and finding a .la * file (libtool) as well as the .so (module) and trying to * load the same module twice. * * See bug http://bugs.librdf.org/mantis/view.php?id=460 for * context */ return 0; #else librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "storage %s already registered", storage->name); return 1; #endif } } storage = LIBRDF_CALLOC(librdf_storage_factory*, 1, sizeof(*storage)); if(!storage) goto failed; storage->name = LIBRDF_MALLOC(char*, strlen(name) + 1); if(!storage->name) goto tidy; strcpy(storage->name, name); storage->label = LIBRDF_MALLOC(char*, strlen(label) + 1); if(!storage->label) goto tidy; strcpy(storage->label, label); /* Call the storage registration function on the new object */ (*factory)(storage); if(storage->version < LIBRDF_STORAGE_MIN_INTERFACE_VERSION || storage->version > LIBRDF_STORAGE_MAX_INTERFACE_VERSION) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "storage %s interface version %d is not in supported range %d-%d", name, storage->version, LIBRDF_STORAGE_MIN_INTERFACE_VERSION, LIBRDF_STORAGE_MAX_INTERFACE_VERSION); goto tidy; } if(raptor_sequence_push(world->storages, storage)) goto failed; return 0; tidy: librdf_free_storage_factory(storage); failed: LIBRDF_FATAL1(world, LIBRDF_FROM_STORAGE, "Registering storage failed"); return 1; } /** * librdf_get_storage_factory: * @world: redland world object * @name: the factory name or NULL for the default factory * * Get a storage factory by name. * * Return value: the factory object or NULL if there is no such factory **/ librdf_storage_factory* librdf_get_storage_factory(librdf_world* world, const char *name) { int i; librdf_storage_factory *factory; librdf_world_open(world); /* use "memory" if nothing is specified (FIXME: probably not the best choice) */ if (!name) name = "memory"; /* search for factory */ for(i=0; (factory=(librdf_storage_factory*)raptor_sequence_get_at(world->storages, i)); i++) { if(!strcmp(factory->name, name)) break; } if(!factory) { LIBRDF_DEBUG2("No storage with name %s found\n", name); return NULL; } return factory; } /** * librdf_storage_enumerate: * @world: redland world object * @counter: index into the list of storages * @name: pointer to store the name of the storage (or NULL) * @label: pointer to store syntax readable label (or NULL) * * Get information on storages. * * Return value: non 0 on failure of if counter is out of range **/ int librdf_storage_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label) { librdf_storage_factory *factory; int ioffset = LIBRDF_GOOD_CAST(int, counter); librdf_world_open(world); factory = (librdf_storage_factory*)raptor_sequence_get_at(world->storages, ioffset); if(!factory) return 1; if(name) *name = factory->name; if(label) *label = factory->label; return 0; } /** * librdf_new_storage: * @world: redland world object * @storage_name: the storage factory name * @name: an identifier for the storage * @options_string: options to initialise storage * * Constructor - create a new #librdf_storage object. * * The options are encoded as described in librdf_hash_from_string() * and can be NULL if none are required. * * Return value: a new #librdf_storage object or NULL on failure * */ librdf_storage* librdf_new_storage(librdf_world *world, const char *storage_name, const char *name, const char *options_string) { librdf_storage_factory* factory; librdf_hash* options_hash; librdf_world_open(world); factory = librdf_get_storage_factory(world, storage_name); if(!factory) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "storage '%s' not found", storage_name); return NULL; } options_hash=librdf_new_hash(world, NULL); if(!options_hash) return NULL; if(librdf_hash_open(options_hash, NULL, 0, 1, 1, NULL)) { librdf_free_hash(options_hash); return NULL; } if(librdf_hash_from_string(options_hash, options_string)) { librdf_free_hash(options_hash); return NULL; } return librdf_new_storage_from_factory(world, factory, name, options_hash); } /** * librdf_new_storage_with_options: * @world: redland world object * @storage_name: the storage factory name * @name: an identifier for the storage * @options: #librdf_hash of options to use * * Constructor - create a new #librdf_storage object. * * The options can be NULL if none are required. * * Return value: a new #librdf_storage object or NULL on failure * */ librdf_storage* librdf_new_storage_with_options(librdf_world *world, const char *storage_name, const char *name, librdf_hash *options) { librdf_storage_factory* factory; librdf_hash* options_hash; librdf_world_open(world); factory = librdf_get_storage_factory(world, storage_name); if(!factory) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "storage '%s' not found", name); return NULL; } options_hash=librdf_new_hash_from_hash(options); if(!options_hash) return NULL; if(librdf_hash_open(options_hash, NULL, 0, 1, 1, NULL)) { librdf_free_hash(options_hash); return NULL; } return librdf_new_storage_from_factory(world, factory, name, options_hash); } /** * librdf_new_storage_from_storage: * @old_storage: the existing storage #librdf_storage to use * * Copy constructor - create a new librdf_storage object from an existing one * * Should create a new storage in the same context as the existing one * as appropriate for the storage. For example, in a RDBMS storage * it would be a new database, or in on disk it would be a new * set of files. This will mean automatically generating * a new identifier for the storage, maybe based on the existing * storage identifier. * * Return value: a new #librdf_storage object or NULL on failure * */ librdf_storage* librdf_new_storage_from_storage(librdf_storage* old_storage) { librdf_storage* new_storage; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(old_storage, librdf_storage, NULL); if(!old_storage->factory->clone) { librdf_log(old_storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "clone method not implemented for storage factory %s", old_storage->factory->name); return NULL; } new_storage = LIBRDF_CALLOC(librdf_storage*, 1, sizeof(*new_storage)); if(!new_storage) return NULL; /* set usage to 1 early to allow cleanup with librdf_free_storage() */ new_storage->usage=1; new_storage->instance=NULL; new_storage->world=old_storage->world; /* do this now so librdf_free_storage won't call new factory on * partially copied storage */ new_storage->factory=old_storage->factory; /* clone is assumed to do leave the new storage in the same state * after an init() method on an existing storage - i.e ready to * use but closed. */ if(old_storage->factory->clone(new_storage, old_storage)) { librdf_free_storage(new_storage); return NULL; } return new_storage; } /** * librdf_new_storage_from_factory: * @world: redland world object * @factory: the factory to use to construct the storage * @name: name to use for storage * @options: #librdf_hash of options to initialise storage * * Constructor - create a new #librdf_storage object. * * If the options are present, they become owned by the storage * and should no longer be used. * * Return value: a new #librdf_storage object or NULL on failure * */ librdf_storage* librdf_new_storage_from_factory(librdf_world *world, librdf_storage_factory* factory, const char *name, librdf_hash* options) { librdf_storage* storage; librdf_world_open(world); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(factory, librdf_storage_factory, NULL); if(!factory) { librdf_free_hash(options); return NULL; } storage = LIBRDF_CALLOC(librdf_storage*, 1, sizeof(*storage)); if(!storage) { librdf_free_hash(options); return NULL; } storage->world=world; /* set usage to 1 early to allow cleanup with librdf_free_storage() */ storage->usage=1; storage->instance=NULL; storage->factory=factory; if(factory->init(storage, name, options)) { librdf_free_storage(storage); return NULL; } return storage; } /** * librdf_free_storage: * @storage: #librdf_storage object * * Destructor - destroy a #librdf_storage object. **/ void librdf_free_storage(librdf_storage* storage) { if(!storage) return; if(--storage->usage) return; if(storage->factory) storage->factory->terminate(storage); LIBRDF_FREE(librdf_storage, storage); } /** * librdf_storage_add_reference: * @storage: #librdf_storage object * * Increment storage reference count by one. * * This function is intended to be internal to librdf storage modules. **/ void librdf_storage_add_reference(librdf_storage *storage) { storage->usage++; } /** * librdf_storage_remove_reference: * @storage: #librdf_storage object * * Decrement storage reference count by one and free the storage if reference count becomes zero. * * This function is intended to be internal to librdf storage modules. **/ void librdf_storage_remove_reference(librdf_storage *storage) { librdf_free_storage(storage); } /** * librdf_storage_set_instance: * @storage: #librdf_storage object * @instance: Opaque instance pointer * * Set the instance data for this storage. * * This function is intended for use by the 'init' method of storage * implementations to set instance data which can be retrived with * librdf_storage_get_instance() and used in other methods of that * storage. * * The instance is completely opaque to librdf, including allocation * and deallocation. **/ void librdf_storage_set_instance(librdf_storage *storage, librdf_storage_instance instance) { storage->instance = instance; } /** * librdf_storage_get_instance: * @storage: #librdf_storage object * * Get instance data for this storage * * Return value: opaque instance data for this storage **/ librdf_storage_instance librdf_storage_get_instance(librdf_storage *storage) { return storage->instance; } /** * librdf_storage_get_world: * @storage: #librdf_storage object * * Get the #librdf_world object associated with this storage. * * Return value: world object for this storage **/ librdf_world* librdf_storage_get_world(librdf_storage *storage) { return storage->world; } /* methods */ /** * librdf_storage_open: * @storage: #librdf_storage object * @model: model stored * * Start a model / storage association. * * This is ended with librdf_storage_close() * * Return value: non 0 on failure **/ int librdf_storage_open(librdf_storage* storage, librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); return storage->factory->open(storage, model); } /** * librdf_storage_close: * @storage: #librdf_storage object * * End a model / storage association. * * Return value: non 0 on failure **/ int librdf_storage_close(librdf_storage* storage) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); return storage->factory->close(storage); } /** * librdf_storage_size: * @storage: #librdf_storage object * * Get the number of statements stored. * * Return value: The number of statements or < 0 if cannot be determined **/ int librdf_storage_size(librdf_storage* storage) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, -1); return storage->factory->size(storage); } /** * librdf_storage_add_statement: * @storage: #librdf_storage object * @statement: #librdf_statement statement to add * * Add a statement to a storage. * * The passed-in statement is copied when added to the store, not * shared with the store. * * If the statement already exists in the store, it is not added * unless Redland contexts are being used. * * Enforces that the statement is legal for RDF - URI or blank subject, * URI predicate and URI or blank or literal object (i.e. anything). * * Return value: non 0 on failure, <0 on error, >0 if statement was illegal **/ int librdf_storage_add_statement(librdf_storage* storage, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); /* subject can be a URI or blank node */ if(!librdf_node_is_resource(statement->subject) && !librdf_node_is_blank(statement->subject)) return 1; /* predicate can only be a URI */ if(!librdf_node_is_resource(statement->predicate)) return 1; /* object can be any node - no check needed */ if(storage->factory->add_statement) return storage->factory->add_statement(storage, statement); return -1; } /** * librdf_storage_add_statements: * @storage: #librdf_storage object * @statement_stream: #librdf_stream of statements * * Add a stream of statements to the storage. * * If any of the statements already exists in the store, they are not * added unless Redland contexts are being used. * * Return value: non 0 on failure **/ int librdf_storage_add_statements(librdf_storage* storage, librdf_stream* statement_stream) { int status=0; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement_stream, librdf_stream, 1); if(storage->factory->add_statements) return storage->factory->add_statements(storage, statement_stream); while(!librdf_stream_end(statement_stream)) { librdf_statement* statement=librdf_stream_get_object(statement_stream); if(statement) { status=librdf_storage_add_statement(storage, statement); if(status > 0) /* just skip illegal statements */ status=0; } else status=1; if(status) break; librdf_stream_next(statement_stream); } return status; } /** * librdf_storage_remove_statement: * @storage: #librdf_storage object * @statement: #librdf_statement statement to remove * * Remove a statement from the storage. * * Return value: non 0 on failure **/ int librdf_storage_remove_statement(librdf_storage* storage, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if(storage->factory->remove_statement) return storage->factory->remove_statement(storage, statement); return 1; } /** * librdf_storage_contains_statement: * @storage: #librdf_storage object * @statement: #librdf_statement statement to check * * Test if a given statement is present in the storage. * * Return value: non 0 if the storage contains the statement (>0 if illegal statement) **/ int librdf_storage_contains_statement(librdf_storage* storage, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if(!librdf_statement_is_complete(statement)) return 1; return storage->factory->contains_statement(storage, statement) ? -1 : 0; } /** * librdf_storage_serialise: * @storage: #librdf_storage object * * Serialise the storage as a librdf_stream of statemetns. * * Return value: #librdf_stream of statements or NULL on failure **/ librdf_stream* librdf_storage_serialise(librdf_storage* storage) { return storage->factory->serialise(storage); } /** * librdf_storage_find_statements: * @storage: #librdf_storage object * @statement: #librdf_statement partial statement to find * * Search the storage for matching statements. * * Searches the storage for a (partial) statement as described in * librdf_statement_match() and returns a #librdf_stream of * matching #librdf_statement objects. * * Return value: #librdf_stream of matching statements (may be empty) or NULL on failure **/ librdf_stream* librdf_storage_find_statements(librdf_storage* storage, librdf_statement* statement) { librdf_node *subject, *predicate, *object; librdf_iterator *iterator; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); subject=librdf_statement_get_subject(statement); predicate=librdf_statement_get_predicate(statement); object=librdf_statement_get_object(statement); /* try to pick the most efficient storage back end */ /* only subject/source field blank -> use find_sources */ if(storage->factory->find_sources && !subject && predicate && object) { iterator=storage->factory->find_sources(storage, predicate, object); if(iterator) return librdf_new_stream_from_node_iterator(iterator, statement, LIBRDF_STATEMENT_SUBJECT); return NULL; } /* only predicate/arc field blank -> use find_arcs */ if(storage->factory->find_arcs && subject && !predicate && object) { iterator=storage->factory->find_arcs(storage, subject, object); if(iterator) return librdf_new_stream_from_node_iterator(iterator, statement, LIBRDF_STATEMENT_PREDICATE); return NULL; } /* only object/target field blank -> use find_targets */ if(storage->factory->find_targets && subject && predicate && !object) { iterator=storage->factory->find_targets(storage, subject, predicate); if(iterator) return librdf_new_stream_from_node_iterator(iterator, statement, LIBRDF_STATEMENT_OBJECT); return NULL; } return storage->factory->find_statements(storage, statement); } typedef struct { librdf_storage *storage; librdf_stream *stream; librdf_statement *partial_statement; librdf_statement_part want; librdf_node *object_node; librdf_node *context_node; } librdf_storage_stream_to_node_iterator_context; static int librdf_storage_stream_to_node_iterator_is_end(void* iterator) { librdf_storage_stream_to_node_iterator_context* context=(librdf_storage_stream_to_node_iterator_context*)iterator; return librdf_stream_end(context->stream); } static int librdf_storage_stream_to_node_iterator_next_method(void* iterator) { librdf_storage_stream_to_node_iterator_context* context=(librdf_storage_stream_to_node_iterator_context*)iterator; if(context->object_node) { librdf_free_node(context->object_node); context->object_node=NULL; } if(context->context_node) { librdf_free_node(context->context_node); context->context_node=NULL; } return librdf_stream_next(context->stream); } static void* librdf_storage_stream_to_node_iterator_get_method(void* iterator, int flags) { librdf_storage_stream_to_node_iterator_context* context=(librdf_storage_stream_to_node_iterator_context*)iterator; librdf_node* node; librdf_statement* statement=librdf_stream_get_object(context->stream); if(!statement) return NULL; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: if(!context->object_node) { switch(context->want) { case LIBRDF_STATEMENT_SUBJECT: /* SOURCES (subjects) */ node=librdf_statement_get_subject(statement); break; case LIBRDF_STATEMENT_PREDICATE: /* ARCS (predicates) */ node=librdf_statement_get_predicate(statement); break; case LIBRDF_STATEMENT_OBJECT: /* TARGETS (objects) */ node=librdf_statement_get_object(statement); break; case LIBRDF_STATEMENT_ALL: default: /* error */ librdf_log(context->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown statement part %d", context->want); node=NULL; } context->object_node=librdf_new_node_from_node(node); } node=context->object_node; break; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: if(!context->context_node) { node = librdf_stream_get_context2(context->stream); context->context_node=node ? librdf_new_node_from_node(node) : NULL; } node=context->context_node; break; default: librdf_log(context->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); node=NULL; } return (void*)node; } static void librdf_storage_stream_to_node_iterator_finished(void* iterator) { librdf_storage_stream_to_node_iterator_context* context=(librdf_storage_stream_to_node_iterator_context*)iterator; librdf_statement *partial_statement=context->partial_statement; if(partial_statement) librdf_free_statement(partial_statement); if(context->stream) librdf_free_stream(context->stream); if(context->storage) librdf_storage_remove_reference(context->storage); if(context->object_node) librdf_free_node(context->object_node); if(context->context_node) librdf_free_node(context->context_node); LIBRDF_FREE(librdf_storage_stream_to_node_iterator_context, context); } /* * librdf_storage_node_stream_to_node_create: * @storage: the storage object to use * @node1: the first node to encode in the key (or NULL if not needed) * @node2: the second node to encode in the key (or NULL if not needed) * @want: the field required from the statement * * INTERNAL - Create a stream for get sources, targets or arcs methods using find_statements method * * node1 and node2 cannot both be NULL * * Return value: a new #librdf_iterator or NULL on failure **/ static librdf_iterator* librdf_storage_node_stream_to_node_create(librdf_storage* storage, librdf_node *node1, librdf_node *node2, librdf_statement_part want) { librdf_statement *partial_statement; librdf_stream *stream; librdf_storage_stream_to_node_iterator_context* context; librdf_iterator* iterator; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); LIBRDF_ASSERT_RETURN(node1 == NULL && node2 == NULL, "both node objects are NULL", NULL); partial_statement=librdf_new_statement(storage->world); if(!partial_statement) return NULL; context = LIBRDF_CALLOC(librdf_storage_stream_to_node_iterator_context*, 1, sizeof(*context)); if(!context) { librdf_free_statement(partial_statement); return NULL; } if(node1) node1=librdf_new_node_from_node(node1); if(node2) node2=librdf_new_node_from_node(node2); switch(want) { case LIBRDF_STATEMENT_SUBJECT: librdf_statement_set_predicate(partial_statement, node1); librdf_statement_set_object(partial_statement, node2); break; case LIBRDF_STATEMENT_PREDICATE: librdf_statement_set_subject(partial_statement, node1); librdf_statement_set_object(partial_statement, node2); break; case LIBRDF_STATEMENT_OBJECT: librdf_statement_set_subject(partial_statement, node1); librdf_statement_set_predicate(partial_statement, node2); break; case LIBRDF_STATEMENT_ALL: default: librdf_free_node(node1); librdf_free_node(node2); librdf_free_statement(partial_statement); librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Illegal statement part %d seen", want); return NULL; } stream=storage->factory->find_statements(storage, partial_statement); if(!stream) { librdf_storage_stream_to_node_iterator_finished(context); return librdf_new_empty_iterator(storage->world); } /* initialise context */ context->partial_statement=partial_statement; context->stream=stream; context->want=want; context->storage=storage; librdf_storage_add_reference(context->storage); iterator=librdf_new_iterator(storage->world, (void*)context, librdf_storage_stream_to_node_iterator_is_end, librdf_storage_stream_to_node_iterator_next_method, librdf_storage_stream_to_node_iterator_get_method, librdf_storage_stream_to_node_iterator_finished); if(!iterator) librdf_storage_stream_to_node_iterator_finished(context); return iterator; } /** * librdf_storage_get_sources: * @storage: #librdf_storage object * @arc: #librdf_node arc * @target: #librdf_node target * * Return the sources (subjects) of arc in an RDF graph given arc (predicate) and target (object). * * Searches the storage for arcs matching the given arc and target * and returns a list of the source #librdf_node objects as an iterator * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ librdf_iterator* librdf_storage_get_sources(librdf_storage *storage, librdf_node *arc, librdf_node *target) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(arc, librdf_node, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(target, librdf_node, NULL); if (storage->factory->find_sources) return storage->factory->find_sources(storage, arc, target); return librdf_storage_node_stream_to_node_create(storage, arc, target, LIBRDF_STATEMENT_SUBJECT); } /** * librdf_storage_get_arcs: * @storage: #librdf_storage object * @source: #librdf_node source * @target: #librdf_node target * * Return the arcs (predicates) of an arc in an RDF graph given source (subject) and target (object). * * Searches the storage for arcs matching the given source and target * and returns a list of the arc #librdf_node objects as an iterator * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ librdf_iterator* librdf_storage_get_arcs(librdf_storage *storage, librdf_node *source, librdf_node *target) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(source, librdf_node, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(target, librdf_node, NULL); if (storage->factory->find_arcs) return storage->factory->find_arcs(storage, source, target); return librdf_storage_node_stream_to_node_create(storage, source, target, LIBRDF_STATEMENT_PREDICATE); } /** * librdf_storage_get_targets: * @storage: #librdf_storage object * @source: #librdf_node source * @arc: #librdf_node arc * * Return the targets (objects) of an arc in an RDF graph given source (subject) and arc (predicate). * * Searches the storage for targets matching the given source and arc * and returns a list of the source #librdf_node objects as an iterator * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ librdf_iterator* librdf_storage_get_targets(librdf_storage *storage, librdf_node *source, librdf_node *arc) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(source, librdf_node, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(arc, librdf_node, NULL); if (storage->factory->find_targets) return storage->factory->find_targets(storage, source, arc); return librdf_storage_node_stream_to_node_create(storage, source, arc, LIBRDF_STATEMENT_OBJECT); } /** * librdf_storage_get_arcs_in: * @storage: #librdf_storage object * @node: #librdf_node resource node * * Return the properties pointing to the given resource. * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ librdf_iterator* librdf_storage_get_arcs_in(librdf_storage *storage, librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); if (storage->factory->get_arcs_in) return storage->factory->get_arcs_in(storage, node); return librdf_storage_node_stream_to_node_create(storage, NULL, node, LIBRDF_STATEMENT_PREDICATE); } /** * librdf_storage_get_arcs_out: * @storage: #librdf_storage object * @node: #librdf_node resource node * * Return the properties pointing from the given resource. * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ librdf_iterator* librdf_storage_get_arcs_out(librdf_storage *storage, librdf_node *node) { if (storage->factory->get_arcs_out) return storage->factory->get_arcs_out(storage, node); return librdf_storage_node_stream_to_node_create(storage, node, NULL, LIBRDF_STATEMENT_PREDICATE); } /** * librdf_storage_has_arc_in: * @storage: #librdf_storage object * @node: #librdf_node resource node * @property: #librdf_node property node * * Check if a node has a given property pointing to it. * * Return value: non 0 if arc property does point to the resource node **/ int librdf_storage_has_arc_in(librdf_storage *storage, librdf_node *node, librdf_node *property) { librdf_iterator *iterator; int status; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(property, librdf_node, 0); if (storage->factory->has_arc_in) return storage->factory->has_arc_in(storage, node, property); iterator=librdf_storage_get_sources(storage, property, node); if(!iterator) return 0; /* a non-empty list of sources is success */ status=!librdf_iterator_end(iterator); librdf_free_iterator(iterator); return status; } /** * librdf_storage_has_arc_out: * @storage: #librdf_storage object * @node: #librdf_node resource node * @property: #librdf_node property node * * Check if a node has a given property pointing from it. * * Return value: non 0 if arc property does point from the resource node **/ int librdf_storage_has_arc_out(librdf_storage *storage, librdf_node *node, librdf_node *property) { librdf_iterator *iterator; int status; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(property, librdf_node, 0); if (storage->factory->has_arc_out) return storage->factory->has_arc_out(storage, node, property); iterator=librdf_storage_get_targets(storage, node, property); if(!iterator) return 0; /* a non-empty list of targets is success */ status=!librdf_iterator_end(iterator); librdf_free_iterator(iterator); return status; } /** * librdf_storage_context_add_statement: * @storage: #librdf_storage object * @context: #librdf_node context node * @statement: #librdf_statement statement to add * * Add a statement to a storage in a context. * * If @context is NULL, this is equivalent to librdf_storage_add_statement * * Return value: non 0 on failure **/ int librdf_storage_context_add_statement(librdf_storage* storage, librdf_node* context, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if(!context) return librdf_storage_add_statement(storage, statement); if(storage->factory->context_add_statement) return storage->factory->context_add_statement(storage, context, statement); return 1; } /** * librdf_storage_context_add_statements: * @storage: #librdf_storage object * @context: #librdf_node context * @stream: #librdf_stream stream object * * Add statements to a storage with a context. * * If @context is NULL, this is equivalent to librdf_storage_add_statements * * Return value: Non 0 on failure **/ int librdf_storage_context_add_statements(librdf_storage* storage, librdf_node* context, librdf_stream* stream) { int status=0; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(stream, librdf_stream, 1); if(!context) return librdf_storage_add_statements(storage, stream); if(storage->factory->context_add_statements) return storage->factory->context_add_statements(storage, context, stream); if(!storage->factory->context_add_statement) return 1; if(!stream) return 1; while(!librdf_stream_end(stream)) { librdf_statement* statement=librdf_stream_get_object(stream); if(!statement) break; status=librdf_storage_context_add_statement(storage, context, statement); if(status) break; librdf_stream_next(stream); } return status; } /** * librdf_storage_context_remove_statement: * @storage: #librdf_storage object * @context: #librdf_node context node * @statement: #librdf_statement statement to remove * * Remove a statement from a storage in a context. * * If @context is NULL, this is equivalent to librdf_storage_remove_statement * * Return value: non 0 on failure **/ int librdf_storage_context_remove_statement(librdf_storage* storage, librdf_node* context, librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if(!storage->factory->context_remove_statement) return 1; return storage->factory->context_remove_statement(storage, context, statement); } /** * librdf_storage_context_remove_statements: * @storage: #librdf_storage object * @context: #librdf_uri context * * Remove statements from a storage with the given context. * * Return value: Non 0 on failure **/ int librdf_storage_context_remove_statements(librdf_storage* storage, librdf_node* context) { librdf_stream *stream; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); if(storage->factory->context_remove_statements) return storage->factory->context_remove_statements(storage, context); if(!storage->factory->context_remove_statement) return 1; stream=librdf_storage_context_as_stream(storage, context); if(!stream) return 1; while(!librdf_stream_end(stream)) { librdf_statement *statement=librdf_stream_get_object(stream); if(!statement) break; librdf_storage_context_remove_statement(storage, context, statement); librdf_stream_next(stream); } librdf_free_stream(stream); return 0; } /** * librdf_storage_context_as_stream: * @storage: #librdf_storage object * @context: #librdf_node context node * * List all statements in a storage context. * * Return value: #librdf_stream of statements or NULL on failure or context is empty **/ librdf_stream* librdf_storage_context_as_stream(librdf_storage* storage, librdf_node* context) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); return storage->factory->context_serialise(storage, context); } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_storage_context_serialise: * @storage: #librdf_storage object * @context: #librdf_node context node * * List all statements in a storage context (DEPRECATED). * * DEPRECATED to reduce confusion with the librdf_serializer class. * Please use librdf_storage_context_as_stream. * * Return value: #librdf_stream of statements or NULL on failure or context is empty **/ librdf_stream* librdf_storage_context_serialise(librdf_storage* storage, librdf_node* context) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); return librdf_storage_context_as_stream(storage, context); } #endif /** * librdf_storage_supports_query: * @storage: #librdf_storage object * @query: #librdf_query query object * * Check if a storage system supports a query language. * * Return value: non-0 if the query is supported. **/ int librdf_storage_supports_query(librdf_storage* storage, librdf_query *query) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query, librdf_query, 0); if(storage->factory->supports_query) return storage->factory->supports_query(storage, query); else return 0; } /** * librdf_storage_query_execute: * @storage: #librdf_storage object * @query: #librdf_query query object * * Run the given query against the storage. * * Return value: #librdf_query_results or NULL on failure **/ librdf_query_results* librdf_storage_query_execute(librdf_storage* storage, librdf_query *query) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query, librdf_query, NULL); if(storage->factory->supports_query) return storage->factory->query_execute(storage, query); else return NULL; } /** * librdf_storage_sync: * @storage: #librdf_storage object * * Synchronise the storage to the storage implementation. * * Return value: non-0 on failure **/ int librdf_storage_sync(librdf_storage* storage) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, 1); if(storage->factory->sync) return storage->factory->sync(storage); return 0; } /** * librdf_storage_find_statements_in_context: * @storage: #librdf_storage object * @statement: #librdf_statement partial statement to find * @context_node: context #librdf_node (or NULL) * * Search the storage for matching statements in a given context. * * Searches the storage for a (partial) statement as described in * librdf_statement_match() in the given context and returns a * #librdf_stream of matching #librdf_statement objects. If * context is NULL, this is equivalent to librdf_storage_find_statements. * * Return value: #librdf_stream of matching statements (may be empty) or NULL on failure **/ librdf_stream* librdf_storage_find_statements_in_context(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node) { librdf_stream *stream; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); if(storage->factory->find_statements_in_context) return storage->factory->find_statements_in_context(storage, statement, context_node); statement=librdf_new_statement_from_statement(statement); if(!statement) return NULL; stream=librdf_storage_context_as_stream(storage, context_node); if(!stream) { librdf_free_statement(statement); return NULL; } librdf_stream_add_map(stream, &librdf_stream_statement_find_map, (librdf_stream_map_free_context_handler)&librdf_free_statement, (void*)statement); return stream; } /** * librdf_storage_get_contexts: * @storage: #librdf_storage object * * Return the list of contexts in the store. * * Returns an iterator of #librdf_node context nodes for each * context in the store. * * Return value: #librdf_iterator of context nodes or NULL on failure or if contexts are not supported **/ librdf_iterator* librdf_storage_get_contexts(librdf_storage* storage) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); if(storage->factory->get_contexts) return storage->factory->get_contexts(storage); else return NULL; } /** * librdf_storage_get_feature: * @storage: #librdf_storage object * @feature: #librdf_uri feature property * * Get the value of a storage feature. * * Return value: new #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ librdf_node* librdf_storage_get_feature(librdf_storage* storage, librdf_uri* feature) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(feature, librdf_uri, NULL); if(storage->factory->get_feature) return storage->factory->get_feature(storage, feature); return NULL; } /** * librdf_storage_set_feature: * @storage: #librdf_storage object * @feature: #librdf_uri feature property * @value: #librdf_node feature property value * * Set the value of a storage feature. * * Return value: non 0 on failure (negative if no such feature) **/ int librdf_storage_set_feature(librdf_storage* storage, librdf_uri* feature, librdf_node* value) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, -1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(feature, librdf_uri, -1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(value, librdf_node, -1); if(storage->factory->set_feature) return storage->factory->set_feature(storage, feature, value); return -1; } /** * librdf_storage_find_statements_with_options: * @storage: #librdf_storage object * @statement: #librdf_statement partial statement to find * @context_node: #librdf_node context node or NULL. * @options: #librdf_hash of matching options or NULL * * Search the storage for matching statements with match options. * * Searches the storage for a (partial) statement as described in * librdf_statement_match() and returns a #librdf_stream of * matching #librdf_statement objects. * * If options is given then the match is made according to * the given options. If options is NULL, this is equivalent * to librdf_storage_find_statements_in_context. * * Return value: #librdf_stream of matching statements (may be empty) or NULL on failure **/ librdf_stream* librdf_storage_find_statements_with_options(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options) { if(storage->factory->find_statements_with_options) return storage->factory->find_statements_with_options(storage, statement, context_node, options); else return librdf_storage_find_statements_in_context(storage, statement, context_node); } /** * librdf_storage_transaction_start: * @storage: the storage object * * Start a transaction * * Return value: non-0 on failure **/ int librdf_storage_transaction_start(librdf_storage* storage) { if(storage->factory->transaction_start) return storage->factory->transaction_start(storage); else return 1; } /** * librdf_storage_transaction_start_with_handle: * @storage: the storage object * @handle: the transaction object * * Start a transaction using an existing external transaction object. * * Return value: non-0 on failure **/ int librdf_storage_transaction_start_with_handle(librdf_storage* storage, void* handle) { if(storage->factory->transaction_start_with_handle) return storage->factory->transaction_start_with_handle(storage, handle); else return 1; } /** * librdf_storage_transaction_commit: * @storage: the storage object * * Commit a transaction. * * Return value: non-0 on failure **/ int librdf_storage_transaction_commit(librdf_storage* storage) { if(storage->factory->transaction_commit) return storage->factory->transaction_commit(storage); else return 1; } /** * librdf_storage_transaction_rollback: * @storage: the storage object * * Rollback a transaction. * * Return value: non-0 on failure **/ int librdf_storage_transaction_rollback(librdf_storage* storage) { if(storage->factory->transaction_rollback) return storage->factory->transaction_rollback(storage); else return 1; } /** * librdf_storage_transaction_get_handle: * @storage: the storage object * * Get the current transaction handle. * * Return value: non-0 on failure **/ void* librdf_storage_transaction_get_handle(librdf_storage* storage) { if(storage->factory->transaction_get_handle) return storage->factory->transaction_get_handle(storage); else return NULL; } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { librdf_storage* storage; const char *program=librdf_basename((const char*)argv[0]); librdf_world *world; /* triples of arguments to librdf_new_storage */ const char* const storages[] = { "memory", NULL, "contexts='yes'", #ifdef HAVE_BDB_HASH "hashes", "test", "hash-type='bdb',dir='.',write='yes',new='yes',contexts='yes'", #else "hashes", "test", "hash-type='memory',write='yes',new='yes',contexts='yes'", #endif #ifdef STORAGE_TREES "trees", "test", "contexts='yes'", #endif #ifdef STORAGE_FILE "file", "file://../redland.rdf", NULL, "uri", "http://librdf.org/redland.rdf", NULL, #endif #ifdef STORAGE_MYSQL "mysql", "test", "host='localhost',database='test'", #endif #ifdef STORAGE_POSTGRESQL "postgresql", "test", "host='localhost',database='test'", #endif #ifdef STORAGE_TSTORE "tstore", "test", "host='localhost',database='test'", #endif #ifdef STORAGE_SQLITE "sqlite", "test", "new='yes'", #endif NULL, NULL, NULL }; int test = 0; int ret = 0; world=librdf_new_world(); librdf_world_open(world); for ( ; storages[test] != NULL; test += 3) { fprintf(stdout, "%s: Creating storage %s\n", program, storages[test]); storage=librdf_new_storage(world, storages[test], /* type */ storages[test+1], /* name */ storages[test+2]); /* options */ if(!storage) { fprintf(stderr, "%s: WARNING: Failed to create new storage %s\n", program, storages[test]); continue; } fprintf(stdout, "%s: Opening storage\n", program); if(librdf_storage_open(storage, NULL)) { fprintf(stderr, "%s: Failed to open storage type %s\n", program, storages[test]); ret++; continue; } /* Can do nothing here since need model and storage working */ fprintf(stdout, "%s: Closing storage\n", program); librdf_storage_close(storage); fprintf(stdout, "%s: Freeing storage\n", program); librdf_free_storage(storage); } librdf_free_world(world); return ret; } #endif redland-1.0.17/src/rdf_parser.c0000644000175000017500000011175511773150065013233 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_parser.c - RDF Parser (syntax to RDF triples) interface * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include #ifndef STANDALONE /** * librdf_init_parser: * @world: redland world object * * INTERNAL - Initialise the parser module. * **/ void librdf_init_parser(librdf_world *world) { librdf_parser_raptor_constructor(world); } /** * librdf_finish_parser: * @world: redland world object * * INTERNAL - Terminate the parser module. * **/ void librdf_finish_parser(librdf_world *world) { if(world->parsers) { raptor_free_sequence(world->parsers); world->parsers=NULL; } librdf_parser_raptor_destructor(); } /* helper functions */ static void librdf_free_parser_factory(librdf_parser_factory *factory) { if(factory->name) LIBRDF_FREE(char*, factory->name); if(factory->label) LIBRDF_FREE(char*, factory->label); if(factory->mime_type) LIBRDF_FREE(char*, factory->mime_type); if(factory->type_uri) librdf_free_uri(factory->type_uri); LIBRDF_FREE(librdf_parser_factory, factory); } /** * librdf_parser_register_factory: * @world: redland world object * @name: the name of the parser * @label: the label of the parser (optional) * @mime_type: MIME type of the syntax (optional) * @uri_string: URI of the syntax (optional) * @factory: function to be called to register the factor parameters * * Register a parser factory . * **/ REDLAND_EXTERN_C void librdf_parser_register_factory(librdf_world *world, const char *name, const char *label, const char *mime_type, const unsigned char *uri_string, void (*factory) (librdf_parser_factory*)) { librdf_parser_factory *parser; librdf_world_open(world); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG2("Received registration for parser %s\n", name); #endif if(!world->parsers) { world->parsers = raptor_new_sequence((raptor_data_free_handler)librdf_free_parser_factory, NULL); if(!world->parsers) goto oom; } parser = LIBRDF_CALLOC(librdf_parser_factory*, 1, sizeof(*parser)); if(!parser) goto oom; parser->name = LIBRDF_MALLOC(char*, strlen(name) + 1); if(!parser->name) goto oom_tidy; strcpy(parser->name, name); if(label) { parser->label = LIBRDF_MALLOC(char*, strlen(label) + 1); if(!parser->label) goto oom_tidy; strcpy(parser->label, label); } /* register mime type if any */ if(mime_type) { parser->mime_type = LIBRDF_MALLOC(char*, strlen(mime_type) + 1); if(!parser->mime_type) goto oom_tidy; strcpy(parser->mime_type, mime_type); } /* register URI if any */ if(uri_string) { parser->type_uri=librdf_new_uri(world, uri_string); if(!parser->type_uri) goto oom_tidy; } if(raptor_sequence_push(world->parsers, parser)) goto oom; /* Call the parser registration function on the new object */ (*factory)(parser); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("%s has context size %d\n", name, parser->context_length); #endif return; oom_tidy: librdf_free_parser_factory(parser); oom: LIBRDF_FATAL1(world, LIBRDF_FROM_PARSER, "Out of memory"); } /** * librdf_get_parser_factory: * @world: redland world object * @name: the name of the factory (or NULL or empty string if don't care) * @mime_type: the MIME type of the syntax (NULL or empty if don't care) * @type_uri: URI of syntax (NULL if not used) * * Get a parser factory by name. * * If all fields are NULL, this means any parser supporting * MIME Type "application/rdf+xml" * * Return value: the factory or NULL if not found **/ librdf_parser_factory* librdf_get_parser_factory(librdf_world *world, const char *name, const char *mime_type, librdf_uri *type_uri) { librdf_parser_factory *factory; librdf_world_open(world); if(name && !*name) name=NULL; if(!mime_type || (mime_type && !*mime_type)) { if(!name && !type_uri) mime_type="application/rdf+xml"; else mime_type=NULL; } /* return 1st parser if no particular one wanted */ if(!name && !mime_type && !type_uri) { factory=(librdf_parser_factory*)raptor_sequence_get_at(world->parsers, 0); if(!factory) { LIBRDF_DEBUG1("No parsers available\n"); return NULL; } } else { int i; for(i=0; (factory=(librdf_parser_factory*)raptor_sequence_get_at(world->parsers, i)); i++) { /* next if name does not match */ if(name && strcmp(factory->name, name)) continue; /* MIME type may need to match */ if(mime_type) { if(!factory->mime_type) continue; if(strcmp(factory->mime_type, mime_type)) continue; } /* URI may need to match */ if(type_uri) { if(!factory->type_uri) continue; if(!librdf_uri_equals(factory->type_uri, type_uri)) continue; } /* found it */ break; } /* else FACTORY with given arguments not found */ if(!factory) return NULL; } return factory; } /** * librdf_parser_enumerate: * @world: redland world object * @counter: index into the list of parsers * @name: pointer to store the name of the parser (or NULL) * @label: pointer to store syntax readable label (or NULL) * * Get information on parsers. * * @Deprecated: use librdf_parser_get_description() to return more information in a static structure. * * Return value: non 0 on failure of if counter is out of range **/ int librdf_parser_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label) { librdf_parser_factory *factory; int ioffset = LIBRDF_GOOD_CAST(int, counter); librdf_world_open(world); factory = (librdf_parser_factory*)raptor_sequence_get_at(world->parsers, ioffset); if(!factory) return 1; if(name) *name = factory->name; if(label) *label = factory->label; return 0; } /** * librdf_parser_get_description: * @world: world object * @counter: index into the list of parsers * * Get parser descriptive syntax information * * Return value: description or NULL if counter is out of range **/ const raptor_syntax_description* librdf_parser_get_description(librdf_world* world, unsigned int counter) { librdf_world_open(world); return raptor_world_get_parser_description(world->raptor_world_ptr, counter); } /** * librdf_parser_check_name: * @world: redland world object * @name: name of parser * * Check if a parser name is known * * Return value: non 0 if name is a known parser **/ int librdf_parser_check_name(librdf_world* world, const char *name) { librdf_parser_factory *factory; int i; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(name, char*, 0); librdf_world_open(world); for(i = 0; (factory = (librdf_parser_factory*)raptor_sequence_get_at(world->parsers, i)); i++) { if(!strcmp(factory->name, name)) return 1; } return 0; } /** * librdf_new_parser: * @world: redland world object * @name: the parser factory name (or NULL or empty string if don't care) * @mime_type: the MIME type of the syntax (NULL if not used) * @type_uri: URI of syntax (NULL if not used) * * Constructor - create a new #librdf_parser object. * * If all fields are NULL, this means any parser supporting * MIME Type "application/rdf+xml" * * Return value: new #librdf_parser object or NULL **/ librdf_parser* librdf_new_parser(librdf_world *world, const char *name, const char *mime_type, librdf_uri *type_uri) { librdf_parser_factory* factory; librdf_world_open(world); factory = librdf_get_parser_factory(world, name, mime_type, type_uri); if(!factory) { if(name) librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "parser '%s' not found", name); else if(mime_type) librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "parser for mime_type '%s' not found", mime_type); else if(type_uri) librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "parser for type URI '%s' not found", librdf_uri_as_string(type_uri)); else librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "default parser not found"); return NULL; } return librdf_new_parser_from_factory(world, factory); } /** * librdf_new_parser_from_factory: * @world: redland world object * @factory: the parser factory to use to create this parser * * Constructor - create a new #librdf_parser object. * * Return value: new #librdf_parser object or NULL **/ librdf_parser* librdf_new_parser_from_factory(librdf_world *world, librdf_parser_factory *factory) { librdf_parser* d; librdf_world_open(world); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(factory, librdf_parser_factory, NULL); d = LIBRDF_CALLOC(librdf_parser*, 1, sizeof(*d)); if(!d) return NULL; d->context = LIBRDF_CALLOC(void*, 1, factory->context_length); if(!d->context) { librdf_free_parser(d); return NULL; } d->world=world; d->factory=factory; if(factory->init && factory->init(d, d->context)) { /* factory init failed - clean up */ librdf_free_parser(d); d=NULL; } return d; } /** * librdf_free_parser: * @parser: the parser * * Destructor - destroys a #librdf_parser object. * **/ void librdf_free_parser(librdf_parser *parser) { if(!parser) return; if(parser->context) { if(parser->factory->terminate) parser->factory->terminate(parser->context); LIBRDF_FREE(parser_context, parser->context); } LIBRDF_FREE(librdf_parser, parser); } /* methods */ /** * librdf_parser_parse_as_stream: * @parser: the parser * @uri: the URI to read * @base_uri: the base URI to use or NULL * * Parse a URI to a librdf_stream of statements. * * Return value: #librdf_stream of statements or NULL **/ librdf_stream* librdf_parser_parse_as_stream(librdf_parser* parser, librdf_uri* uri, librdf_uri* base_uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, NULL); if(parser->factory->parse_uri_as_stream) return parser->factory->parse_uri_as_stream(parser->context, uri, base_uri); if(!librdf_uri_is_file_uri(uri)) { LIBRDF_DEBUG2("%s parser can only handle file: URIs\n", parser->factory->name); return NULL; } return parser->factory->parse_file_as_stream(parser->context, uri, base_uri); } /** * librdf_parser_parse_into_model: * @parser: the parser * @uri: the URI to read the content * @base_uri: the base URI to use or NULL * @model: the model to use * * Parse a URI of content into an librdf_model. * * Return value: non 0 on failure **/ int librdf_parser_parse_into_model(librdf_parser* parser, librdf_uri* uri, librdf_uri* base_uri, librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); if(parser->factory->parse_uri_into_model) return parser->factory->parse_uri_into_model(parser->context, uri, base_uri, model); if(!librdf_uri_is_file_uri(uri)) { LIBRDF_DEBUG2("%s parser can only handle file: URIs\n", parser->factory->name); return 1; } return parser->factory->parse_file_into_model(parser->context, uri, base_uri, model); } /** * librdf_parser_parse_string_as_stream: * @parser: the parser * @string: the string to parse * @base_uri: the base URI to use or NULL * * Parse a string of content to a librdf_stream of statements. * * Return value: #librdf_stream of statements or NULL **/ librdf_stream* librdf_parser_parse_string_as_stream(librdf_parser* parser, const unsigned char *string, librdf_uri* base_uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(string, string, NULL); if(parser->factory->parse_string_as_stream) return parser->factory->parse_string_as_stream(parser->context, string, base_uri); return NULL; } /** * librdf_parser_parse_string_into_model: * @parser: the parser * @string: the content to parse * @base_uri: the base URI to use or NULL * @model: the model to use * * Parse a string of content into an librdf_model. * * Return value: non 0 on failure **/ int librdf_parser_parse_string_into_model(librdf_parser* parser, const unsigned char *string, librdf_uri* base_uri, librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(string, string, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); if(parser->factory->parse_string_into_model) return parser->factory->parse_string_into_model(parser->context, string, base_uri, model); return 1; } /** * librdf_parser_parse_counted_string_as_stream: * @parser: the parser * @string: the string to parse * @length: length of the string content (must be >0) * @base_uri: the base URI to use or NULL * * Parse a counted string of content to a librdf_stream of statements. * * Return value: #librdf_stream of statements or NULL **/ librdf_stream* librdf_parser_parse_counted_string_as_stream(librdf_parser* parser, const unsigned char *string, size_t length, librdf_uri* base_uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(string, string, NULL); LIBRDF_ASSERT_RETURN(length < 1, "string length is not greater than zero", NULL); if(parser->factory->parse_counted_string_as_stream) return parser->factory->parse_counted_string_as_stream(parser->context, string, length, base_uri); return NULL; } /** * librdf_parser_parse_counted_string_into_model: * @parser: the parser * @string: the content to parse * @length: length of content (must be >0) * @base_uri: the base URI to use or NULL * @model: the model to use * * Parse a counted string of content into an librdf_model. * * Return value: non 0 on failure **/ int librdf_parser_parse_counted_string_into_model(librdf_parser* parser, const unsigned char *string, size_t length, librdf_uri* base_uri, librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(string, string, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); LIBRDF_ASSERT_RETURN(length < 1, "string length is not greater than zero", 1); if(parser->factory->parse_counted_string_into_model) return parser->factory->parse_counted_string_into_model(parser->context, string, length, base_uri, model); return 1; } /** * librdf_parser_parse_file_handle_as_stream: * @parser: the parser * @fh: FILE* to read content source * @close_fh: non-0 to fclose() the file handle on finishing * @base_uri: the base URI to use (or NULL) * * Parse a FILE* handle of content to a #librdf_stream of statements. * * Return value: #librdf_stream of statements or NULL **/ librdf_stream* librdf_parser_parse_file_handle_as_stream(librdf_parser* parser, FILE *fh, int close_fh, librdf_uri* base_uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(fh, FILE, NULL); if(parser->factory->parse_file_handle_as_stream) return parser->factory->parse_file_handle_as_stream(parser->context, fh, close_fh, base_uri); return NULL; } /** * librdf_parser_parse_file_handle_into_model: * @parser: the parser * @fh: FILE* to read content source * @close_fh: non-0 to fclose() the file handle on finishing * @base_uri: the base URI to use (or NULL) * @model: the model to write to * * Parse a FILE* handle of content into an #librdf_model. * * Return value: non 0 on failure **/ int librdf_parser_parse_file_handle_into_model(librdf_parser* parser, FILE *fh, int close_fh, librdf_uri* base_uri, librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(fh, FILE, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); if(parser->factory->parse_file_handle_into_model) return parser->factory->parse_file_handle_into_model(parser->context, fh, close_fh, base_uri, model); return 1; } /** * librdf_parser_parse_iostream_as_stream: * @parser: the parser * @iostream: the iostream to parse * @base_uri: the base URI to use or NULL * * Parse an iostream of content to a librdf_stream of statements. * * Return value: #librdf_stream of statements or NULL **/ librdf_stream* librdf_parser_parse_iostream_as_stream(librdf_parser* parser, raptor_iostream *iostream, librdf_uri* base_uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(iostream, raptor_iostream, NULL); if(parser->factory->parse_iostream_as_stream) return parser->factory->parse_iostream_as_stream(parser->context, iostream, base_uri); return NULL; } /** * librdf_parser_parse_iostream_into_model: * @parser: the parser * @iostream: the content to parse * @base_uri: the base URI to use or NULL * @model: the model to use * * Parse a iostream of content into an librdf_model. * * Return value: non 0 on failure **/ int librdf_parser_parse_iostream_into_model(librdf_parser* parser, raptor_iostream *iostream, librdf_uri* base_uri, librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(iostream, raptor_iostream, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); if(parser->factory->parse_iostream_into_model) return parser->factory->parse_iostream_into_model(parser->context, iostream, base_uri, model); return 1; } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_parser_set_error: * @parser: the parser * @user_data: user data to pass to function * @error_fn: pointer to the function * * @Deprecated: Does nothing * * Set the parser error handling function. * **/ REDLAND_EXTERN_C void librdf_parser_set_error(librdf_parser* parser, void *user_data, void (*error_fn)(void *user_data, const char *msg, ...)) { } #endif #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_parser_set_warning: * @parser: the parser * @user_data: user data to pass to function * @warning_fn: pointer to the function * * @Deprecated: Does nothing. * * Set the parser warning handling function. * **/ REDLAND_EXTERN_C void librdf_parser_set_warning(librdf_parser* parser, void *user_data, void (*warning_fn)(void *user_data, const char *msg, ...)) { } #endif /** * librdf_parser_get_feature: * @parser: #librdf_parser object * @feature: #librdf_Uuri feature property * * Get the value of a parser feature. * * Return value: new #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ librdf_node* librdf_parser_get_feature(librdf_parser* parser, librdf_uri* feature) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(feature, librdf_uri, NULL); if(parser->factory->get_feature) return parser->factory->get_feature(parser->context, feature); return NULL; } /** * librdf_parser_set_feature: * @parser: #librdf_parser object * @feature: #librdf_uri feature property * @value: #librdf_node feature property value * * Set the value of a parser feature. * * Return value: non 0 on failure (negative if no such feature) **/ int librdf_parser_set_feature(librdf_parser* parser, librdf_uri* feature, librdf_node* value) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(parser, librdf_parser, -1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(feature, librdf_uri, -1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(value, librdf_node, -1); if(parser->factory->set_feature) return parser->factory->set_feature(parser->context, feature, value); return (-1); } /** * librdf_parser_get_accept_header: * @parser: parser * * Get an HTTP Accept value for the parser. * * The returned string must be freed by the caller using * librdf_free_memory(). * * Return value: a new Accept: header string or NULL on failure **/ char* librdf_parser_get_accept_header(librdf_parser* parser) { if(parser->factory->get_accept_header) return parser->factory->get_accept_header(parser->context); return NULL; } /** * librdf_parser_guess_name2: * @world: librdf_world object * @mime_type: MIME type of syntax or NULL * @buffer: content buffer or NULL * @identifier: content identifier or NULL * * Get a parser name for content with type or identifier * * Return value: a parser name or NULL if nothing was guessable **/ const char* librdf_parser_guess_name2(librdf_world* world, const char *mime_type, const unsigned char *buffer, const unsigned char *identifier) { size_t len = buffer ? strlen((const char *)buffer) : 0; /* can do nothing if called with no world */ if(!world || !world->raptor_world_ptr) return NULL; return raptor_world_guess_parser_name(world->raptor_world_ptr, NULL, mime_type, buffer, len, identifier); } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_parser_guess_name: * @mime_type: MIME type of syntax or NULL * @buffer: content buffer or NULL * @identifier: content identifier or NULL * * Get a parser name for content with type or identifier * * Return value: a parser name or NULL if nothing was guessable **/ const char* librdf_parser_guess_name(const char *mime_type, const unsigned char *buffer, const unsigned char *identifier) { return librdf_parser_guess_name2(NULL, mime_type, buffer, identifier); } #endif /** * librdf_parser_get_namespaces_seen_prefix: * @parser: #librdf_parser object * @offset: index into list of namespaces * * Get the prefix of namespaces seen during parsing * * Return value: prefix or NULL if no such namespace prefix **/ const char* librdf_parser_get_namespaces_seen_prefix(librdf_parser* parser, int offset) { if(parser->factory->get_namespaces_seen_prefix) return parser->factory->get_namespaces_seen_prefix(parser->context, offset); return NULL; } /** * librdf_parser_get_namespaces_seen_uri: * @parser: #librdf_parser object * @offset: index into list of namespaces * * Get the uri of namespaces seen during parsing * * Return value: uri or NULL if no such namespace uri **/ librdf_uri* librdf_parser_get_namespaces_seen_uri(librdf_parser* parser, int offset) { if(parser->factory->get_namespaces_seen_uri) return parser->factory->get_namespaces_seen_uri(parser->context, offset); return NULL; } /** * librdf_parser_get_namespaces_seen_count: * @parser: #librdf_parser object * * Get the number of namespaces seen during parsing * * Return value: namespace count **/ int librdf_parser_get_namespaces_seen_count(librdf_parser* parser) { if(parser->factory->get_namespaces_seen_count) return parser->factory->get_namespaces_seen_count(parser->context); return 0; } /** * librdf_parser_set_uri_filter: * @parser: #librdf_parser object * @filter: URI filter function * @user_data: User data to pass to filter function * * Set URI filter function for retrieval during parsing. **/ void librdf_parser_set_uri_filter(librdf_parser* parser, librdf_uri_filter_func filter, void* user_data) { parser->uri_filter=filter; parser->uri_filter_user_data=user_data; } /** * librdf_parser_get_uri_filter: * @parser: #librdf_parser object * @user_data_p: Pointer to user data to return * * Get the current URI filter function for retrieval during parsing. * * Return value: current URI filter function **/ librdf_uri_filter_func librdf_parser_get_uri_filter(librdf_parser* parser, void** user_data_p) { if(user_data_p) *user_data_p=parser->uri_filter_user_data; return parser->uri_filter; } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); #define RDFXML_CONTENT \ "\n" \ "\n" \ " \n" \ " Dave Beckett's Home Page\n" \ " Dave Beckett\n" \ " The generic home page of Dave Beckett.\n" \ " \n" \ "" #define NTRIPLES_CONTENT \ " \"Dave Beckett\" .\n" \ " \"The generic home page of Dave Beckett.\" .\n" \ " \"Dave Beckett's Home Page\" . \n" #define TURTLE_CONTENT \ "@prefix dc: .\n" \ "\n" \ "\n" \ " dc:creator \"Dave Beckett\" ;\n" \ " dc:description \"The generic home page of Dave Beckett.\" ; \n" \ " dc:title \"Dave Beckett's Home Page\" . \n" /* All the examples above give the same three triples */ #define EXPECTED_TRIPLES_COUNT 3 #define URI_STRING_COUNT 3 static const char *test_parser_types[] = { "rdfxml", "ntriples", "turtle", NULL }; static const unsigned char *file_uri_strings[URI_STRING_COUNT] = { (const unsigned char*)"http://example.org/test1.rdf", (const unsigned char*)"http://example.org/test2.nt", (const unsigned char*)"http://example.org/test3.ttl" }; static const unsigned char *file_content[URI_STRING_COUNT] = { (const unsigned char*)RDFXML_CONTENT, (const unsigned char*)NTRIPLES_CONTENT, (const unsigned char*)TURTLE_CONTENT }; int main(int argc, char *argv[]) { librdf_uri* uris[URI_STRING_COUNT]; int testi; const char *type; const char *program = librdf_basename((const char*)argv[0]); librdf_world *world; int failures; world = librdf_new_world(); librdf_world_open(world); for (testi = 0; testi < URI_STRING_COUNT; testi++) { uris[testi] = librdf_new_uri(world, file_uri_strings[testi]); } failures = 0; for(testi = 0; (type = test_parser_types[testi]); testi++) { librdf_storage* storage = NULL; librdf_model *model = NULL; librdf_parser* parser = NULL; librdf_stream *stream = NULL; raptor_iostream *iostream = NULL; size_t length = strlen((const char*)file_content[testi]); int size; char *accept_h; int i; fprintf(stderr, "%s: Testing parsing syntax '%s'\n", program, type); fprintf(stderr, "%s: Creating storage and model\n", program); storage = librdf_new_storage(world, NULL, NULL, NULL); if(!storage) { fprintf(stderr, "%s: Failed to create new storage\n", program); return(1); } model = librdf_new_model(world, storage, NULL); if(!model) { fprintf(stderr, "%s: Failed to create new model\n", program); return(1); } fprintf(stderr, "%s: Creating %s parser\n", program, type); parser = librdf_new_parser(world, type, NULL, NULL); if(!parser) { fprintf(stderr, "%s: WARNING Failed to create new parser named '%s'\n", program, type); /* This may not be an error if raptor is compiled without the parser */ goto tidy_test; } accept_h = librdf_parser_get_accept_header(parser); if(accept_h) { fprintf(stderr, "%s: Parser accept header: '%s'\n", program, accept_h); librdf_free_memory(accept_h); } else fprintf(stderr, "%s: Parser has no accept header\n", program); fprintf(stderr, "%s: Adding %s counted string content as stream\n", program, type); stream = librdf_parser_parse_counted_string_as_stream(parser, file_content[testi], length, uris[testi]); if(!stream) { fprintf(stderr, "%s: Failed to parse RDF from counted string %d as stream\n", program, testi); failures++; goto tidy_test; } librdf_model_add_statements(model, stream); librdf_free_stream(stream); stream = NULL; size = librdf_model_size(model); fprintf(stderr, "%s: Model size is %d triples\n", program, size); if(size != EXPECTED_TRIPLES_COUNT) { fprintf(stderr, "%s: Returned %d triples, not %d as expected\n", program, size, EXPECTED_TRIPLES_COUNT); failures++; goto tidy_test; } stream = librdf_parser_parse_string_as_stream(parser, file_content[testi], uris[testi]); if(!stream) { fprintf(stderr, "%s: Adding %s string content as stream\n", program, type); fprintf(stderr, "%s: Failed to parse RDF from string %d as stream\n", program, testi); failures++; goto tidy_test; } librdf_model_add_statements(model, stream); librdf_free_stream(stream); stream = NULL; size = librdf_model_size(model); fprintf(stderr, "%s: Model size is %d triples\n", program, size); if(size != EXPECTED_TRIPLES_COUNT) { fprintf(stderr, "%s: Returned %d triples, not %d as expected\n", program, size, EXPECTED_TRIPLES_COUNT); failures++; goto tidy_test; } fprintf(stderr, "%s: Adding %s as iostream, as stream\n", program, type); iostream = raptor_new_iostream_from_string(world->raptor_world_ptr, (void *)file_content[testi], length); stream = librdf_parser_parse_iostream_as_stream(parser, iostream, uris[testi]); if(!stream) { fprintf(stderr, "%s: Failed to parse RDF from iostream %d as stream\n", program, testi); failures++; goto tidy_test; } librdf_model_add_statements(model, stream); librdf_free_stream(stream); stream = NULL; raptor_free_iostream(iostream); iostream = NULL; size = librdf_model_size(model); fprintf(stderr, "%s: Model size is %d triples\n", program, size); if(size != EXPECTED_TRIPLES_COUNT) { fprintf(stderr, "%s: Returned %d triples, not %d as expected\n", program, size, EXPECTED_TRIPLES_COUNT); failures++; goto tidy_test; } fprintf(stderr, "%s: Adding %s counted string content\n", program, type); if(librdf_parser_parse_counted_string_into_model(parser, file_content[testi], length, uris[testi], model)) { fprintf(stderr, "%s: Failed to parse RDF from counted string %d into model\n", program, testi); failures++; goto tidy_test; } size = librdf_model_size(model); fprintf(stderr, "%s: Model size is %d triples\n", program, size); if(size != EXPECTED_TRIPLES_COUNT) { fprintf(stderr, "%s: Returned %d triples, not %d as expected\n", program, size, EXPECTED_TRIPLES_COUNT); failures++; goto tidy_test; } fprintf(stderr, "%s: Adding %s string content\n", program, type); if(librdf_parser_parse_string_into_model(parser, file_content[testi], uris[testi], model)) { fprintf(stderr, "%s: Failed to parse RDF from string %d into model\n", program, testi); failures++; goto tidy_test; } for(i = 0; i < librdf_parser_get_namespaces_seen_count(parser); i++) { const char* prefix = librdf_parser_get_namespaces_seen_prefix(parser, i); librdf_uri* uri = librdf_parser_get_namespaces_seen_uri(parser, i); fprintf(stderr, "%s: Saw namespace %d): prefix:%s URI:%s\n", program, i, (!prefix ? "" : (const char*)prefix), (!uri ? "(none)" : (const char*)librdf_uri_as_string(uri))); } size = librdf_model_size(model); fprintf(stderr, "%s: Model size is %d triples\n", program, size); if(size != EXPECTED_TRIPLES_COUNT) { fprintf(stderr, "%s: Returned %d triples, not %d as expected\n", program, size, EXPECTED_TRIPLES_COUNT); failures++; goto tidy_test; } /* test parsing iostream */ fprintf(stderr, "%s: Adding %s iostream content\n", program, type); iostream = raptor_new_iostream_from_string(world->raptor_world_ptr, (void *)file_content[testi], length); if(librdf_parser_parse_iostream_into_model(parser, iostream, uris[testi], model)) { fprintf(stderr, "%s: Failed to parse RDF from iostream %d into model\n", program, testi); failures++; goto tidy_test; } raptor_free_iostream(iostream); iostream = NULL; for(i = 0; i < librdf_parser_get_namespaces_seen_count(parser); i++) { const char* prefix = librdf_parser_get_namespaces_seen_prefix(parser, i); librdf_uri* uri = librdf_parser_get_namespaces_seen_uri(parser, i); fprintf(stderr, "%s: Saw namespace %d): prefix:%s URI:%s\n", program, i, (!prefix ? "" : (const char*)prefix), (!uri ? "(none)" : (const char*)librdf_uri_as_string(uri))); } size = librdf_model_size(model); fprintf(stderr, "%s: Model size is %d triples\n", program, size); if(size != EXPECTED_TRIPLES_COUNT) { fprintf(stderr, "%s: Returned %d triples, not %d as expected\n", program, size, EXPECTED_TRIPLES_COUNT); failures++; goto tidy_test; } fprintf(stderr, "%s: Freeing parser, model and storage\n", program); tidy_test: if(stream) librdf_free_stream(stream); if(parser) librdf_free_parser(parser); if(model) librdf_free_model(model); if(storage) librdf_free_storage(storage); } fprintf(stderr, "%s: Freeing URIs\n", program); for (testi = 0; testi < URI_STRING_COUNT; testi++) { librdf_free_uri(uris[testi]); } librdf_free_world(world); return failures; } #endif redland-1.0.17/src/rdf_serializer.c0000644000175000017500000010261112244515270014074 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_serializer.c - RDF Serializer (RDF triples to syntax) interface * * Copyright (C) 2002-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2002-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include #ifndef STANDALONE /** * librdf_init_serializer: * @world: redland world object * * INTERNAL - Initialise the serializer module. * **/ void librdf_init_serializer(librdf_world *world) { librdf_serializer_raptor_constructor(world); } /** * librdf_finish_serializer: * @world: redland world object * * INTERNAL - Terminate the serializer module. * **/ void librdf_finish_serializer(librdf_world *world) { if(world->serializers) { raptor_free_sequence(world->serializers); world->serializers=NULL; } #ifdef HAVE_RAPTOR_RDF_SERIALIZER librdf_serializer_raptor_destructor(); #endif } /* helper functions */ static void librdf_free_serializer_factory(librdf_serializer_factory *factory) { if(factory->name) LIBRDF_FREE(char*, factory->name); if(factory->label) LIBRDF_FREE(char*, factory->label); if(factory->mime_type) LIBRDF_FREE(char*, factory->mime_type); if(factory->type_uri) librdf_free_uri(factory->type_uri); LIBRDF_FREE(librdf_serializer_factory, factory); } /** * librdf_serializer_register_factory: * @world: redland world object * @name: the name of the serializer * @label: the label of the serializer (optional) * @mime_type: MIME type of the syntax (optional) * @uri_string: URI of the syntax (optional) * @factory: function to be called to register the factor parameters * * Register a serializer factory . * **/ REDLAND_EXTERN_C void librdf_serializer_register_factory(librdf_world *world, const char *name, const char *label, const char *mime_type, const unsigned char *uri_string, void (*factory) (librdf_serializer_factory*)) { librdf_serializer_factory *serializer; librdf_world_open(world); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG2("Received registration for serializer %s\n", name); #endif if(!world->serializers) { world->serializers = raptor_new_sequence((raptor_data_free_handler)librdf_free_serializer_factory, NULL); if(!world->serializers) goto oom; } serializer = LIBRDF_CALLOC(librdf_serializer_factory*, 1, sizeof(*serializer)); if(!serializer) goto oom; serializer->name = LIBRDF_MALLOC(char*, strlen(name) + 1); if(!serializer->name) goto oom_tidy; strcpy(serializer->name, name); if(label) { serializer->label = LIBRDF_MALLOC(char*, strlen(label) + 1); if(!serializer->label) goto oom_tidy; strcpy(serializer->label, label); } /* register mime type if any */ if(mime_type) { serializer->mime_type = LIBRDF_MALLOC(char*, strlen(mime_type) + 1); if(!serializer->mime_type) goto oom_tidy; strcpy(serializer->mime_type, mime_type); } /* register URI if any */ if(uri_string) { serializer->type_uri=librdf_new_uri(world, uri_string); if(!serializer->type_uri) goto oom_tidy; } if(raptor_sequence_push(world->serializers, serializer)) goto oom; /* Call the serializer registration function on the new object */ (*factory)(serializer); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("%s has context size %d\n", name, serializer->context_length); #endif return; oom_tidy: librdf_free_serializer_factory(serializer); oom: LIBRDF_FATAL1(world, LIBRDF_FROM_SERIALIZER, "Out of memory"); } /** * librdf_get_serializer_factory: * @world: redland world object * @name: the name of the factory (or NULL or empty string if don't care) * @mime_type: the MIME type of the syntax (NULL or empty string if not used) * @type_uri: URI of syntax (NULL if not used) * * Get a serializer factory by name. * * If all fields are NULL, this means any parser supporting * MIME Type "application/rdf+xml" * * Return value: the factory or NULL if not found **/ librdf_serializer_factory* librdf_get_serializer_factory(librdf_world *world, const char *name, const char *mime_type, librdf_uri *type_uri) { librdf_serializer_factory *factory; librdf_world_open(world); if(name && !*name) name=NULL; if(!mime_type || (mime_type && !*mime_type)) { if(!name && !type_uri) name="rdfxml"; else mime_type=NULL; } /* return 1st serializer if no particular one wanted */ if(!name && !mime_type && !type_uri) { factory=(librdf_serializer_factory*)raptor_sequence_get_at(world->serializers, 0); if(!factory) { LIBRDF_DEBUG1("No serializers available\n"); return NULL; } } else { int i; for(i=0; (factory=(librdf_serializer_factory*)raptor_sequence_get_at(world->serializers, i)); i++) { /* next if name does not match */ if(name && strcmp(factory->name, name)) continue; /* MIME type may need to match */ if(mime_type) { if(!factory->mime_type) continue; if(strcmp(factory->mime_type, mime_type)) continue; } /* URI may need to match */ if(type_uri) { if(!factory->type_uri) continue; if(!librdf_uri_equals(factory->type_uri, type_uri)) continue; } /* found it */ break; } /* else FACTORY with given arguments not found */ if(!factory) return NULL; } return factory; } /** * librdf_serializer_enumerate: * @world: redland world object * @counter: index into the list of serializers * @name: pointer to store the name of the serializer (or NULL) * @label: pointer to store syntax readable label (or NULL) * * Get information on serializers. * * @Deprecated: use librdf_serializer_get_description() to return more information in a static structure. * * Return value: non 0 on failure of if counter is out of range **/ int librdf_serializer_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label) { librdf_serializer_factory *factory; int ioffset = LIBRDF_GOOD_CAST(int, counter); librdf_world_open(world); factory = (librdf_serializer_factory*)raptor_sequence_get_at(world->serializers, ioffset); if(!factory) return 1; if(name) *name = factory->name; if(label) *label = factory->label; return 0; } /** * librdf_serializer_get_description: * @world: world object * @counter: index into the list of serializers * * Get serializer descriptive syntax information * * Return value: description or NULL if counter is out of range **/ const raptor_syntax_description* librdf_serializer_get_description(librdf_world* world, unsigned int counter) { librdf_world_open(world); return raptor_world_get_serializer_description(world->raptor_world_ptr, counter); } /** * librdf_serializer_check_name: * @world: redland world object * @name: name of serializer * * Check if a serializer name is known * * Return value: non 0 if name is a known serializer **/ int librdf_serializer_check_name(librdf_world* world, const char *name) { librdf_serializer_factory *factory; int i; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(name, char*, 0); librdf_world_open(world); for(i = 0; (factory = (librdf_serializer_factory*)raptor_sequence_get_at(world->serializers, i)); i++) { if(!strcmp(factory->name, name)) return 1; } return 0; } /** * librdf_new_serializer: * @world: redland world object * @name: the serializer factory name (or NULL or empty string if don't care) * @mime_type: the MIME type of the syntax (NULL if not used) * @type_uri: URI of syntax (NULL if not used) * * Constructor - create a new #librdf_serializer object. * * Return value: new #librdf_serializer object or NULL **/ librdf_serializer* librdf_new_serializer(librdf_world *world, const char *name, const char *mime_type, librdf_uri *type_uri) { librdf_serializer_factory* factory; librdf_world_open(world); factory = librdf_get_serializer_factory(world, name, mime_type, type_uri); if(!factory) { if(name) librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_SERIALIZER, NULL, "serializer '%s' not found", name); else if(mime_type) librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_SERIALIZER, NULL, "serializer for mime_type '%s' not found", mime_type); else if(type_uri) librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_SERIALIZER, NULL, "serializer for type URI '%s' not found", librdf_uri_as_string(type_uri)); else librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_SERIALIZER, NULL, "default serializer not found"); return NULL; } return librdf_new_serializer_from_factory(world, factory); } /** * librdf_new_serializer_from_factory: * @world: redland world object * @factory: the serializer factory to use to create this serializer * * Constructor - create a new #librdf_serializer object. * * Return value: new #librdf_serializer object or NULL **/ librdf_serializer* librdf_new_serializer_from_factory(librdf_world *world, librdf_serializer_factory *factory) { librdf_serializer* d; librdf_world_open(world); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(factory, librdf_serializer_factory, NULL); d = LIBRDF_CALLOC(librdf_serializer*, 1, sizeof(*d)); if(!d) return NULL; d->context = LIBRDF_CALLOC(void*, 1, factory->context_length); if(!d->context) { librdf_free_serializer(d); return NULL; } d->world=world; d->factory=factory; if(factory->init) if(factory->init(d, d->context)) { librdf_free_serializer(d); return NULL; } return d; } /** * librdf_free_serializer: * @serializer: the serializer * * Destructor - destroys a #librdf_serializer object. * **/ void librdf_free_serializer(librdf_serializer *serializer) { if(!serializer) return; if(serializer->context) { if(serializer->factory->terminate) serializer->factory->terminate(serializer->context); LIBRDF_FREE(serializer_context, serializer->context); } LIBRDF_FREE(librdf_serializer, serializer); } /* methods */ #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_serializer_serialize_model: * @serializer: the serializer * @handle: file handle to serialize to * @base_uri: the base URI to use (or NULL) * @model: the #librdf_model model to use * * @Deprecated: Use librdf_serializer_serialize_model_to_file_handle() * * Write a serialized #librdf_model to a FILE*. * * Return value: non 0 on failure **/ int librdf_serializer_serialize_model(librdf_serializer* serializer, FILE *handle, librdf_uri* base_uri, librdf_model* model) { return librdf_serializer_serialize_model_to_file_handle(serializer, handle, base_uri, model); } #endif /** * librdf_serializer_serialize_stream_to_file_handle: * @serializer: the serializer * @handle: file handle to serialize to * @base_uri: the base URI to use (or NULL) * @stream: the #librdf_stream model to use * * Write a #librdf_stream to a FILE*. * * Return value: non 0 on failure **/ int librdf_serializer_serialize_stream_to_file_handle(librdf_serializer* serializer, FILE *handle, librdf_uri* base_uri, librdf_stream* stream) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(handle, FILE*, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(stream, librdf_stream, 1); return serializer->factory->serialize_stream_to_file_handle(serializer->context, handle, base_uri, stream); } /** * librdf_serializer_serialize_model_to_file_handle: * @serializer: the serializer * @handle: file handle to serialize to * @base_uri: the base URI to use (or NULL) * @model: the #librdf_model model to use * * Write a serialized #librdf_model to a FILE*. * * Return value: non 0 on failure **/ int librdf_serializer_serialize_model_to_file_handle(librdf_serializer* serializer, FILE *handle, librdf_uri* base_uri, librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(handle, FILE*, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); return serializer->factory->serialize_model_to_file_handle(serializer->context, handle, base_uri, model); } /** * librdf_serializer_serialize_stream_to_file: * @serializer: the serializer * @name: filename to serialize to * @base_uri: the base URI to use (or NULL) * @stream: the #librdf_stream stream to use * * Write a #librdf_stream to a file. * * Return value: non 0 on failure **/ int librdf_serializer_serialize_stream_to_file(librdf_serializer* serializer, const char *name, librdf_uri* base_uri, librdf_stream* stream) { FILE* fh; int status; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(name, string, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(stream, librdf_stream, 1); fh=fopen(name, "w+"); if(!fh) { librdf_log(serializer->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_SERIALIZER, NULL, "failed to open file '%s' for writing - %s", name, strerror(errno)); return 1; } status=librdf_serializer_serialize_stream_to_file_handle(serializer, fh, base_uri, stream); fclose(fh); return status; } /** * librdf_serializer_serialize_model_to_file: * @serializer: the serializer * @name: filename to serialize to * @base_uri: the base URI to use (or NULL) * @model: the #librdf_model model to use * * Write a serialized #librdf_model to a file. * * Return value: non 0 on failure **/ int librdf_serializer_serialize_model_to_file(librdf_serializer* serializer, const char *name, librdf_uri* base_uri, librdf_model* model) { FILE* fh; int status; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(name, string, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); fh=fopen(name, "w+"); if(!fh) { librdf_log(serializer->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_SERIALIZER, NULL, "failed to open file '%s' for writing - %s", name, strerror(errno)); return 1; } status=librdf_serializer_serialize_model_to_file_handle(serializer, fh, base_uri, model); fclose(fh); return status; } /** * librdf_serializer_serialize_stream_to_counted_string: * @serializer: the serializer * @base_uri: the base URI to use (or NULL) * @stream: the #librdf_stream stream to use * @length_p: pointer to store length or NULL * * Write a #librdf_stream to a counted string. * Caller should free the string with librdf_free_memory(). * * Return value: stream as string or NULL on failure **/ unsigned char* librdf_serializer_serialize_stream_to_counted_string(librdf_serializer* serializer, librdf_uri* base_uri, librdf_stream* stream, size_t* length_p) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(stream, librdf_stream, NULL); if(length_p) *length_p=0; return serializer->factory->serialize_stream_to_counted_string(serializer->context, base_uri, stream, length_p); } /** * librdf_serializer_serialize_model_to_counted_string: * @serializer: the serializer * @base_uri: the base URI to use (or NULL) * @model: the #librdf_model model to use * @length_p: pointer to store length or NULL * * Write a serialized #librdf_model to a counted string. * The returned string must be freed by the caller using librdf_free_memory(). * * Return value: non 0 on failure **/ unsigned char* librdf_serializer_serialize_model_to_counted_string(librdf_serializer* serializer, librdf_uri* base_uri, librdf_model* model, size_t* length_p) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); if(length_p) *length_p=0; return serializer->factory->serialize_model_to_counted_string(serializer->context, base_uri, model, length_p); } /** * librdf_serializer_serialize_stream_to_string: * @serializer: the serializer * @base_uri: the base URI to use (or NULL) * @stream: the #librdf_stream stream to use * * Write a #librdf_stream to a string. * * Return value: NULL on failure **/ unsigned char* librdf_serializer_serialize_stream_to_string(librdf_serializer* serializer, librdf_uri* base_uri, librdf_stream* stream) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(stream, librdf_stream, NULL); return serializer->factory->serialize_stream_to_counted_string(serializer->context, base_uri, stream, NULL); } /** * librdf_serializer_serialize_model_to_string: * @serializer: the serializer * @base_uri: the base URI to use (or NULL) * @model: the #librdf_model model to use * * Write a serialized #librdf_model to a string. * The returned string must be freed by the caller using librdf_free_memory(). * * Return value: NULL on failure **/ unsigned char* librdf_serializer_serialize_model_to_string(librdf_serializer* serializer, librdf_uri* base_uri, librdf_model* model) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); return serializer->factory->serialize_model_to_counted_string(serializer->context, base_uri, model, NULL); } /** * librdf_serializer_serialize_stream_to_iostream: * @serializer: the serializer * @base_uri: the base URI to use (or NULL) * @stream: the #librdf_stream stream to use * @iostr: the #raptor_iostream to write to * * Write a #librdf_stream to a #raptor_iostream. * This function takes ownership of the iostream and frees it. * * Return value: non-0 on failure **/ int librdf_serializer_serialize_stream_to_iostream(librdf_serializer* serializer, librdf_uri* base_uri, librdf_stream *stream, raptor_iostream* iostr) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(stream, librdf_stream, 1); return serializer->factory->serialize_stream_to_iostream(serializer->context, base_uri, stream, iostr); } /** * librdf_serializer_serialize_model_to_iostream: * @serializer: the serializer * @base_uri: the base URI to use (or NULL) * @model: the #librdf_model model to use * @iostr: the #raptor_iostream to write to * * Write a serialized #librdf_model to a #raptor_iostream. * This function takes ownership of the iostream and frees it. * * Return value: non-0 on failure **/ int librdf_serializer_serialize_model_to_iostream(librdf_serializer* serializer, librdf_uri* base_uri, librdf_model *model, raptor_iostream* iostr) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, 1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, 1); return serializer->factory->serialize_model_to_iostream(serializer->context, base_uri, model, iostr); } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_serializer_set_error: * @serializer: the serializer * @user_data: user data to pass to function * @error_fn: pointer to the function * * @Deprecated: Does nothing * * Set the serializer error handling function. * **/ REDLAND_EXTERN_C void librdf_serializer_set_error(librdf_serializer* serializer, void *user_data, void (*error_fn)(void *user_data, const char *msg, ...)) { } #endif #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_serializer_set_warning: * @serializer: the serializer * @user_data: user data to pass to function * @warning_fn: pointer to the function * * @Deprecated: Does nothing * * Set the serializer warning handling function. * **/ REDLAND_EXTERN_C void librdf_serializer_set_warning(librdf_serializer* serializer, void *user_data, void (*warning_fn)(void *user_data, const char *msg, ...)) { } #endif /** * librdf_serializer_get_feature: * @serializer: serializer object * @feature: URI of feature * * Get the value of a serializer feature. * * Return value: the value of the feature or NULL if no such feature * exists or the value is empty. **/ librdf_node* librdf_serializer_get_feature(librdf_serializer* serializer, librdf_uri *feature) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(feature, librdf_uri, NULL); if(serializer->factory->get_feature) return serializer->factory->get_feature(serializer->context, feature); return NULL; } /** * librdf_serializer_set_feature: * @serializer: serializer object * @feature: URI of feature * @value: value to set * * Set the value of a serializer feature. * * Return value: non 0 on failure (negative if no such feature) **/ int librdf_serializer_set_feature(librdf_serializer* serializer, librdf_uri *feature, librdf_node* value) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, -1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(feature, librdf_uri, -1); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(value, librdf_node, -1); if(serializer->factory->set_feature) return serializer->factory->set_feature(serializer->context, feature, value); return (-1); } /** * librdf_serializer_set_namespace: * @serializer: serializer object * @uri: URI of namespace or NULL * @prefix: prefix to use or NULL * * Set a namespace URI/prefix mapping. * * Return value: non 0 on failure **/ int librdf_serializer_set_namespace(librdf_serializer* serializer, librdf_uri *uri, const char *prefix) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, 1); if(uri && !*librdf_uri_as_string(uri)) uri=NULL; if(prefix && !*prefix) prefix=NULL; if(serializer->factory->set_namespace) return serializer->factory->set_namespace(serializer->context, uri, prefix); return 1; } #endif /* TEST CODE */ #ifdef STANDALONE #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_UNISTD_H #include #endif /* one more prototype */ int main(int argc, char *argv[]); struct log_data { int errors; int warnings; } LogData; static int REDLAND_CALLBACK_STDCALL log_handler(void *user_data, librdf_log_message *message) { struct log_data* ld=(struct log_data*)user_data; switch(message->level) { case LIBRDF_LOG_ERROR: ld->errors++; break; case LIBRDF_LOG_WARN: ld->warnings++; break; case LIBRDF_LOG_NONE: case LIBRDF_LOG_DEBUG: case LIBRDF_LOG_INFO: case LIBRDF_LOG_FATAL: default: break; } return 1; } #define EXPECTED_ERRORS1 3 /* Extra error is another UTF-8 encoding error */ #define EXPECTED_ERRORS2 4 #define EXPECTED_WARNINGS 0 #define SYNTAX_TYPE "ntriples" #define SYNTAX_CONTENT \ " \"Dave Beckett\" .\n" \ " \"The generic home page of Dave Beckett.\" .\n" \ " \"Dave Beckett's Home Page\" . \n" int main(int argc, char *argv[]) { const char *program=librdf_basename((const char*)argv[0]); const char *test_serializer_types[]={"rdfxml", "ntriples", NULL}; int i; const char *type; unsigned char *string; size_t string_length; librdf_world *world; librdf_storage *storage; librdf_model* model; librdf_uri* base_uri; librdf_statement* statement; librdf_serializer* serializer; librdf_parser* parser; librdf_stream* stream; FILE *fh; struct stat st_buf; world=librdf_new_world(); librdf_world_open(world); librdf_world_set_logger(world, &LogData, log_handler); for(i=0; (type=test_serializer_types[i]); i++) { fprintf(stderr, "%s: Trying to create new %s serializer\n", program, type); serializer=librdf_new_serializer(world, type, NULL, NULL); if(!serializer) { fprintf(stderr, "%s: Failed to create new serializer type %s\n", program, type); continue; } fprintf(stderr, "%s: Freeing serializer\n", program); librdf_free_serializer(serializer); } storage=librdf_new_storage(world, NULL, NULL, NULL); model=librdf_new_model(world, storage, NULL); /* ERROR: Subject URI is bad UTF-8 */ statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/foo\xfc"), librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/bar"), librdf_new_node_from_literal(world, (const unsigned char*)"blah", NULL, 0)); librdf_model_add_statement(model, statement); librdf_free_statement(statement); /* ERROR: Predicate URI is not serializable */ statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/foo"), librdf_new_node_from_uri_string(world, (const unsigned char*)"http://bad.example.org/"), librdf_new_node_from_literal(world, (const unsigned char*)"blah", NULL, 0)); librdf_model_add_statement(model, statement); librdf_free_statement(statement); /* ERROR: Object literal is bad UTF-8 */ statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/foo"), librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/abc"), librdf_new_node_from_literal(world, (const unsigned char*)"\xfc", NULL, 0)); librdf_model_add_statement(model, statement); librdf_free_statement(statement); serializer=librdf_new_serializer(world, "rdfxml", NULL, NULL); base_uri=librdf_new_uri(world, (const unsigned char*)"http://example.org/base#"); string=librdf_serializer_serialize_model_to_counted_string(serializer, base_uri, model, &string_length); #define EXPECTED_BAD_STRING_LENGTH1 382 /* Raptor 2.0.11 changed the serialization slightly */ #define EXPECTED_BAD_STRING_LENGTH2 378 if(string_length != EXPECTED_BAD_STRING_LENGTH1 && string_length != EXPECTED_BAD_STRING_LENGTH2) { fprintf(stderr, "%s: Serialising model to RDF/XML returned string '%s' size %d, expected %d or %d\n", program, string, (int)string_length, EXPECTED_BAD_STRING_LENGTH1, EXPECTED_BAD_STRING_LENGTH2); return 1; } librdf_free_memory(string); librdf_free_uri(base_uri); base_uri=NULL; librdf_free_model(model); model=NULL; librdf_free_storage(storage); storage=NULL; if(LogData.errors != EXPECTED_ERRORS1 && LogData.errors != EXPECTED_ERRORS2) { fprintf(stderr, "%s: Serialising to RDF/XML returned %d errors, expected %d or %d\n", program, LogData.errors, EXPECTED_ERRORS1, EXPECTED_ERRORS2); return 1; } if(LogData.warnings != EXPECTED_WARNINGS) { fprintf(stderr, "%s: Serialising to RDF/XML returned %d warnings, expected %d\n", program, LogData.warnings, EXPECTED_WARNINGS); return 1; } /* Good model to serialize */ storage=librdf_new_storage(world, NULL, NULL, NULL); model=librdf_new_model(world, storage, NULL); parser=librdf_new_parser(world, SYNTAX_TYPE, NULL, NULL); if(!parser) { fprintf(stderr, "%s: Failed to create new parser type %s\n", program, SYNTAX_TYPE); return 1; } fprintf(stderr, "%s: Adding %s string content\n", program, SYNTAX_TYPE); if(librdf_parser_parse_string_into_model(parser, (const unsigned char*)SYNTAX_CONTENT, NULL /* no base URI*/, model)) { fprintf(stderr, "%s: Failed to parse RDF from %s string into model\n", SYNTAX_TYPE, program); return 1; } librdf_free_parser(parser); fprintf(stderr, "%s: Serializing stream to a string\n", program); stream=librdf_model_as_stream(model); string_length=0; string=librdf_serializer_serialize_stream_to_counted_string(serializer, NULL, stream, &string_length); #define EXPECTED_GOOD_STRING_LENGTH 668 if(string_length != EXPECTED_GOOD_STRING_LENGTH) { fprintf(stderr, "%s: Serialising stream to RDF/XML returned string '%s' size %d, expected %d\n", program, string, (int)string_length, EXPECTED_GOOD_STRING_LENGTH); return 1; } librdf_free_stream(stream); librdf_free_memory(string); fprintf(stderr, "%s: Serializing stream to a file handle\n", program); stream=librdf_model_as_stream(model); #define FILENAME "test.rdf" fh=fopen(FILENAME, "w"); if(!fh) { fprintf(stderr, "%s: Failed to fopen for writing '%s' - %s\n", program, FILENAME, strerror(errno)); return 1; } librdf_serializer_serialize_stream_to_file_handle(serializer, fh, NULL, stream); fclose(fh); stat(FILENAME, &st_buf); if((int)st_buf.st_size != EXPECTED_GOOD_STRING_LENGTH) { fprintf(stderr, "%s: Serialising stream to file handle returned file '%s' of size %d bytes, expected %d\n", program, FILENAME, (int)st_buf.st_size, EXPECTED_GOOD_STRING_LENGTH); return 1; } unlink(FILENAME); librdf_free_stream(stream); librdf_free_serializer(serializer); serializer=NULL; librdf_free_model(model); model=NULL; librdf_free_storage(storage); storage=NULL; librdf_free_world(world); /* keep gcc -Wall happy */ return(0); } #endif redland-1.0.17/src/rdf_node.h0000644000175000017500000001453011516326266012665 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_node.h - RDF Node definition * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_NODE_H #define LIBRDF_NODE_H #ifndef LIBRDF_OBJC_FRAMEWORK #include #else #include #endif #ifdef __cplusplus extern "C" { #endif /* Node types */ /* DEPENDENCY: If this list is changed, the librdf_node_type_names * definition in rdf_node.c must be updated to match * * Node type 3 is unused and should not be renumbered to keep binary * ABI compatibility. */ /** * librdf_node_type: * @LIBRDF_NODE_TYPE_UNKNOWN: Internal * @LIBRDF_NODE_TYPE_RESOURCE: rdf:Resource (& rdf:Property) - has a URI * @LIBRDF_NODE_TYPE_LITERAL: rdf:Literal - has an XML string, language, * XML space * @LIBRDF_NODE_TYPE_BLANK: blank node has an identifier string. * @LIBRDF_NODE_TYPE_LAST: Internal * * Type of a redland node. * * Better to check this with functions librdf_node_is_resource(), * librdf_node_is_literal() or librdf_node_is_blank(). * */ typedef enum { LIBRDF_NODE_TYPE_UNKNOWN = RAPTOR_TERM_TYPE_UNKNOWN, LIBRDF_NODE_TYPE_RESOURCE = RAPTOR_TERM_TYPE_URI, LIBRDF_NODE_TYPE_LITERAL = RAPTOR_TERM_TYPE_LITERAL, LIBRDF_NODE_TYPE_BLANK = RAPTOR_TERM_TYPE_BLANK, LIBRDF_NODE_TYPE_LAST = LIBRDF_NODE_TYPE_BLANK } librdf_node_type; #ifdef LIBRDF_INTERNAL #include #endif /* Create a new Node. */ REDLAND_API librdf_node* librdf_new_node(librdf_world* world); /* Create a new resource Node from URI string. */ REDLAND_API librdf_node* librdf_new_node_from_uri_string(librdf_world* world, const unsigned char *uri_string); REDLAND_API librdf_node* librdf_new_node_from_counted_uri_string(librdf_world* world, const unsigned char *uri_string, size_t len); /* Create a new resource Node from URI object. */ REDLAND_API librdf_node* librdf_new_node_from_uri(librdf_world* world, librdf_uri *uri); /* Create a new resource Node from URI object with a local_name */ REDLAND_API librdf_node* librdf_new_node_from_uri_local_name(librdf_world* world, librdf_uri *uri, const unsigned char *local_name); /* Create a new resource Node from URI string renormalised to a new base */ REDLAND_API librdf_node* librdf_new_node_from_normalised_uri_string(librdf_world* world, const unsigned char *uri_string, librdf_uri *source_uri, librdf_uri *base_uri); /* Create a new Node from literal string / language. */ REDLAND_API librdf_node* librdf_new_node_from_literal(librdf_world* world, const unsigned char *string, const char *xml_language, int is_wf_xml); /* Create a new Node from a typed literal string / language. */ REDLAND_API librdf_node* librdf_new_node_from_typed_literal(librdf_world *world, const unsigned char *value, const char *xml_language, librdf_uri* datatype_uri); REDLAND_API librdf_node* librdf_new_node_from_typed_counted_literal(librdf_world *world, const unsigned char *value, size_t value_len, const char *xml_language, size_t xml_language_len, librdf_uri* datatype_uri); /* Create a new Node from blank node identifier. */ REDLAND_API librdf_node* librdf_new_node_from_blank_identifier(librdf_world* world, const unsigned char *identifier); REDLAND_API librdf_node* librdf_new_node_from_counted_blank_identifier(librdf_world* world, const unsigned char *identifier, size_t identifier_len); /* Create a new Node from an existing Node - CLONE */ REDLAND_API librdf_node* librdf_new_node_from_node(librdf_node *node); /* destructor */ REDLAND_API void librdf_free_node(librdf_node* node); /* functions / methods */ REDLAND_API librdf_uri* librdf_node_get_uri(librdf_node* node); REDLAND_API librdf_node_type librdf_node_get_type(librdf_node* node); REDLAND_API unsigned char* librdf_node_get_literal_value(librdf_node* node); REDLAND_API unsigned char* librdf_node_get_literal_value_as_counted_string(librdf_node* node, size_t* len_p); REDLAND_API char* librdf_node_get_literal_value_as_latin1(librdf_node* node); REDLAND_API char* librdf_node_get_literal_value_language(librdf_node* node); REDLAND_API int librdf_node_get_literal_value_is_wf_xml(librdf_node* node); REDLAND_API librdf_uri* librdf_node_get_literal_value_datatype_uri(librdf_node* node); REDLAND_API int librdf_node_get_li_ordinal(librdf_node* node); REDLAND_API unsigned char *librdf_node_get_blank_identifier(librdf_node* node); REDLAND_API unsigned char *librdf_node_get_counted_blank_identifier(librdf_node* node, size_t* len_p); REDLAND_API int librdf_node_is_resource(librdf_node* node); REDLAND_API int librdf_node_is_literal(librdf_node* node); REDLAND_API int librdf_node_is_blank(librdf_node* node); /* serialise / deserialise */ REDLAND_API size_t librdf_node_encode(librdf_node* node, unsigned char *buffer, size_t length); REDLAND_API librdf_node* librdf_node_decode(librdf_world *world, size_t* size_p, unsigned char *buffer, size_t length); /* convert to a string */ REDLAND_API REDLAND_DEPRECATED unsigned char *librdf_node_to_string(librdf_node* node); REDLAND_API REDLAND_DEPRECATED unsigned char* librdf_node_to_counted_string(librdf_node* node, size_t* len_p); /* pretty print it */ REDLAND_API int librdf_node_write(librdf_node* node, raptor_iostream *iostr); REDLAND_API void librdf_node_print(librdf_node* node, FILE *fh); /* utility functions */ REDLAND_API int librdf_node_equals(librdf_node* first_node, librdf_node* second_node); /* create an iterator for a static array of nodes */ REDLAND_API REDLAND_DEPRECATED librdf_iterator* librdf_node_static_iterator_create(librdf_node** nodes, int size); REDLAND_API librdf_iterator* librdf_node_new_static_node_iterator(librdf_world* world, librdf_node** nodes, int size); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_stream_internal.h0000644000175000017500000000361611170164361015122 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_stream_internal.h - Internal RDF Stream definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_STREAM_INTERNAL_H #define LIBRDF_STREAM_INTERNAL_H #ifdef __cplusplus extern "C" { #endif /* used in map_list below */ typedef struct { void *context; /* context to pass on to map */ librdf_stream_map_handler fn; librdf_stream_map_free_context_handler free_context; } librdf_stream_map; struct librdf_stream_s { librdf_world *world; void *context; int is_finished; /* 1 when have no more statements */ int is_updated; /* 1 when we know there is a current item */ int is_updating; /* 1 when are in the middle of update process */ /* Used when mapping */ librdf_statement *current; librdf_list *map_list; /* non-empty means there is a list of maps */ int (*is_end_method)(void*); int (*next_method)(void*); void* (*get_method)(void*, int); /* flags: type of get */ void (*finished_method)(void*); }; librdf_statement* librdf_stream_statement_find_map(librdf_stream *stream, void* context, librdf_statement* statement); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_storage_tstore.c0000644000175000017500000005643511616407050015001 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_tstore.c - RDF Storage using 3store * * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include #include #include typedef struct { /* Tstore args for connecting */ const char *host; const char *db; const char *user; const char *password; const char *model; RDFSQL* rdfsql; } librdf_storage_tstore_instance; /* prototypes for local functions */ static int librdf_storage_tstore_init(librdf_storage* storage, const char *name, librdf_hash* options); static int librdf_storage_tstore_open(librdf_storage* storage, librdf_model* model); static int librdf_storage_tstore_close(librdf_storage* storage); static int librdf_storage_tstore_size(librdf_storage* storage); static int librdf_storage_tstore_add_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_tstore_remove_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_tstore_contains_statement(librdf_storage* storage, librdf_statement* statement); static librdf_stream* librdf_storage_tstore_serialise(librdf_storage* storage); static librdf_stream* librdf_storage_tstore_find_statements(librdf_storage* storage, librdf_statement* statement); /* serialising implementing functions */ static int librdf_storage_tstore_serialise_end_of_stream(void* context); static int librdf_storage_tstore_serialise_next_statement(void* context); static void* librdf_storage_tstore_serialise_get_statement(void* context, int flags); static void librdf_storage_tstore_serialise_finished(void* context); /* find implementing functions */ static int librdf_storage_tstore_find_end_of_stream(void* context); static int librdf_storage_tstore_find_next_statement(void* context); static void* librdf_storage_tstore_find_get_statement(void* context, int flags); static void librdf_storage_tstore_find_finished(void* context); /* context functions */ static int librdf_storage_tstore_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_tstore_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static librdf_stream* librdf_storage_tstore_context_serialise(librdf_storage* storage, librdf_node* context_node); /* context list statement stream methods */ #if 0 static int librdf_storage_tstore_context_serialise_end_of_stream(void* context); static int librdf_storage_tstore_context_serialise_next_statement(void* context); static void* librdf_storage_tstore_context_serialise_get_statement(void* context, int flags); static void librdf_storage_tstore_context_serialise_finished(void* context); #endif static librdf_statement* librdf_storage_tstore_statement_from_rs_triple(librdf_world* world, rs_triple *triple); static rs_triple* librdf_storage_tstore_statement_as_rs_triple(librdf_statement *statement); static void librdf_storage_tstore_register_factory(librdf_storage_factory *factory); #ifdef MODULAR_LIBRDF void librdf_storage_module_register_factory(librdf_world *world); #endif /* functions implementing storage api */ static int librdf_storage_tstore_init(librdf_storage* storage, const char *name, librdf_hash* options) { librdf_storage_tstore_instance* context; context = LIBRDF_CALLOC(librdf_storage_tstore_instance*, 1, sizeof(*context)); if(!context) { if(options) librdf_free_hash(options); return 1; } librdf_storage_set_instance(storage, context); context->host=librdf_hash_get_del(options, "host"); context->db=librdf_hash_get_del(options, "database"); context->user=librdf_hash_get_del(options, "user"); context->password=librdf_hash_get_del(options, "password"); context->model=librdf_hash_get_del(options, "model"); /* no more options, might as well free them now */ if(options) librdf_free_hash(options); return 0; } static void librdf_storage_tstore_terminate(librdf_storage* storage) { librdf_storage_tstore_instance *context; context =(librdf_storage_tstore_instance*)storage->instance; if(context == NULL) return; LIBRDF_FREE(librdf_storage_tstore_instance*, context); } static int librdf_storage_tstore_open(librdf_storage* storage, librdf_model* model) { librdf_storage_tstore_instance *context; context = (librdf_storage_tstore_instance*)storage->instance; if(context->host) context->rdfsql=rs_connect_remote(context->host, context->db, context->user, context->password, context->model); else context->rdfsql=rs_connect(context->db, context->user, context->password, context->model); if(!context->rdfsql) return 1; return 0; } /** * librdf_storage_tstore_close: * @storage: the storage * * . * * Close the storage list storage, and free all content since there is no * persistance. * * Return value: non 0 on failure **/ static int librdf_storage_tstore_close(librdf_storage* storage) { /* librdf_storage_tstore_instance* context=(librdf_storage_tstore_instance*)storage->instance; */ return 0; } static int librdf_storage_tstore_size(librdf_storage* storage) { return -1; } static int librdf_storage_tstore_add_statement(librdf_storage* storage, librdf_statement* statement) { /* FIXME - cannot check for adding duplicate statements */ return librdf_storage_tstore_context_add_statement(storage, NULL, statement); } static int librdf_storage_tstore_remove_statement(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_tstore_context_remove_statement(storage, NULL, statement); } static int librdf_storage_tstore_contains_statement(librdf_storage* storage, librdf_statement* statement) { /*librdf_storage_tstore_instance* context=(librdf_storage_tstore_instance*)storage->instance; */ /* FIXME */ return 0; } static librdf_statement* librdf_storage_tstore_statement_from_rs_triple(librdf_world* world, rs_triple *triple) { librdf_node *subject_node; librdf_node *predicate_node; librdf_node *object_node; if(triple->subject) { if(!strncmp(triple->subject, "_:",2)) subject_node=librdf_new_node_from_blank_identifier(world, (const unsigned char *)triple->subject+2); else subject_node=librdf_new_node_from_uri_string(world, (const unsigned char *)triple->subject); if(!subject_node) return NULL; } else subject_node=NULL; if(triple->predicate) { predicate_node=librdf_new_node_from_uri_string(world, (const unsigned char *)triple->predicate); if(!predicate_node) { librdf_free_node(subject_node); return NULL; } } else predicate_node=NULL; if(triple->object) { if(triple->literal) object_node=librdf_new_node_from_typed_literal(world, (const unsigned char *)triple->object, NULL, NULL); else if(!strncmp(triple->object, ":", 2)) object_node=librdf_new_node_from_blank_identifier(world, (const unsigned char *)triple->object+2); else object_node=librdf_new_node_from_uri_string(world, (const unsigned char *)triple->object); if(!object_node) { librdf_free_node(subject_node); librdf_free_node(predicate_node); return NULL; } } else object_node=NULL; return librdf_new_statement_from_nodes(world, subject_node, predicate_node, object_node); } /* FIXME returns an alloced triple pointing to shared strings */ static rs_triple* librdf_storage_tstore_statement_as_rs_triple(librdf_statement *statement) { librdf_node *subject_node=statement->subject; librdf_node *predicate_node=statement->predicate; librdf_node *object_node=statement->object; rs_triple* triple = LIBRDF_MALLOC(rs_triple, sizeof(*triple)); if(subject_node) { if(librdf_node_is_blank(subject_node)) triple->subject=(char*)librdf_node_get_blank_identifier(subject_node); else triple->subject=(char*)librdf_uri_as_string(librdf_node_get_uri(subject_node)); } else triple->subject=NULL; if(predicate_node) triple->predicate=(char*)librdf_uri_as_string(librdf_node_get_uri(predicate_node)); else triple->predicate=NULL; /* Assumptions - FIXME */ triple->literal = 0; if(object_node) { if(librdf_node_is_literal(object_node)) { triple->object=(char*)librdf_node_get_literal_value(object_node); triple->literal = 1; } else if(librdf_node_is_blank(object_node)) { triple->object=(char*)librdf_node_get_blank_identifier(object_node); } else { triple->object=(char*)librdf_uri_as_string(librdf_node_get_uri(object_node)); } } else triple->object=NULL; return triple; } typedef struct { librdf_storage* storage; rs_result *result; rs_triple *triple; } librdf_storage_tstore_serialise_stream_context; static librdf_stream* librdf_storage_tstore_serialise(librdf_storage* storage) { librdf_storage_tstore_instance* context=(librdf_storage_tstore_instance*)storage->instance; librdf_storage_tstore_serialise_stream_context* scontext; librdf_stream* stream; scontext = LIBRDF_CALLOC(librdf_storage_tstore_serialise_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; scontext->storage=storage; librdf_storage_add_reference(scontext->storage); scontext->result=rs_find_all_resources(context->rdfsql, 0, context->model); if(!scontext->result) /* empty */ scontext->triple=NULL; else scontext->triple=rs_next_triple(scontext->result); stream=librdf_new_stream(storage->world, (void*)scontext, &librdf_storage_tstore_serialise_end_of_stream, &librdf_storage_tstore_serialise_next_statement, &librdf_storage_tstore_serialise_get_statement, &librdf_storage_tstore_serialise_finished); if(!stream) { librdf_storage_tstore_serialise_finished((void*)scontext); return NULL; } return stream; } static int librdf_storage_tstore_serialise_end_of_stream(void* context) { librdf_storage_tstore_serialise_stream_context* scontext=(librdf_storage_tstore_serialise_stream_context*)context; return scontext->triple == NULL; } static int librdf_storage_tstore_serialise_next_statement(void* context) { librdf_storage_tstore_serialise_stream_context* scontext=(librdf_storage_tstore_serialise_stream_context*)context; if(!scontext->triple) return 1; scontext->triple=rs_next_triple(scontext->result); return scontext->triple == NULL; } static void* librdf_storage_tstore_serialise_get_statement(void* context, int flags) { librdf_storage_tstore_serialise_stream_context* scontext=(librdf_storage_tstore_serialise_stream_context*)context; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: { librdf_statement* statement=librdf_storage_tstore_statement_from_rs_triple(scontext->storage->world, scontext->triple); return statement; } case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return NULL; default: librdf_log(scontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_storage_tstore_serialise_finished(void* context) { librdf_storage_tstore_serialise_stream_context* scontext=(librdf_storage_tstore_serialise_stream_context*)context; if(scontext->triple) { /* The docs say about rs_find_triples:[[ * NB Once rs_find_triples has been called, all the triples * /must/ be fetched with rs_next_triple(), even if they are * not required. * ]] * but let's assume it applies to rs_find_all_resources */ while(rs_next_triple(scontext->result)) ; } if(scontext->result) rs_free_result(scontext->result); if(scontext->storage) librdf_storage_remove_reference(scontext->storage); LIBRDF_FREE(librdf_storage_tstore_serialise_stream_context*, scontext); } typedef struct { librdf_storage* storage; rs_result *result; rs_triple *triple; rs_triple *search_triple; } librdf_storage_tstore_find_stream_context; /** * librdf_storage_tstore_find_statements: * @storage: the storage * @statement: the statement to match * * . * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * Uses #librdf_statement_match to do the matching. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_tstore_find_statements(librdf_storage* storage, librdf_statement* statement) { librdf_storage_tstore_instance* context=(librdf_storage_tstore_instance*)storage->instance; librdf_storage_tstore_find_stream_context* scontext; librdf_stream* stream; rs_triple* triple; rs_obj_type type; statement=librdf_new_statement_from_statement(statement); if(!statement) return NULL; scontext = LIBRDF_CALLOC(librdf_storage_tstore_find_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; scontext->storage=storage; librdf_storage_add_reference(scontext->storage); triple=librdf_storage_tstore_statement_as_rs_triple(statement); scontext->search_triple=triple; if(triple->object) type=(triple->literal ? ObjLiteral: ObjURI); else type=ObjAny; scontext->result=rs_find_triples(context->rdfsql, triple->subject, triple->predicate, triple->object, type, 0, context->model); if(!scontext->result) /* empty */ scontext->triple=NULL; else scontext->triple=rs_next_triple(scontext->result); stream=librdf_new_stream(storage->world, (void*)scontext, &librdf_storage_tstore_find_end_of_stream, &librdf_storage_tstore_find_next_statement, &librdf_storage_tstore_find_get_statement, &librdf_storage_tstore_find_finished); if(!stream) { librdf_storage_tstore_find_finished((void*)scontext); return NULL; } return stream; } static int librdf_storage_tstore_find_end_of_stream(void* context) { librdf_storage_tstore_find_stream_context* scontext=(librdf_storage_tstore_find_stream_context*)context; return scontext->triple == NULL; } static int librdf_storage_tstore_find_next_statement(void* context) { librdf_storage_tstore_find_stream_context* scontext=(librdf_storage_tstore_find_stream_context*)context; if(!scontext->triple) return 1; scontext->triple=rs_next_triple(scontext->result); return scontext->triple == NULL; } static void* librdf_storage_tstore_find_get_statement(void* context, int flags) { librdf_storage_tstore_find_stream_context* scontext=(librdf_storage_tstore_find_stream_context*)context; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: { librdf_statement* statement=librdf_storage_tstore_statement_from_rs_triple(scontext->storage->world, scontext->triple); return statement; } case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return NULL; default: librdf_log(scontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_storage_tstore_find_finished(void* context) { librdf_storage_tstore_find_stream_context* scontext=(librdf_storage_tstore_find_stream_context*)context; if(scontext->triple) { /* The docs say about rs_find_triples:[[ * NB Once rs_find_triples has been called, all the triples * /must/ be fetched with rs_next_triple(), even if they are * not required. * ]] */ while(rs_next_triple(scontext->result)) ; } if(scontext->result) rs_free_result(scontext->result); /* FIXME: as alloced in librdf_storage_tstore_statement_as_rs_triple */ if(scontext->search_triple) LIBRDF_FREE(rs_triple*, scontext->search_triple); if(scontext->storage) librdf_storage_remove_reference(scontext->storage); LIBRDF_FREE(librdf_storage_tstore_find_stream_context*, scontext); } /** * librdf_storage_tstore_context_add_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to add * * Add a statement to a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_tstore_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { librdf_storage_tstore_instance* context; librdf_node *subject_node=statement->subject; librdf_node *predicate_node=statement->predicate; librdf_node *object_node=statement->object; char *subject; char *predicate; char *object; rs_obj_type type; context = (librdf_storage_tstore_instance*)storage->instance; if(librdf_node_is_blank(subject_node)) { subject=(char*)librdf_node_get_blank_identifier(subject_node); } else subject=(char*)librdf_uri_as_string(librdf_node_get_uri(subject_node)); predicate=(char*)librdf_uri_as_string(librdf_node_get_uri(predicate_node)); /* Assumptions - FIXME */ if(librdf_node_is_literal(object_node)) { object=(char*)librdf_node_get_literal_value(object_node); type = ObjLiteral; } else if(librdf_node_is_blank(object_node)) { object=(char*)librdf_node_get_blank_identifier(object_node); type = ObjURI; } else { object=(char*)librdf_uri_as_string(librdf_node_get_uri(object_node)); type = ObjURI; } if(rs_assert_triple(context->rdfsql, subject, predicate, object, type)) return 1; return 0; } /** * librdf_storage_tstore_context_remove_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to remove * * Remove a statement from a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_tstore_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { /* librdf_storage_tstore_instance* context=(librdf_storage_tstore_instance*)storage->instance; */ /* FIXME */ return 0; } typedef struct { librdf_iterator* iterator; librdf_hash_datum *key; librdf_hash_datum *value; librdf_statement current; /* static, shared statement */ } librdf_storage_tstore_context_serialise_stream_context; /** * librdf_storage_tstore_context_serialise: * @storage: #librdf_storage object * @context_node: #librdf_node object * * List all statements in a storage context. * * Return value: #librdf_stream of statements or NULL on failure or context is empty **/ static librdf_stream* librdf_storage_tstore_context_serialise(librdf_storage* storage, librdf_node* context_node) { return NULL; } #if 0 static int librdf_storage_tstore_context_serialise_end_of_stream(void* context) { /* librdf_storage_tstore_context_serialise_stream_context* scontext=(librdf_storage_tstore_context_serialise_stream_context*)context; */ return 1; } static int librdf_storage_tstore_context_serialise_next_statement(void* context) { /* librdf_storage_tstore_context_serialise_stream_context* scontext=(librdf_storage_tstore_context_serialise_stream_context*)context; */ return 1; } static void* librdf_storage_tstore_context_serialise_get_statement(void* context, int flags) { /* librdf_storage_tstore_context_serialise_stream_context* scontext=(librdf_storage_tstore_context_serialise_stream_context*)context; */ return NULL; } static void librdf_storage_tstore_context_serialise_finished(void* context) { librdf_storage_tstore_context_serialise_stream_context* scontext; scontext = (librdf_storage_tstore_context_serialise_stream_context*)context; LIBRDF_FREE(librdf_storage_tstore_context_serialise_stream_context*, scontext); } #endif /** Local entry point for dynamically loaded storage module */ static void librdf_storage_register_factory(librdf_storage_factory *factory) { assert(factory->name == "tstore"); factory->version = LIBRDF_STORAGE_INTERFACE_VERSION; factory->init = librdf_storage_tstore_init; factory->terminate = librdf_storage_tstore_terminate; factory->open = librdf_storage_tstore_open; factory->close = librdf_storage_tstore_close; factory->size = librdf_storage_tstore_size; factory->add_statement = librdf_storage_tstore_add_statement; factory->remove_statement = librdf_storage_tstore_remove_statement; factory->contains_statement = librdf_storage_tstore_contains_statement; factory->serialise = librdf_storage_tstore_serialise; factory->find_statements = librdf_storage_tstore_find_statements; factory->context_add_statement = librdf_storage_tstore_context_add_statement; factory->context_remove_statement = librdf_storage_tstore_context_remove_statement; factory->context_serialise = librdf_storage_tstore_context_serialise; } #ifdef MODULAR_LIBRDF /** Entry point for dynamically loaded storage module */ static void librdf_storage_module_register_factory(librdf_world *world) { librdf_storage_register_factory(world, "tstore", "AKT triplestore", &librdf_storage_tstore_register_factory); } #else /* * librdf_init_storage_tstore: * @world: world object * * INTERNAL - Initialise the built-in storage_tstore module. */ void librdf_init_storage_tstore(librdf_world *world) { librdf_storage_register_factory(world, "tstore", "AKT triplestore", &librdf_storage_tstore_register_factory); } #endif redland-1.0.17/src/rdf_digest_internal.h0000644000175000017500000000527711772470733015126 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_digest_internal.h - Internal RDF Digest Factory / Digest definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_DIGEST_INTERNAL_H #define LIBRDF_DIGEST_INTERNAL_H #ifdef __cplusplus extern "C" { #endif /* based on the GNUPG cipher/digest registration stuff */ struct librdf_digest_factory_s { struct librdf_digest_factory_s* next; char * name; /* the rest of this structure is populated by the digest-specific register function */ size_t context_length; size_t digest_length; /* functions (over context) */ void (*init)( void *_context ); void (*update)( void *_context, const unsigned char *buf, size_t nbytes ); void (*final)( void *_context ); unsigned char *(*get_digest)( void *_context ); }; struct librdf_digest_s { librdf_world *world; void* context; unsigned char *digest; librdf_digest_factory* factory; }; /* module init */ void librdf_init_digest(librdf_world *world); /* module finish */ void librdf_finish_digest(librdf_world *world); /* in librdf_digest_openssl.c */ #ifdef HAVE_OPENSSL_DIGESTS void librdf_digest_openssl_constructor(librdf_world *world); #endif /* in librdf_digest_md5.c */ #ifdef HAVE_LOCAL_MD5_DIGEST void librdf_digest_md5_constructor(librdf_world *world); #endif /* in librdf_digest_sha1.c */ #ifdef HAVE_LOCAL_SHA1_DIGEST void librdf_digest_sha1_constructor(librdf_world *world); #endif /* in librdf_digest_ripemd160.c */ #ifdef HAVE_LOCAL_RIPEMD160_DIGEST void librdf_digest_rmd160_constructor(librdf_world *world); #endif /* factory static methods */ void librdf_digest_register_factory(librdf_world *world, const char *name, void (*factory) (librdf_digest_factory*)); librdf_digest_factory* librdf_get_digest_factory(librdf_world *world, const char *name); /* constructor */ librdf_digest* librdf_new_digest_from_factory(librdf_world *world, librdf_digest_factory *factory); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/win32_rdf_config.h.in0000644000175000017500000001657712127603464014646 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * win32_rdf_config.h - redland WIN32 hard-coded config * * Copyright (C) 2004-2011, David Beckett http://www.dajobe.org/ * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * */ #ifndef WIN32_RDF_CONFIG_H #define WIN32_RDF_CONFIG_H #ifdef __cplusplus extern "C" { #endif #define WIN32_LEAN_AND_MEAN 1 /* getopt is not in standard win32 C library - define if we have it */ /* #define HAVE_GETOPT_H 1 */ #define HAVE_STDLIB_H 1 /* For using expat on win32 */ /*#define RAPTOR_XML_EXPAT 1 #define HAVE_EXPAT_H 1*/ #define HAVE_STRICMP 1 /* MS names for these functions */ // next line breaks build on wntmsci12 //#define vsnprintf _vsnprintf #define snprintf _snprintf #define access _access #define stricmp _stricmp #define strnicmp _strnicmp #define close _close #define unlink _unlink #define mktemp _mktemp #define HAVE_C99_VSNPRINTF 1 /* Define the following if you are calling the librdf from C# or any language which uses stdcall */ #define USE_STDCALL_CALLBACKS 1 /* for access() which is POSIX but doesn't seem to have the defines in VC */ #ifndef R_OK #define F_OK 0 #define R_OK 4 #endif /* __func__ doesn't exist in Visual Studio 6 */ #define __func__ "" #undef REDLAND_INLINE #define REDLAND_INLINE __inline /* * Defines that come from rdf_config.h */ /* BDB has close method with 2 args */ #define HAVE_BDB_CLOSE_2_ARGS 1 /* BDB defines DBC */ #define HAVE_BDB_CURSOR 1 /* BDB cursor method has 4 arguments */ #define HAVE_BDB_CURSOR_4_ARGS 1 /* BDB defines DB_TXN */ #define HAVE_BDB_DB_TXN 1 /* BDB has fd method with 2 args */ #define HAVE_BDB_FD_2_ARGS 1 /* Have BDB hash support */ #define HAVE_BDB_HASH 1 /* BDB has open method with 6 args */ /* #undef HAVE_BDB_OPEN_6_ARGS */ /* BDB has open method with 7 args */ #define HAVE_BDB_OPEN_7_ARGS 1 /* BDB has set_flags method */ #define HAVE_BDB_SET_FLAGS 1 /* BDB has dbopen method */ /* #undef HAVE_DBOPEN */ /* BDB has db_create method */ #define HAVE_DB_CREATE 1 /* Define to 1 if you have the header file. */ #define HAVE_DB_H 1 /* Define to 1 if you have the header file. */ /* undef HAVE_DLFCN_H */ /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the `getenv' function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the `getopt' function. */ #define HAVE_GETOPT 1 /* Define to 1 if you have the header file. */ #define HAVE_GETOPT_H 1 /* Define to 1 if you have the `getopt_long' function. */ #define HAVE_GETOPT_LONG 1 /* Define to 1 if you have the `gettimeofday' function. */ /* #undef HAVE_GETTIMEOFDAY */ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* W3C libwww is present */ /* #undef HAVE_LIBWWW */ /* Have local MD5 digest */ #define HAVE_LOCAL_MD5_DIGEST 1 /* Have local RIPEMD160 digest */ /* #undef HAVE_LOCAL_RIPEMD160_DIGEST */ /* Have local SHA1 digest */ #define HAVE_LOCAL_SHA1_DIGEST 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mkstemp' function. */ /* #undef HAVE_MKSTEMP */ /* Define to 1 if you have the `mktemp' function. */ #define HAVE_MKTEMP 1 /* MySQL libraries are present */ #define HAVE_MYSQL 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_OPENSSL_CRYPTO_H */ /* Have openssl MD5 digest */ /* #undef HAVE_OPENSSL_CRYPTO_MD5_DIGEST */ /* Have openssl RIPEMD160 digest */ /* #undef HAVE_OPENSSL_CRYPTO_RIPEMD160_DIGEST */ /* Have openssl SHA1 digest */ /* #undef HAVE_OPENSSL_CRYPTO_SHA1_DIGEST */ /* Have openssl digests */ /* #undef HAVE_OPENSSL_DIGESTS */ /* Define to 1 if you have the header file. */ /* #undef HAVE_PTHREAD_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ /*#define HAVE_SYS_TIME_H*/ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the `tmpnam' function. */ #define HAVE_TMPNAM 1 /* Have 3store available */ /* #undef HAVE_TSTORE */ /* Define to 1 if you have the header file. */ /* #define HAVE_UNISTD_H */ /* Disable run time assertion checks. */ /* #undef LIBRDF_DISABLE_ASSERT */ /* Disable run time assertion check messages. */ /* #undef LIBRDF_DISABLE_ASSERT_MESSAGES */ /* Release version as a decimal */ #define LIBRDF_VERSION_DECIMAL @LIBRDF_VERSION_DECIMAL@ /* Major version number */ #define LIBRDF_VERSION_MAJOR @LIBRDF_VERSION_MAJOR@ /* Minor version number */ #define LIBRDF_VERSION_MINOR @LIBRDF_VERSION_MINOR@ /* Release version number */ #define LIBRDF_VERSION_RELEASE @LIBRDF_VERSION_RELEASE@ /* The size of a `unsigned char', as computed by sizeof. */ #define SIZEOF_UNSIGNED_CHAR 1 /* The size of a `unsigned short', as computed by sizeof. */ #define SIZEOF_UNSIGNED_SHORT 2 /* The size of a `unsigned int', as computed by sizeof. */ #define SIZEOF_UNSIGNED_INT 4 /* The size of a `unsigned long', as computed by sizeof. */ #define SIZEOF_UNSIGNED_LONG 4 /* The size of a `unsigned long long', as computed by sizeof. */ #define SIZEOF_UNSIGNED_LONG_LONG 8 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Building file storage */ #define STORAGE_FILE 1 #define STORAGE_HASHES 1 #define STORAGE_MEMORY 1 #define STORAGE_TREES 1 /* Building MySQL storage */ /* #define STORAGE_MYSQL 1 */ /* Building PostgreSQL storage */ /*#undef STORAGE_POSTGRESQL*/ /* Building SQLite storage */ #define STORAGE_SQLITE 1 /* Building 3store storage */ /*#undef STORAGE_TSTORE*/ /* Define to 1 if you can safely include both and . */ /* #define TIME_WITH_SYS_TIME*/ /* Version number of package */ #define VERSION "@VERSION@" /* Use POSIX threads */ #undef WITH_THREADS /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ #include #include #include /* get _isnan() since it is not in math.h */ #include #ifndef isnan #define isnan(d) (_isnan(d)) #endif #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_list_internal.h0000644000175000017500000000366311167024223014602 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_list_internal.h - Internal RDF List Interface definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_LIST_INTERNAL_H #define LIBRDF_LIST_INTERNAL_H #ifndef LIBRDF_OBJC_FRAMEWORK #include #else #include #endif #ifdef __cplusplus extern "C" { #endif /* private structure */ struct librdf_list_node_s { struct librdf_list_node_s* next; struct librdf_list_node_s* prev; void *data; }; typedef struct librdf_list_node_s librdf_list_node; struct librdf_list_iterator_context_s { librdf_iterator* iterator; librdf_list* list; librdf_list_node *current; librdf_list_node *next; struct librdf_list_iterator_context_s* next_ic; struct librdf_list_iterator_context_s* prev_ic; }; typedef struct librdf_list_iterator_context_s librdf_list_iterator_context; struct librdf_list_s { librdf_world *world; librdf_list_node* first; librdf_list_node* last; int length; int (*equals) (void* data1, void *data2); int iterator_count; librdf_list_iterator_context* first_iterator; librdf_list_iterator_context* last_iterator; }; #ifdef __cplusplus } #endif #endif redland-1.0.17/src/win32/0000755000175000017500000000000012257576340011756 500000000000000redland-1.0.17/src/win32/Makefile.am0000644000175000017500000000006111167024222013711 00000000000000EXTRA_DIST=\ README.txt \ librdf.vcproj msvc.def redland-1.0.17/src/win32/Makefile.in0000644000175000017500000003136412257575714013756 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/win32 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/rdf_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIGEST_OBJS = @DIGEST_OBJS@ DIGEST_SRCS = @DIGEST_SRCS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HASH_OBJS = @HASH_OBJS@ HASH_SRCS = @HASH_SRCS@ HAVE_RAPTOR2_API = @HAVE_RAPTOR2_API@ HTML_DIR = @HTML_DIR@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IODBC_CONFIG = @IODBC_CONFIG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBRDF_CPPFLAGS = @LIBRDF_CPPFLAGS@ LIBRDF_DIRECT_LIBS = @LIBRDF_DIRECT_LIBS@ LIBRDF_EXTERNAL_CPPFLAGS = @LIBRDF_EXTERNAL_CPPFLAGS@ LIBRDF_EXTERNAL_LIBS = @LIBRDF_EXTERNAL_LIBS@ LIBRDF_INTERNAL_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ LIBRDF_INTERNAL_DEPS = @LIBRDF_INTERNAL_DEPS@ LIBRDF_INTERNAL_LIBS = @LIBRDF_INTERNAL_LIBS@ LIBRDF_LDFLAGS = @LIBRDF_LDFLAGS@ LIBRDF_LIBTOOLLIBS = @LIBRDF_LIBTOOLLIBS@ LIBRDF_LIBTOOL_VERSION = @LIBRDF_LIBTOOL_VERSION@ LIBRDF_PKGCONFIG_PRIVATE_LIBS = @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ LIBRDF_VERSION_DECIMAL = @LIBRDF_VERSION_DECIMAL@ LIBRDF_VERSION_MAJOR = @LIBRDF_VERSION_MAJOR@ LIBRDF_VERSION_MINOR = @LIBRDF_VERSION_MINOR@ LIBRDF_VERSION_RELEASE = @LIBRDF_VERSION_RELEASE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEM = @MEM@ MEM_LIBS = @MEM_LIBS@ MKDIR_P = @MKDIR_P@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ODBC_CFLAGS = @ODBC_CFLAGS@ ODBC_LIBS = @ODBC_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSTGRESQL_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ POSTGRESQL_LIBS = @POSTGRESQL_LIBS@ RANLIB = @RANLIB@ RAPTOR2_CFLAGS = @RAPTOR2_CFLAGS@ RAPTOR2_LIBS = @RAPTOR2_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ RASQAL_CFLAGS = @RASQAL_CFLAGS@ RASQAL_LIBS = @RASQAL_LIBS@ RASQAL_MAX_VERSION = @RASQAL_MAX_VERSION@ RASQAL_MIN_VERSION = @RASQAL_MIN_VERSION@ RECHO = @RECHO@ RECHO_C = @RECHO_C@ RECHO_N = @RECHO_N@ REDLAND_MODULE_PATH = @REDLAND_MODULE_PATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TAR = @TAR@ TSTORE_CONFIG = @TSTORE_CONFIG@ TSTORE_CPPFLAGS = @TSTORE_CPPFLAGS@ TSTORE_LIBS = @TSTORE_LIBS@ VERSION = @VERSION@ VIRTUOSO_CPPFLAGS = @VIRTUOSO_CPPFLAGS@ VIRTUOSO_LIBS = @VIRTUOSO_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ README.txt \ librdf.vcproj msvc.def all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/win32/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/win32/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: redland-1.0.17/src/win32/README.txt0000644000175000017500000000127111167024222013357 00000000000000This is user contributed win32 configuration for building redland using MS Windows development environments. The files here are *.vcproj and msvc.def files for MS Visual Studio 8, provided by John Barstow. The project files assume that raptor and rasqal have been installed or compiled in sibling directories, following the directory structure of the redland release. The project file may also depend on external libraries such as SleepyCat, MySQL to provide other functionality. See librdf.vcproj for the exact paths used, which can be version-number dependant. I do not test this configuration since I don't use Windows. I am happy to receive patches to fix things though. Dave 2005-05-19 redland-1.0.17/src/win32/librdf.vcproj0000644000175000017500000001656411167024222014363 00000000000000 redland-1.0.17/src/win32/msvc.def0000644000175000017500000000033711167024222013313 00000000000000LIBRARY librdf EXPORTS librdf_version_major DATA librdf_version_minor DATA librdf_version_release DATA librdf_version_decimal DATA librdf_short_copyright_string DATA librdf_copyright_string DATA librdf_version_string DATA redland-1.0.17/src/rdf_storage_sql.c0000644000175000017500000001540411773150065014254 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage.c - RDF Storage SQL support functions * * Copyright (C) 2008, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include /* for access() and R_OK */ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #include static void librdf_sql_config_store_triple(void *user_data, raptor_statement *triple); static void librdf_sql_config_store_triple(void *user_data, raptor_statement *triple) { librdf_sql_config* config=(librdf_sql_config*)user_data; int i; for(i=0; i < config->predicates_count; i++) { if(triple->predicate->type != RAPTOR_TERM_TYPE_URI || triple->object->type != RAPTOR_TERM_TYPE_LITERAL) continue; if(!strcmp((const char*)raptor_uri_as_string(triple->predicate->value.uri), config->predicate_uri_strings[i])) { config->values[i] = strdup((const char *)triple->object->value.literal.string); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("Set config value %d to '%s'\n", i, config->values[i]); #endif } } return; } /** * librdf_new_sql_config: * @world: librdf_world * @storage_name: SQL storage name * @layout: SQL schema variant * @config_dir: directory for configuration files * @predicate_uri_strings: configuration predicate URIs to look for * * Constructor - Make a new SQL configuration for a layout from a file * * Uses SQL storage name @storage_name and with database schema * @layout to give a configuration that will contain an array of * string values in the #librdf_sql_config field values array. * * Return value: configuration or NULL on failure **/ librdf_sql_config* librdf_new_sql_config(librdf_world* world, const char* storage_name, const char* layout, const char* config_dir, const char** predicate_uri_strings) { raptor_parser* rdf_parser=NULL; unsigned char *uri_string=NULL; raptor_uri *base_uri; raptor_uri *uri; librdf_sql_config* config; size_t len; int i; librdf_world_open(world); config = LIBRDF_MALLOC(librdf_sql_config*, sizeof(*config)); len=strlen(config_dir) + 1 + strlen(storage_name) + 4 + 1; if(layout) len+= strlen(layout) + 1; config->filename = LIBRDF_MALLOC(char*, len); if(layout) sprintf(config->filename, "%s/%s-%s.ttl", config_dir, storage_name, layout); else sprintf(config->filename, "%s/%s.ttl", config_dir, storage_name); config->predicate_uri_strings=predicate_uri_strings; for(i=0; config->predicate_uri_strings[i]; i++) ; config->predicates_count=i; config->values = LIBRDF_CALLOC(char**, sizeof(char*), LIBRDF_GOOD_CAST(size_t, config->predicates_count)); librdf_log(world, 0, LIBRDF_LOG_DEBUG, LIBRDF_FROM_STORAGE, NULL, "Opening storage '%s' layout '%s' configuration file '%s'", storage_name, (layout ? layout: "(default)"), config->filename); if(access((const char*)config->filename, R_OK)) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Failed to open configuration file '%s' for storage '%s' layout '%s' - %s", config->filename, storage_name, (layout ? layout: "(default)"), strerror(errno)); librdf_free_sql_config(config); return NULL; } uri_string=raptor_uri_filename_to_uri_string(config->filename); uri = raptor_new_uri(world->raptor_world_ptr, uri_string); base_uri = raptor_uri_copy( uri); rdf_parser = raptor_new_parser(world->raptor_world_ptr, "turtle"); raptor_parser_set_statement_handler(rdf_parser, config, librdf_sql_config_store_triple); raptor_parser_parse_file(rdf_parser, uri, base_uri); raptor_free_parser(rdf_parser); raptor_free_uri(base_uri); raptor_free_uri(uri); raptor_free_memory(uri_string); /* Check all values are given */ for(i=0; i < config->predicates_count; i++) { if(!config->values[i]) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Configuration %s missing for storage %s", config->predicate_uri_strings[i], storage_name); librdf_free_sql_config(config); return NULL; } } return config; } const char* librdf_storage_sql_dbconfig_predicates[DBCONFIG_CREATE_TABLE_LAST+2]={ "http://schemas.librdf.org/2006/dbconfig#createTableStatements", "http://schemas.librdf.org/2006/dbconfig#createTableLiterals", "http://schemas.librdf.org/2006/dbconfig#createTableResources", "http://schemas.librdf.org/2006/dbconfig#createTableBnodes", "http://schemas.librdf.org/2006/dbconfig#createTableModels", NULL }; /** * librdf_new_sql_config_for_storage: * @storage: SQL #librdf_storage to configure * @layout: layout variant * @dir: directory to look for configuration or NULL for default dir * * Constructor - Create a new SQL storage configuration for a given database layout. * * Return value: new configuration or NULL on failure **/ librdf_sql_config* librdf_new_sql_config_for_storage(librdf_storage* storage, const char* layout, const char *dir) { if(!dir) dir=PKGDATADIR; return librdf_new_sql_config(storage->world, storage->factory->name, layout, dir, librdf_storage_sql_dbconfig_predicates); } /** * librdf_free_sql_config: * @config: SQL storage configuration * * Destructor - free a SQL configuration. **/ void librdf_free_sql_config(librdf_sql_config* config) { int i; if(config->values) { for(i=0; i < config->predicates_count; i++) { if(config->values[i]) LIBRDF_FREE(char*, config->values[i]); } LIBRDF_FREE(char*, config->values); } if(config->filename) LIBRDF_FREE(char*, config->filename); LIBRDF_FREE(char*, config); } redland-1.0.17/src/rdf_statement_internal.h0000644000175000017500000000226211612427073015632 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_statement_internal.h - Internal RDF Statement definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_STATEMENT_INTERNAL_H #define LIBRDF_STATEMENT_INTERNAL_H #ifdef __cplusplus extern "C" { #endif /* class methods */ void librdf_init_statement(librdf_world *world); void librdf_finish_statement(librdf_world *world); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_hash.h0000644000175000017500000000563011661544002012653 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_hash.h - RDF Hash Factory and Hash interfaces and definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_HASH_H #define LIBRDF_HASH_H #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif /* public constructors */ REDLAND_API librdf_hash* librdf_new_hash(librdf_world *world, const char *name); REDLAND_API librdf_hash* librdf_new_hash_from_string(librdf_world *world, const char *name, const char *string); REDLAND_API librdf_hash* librdf_new_hash_from_array_of_strings(librdf_world *world, const char *name, const char **array); /* public copy constructor */ REDLAND_API librdf_hash* librdf_new_hash_from_hash (librdf_hash* old_hash); /* public destructor */ REDLAND_API void librdf_free_hash(librdf_hash *hash); /* public methods */ /* retrieve one value for a given hash key */ REDLAND_API char* librdf_hash_get(librdf_hash* hash, const char *key); /* lookup a hash key and decode value as a boolean */ REDLAND_API int librdf_hash_get_as_boolean(librdf_hash* hash, const char *key); /* lookup a hash key and decode value as a long */ REDLAND_API long librdf_hash_get_as_long(librdf_hash* hash, const char *key); /* retrieve one value for key and delete from hash all other values */ REDLAND_API char* librdf_hash_get_del(librdf_hash* hash, const char *key); /* insert a key/value pair */ REDLAND_API int librdf_hash_put_strings(librdf_hash* hash, const char *key, const char *value); /* make a hash from a string */ REDLAND_API int librdf_hash_from_string(librdf_hash* hash, const char *string); /* make a string from a hash */ REDLAND_API char* librdf_hash_to_string(librdf_hash* hash, const char *filter[]); REDLAND_API void librdf_hash_print(librdf_hash* hash, FILE *fh); REDLAND_API void librdf_hash_print_keys(librdf_hash* hash, FILE *fh); REDLAND_API void librdf_hash_print_values(librdf_hash* hash, const char *key_string, FILE *fh); REDLAND_API unsigned char* librdf_hash_interpret_template(const unsigned char* template_string, librdf_hash* dictionary, const unsigned char* prefix, const unsigned char* suffix); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_serializer_internal.h0000644000175000017500000000664511610752765016017 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_serializer_internal.h - Internal RDF Serializer definitions * * Copyright (C) 2002-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2002-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_SERIALIZER_INTERNAL_H #define LIBRDF_SERIALIZER_INTERNAL_H #ifdef __cplusplus extern "C" { #endif #include struct librdf_serializer_factory_s { struct librdf_serializer_factory_s* next; /* factory name - required */ char *name; /* factory label */ char *label; /* serialize to this MIME type/ Internet Media Type - optional */ char *mime_type; /* writes the syntax defined by this URI - optional */ librdf_uri *type_uri; /* the rest of this structure is populated by the serializer-specific register function */ size_t context_length; /* create a new serializer */ int (*init)(librdf_serializer* serializer, void *_context); /* destroy a serializer */ void (*terminate)(void *_context); /* get/set features of serializer */ librdf_node* (*get_feature)(void *_context, librdf_uri* feature); int (*set_feature)(void *_context, librdf_uri *feature, librdf_node* value); int (*set_namespace)(void *_context, librdf_uri *uri, const char *prefix); int (*serialize_stream_to_file_handle)(void *_context, FILE *handle, librdf_uri* base_uri, librdf_stream *stream); int (*serialize_model_to_file_handle)(void *_context, FILE *handle, librdf_uri* base_uri, librdf_model *model); unsigned char* (*serialize_stream_to_counted_string)(void *_context, librdf_uri* base_uri, librdf_stream *stream, size_t *length_p); unsigned char* (*serialize_model_to_counted_string)(void *_context, librdf_uri* base_uri, librdf_model *model, size_t *length_p); int (*serialize_stream_to_iostream)(void *context, librdf_uri* base_uri, librdf_stream *stream, raptor_iostream* iostr); int (*serialize_model_to_iostream)(void *context, librdf_uri* base_uri, librdf_model *model, raptor_iostream* iostr); }; struct librdf_serializer_s { librdf_world *world; void *context; void *error_user_data; void *warning_user_data; void (*error_fn)(void *user_data, const char *msg, ...); void (*warning_fn)(void *user_data, const char *msg, ...); librdf_serializer_factory* factory; }; /* class methods */ librdf_serializer_factory* librdf_get_serializer_factory(librdf_world *world, const char *name, const char *mime_type, librdf_uri *type_uri); /* module init */ void librdf_init_serializer(librdf_world *world); /* module finish */ void librdf_finish_serializer(librdf_world *world); void librdf_serializer_raptor_constructor(librdf_world* world); void librdf_serializer_rdfxml_constructor(librdf_world* world); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_utf8.h0000644000175000017500000000375311773205103012622 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_utf8.h - RDF UTF8 / Unicode chars helper routines Definition * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_UTF8_H #define LIBRDF_UTF8_H #ifdef __cplusplus extern "C" { #endif #include /** * librdf_unichar: * * Unicode codepoint. * */ typedef raptor_unichar librdf_unichar; REDLAND_API REDLAND_DEPRECATED int librdf_unicode_char_to_utf8(librdf_unichar c, unsigned char *output, int length); REDLAND_API REDLAND_DEPRECATED int librdf_utf8_to_unicode_char(librdf_unichar *output, const unsigned char *input, int length); REDLAND_API unsigned char* librdf_latin1_to_utf8_2(const unsigned char *input, size_t length, size_t *output_length); REDLAND_API unsigned char* librdf_utf8_to_latin1_2(const unsigned char *input, size_t length, unsigned char discard, size_t *output_length); REDLAND_API REDLAND_DEPRECATED unsigned char* librdf_utf8_to_latin1(const unsigned char *input, int length, int *output_length); REDLAND_API REDLAND_DEPRECATED unsigned char* librdf_latin1_to_utf8(const unsigned char *input, int length, int *output_length); REDLAND_API void librdf_utf8_print(const unsigned char *input, int length, FILE *stream); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_hash_internal.h0000644000175000017500000001445511661544002014554 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_hash_internal.h - Internal RDF Hash Factory and Hash definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_HASH_INTERNAL_H #define LIBRDF_HASH_INTERNAL_H #ifdef __cplusplus extern "C" { #endif /** data type used to describe hash key and data */ struct librdf_hash_datum_s { librdf_world *world; void *data; size_t size; /* used internally to build lists of these */ struct librdf_hash_datum_s *next; }; typedef struct librdf_hash_datum_s librdf_hash_datum; /* constructor / destructor for above */ librdf_hash_datum* librdf_new_hash_datum(librdf_world *world, void *data, size_t size); void librdf_free_hash_datum(librdf_hash_datum *ptr); /** A hash object */ struct librdf_hash_s { librdf_world* world; char* identifier; /* as passed in during open(), used by clone() */ void* context; int is_open; struct librdf_hash_factory_s* factory; }; /** A Hash Factory */ struct librdf_hash_factory_s { struct librdf_hash_factory_s* next; char* name; /* the rest of this structure is populated by the hash-specific register function */ size_t context_length; /* size of the cursor context */ size_t cursor_context_length; /* clone an existing storage */ int (*clone)(librdf_hash* new_hash, void* new_context, char* new_name, void* old_context); /* create / destroy a hash implementation */ int (*create)(librdf_hash* hash, void* context); int (*destroy)(void* context); /* open/create hash with identifier and options */ int (*open)(void* context, const char *identifier, int mode, int is_writable, int is_new, librdf_hash* options); /* end hash association */ int (*close)(void* context); /* hoe many values? */ int (*values_count)(void* context); /* insert key/value pairs according to flags */ int (*put)(void* context, librdf_hash_datum *key, librdf_hash_datum *data); /* returns true if key exists in hash, without returning value */ int (*exists)(void* context, librdf_hash_datum *key, librdf_hash_datum *value); int (*delete_key)(void* context, librdf_hash_datum *key); int (*delete_key_value)(void* context, librdf_hash_datum *key, librdf_hash_datum *value); /* flush any cached information to disk */ int (*sync)(void* context); /* get the file descriptor for the hash, if it is file based (for locking) */ int (*get_fd)(void* context); /* create a cursor and operate on it */ int (*cursor_init)(void *cursor_context, void* hash_context); int (*cursor_get)(void *cursor, librdf_hash_datum *key, librdf_hash_datum *value, unsigned int flags); void (*cursor_finish)(void *context); }; typedef struct librdf_hash_factory_s librdf_hash_factory; /* factory class methods */ void librdf_hash_register_factory(librdf_world *world, const char *name, void (*factory) (librdf_hash_factory*)); librdf_hash_factory* librdf_get_hash_factory(librdf_world *world, const char *name); /* module init */ void librdf_init_hash(librdf_world *world); /* module terminate */ void librdf_finish_hash(librdf_world *world); /* hash cursor_get method flags */ #define LIBRDF_HASH_CURSOR_SET 0 #define LIBRDF_HASH_CURSOR_NEXT_VALUE 1 #define LIBRDF_HASH_CURSOR_FIRST 2 #define LIBRDF_HASH_CURSOR_NEXT 3 /* constructors */ librdf_hash* librdf_new_hash_from_factory(librdf_world *world, librdf_hash_factory* factory); /* methods */ /* open/create hash with identifier and options */ int librdf_hash_open(librdf_hash* hash, const char *identifier, int mode, int is_writable, int is_new, librdf_hash* options); /* end hash association */ int librdf_hash_close(librdf_hash* hash); /* how many values */ int librdf_hash_values_count(librdf_hash* hash); /* retrieve one value for a given hash key as a hash datum */ librdf_hash_datum* librdf_hash_get_one(librdf_hash* hash, librdf_hash_datum *key); /* retrieve all values for a given hash key according to flags */ librdf_iterator* librdf_hash_get_all(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value); /* insert a key/value pair */ int librdf_hash_put(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value); /* returns true if key exists in hash, without returning value */ int librdf_hash_exists(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value); int librdf_hash_delete(librdf_hash* hash, librdf_hash_datum *key, librdf_hash_datum *value); int librdf_hash_delete_all(librdf_hash* hash, librdf_hash_datum *key); librdf_iterator* librdf_hash_keys(librdf_hash* hash, librdf_hash_datum *key); /* flush any cached information to disk */ int librdf_hash_sync(librdf_hash* hash); /* get the file descriptor for the hash, if it is file based (for locking) */ int librdf_hash_get_fd(librdf_hash* hash); /* init a hash from an array of strings */ int librdf_hash_from_array_of_strings(librdf_hash* hash, const char *array[]); /* cursor methods from rdf_hash_cursor.c */ librdf_hash_cursor* librdf_new_hash_cursor (librdf_hash* hash); void librdf_free_hash_cursor (librdf_hash_cursor* cursor); int librdf_hash_cursor_set(librdf_hash_cursor *cursor, librdf_hash_datum *key,librdf_hash_datum *value); int librdf_hash_cursor_get_next_value(librdf_hash_cursor *cursor, librdf_hash_datum *key,librdf_hash_datum *value); int librdf_hash_cursor_get_first(librdf_hash_cursor *cursor, librdf_hash_datum *key, librdf_hash_datum *value); int librdf_hash_cursor_get_next(librdf_hash_cursor *cursor, librdf_hash_datum *key, librdf_hash_datum *value); #ifdef HAVE_BDB_HASH void librdf_init_hash_bdb(librdf_world *world); #endif void librdf_init_hash_memory(librdf_world *world); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/mysql-v1.ttl0000644000175000017500000000326512115553112013141 00000000000000# # Redland MySQL storage schema - MyISAM # # Turtle with variable substitution # @prefix mysql: . @prefix dbconfig: . @prefix rdfs: . mysql: rdfs:label "Redland MySQL Schema V1 MyISAM"; dbconfig:createTableStatements """ CREATE TABLE IF NOT EXISTS $(STATEMENTS_NAME) ( Subject bigint unsigned NOT NULL, Predicate bigint unsigned NOT NULL, Object bigint unsigned NOT NULL, Context bigint unsigned NOT NULL, KEY Context (Context), KEY SubjectPredicate (Subject,Predicate), KEY PredicateObject (Predicate,Object), KEY ObjectSubject (Object,Subject) ) ENGINE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=33 """; dbconfig:createTableLiterals """ CREATE TABLE IF NOT EXISTS Literals ( ID bigint unsigned NOT NULL, Value longtext NOT NULL, Language text NOT NULL, Datatype text NOT NULL, PRIMARY KEY ID (ID), FULLTEXT KEY Value (Value) ) ENGINE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=44 """; dbconfig:createTableResources """ CREATE TABLE IF NOT EXISTS Resources ( ID bigint unsigned NOT NULL, URI text NOT NULL, PRIMARY KEY ID (ID) ) ENGINE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=63 """; dbconfig:createTableBnodes """ CREATE TABLE IF NOT EXISTS Bnodes ( ID bigint unsigned NOT NULL, Name text NOT NULL, PRIMARY KEY ID (ID) ) ENGINE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=33 """; dbconfig:createTableModels """ CREATE TABLE IF NOT EXISTS Models ( ID bigint unsigned NOT NULL, Name text NOT NULL, PRIMARY KEY ID (ID) ) ENGINE=MyISAM DELAY_KEY_WRITE=1 """; . redland-1.0.17/src/rdf_log_internal.h0000644000175000017500000000247111773152772014422 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_log_internal.h - Internal RDF logging definitions * * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_LOG_INTERNAL_H #define LIBRDF_LOG_INTERNAL_H #ifdef __cplusplus extern "C" { #endif REDLAND_NORETURN void librdf_fatal(librdf_world* world, int facility, const char *file, int line, const char *function, const char *message); void librdf_test_error(librdf_world* world, const char *message); void librdf_test_warning(librdf_world* world, const char *message); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/librdf.h.in0000644000175000017500000002056611773152772012766 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * redland.h - Redland RDF Application Framework public API * * Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_H #define LIBRDF_H #ifndef LIBRDF_OBJC_FRAMEWORK /* raptor */ #include /* rasqal: uses raptor */ #include /* librdf: uses rasqal and raptor */ #else #include #include #endif #ifdef __cplusplus extern "C" { #endif #include #ifndef REDLAND_API # ifdef WIN32 # ifdef __GNUC__ # undef _declspec # define _declspec(x) __declspec(x) # endif # ifdef REDLAND_STATIC # define REDLAND_API # else # ifdef LIBRDF_INTERNAL # define REDLAND_API _declspec(dllexport) # else # define REDLAND_API _declspec(dllimport) # endif # endif # else # define REDLAND_API # endif #endif #ifndef REDLAND_CALLBACK_STDCALL # if defined(WIN32) && defined(USE_STDCALL_CALLBACKS) # define REDLAND_CALLBACK_STDCALL _stdcall # else # define REDLAND_CALLBACK_STDCALL # endif #endif /* Use gcc 3.1+ feature to allow marking of deprecated API calls. * This gives a warning during compiling. */ #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 #define REDLAND_DEPRECATED __attribute__((deprecated)) #define REDLAND_NORETURN __attribute__((__noreturn__)) #else #define REDLAND_DEPRECATED #define REDLAND_NORETURN #endif #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #define REDLAND_PRINTF_FORMAT(string_index, first_to_check_index) \ __attribute__((__format__(__printf__, string_index, first_to_check_index))) #else #define REDLAND_PRINTF_FORMAT(string_index, first_to_check_index) #endif /* Public defines */ /** * LIBRDF_VERSION: * * Redland librdf library version number * * Format: major * 10000 + minor * 100 + release */ #define LIBRDF_VERSION @LIBRDF_VERSION_DECIMAL@ /** * LIBRDF_VERSION_STRING: * * Redland librdf library version string */ #define LIBRDF_VERSION_STRING "@VERSION@" /** * LIBRDF_VERSION_MAJOR: * * Redland librdf library major version */ #define LIBRDF_VERSION_MAJOR @LIBRDF_VERSION_MAJOR@ /** * LIBRDF_VERSION_MINOR: * * Redland librdf library minor version */ #define LIBRDF_VERSION_MINOR @LIBRDF_VERSION_MINOR@ /** * LIBRDF_VERSION_RELEASE: * * Redland librdf library release */ #define LIBRDF_VERSION_RELEASE @LIBRDF_VERSION_RELEASE@ /* Public typedefs (references to private structures) */ /** * librdf_world: * * Redland world class. */ typedef struct librdf_world_s librdf_world; /** * librdf_hash: * * Redland hash class. */ typedef struct librdf_hash_s librdf_hash; /** * librdf_hash_cursor: * * Redland hash cursor class. */ typedef struct librdf_hash_cursor_s librdf_hash_cursor; /** * librdf_digest: * * Redland content digest class. */ typedef struct librdf_digest_s librdf_digest; /** * librdf_digest_factory: * * Redland digest factory class. */ typedef struct librdf_digest_factory_s librdf_digest_factory; /** * librdf_uri: * * Redland URI class. */ typedef struct raptor_uri_s librdf_uri; /** * librdf_list: * * Redland list class. */ typedef struct librdf_list_s librdf_list; /** * librdf_iterator: * * Redland iterator class. */ typedef struct librdf_iterator_s librdf_iterator; /** * librdf_node: * * Redland node class. */ typedef raptor_term librdf_node; /** * librdf_statement: * * Redland statement class. */ typedef raptor_statement librdf_statement; /** * librdf_model: * * Redland model class. */ typedef struct librdf_model_s librdf_model; /** * librdf_model_factory: * * Redland model factory class. */ typedef struct librdf_model_factory_s librdf_model_factory; /** * librdf_storage: * * Redland storage class. */ typedef struct librdf_storage_s librdf_storage; /** * librdf_storage_factory: * * Redland storage factory class. */ typedef struct librdf_storage_factory_s librdf_storage_factory; /** * librdf_stream: * * Redland stream class. */ typedef struct librdf_stream_s librdf_stream; /** * librdf_parser: * * Redland parser class. */ typedef struct librdf_parser_s librdf_parser; /** * librdf_parser_factory: * * Redland parser factory class. */ typedef struct librdf_parser_factory_s librdf_parser_factory; /** * librdf_query: * * Redland query class. */ typedef struct librdf_query_s librdf_query; /** * librdf_query_factory: * * Redland query factory class. */ typedef struct librdf_query_factory_s librdf_query_factory; /** * librdf_query_results: * * Redland query results class. */ typedef struct librdf_query_results_s librdf_query_results; /** * librdf_query_results_formatter: * * Redland query results formatter class. */ typedef struct librdf_query_results_formatter_s librdf_query_results_formatter; /** * librdf_serializer: * * Redland serializer class. */ typedef struct librdf_serializer_s librdf_serializer; /** * librdf_serializer_factory: * * Redland serializer factory class. */ typedef struct librdf_serializer_factory_s librdf_serializer_factory; /* Public statics */ /** * librdf_short_copyright_string: * * Short copyright string (one line). */ REDLAND_API extern const char * const librdf_short_copyright_string; /** * librdf_copyright_string: * * Copyright string (multiple lines). */ REDLAND_API extern const char * const librdf_copyright_string; /** * librdf_version_string: * * Redland librdf version as a string. */ REDLAND_API extern const char * const librdf_version_string; /** * librdf_version_major: * * Redland librdf major version number. */ REDLAND_API extern const unsigned int librdf_version_major; /** * librdf_version_minor: * * Redland librdf minor version number. */ REDLAND_API extern const unsigned int librdf_version_minor; /** * librdf_version_release: * * Redland librdf release version number. */ REDLAND_API extern const unsigned int librdf_version_release; /** * librdf_version_decimal: * * Redland librdf version as a decimal number. * * Format: major * 10000 + minor * 100 + release */ REDLAND_API extern const unsigned int librdf_version_decimal; /** * librdf_license_string: * * Redland librdf license string. */ REDLAND_API extern const char * const librdf_license_string; /** * librdf_home_url_string: * * Redland librdf home page URL. */ REDLAND_API extern const char * const librdf_home_url_string; /* Required for va_list in error handler function registrations * which are in the public API */ #include /* internal interfaces */ #ifdef LIBRDF_INTERNAL #include #endif /* public interfaces */ /* FIXME: Should be replaced with automatically pulled * definitions from the listed rdf_*.h header files. */ #ifndef LIBRDF_OBJC_FRAMEWORK #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #else #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_heuristics.c0000644000175000017500000001303711773150065014113 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_heuristics.c - Heuristic routines to guess things about RDF * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include #ifdef HAVE_STDLIB_H #include /* for strtol */ #endif #include #ifndef STANDALONE /** * librdf_heuristic_is_blank_node: * @node: string object to guess type * * Try to guess if an node string is a blank node identifier. * * The guessing is done by assuming the object is a blank node if it matches * ^_: like N-Triples, N3 and related. * * Return value: non 0 if node is probably a blank node identifier **/ int librdf_heuristic_is_blank_node(const char *node) { return node && (*node == '_' && node[1] == ':'); } /** * librdf_heuristic_get_blank_node: * @node: string object to guess type * * Get a blank node identifier from a node string. * * Picks the blank node identifier out of a string. Looks for things * like _:ABC * * Return value: the blank node identifer string or NULL if the node does not seem to be a blank node identifier **/ const char* librdf_heuristic_get_blank_node(const char *node) { return librdf_heuristic_is_blank_node(node) ? node+2 : NULL; } /** * librdf_heuristic_object_is_literal: * @object: string object to guess type * * Try to guess if an object string is a literal or a resource. * * The guessing is done by assuming the object is a URL if it matches * ^[isalnum()]+:[^isblank()]+$ * * This will be fooled by literals of form 'thing:non-blank-thing' but * is good enough. * * Return value: non 0 if object is probably a literal **/ int librdf_heuristic_object_is_literal(const char *object) { int object_is_literal=1; /* assume the worst */ if(!object) return 0; if(librdf_heuristic_is_blank_node(object)) return 0; /* Find first non alphanumeric */ for(;*object; object++) if(!isalnum((int)*object)) break; /* Better be a ':' */ if(*object && *object == ':') { /* check rest of string has no spaces */ for(;*object; object++) if(isspace((int)*object)) break; /* reached end, not a literal (by this heuristic) */ if(!*object) object_is_literal=0; } return object_is_literal; } /** * librdf_heuristic_gen_name: * @name: the name * * Generate a new name from an existing name. * * Adds an integer or increases the integer at the end of the name * in order to generate a new one * * Return value: a new name or NULL on failure **/ char * librdf_heuristic_gen_name(const char *name) { char *new_name; const char *p = name; size_t len; size_t offset; long l = -1L; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(name, cstring, NULL); /* Move to last character of name */ len = strlen(name); offset = len - 1; p = name + offset; /* Move p to last non number char */ if(isdigit((int)*p)) { while(p > name && isdigit((int)*p)) p--; l = strtol(p + 1, (char**)NULL, 10); offset = LIBRDF_GOOD_CAST(size_t, p - name); } if(l < 0) l = 0; l++; /* +1 to required length if no digit was found */ if(offset == len - 1) len++; /* +1 to required length if an extra digit is needed - * number now ends in 0. Note l is never 0. */ if((l % 10) == 0) len++; new_name = LIBRDF_MALLOC(char*, len + 1); /* +1 for \0 */ strncpy(new_name, name, offset + 2); sprintf(new_name + offset + 1, "%ld", l); return new_name; } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { const char *test_names[]={"test", "abc123", "99997", NULL}; char *name; int n; int rc=0; #define NAMES_COUNT 11 const char *program=librdf_basename((const char*)argv[0]); for(n=0; (name=(char*)test_names[n]); n++) { int i; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 fprintf(stdout, "%s: Generating %d new names from '%s'\n", program, NAMES_COUNT, name); #endif for(i=0; i< NAMES_COUNT; i++) { char *new_name; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 fprintf(stdout, "Generating name from '%s'\n", name); #endif new_name=librdf_heuristic_gen_name(name); if(!new_name) { fprintf(stdout, "%s: Failed to generate name from '%s'\n", program, name); rc=1; break; } #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 fprintf(stdout, " result was '%s'\n", new_name); #endif if(name != test_names[n]) LIBRDF_FREE(char*, (char*)name); /* copy them over */ name=new_name; } if(name != test_names[n]) LIBRDF_FREE(char*, name); } return rc; } #endif redland-1.0.17/src/rdf_heuristics.h0000644000175000017500000000243111167024222014104 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_heuristics.h - Heuristic routines to guess things about RDF prototypes * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_HEURISTICS_H #define LIBRDF_HEURISTICS_H #ifdef __cplusplus extern "C" { #endif char* librdf_heuristic_gen_name(const char *name); int librdf_heuristic_is_blank_node(const char *node); const char* librdf_heuristic_get_blank_node(const char *node); int librdf_heuristic_object_is_literal(const char *object); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_statement.c0000644000175000017500000006005411655006762013741 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_raptor_statement.c - RDF Statement Class using raptor_statement * * Copyright (C) 2010-2011, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include #ifndef STANDALONE static size_t librdf_statement_encode_parts_internal(librdf_statement* statement, librdf_node* context_node, unsigned char *buffer, size_t length, librdf_statement_part fields); /* class methods */ /** * librdf_new_statement: * @world: redland world object * * Constructor - create a new empty #librdf_statement. * * Return value: a new #librdf_statement or NULL on failure **/ librdf_statement* librdf_new_statement(librdf_world *world) { librdf_world_open(world); return raptor_new_statement(world->raptor_world_ptr); } /** * librdf_new_statement_from_statement: * @statement: #librdf_statement to copy * * Copy constructor - create a new librdf_statement from an existing librdf_statement. * Creates a deep copy - changes to original statement nodes are not reflected in the copy. * * Return value: a new #librdf_statement with copy or NULL on failure **/ librdf_statement* librdf_new_statement_from_statement(librdf_statement* statement) { raptor_term *subject = NULL; raptor_term *predicate = NULL; raptor_term *object = NULL; raptor_term *graph = NULL; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); if(!statement) return NULL; subject = raptor_term_copy(statement->subject); if(statement->subject && !subject) goto err; predicate = raptor_term_copy(statement->predicate); if(statement->predicate && !predicate) goto err; object = raptor_term_copy(statement->object); if(statement->object && !object) goto err; graph = raptor_term_copy(statement->graph); if(statement->graph && !graph) goto err; return raptor_new_statement_from_nodes(statement->world, subject, predicate, object, graph); err: if(graph) raptor_free_term(graph); if(object) raptor_free_term(object); if(predicate) raptor_free_term(predicate); if(subject) raptor_free_term(subject); return NULL; } /** * librdf_new_statement_from_statement2: * @statement: #librdf_statement to copy * * Copy constructor - create a new librdf_statement from an existing librdf_statement. * Creates a shallow copy - changes to original statement nodes are reflected in the copy. * * Return value: a new #librdf_statement with copy or NULL on failure **/ librdf_statement* librdf_new_statement_from_statement2(librdf_statement* statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); if(!statement) return NULL; return raptor_statement_copy(statement); } /** * librdf_new_statement_from_nodes: * @world: redland world object * @subject: #librdf_node * @predicate: #librdf_node * @object: #librdf_node * * Constructor - create a new #librdf_statement from existing #librdf_node objects. * * The node objects become owned by the new statement (or freed on error). * * Return value: a new #librdf_statement with copy or NULL on failure **/ librdf_statement* librdf_new_statement_from_nodes(librdf_world *world, librdf_node* subject, librdf_node* predicate, librdf_node* object) { librdf_world_open(world); return raptor_new_statement_from_nodes(world->raptor_world_ptr, subject, predicate, object, NULL); } /** * librdf_statement_init: * @world: redland world object * @statement: #librdf_statement object * * Initialise a statically declared librdf_statement. * * This MUST be called on a statically declared librdf_statement * to initialise it properly. It is the responsibility of the * user of the statically allocated librdf_statement to deal * with deallocation of any statement parts (subject, predicate, object). **/ void librdf_statement_init(librdf_world *world, librdf_statement *statement) { librdf_world_open(world); LIBRDF_ASSERT_OBJECT_POINTER_RETURN(statement, librdf_statement); raptor_statement_init(statement, world->raptor_world_ptr); } /** * librdf_statement_clear: * @statement: #librdf_statement object * * Empty a librdf_statement of nodes. * **/ void librdf_statement_clear(librdf_statement *statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN(statement, librdf_statement); raptor_statement_clear(statement); } /** * librdf_free_statement: * @statement: #librdf_statement object * * Destructor - destroy a #librdf_statement. * **/ void librdf_free_statement(librdf_statement* statement) { if(!statement) return; raptor_free_statement(statement); } /* methods */ /** * librdf_statement_get_subject: * @statement: #librdf_statement object * * Get the statement subject. * * This method returns a SHARED pointer to the subject which must * be copied by the caller if needed. * * Return value: a pointer to the #librdf_node of the statement subject - **/ librdf_node* librdf_statement_get_subject(librdf_statement *statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); return statement->subject; } /** * librdf_statement_set_subject: * @statement: #librdf_statement object * @node: #librdf_node of subject * * Set the statement subject. * * The subject passed in becomes owned by * the statement object and must not be used by the caller after this call. **/ void librdf_statement_set_subject(librdf_statement *statement, librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN(statement, librdf_statement); statement->subject = node; } /** * librdf_statement_get_predicate: * @statement: #librdf_statement object * * Get the statement predicate. * * This method returns a SHARED pointer to the predicate which must * be copied by the caller if needed. * * Return value: a pointer to the #librdf_node of the statement predicate - **/ librdf_node* librdf_statement_get_predicate(librdf_statement *statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); return statement->predicate; } /** * librdf_statement_set_predicate: * @statement: #librdf_statement object * @node: #librdf_node of predicate * * Set the statement predicate. * * The predicate passed in becomes owned by * the statement object and must not be used by the caller after this call. **/ void librdf_statement_set_predicate(librdf_statement *statement, librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN(statement, librdf_statement); statement->predicate = node; } /** * librdf_statement_get_object: * @statement: #librdf_statement object * * Get the statement object. * * This method returns a SHARED pointer to the object which must * be copied by the caller if needed. * * Return value: a pointer to the #librdf_node of the statement object - **/ librdf_node* librdf_statement_get_object(librdf_statement *statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); return statement->object; } /** * librdf_statement_set_object: * @statement: #librdf_statement object * @node: #librdf_node of object * * Set the statement object. * * The object passed in becomes owned by * the statement object and must not be used by the caller after this call. **/ void librdf_statement_set_object(librdf_statement *statement, librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN(statement, librdf_statement); statement->object = node; } /** * librdf_statement_is_complete: * @statement: #librdf_statement object * * Check if statement is a complete and legal RDF triple. * * Checks that all subject, predicate, object fields are present * and they have the allowed node types. * * Return value: non 0 if the statement is complete and legal **/ int librdf_statement_is_complete(librdf_statement *statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 0); if(!statement->subject || (!librdf_node_is_resource(statement->subject) && !librdf_node_is_blank(statement->subject))) return 0; if(!statement->predicate || !librdf_node_is_resource(statement->predicate)) return 0; if(!statement->object) return 0; return 1; } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_statement_to_string: * @statement: the statement * * Format the librdf_statement as a string. * * Formats the statement as a newly allocate string that must be freed by * the caller. * * @Deprecated: Use librdf_statement_write() to write to * #raptor_iostream which can be made to write to a string. Use a * #librdf_serializer to write proper syntax formats. * * Return value: the string or NULL on failure. **/ unsigned char * librdf_statement_to_string(librdf_statement *statement) { raptor_iostream* iostr; unsigned char *s; int rc; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); iostr = raptor_new_iostream_to_string(statement->world, (void**)&s, NULL, malloc); if(!iostr) return NULL; rc = librdf_statement_write(statement, iostr); raptor_free_iostream(iostr); if(rc) { raptor_free_memory(s); s = NULL; } return s; } #endif /** * librdf_statement_write: * @statement: the statement * @iostr: raptor iostream to write to * * Write the statement to an iostream * * This method is for debugging and the format of the output should * not be relied on. * * Return value: non-0 on failure **/ int librdf_statement_write(librdf_statement *statement, raptor_iostream *iostr) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 1); if(!statement) return 1; if(librdf_node_write(statement->subject, iostr)) return 1; raptor_iostream_write_byte(' ', iostr); if(librdf_node_write(statement->predicate, iostr)) return 1; raptor_iostream_write_byte(' ', iostr); if(librdf_node_write(statement->object, iostr)) return 1; return 0; } /** * librdf_statement_print: * @statement: the statement * @fh: file handle * * Pretty print the statement to a file descriptor. * * This method is for debugging and the format of the output should * not be relied on. * **/ void librdf_statement_print(librdf_statement *statement, FILE *fh) { raptor_iostream *iostr; LIBRDF_ASSERT_OBJECT_POINTER_RETURN(statement, librdf_statement); if(!statement) return; iostr = raptor_new_iostream_to_file_handle(statement->world, fh); if(!iostr) return; librdf_statement_write(statement, iostr); raptor_free_iostream(iostr); } /** * librdf_statement_equals: * @statement1: first #librdf_statement * @statement2: second #librdf_statement * * Check if two statements are equal. * * Return value: non 0 if statements are equal **/ int librdf_statement_equals(librdf_statement* statement1, librdf_statement* statement2) { return raptor_statement_equals(statement1, statement2); } /** * librdf_statement_match: * @statement: statement * @partial_statement: statement with possible empty parts * * Match a statement against a 'partial' statement. * * A partial statement is where some parts of the statement - * subject, predicate or object can be empty (NULL). * Empty parts match against any value, parts with values * must match exactly. Node matching is done via librdf_node_equals() * * Return value: non 0 on match **/ int librdf_statement_match(librdf_statement* statement, librdf_statement* partial_statement) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(partial_statement, librdf_statement, 0); if(partial_statement->subject && !raptor_term_equals(statement->subject, partial_statement->subject)) return 0; if(partial_statement->predicate && !raptor_term_equals(statement->predicate, partial_statement->predicate)) return 0; if(partial_statement->object && !raptor_term_equals(statement->object, partial_statement->object)) return 0; return 1; } /** * librdf_statement_encode2: * @world: redland world * @statement: the statement to serialise * @buffer: the buffer to use * @length: buffer size * * Serialise a statement into a buffer. * * Encodes the given statement in the buffer, which must be of sufficient * size. If buffer is NULL, no work is done but the size of buffer * required is returned. * * Return value: the number of bytes written or 0 on failure. **/ size_t librdf_statement_encode2(librdf_world *world, librdf_statement* statement, unsigned char *buffer, size_t length) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 0); return librdf_statement_encode_parts2(world, statement, NULL, buffer, length, LIBRDF_STATEMENT_ALL); } /** * librdf_statement_encode: * @statement: the statement to serialise * @buffer: the buffer to use * @length: buffer size * * Serialise a statement into a buffer. * * Encodes the given statement in the buffer, which must be of sufficient * size. If buffer is NULL, no work is done but the size of buffer * required is returned. * * @Deprecated: Use librdf_statement_encode2() * * Return value: the number of bytes written or 0 on failure. **/ size_t librdf_statement_encode(librdf_statement* statement, unsigned char *buffer, size_t length) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 0); return librdf_statement_encode_parts_internal(statement, NULL, buffer, length, LIBRDF_STATEMENT_ALL); } static size_t librdf_statement_encode_parts_internal(librdf_statement* statement, librdf_node* context_node, unsigned char *buffer, size_t length, librdf_statement_part fields) { size_t total_length = 0; size_t node_len; unsigned char *p; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 0); /* min size */ if(buffer && length < 1) return 0; p = buffer; /* magic number 'x' */ if(p) { *p++ = 'x'; length--; } total_length++; if((fields & LIBRDF_STATEMENT_SUBJECT) && statement->subject) { /* 's' + subject */ if(p) { if(length < 1) return 0; *p++ = 's'; length--; } total_length++; node_len = librdf_node_encode(statement->subject, p, length); if(!node_len) return 0; if(p) { p += node_len; length -= node_len; } total_length += node_len; } if((fields & LIBRDF_STATEMENT_PREDICATE) && statement->predicate) { /* 'p' + predicate */ if(p) { if(length < 1) return 0; *p++ = 'p'; length--; } total_length++; node_len = librdf_node_encode(statement->predicate, p, length); if(!node_len) return 0; if(p) { p += node_len; length -= node_len; } total_length += node_len; } if((fields & LIBRDF_STATEMENT_OBJECT) && statement->object) { /* 'o' object */ if(p) { if(length < 1) return 0; *p++ = 'o'; length--; } total_length++; node_len = librdf_node_encode(statement->object, p, length); if(!node_len) return 0; if(p) { p += node_len; length -= node_len; } total_length += node_len; } if(context_node) { /* 'o' object */ if(p) { *p++ = 'c'; length--; } total_length++; node_len = librdf_node_encode(context_node, p, length); if(!node_len) return 0; /* p and length changes never needed to be calculated [clang] */ /* if(p) { p += node_len; length -= node_len; } */ total_length += node_len; } return total_length; } /** * librdf_statement_encode_parts: * @statement: statement to serialise * @context_node: #librdf_node context node (can be NULL) * @buffer: the buffer to use * @length: buffer size * @fields: fields to encode * * Serialise parts of a statement into a buffer. * * Encodes the given statement in the buffer, which must be of sufficient * size. If buffer is NULL, no work is done but the size of buffer * required is returned. * * The fields values are or-ed combinations of: * #LIBRDF_STATEMENT_SUBJECT #LIBRDF_STATEMENT_PREDICATE * #LIBRDF_STATEMENT_OBJECT * or #LIBRDF_STATEMENT_ALL for subject,prdicate,object fields * * If context_node is given, it is encoded also * * @Deprecated: This will no longer be a public API * * Return value: the number of bytes written or 0 on failure. **/ size_t librdf_statement_encode_parts(librdf_statement* statement, librdf_node* context_node, unsigned char *buffer, size_t length, librdf_statement_part fields) { return librdf_statement_encode_parts_internal(statement, context_node, buffer, length, fields); } /** * librdf_statement_decode: * @statement: the statement to deserialise into * @buffer: the buffer to use * @length: buffer size * * Decodes a statement from a buffer. (ALWAYS FAILS) * * Used to decode the serialised statement as created by * librdf_statement_encode() from the given buffer. * * @Deprecated: Replaced by librdf_statement_decode2() which works. * * Return value: 0 signifying failure **/ size_t librdf_statement_decode(librdf_statement* statement, unsigned char *buffer, size_t length) { return 0; } /** * librdf_statement_decode_parts: * @statement: the statement to deserialise into * @context_node: pointer to #librdf_node context_node to deserialise into * @buffer: the buffer to use * @length: buffer size * * Decodes a statement + context node from a buffer. (ALWAYS FAILS) * * Used to decode the serialised statement as created by * librdf_statement_encode() from the given buffer. * * @Deprecated: Replaced by librdf_statement_decode2() which works. * * Return value: 0 signifying failure **/ size_t librdf_statement_decode_parts(librdf_statement* statement, librdf_node** context_node, unsigned char *buffer, size_t length) { return 0; } /** * librdf_statement_decode2: * @world: redland world * @statement: the statement to deserialise into * @context_node: pointer to #librdf_node context_node to deserialise into * @buffer: the buffer to use * @length: buffer size * * Decodes a statement + context node from a buffer. * * Decodes the serialised statement (as created by librdf_statement_encode() ) * from the given buffer. If a context node is found and context_node is * not NULL, a pointer to the new #librdf_node is stored in *context_node. * * Return value: number of bytes used or 0 on failure (bad encoding, allocation failure) **/ size_t librdf_statement_decode2(librdf_world* world, librdf_statement* statement, librdf_node** context_node, unsigned char *buffer, size_t length) { unsigned char *p; librdf_node* node; unsigned char type; size_t total_length = 0; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 0); #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG2("Decoding buffer of %d bytes\n", length); #endif /* absolute minimum - first byte is type */ if(length < 1) return 0; p = buffer; if(*p++ != 'x') return 0; length--; total_length++; while(length > 0) { size_t node_len; type = *p++; length--; total_length++; if(!length) return 0; if(!(node = librdf_node_decode(world, &node_len, p, length))) return 0; p += node_len; length -= node_len; total_length += node_len; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG3("Found type %c (%d bytes)\n", type, node_len); #endif switch(type) { case 's': /* subject */ statement->subject = node; break; case 'p': /* predicate */ statement->predicate = node; break; case 'o': /* object */ statement->object = node; break; case 'c': /* context */ if(context_node) *context_node = node; else librdf_free_node(node); break; default: /* FIXME - report this or not? */ return 0; } } return total_length; } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { librdf_statement *statement, *statement2; int size, size2; const char *program=librdf_basename((const char*)argv[0]); char *s, *buffer; librdf_world *world; raptor_iostream *iostr; world=librdf_new_world(); librdf_world_open(world); iostr = raptor_new_iostream_to_file_handle(world->raptor_world_ptr, stdout); fprintf(stdout, "%s: Creating statement\n", program); statement=librdf_new_statement(world); fprintf(stdout, "%s: Empty statement: ", program); librdf_statement_write(statement, iostr); fputs("\n", stdout); librdf_statement_set_subject(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/net/dajobe/")); librdf_statement_set_predicate(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/#Creator")); librdf_statement_set_object(statement, librdf_new_node_from_literal(world, (const unsigned char*)"Dave Beckett", NULL, 0)); fprintf(stdout, "%s: Resulting statement: ", program); librdf_statement_write(statement, iostr); fputs("\n", stdout); size = librdf_statement_encode2(world, statement, NULL, 0); fprintf(stdout, "%s: Encoding statement requires %d bytes\n", program, size); buffer = LIBRDF_MALLOC(char*, size); fprintf(stdout, "%s: Encoding statement in buffer\n", program); size2 = librdf_statement_encode2(world, statement, (unsigned char*)buffer, size); if(size2 != size) { fprintf(stdout, "%s: Encoding statement used %d bytes, expected it to use %d\n", program, size2, size); return(1); } fprintf(stdout, "%s: Creating new statement\n", program); statement2=librdf_new_statement(world); fprintf(stdout, "%s: Decoding statement from buffer\n", program); if(!librdf_statement_decode2(world, statement2, NULL, (unsigned char*)buffer, size)) { fprintf(stdout, "%s: Decoding statement failed\n", program); return(1); } LIBRDF_FREE(char*, buffer); fprintf(stdout, "%s: New statement is: ", program); librdf_statement_write(statement, iostr); fputs("\n", stdout); fprintf(stdout, "%s: Freeing statements\n", program); librdf_free_statement(statement2); librdf_free_statement(statement); raptor_free_iostream(iostr); librdf_free_world(world); /* keep gcc -Wall happy */ return(0); } #endif redland-1.0.17/src/rdf_concepts.h0000644000175000017500000004265112241001460013541 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_concepts.h - Definitions of RDF concept URIs and nodes * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_CONCEPTS_H #define LIBRDF_CONCEPTS_H #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif typedef enum { LIBRDF_CONCEPT_MS_Alt, LIBRDF_CONCEPT_MS_Bag, LIBRDF_CONCEPT_MS_Property, LIBRDF_CONCEPT_MS_Seq, LIBRDF_CONCEPT_MS_Statement, LIBRDF_CONCEPT_MS_object, LIBRDF_CONCEPT_MS_predicate, LIBRDF_CONCEPT_MS_subject, LIBRDF_CONCEPT_MS_type, LIBRDF_CONCEPT_MS_value, LIBRDF_CONCEPT_MS_li, LIBRDF_CONCEPT_MS_RDF, LIBRDF_CONCEPT_MS_Description, LIBRDF_CONCEPT_MS_aboutEach, LIBRDF_CONCEPT_MS_aboutEachPrefix, LIBRDF_CONCEPT_RS_nodeID, LIBRDF_CONCEPT_RS_List, LIBRDF_CONCEPT_RS_first, LIBRDF_CONCEPT_RS_rest, LIBRDF_CONCEPT_RS_nil, LIBRDF_CONCEPT_RS_XMLLiteral, /* RDF Schema concepts defined in prose at * http://www.w3.org/TR/2000/CR-rdf-schema-20000327/ * and in RDF Schema form at * http://www.w3.org/2000/01/rdf-schema */ LIBRDF_CONCEPT_S_Class, LIBRDF_CONCEPT_S_ConstraintProperty, LIBRDF_CONCEPT_S_ConstraintResource, LIBRDF_CONCEPT_S_Container, LIBRDF_CONCEPT_S_ContainerMembershipProperty, LIBRDF_CONCEPT_S_Literal, LIBRDF_CONCEPT_S_Resource, LIBRDF_CONCEPT_S_comment, LIBRDF_CONCEPT_S_domain, LIBRDF_CONCEPT_S_isDefinedBy, LIBRDF_CONCEPT_S_label, LIBRDF_CONCEPT_S_range, LIBRDF_CONCEPT_S_seeAlso, LIBRDF_CONCEPT_S_subClassOf, LIBRDF_CONCEPT_S_subPropertyOf, /* first entry from schema namespace */ LIBRDF_CONCEPT_FIRST_S_ID = LIBRDF_CONCEPT_S_Class, LIBRDF_CONCEPT_LAST_S_ID = LIBRDF_CONCEPT_S_subPropertyOf, LIBRDF_CONCEPT_RDF11_HTML, LIBRDF_CONCEPT_RDF11_langString, LIBRDF_CONCEPT_LAST = LIBRDF_CONCEPT_RDF11_langString } librdf_concepts_index; /* NOTE: If the above list changes, edit the macros below and * librdf_concept_labels in rdf_concepts.c The above list is ordered * by simple 'sort' order */ /* Get Redland uri object for RDF Syntax/Schema namespaces */ REDLAND_API librdf_uri* librdf_get_concept_ms_namespace(librdf_world *world); REDLAND_API librdf_uri* librdf_get_concept_schema_namespace(librdf_world *world); /* Get Redland node/uri object for RDF concepts */ REDLAND_API librdf_node* librdf_get_concept_resource_by_index(librdf_world *world, librdf_concepts_index idx); REDLAND_API librdf_uri* librdf_get_concept_uri_by_index(librdf_world *world, librdf_concepts_index idx); /* public macros for the resources (librdf_node*) representing the concepts */ /** * LIBRDF_MS_Alt: * * RDF namespace concept librdf_node Alt */ #define LIBRDF_MS_Alt(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_Alt) /** * LIBRDF_MS_Bag: * * RDF namespace concept librdf_node Bag */ #define LIBRDF_MS_Bag(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_Bag) /** * LIBRDF_MS_Property: * * RDF namespace concept librdf_node Property */ #define LIBRDF_MS_Property(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_Property) /** * LIBRDF_MS_Seq: * * RDF namespace concept librdf_node Seq */ #define LIBRDF_MS_Seq(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_Seq) /** * LIBRDF_MS_Statement: * * RDF namespace concept librdf_node Statement */ #define LIBRDF_MS_Statement(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_Statement) /** * LIBRDF_MS_object: * * RDF namespace concept librdf_node object */ #define LIBRDF_MS_object(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_object) /** * LIBRDF_MS_predicate: * * RDF namespace concept librdf_node predicate */ #define LIBRDF_MS_predicate(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_predicate) /** * LIBRDF_MS_subject: * * RDF namespace concept librdf_node subject */ #define LIBRDF_MS_subject(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_subject) /** * LIBRDF_MS_type: * * RDF namespace concept librdf_node type */ #define LIBRDF_MS_type(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_type) /** * LIBRDF_MS_value: * * RDF namespace concept librdf_node value */ #define LIBRDF_MS_value(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_value) /** * LIBRDF_MS_li: * * RDF namespace concept librdf_node li */ #define LIBRDF_MS_li(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_li) /** * LIBRDF_MS_RDF: * * RDF namespace concept librdf_node RDF */ #define LIBRDF_MS_RDF(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_RDF) /** * LIBRDF_MS_Description: * * RDF namespace concept librdf_node Description */ #define LIBRDF_MS_Description(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_Description) /** * LIBRDF_MS_aboutEach: * * RDF namespace concept librdf_node aboutEach */ #define LIBRDF_MS_aboutEach(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_aboutEach) /** * LIBRDF_MS_aboutEachPrefix: * * RDF namespace concept librdf_node aboutEachPrefix */ #define LIBRDF_MS_aboutEachPrefix(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_MS_aboutEachPrefix) /** * LIBRDF_RS_nodeID: * * RDF namespace concept librdf_node nodeID */ #define LIBRDF_RS_nodeID(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_RS_nodeID) /** * LIBRDF_RS_List: * * RDF namespace concept librdf_node List */ #define LIBRDF_RS_List(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_RS_List) /** * LIBRDF_RS_first: * * RDF namespace concept librdf_node first */ #define LIBRDF_RS_first(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_RS_first) /** * LIBRDF_RS_rest: * * RDF namespace concept librdf_node rest */ #define LIBRDF_RS_rest(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_RS_rest) /** * LIBRDF_RS_nil: * * RDF namespace concept librdf_node nil */ #define LIBRDF_RS_nil(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_RS_nil) /** * LIBRDF_RS_XMLLiteral: * * RDF namespace concept librdf_node XMLLiteral */ #define LIBRDF_RS_XMLLiteral(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_RS_XMLLiteral) /** * LIBRDF_S_Class: * * RDFS namespace concept Class */ #define LIBRDF_S_Class(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_Class) /** * LIBRDF_S_ConstraintProperty: * * RDFS namespace concept ConstraintProperty */ #define LIBRDF_S_ConstraintProperty(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_ConstraintProperty) /** * LIBRDF_S_ConstraintResource: * * RDFS namespace concept ConstraintResource */ #define LIBRDF_S_ConstraintResource(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_ConstraintResource) /** * LIBRDF_S_Container: * * RDFS namespace concept Container */ #define LIBRDF_S_Container(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_Container) /** * LIBRDF_S_ContainerMembershipProperty: * * RDFS namespace concept ContainerMembershipProperty */ #define LIBRDF_S_ContainerMembershipProperty(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_ContainerMembershipProperty) /** * LIBRDF_S_Literal: * * RDFS namespace concept Literal */ #define LIBRDF_S_Literal(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_Literal) /** * LIBRDF_S_Resource: * * RDFS namespace concept Resource */ #define LIBRDF_S_Resource(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_Resource) /** * LIBRDF_S_comment: * * RDFS namespace concept comment */ #define LIBRDF_S_comment(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_comment) /** * LIBRDF_S_domain: * * RDFS namespace concept domain */ #define LIBRDF_S_domain(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_domain) /** * LIBRDF_S_isDefinedBy: * * RDFS namespace concept isDefinedBy */ #define LIBRDF_S_isDefinedBy(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_isDefinedBy) /** * LIBRDF_S_label: * * RDFS namespace concept label */ #define LIBRDF_S_label(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_label) /** * LIBRDF_S_range: * * RDFS namespace concept range */ #define LIBRDF_S_range(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_range) /** * LIBRDF_S_seeAlso: * * RDFS namespace concept seeAlso */ #define LIBRDF_S_seeAlso(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_seeAlso) /** * LIBRDF_S_subClassOf: * * RDFS namespace concept subClassOf */ #define LIBRDF_S_subClassOf(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_subClassOf) /** * LIBRDF_S_subPropertyOf: * * RDFS namespace concept subPropertyOf */ #define LIBRDF_S_subPropertyOf(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_subPropertyOf) /** * LIBRDF_S_subPropertyOf: * * RDFS namespace concept subPropertyOf */ #define LIBRDF_S_subPropertyOf(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_S_subPropertyOf) /* public macros for the URIs (librdf_uri*) representing the concepts */ /** * LIBRDF_MS_Alt_URI: * * RDF namespace concept URI Alt */ #define LIBRDF_MS_Alt_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_Alt) /** * LIBRDF_MS_Bag_URI: * * RDF namespace concept URI Bag */ #define LIBRDF_MS_Bag_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_Bag) /** * LIBRDF_MS_Property_URI: * * RDF namespace concept URI Property */ #define LIBRDF_MS_Property_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_Property) /** * LIBRDF_MS_Seq_URI: * * RDF namespace concept URI Seq */ #define LIBRDF_MS_Seq_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_Seq) /** * LIBRDF_MS_Statement_URI: * * RDF namespace concept URI Statement */ #define LIBRDF_MS_Statement_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_Statement) /** * LIBRDF_MS_object_URI: * * RDF namespace concept URI object */ #define LIBRDF_MS_object_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_object) /** * LIBRDF_MS_predicate_URI: * * RDF namespace concept URI predicate */ #define LIBRDF_MS_predicate_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_predicate) /** * LIBRDF_MS_subject_URI: * * RDF namespace concept URI subject */ #define LIBRDF_MS_subject_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_subject) /** * LIBRDF_MS_type_URI: * * RDF namespace concept URI type */ #define LIBRDF_MS_type_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_type) /** * LIBRDF_MS_value_URI: * * RDF namespace concept URI value */ #define LIBRDF_MS_value_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_value) /** * LIBRDF_MS_li_URI: * * RDF namespace concept URI li */ #define LIBRDF_MS_li_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_li) /** * LIBRDF_MS_RDF_URI: * * RDF namespace concept URI RDF */ #define LIBRDF_MS_RDF_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_RDF) /** * LIBRDF_MS_Description_URI: * * RDF namespace concept URI Description */ #define LIBRDF_MS_Description_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_Description) /** * LIBRDF_MS_aboutEach_URI: * * RDF namespace concept URI aboutEach */ #define LIBRDF_MS_aboutEach_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_aboutEach) /** * LIBRDF_MS_aboutEachPrefix_URI: * * RDF namespace concept URI aboutEachPrefix */ #define LIBRDF_MS_aboutEachPrefix_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_MS_aboutEachPrefix) /** * LIBRDF_RS_nodeID_URI: * * RDF namespace concept URI nodeID */ #define LIBRDF_RS_nodeID_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_RS_nodeID) /** * LIBRDF_RS_List_URI: * * RDF namespace concept URI List */ #define LIBRDF_RS_List_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_RS_List) /** * LIBRDF_RS_first_URI: * * RDF namespace concept URI first */ #define LIBRDF_RS_first_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_RS_first) /** * LIBRDF_RS_rest_URI: * * RDF namespace concept URI rest */ #define LIBRDF_RS_rest_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_RS_rest) /** * LIBRDF_RS_nil_URI: * * RDF namespace concept URI nil */ #define LIBRDF_RS_nil_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_RS_nil) /** * LIBRDF_RS_XMLLiteral_URI: * * RDF namespace concept URI XMLLiteral */ #define LIBRDF_RS_XMLLiteral_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_RS_XMLLiteral) /** * LIBRDF_S_subPropertyOf_URI: * * RDFS namespace concept URI subPropertyOf */ #define LIBRDF_S_subPropertyOf_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_subPropertyOf) /** * LIBRDF_S_subClassOf_URI: * * RDFS namespace concept URI subClassOf */ #define LIBRDF_S_subClassOf_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_subClassOf) /** * LIBRDF_S_seeAlso_URI: * * RDFS namespace concept URI seeAlso */ #define LIBRDF_S_seeAlso_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_seeAlso) /** * LIBRDF_S_range_URI: * * RDFS namespace concept URI range */ #define LIBRDF_S_range_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_range) /** * LIBRDF_S_label_URI: * * RDFS namespace concept URI label */ #define LIBRDF_S_label_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_label) /** * LIBRDF_S_isDefinedBy_URI: * * RDFS namespace concept URI isDefinedBy */ #define LIBRDF_S_isDefinedBy_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_isDefinedBy) /** * LIBRDF_S_domain_URI: * * RDFS namespace concept URI domain */ #define LIBRDF_S_domain_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_domain) /** * LIBRDF_S_comment_URI: * * RDFS namespace concept URI comment */ #define LIBRDF_S_comment_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_comment) /** * LIBRDF_S_Resource_URI: * * RDFS namespace concept URI Resource */ #define LIBRDF_S_Resource_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_Resource) /** * LIBRDF_S_Literal_URI: * * RDFS namespace concept URI Literal */ #define LIBRDF_S_Literal_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_Literal) /** * LIBRDF_S_Container_URI: * * RDFS namespace concept URI Container */ #define LIBRDF_S_Container_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_Container) /** * LIBRDF_S_ContainerMembershipProperty_URI: * * RDFS namespace concept URI ContainerMembershipProperty */ #define LIBRDF_S_ContainerMembershipProperty_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_ContainerMembershipProperty) /** * LIBRDF_S_ConstraintResource_URI: * * RDFS namespace concept URI ConstraintResource */ #define LIBRDF_S_ConstraintResource_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_ConstraintResource) /** * LIBRDF_S_ConstraintProperty_URI: * * RDFS namespace concept URI ConstraintProperty */ #define LIBRDF_S_ConstraintProperty_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_ConstraintProperty) /** * LIBRDF_S_Class_URI: * * RDFS namespace concept URI Class */ #define LIBRDF_S_Class_URI(world) \ librdf_get_concept_uri_by_index(world, LIBRDF_CONCEPT_S_Class) /** * LIBRDF_RDF11_HTML: * * RDF 1.1 namespace concept HTML */ #define LIBRDF_RDF11_HTML(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_RDF11_HTML) /** * LIBRDF_RDF11_langString: * * RDF 1.1 namespace concept langString */ #define LIBRDF_RDF11_langString(world) \ librdf_get_concept_resource_by_index(world, LIBRDF_CONCEPT_RDF11_langString) /** * LIBRDF_URI_RDF_MS: * * #librdf_uri for rdf: namespace. Copy with * librdf_new_uri_from_uri() before using. */ #define LIBRDF_URI_RDF_MS(world) librdf_get_concept_ms_namespace(world) /** * LIBRDF_URI_RDF_SCHEMA: * * #librdf_uri for rdfs: namespace. Copy with * librdf_new_uri_from_uri() before using. */ #define LIBRDF_URI_RDF_SCHEMA(world) librdf_get_concept_schema_namespace(world) #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_storage_sqlite.c0000644000175000017500000025062112127601465014757 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_sqlite.c - RDF Storage using SQLite implementation * * Copyright (C) 2004-2010, David Beckett http://www.dajobe.org/ * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include static const char* const sqlite_synchronous_flags[4] = { "off", "normal", "full", NULL }; typedef struct librdf_storage_sqlite_query librdf_storage_sqlite_query; struct librdf_storage_sqlite_query { unsigned char *query; librdf_storage_sqlite_query *next; }; typedef struct { librdf_storage *storage; sqlite3 *db; int is_new; char *name; size_t name_len; int synchronous; /* -1 (not set), 0+ index into sqlite_synchronous_flags */ int in_stream; librdf_storage_sqlite_query *in_stream_queries; int in_transaction; } librdf_storage_sqlite_instance; /* prototypes for local functions */ static int librdf_storage_sqlite_init(librdf_storage* storage, const char *name, librdf_hash* options); static int librdf_storage_sqlite_open(librdf_storage* storage, librdf_model* model); static int librdf_storage_sqlite_close(librdf_storage* storage); static int librdf_storage_sqlite_size(librdf_storage* storage); static int librdf_storage_sqlite_add_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_sqlite_add_statements(librdf_storage* storage, librdf_stream* statement_stream); static int librdf_storage_sqlite_remove_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_sqlite_contains_statement(librdf_storage* storage, librdf_statement* statement); static librdf_stream* librdf_storage_sqlite_serialise(librdf_storage* storage); static librdf_stream* librdf_storage_sqlite_find_statements(librdf_storage* storage, librdf_statement* statement); /* serialising implementing functions */ static int librdf_storage_sqlite_serialise_end_of_stream(void* context); static int librdf_storage_sqlite_serialise_next_statement(void* context); static void* librdf_storage_sqlite_serialise_get_statement(void* context, int flags); static void librdf_storage_sqlite_serialise_finished(void* context); /* find_statements implementing functions */ static int librdf_storage_sqlite_find_statements_end_of_stream(void* context); static int librdf_storage_sqlite_find_statements_next_statement(void* context); static void* librdf_storage_sqlite_find_statements_get_statement(void* context, int flags); static void librdf_storage_sqlite_find_statements_finished(void* context); /* context functions */ static int librdf_storage_sqlite_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_sqlite_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_sqlite_context_contains_statement(librdf_storage* storage, librdf_node* context, librdf_statement* statement); static librdf_stream* librdf_storage_sqlite_context_serialise(librdf_storage* storage, librdf_node* context_node); /* context sqlite statement stream methods */ static int librdf_storage_sqlite_context_serialise_end_of_stream(void* context); static int librdf_storage_sqlite_context_serialise_next_statement(void* context); static void* librdf_storage_sqlite_context_serialise_get_statement(void* context, int flags); static void librdf_storage_sqlite_context_serialise_finished(void* context); /* helper functions for contexts */ static librdf_iterator* librdf_storage_sqlite_get_contexts(librdf_storage* storage); /* get_context iterator functions */ static int librdf_storage_sqlite_get_contexts_is_end(void* iterator); static int librdf_storage_sqlite_get_contexts_next_method(void* iterator); static void* librdf_storage_sqlite_get_contexts_get_method(void* iterator, int); static void librdf_storage_sqlite_get_contexts_finished(void* iterator); /* transactions */ static int librdf_storage_sqlite_transaction_start(librdf_storage *storage); static int librdf_storage_sqlite_transaction_commit(librdf_storage *storage); static int librdf_storage_sqlite_transaction_rollback(librdf_storage *storage); static void librdf_storage_sqlite_query_flush(librdf_storage *storage); static void librdf_storage_sqlite_register_factory(librdf_storage_factory *factory); #ifdef MODULAR_LIBRDF void librdf_storage_module_register_factory(librdf_world *world); #endif /* functions implementing storage api */ static int librdf_storage_sqlite_init(librdf_storage* storage, const char *name, librdf_hash* options) { char *name_copy; char* synchronous; librdf_storage_sqlite_instance* context; if(!name) { if(options) librdf_free_hash(options); return 1; } context = LIBRDF_CALLOC(librdf_storage_sqlite_instance*, 1, sizeof(*context)); if(!context) { if(options) librdf_free_hash(options); return 1; } librdf_storage_set_instance(storage, context); context->storage = storage; context->name_len = strlen(name); name_copy = LIBRDF_MALLOC(char*, context->name_len + 1); if(!name_copy) { if(options) librdf_free_hash(options); return 1; } strncpy(name_copy, name, context->name_len + 1); context->name = name_copy; if(librdf_hash_get_as_boolean(options, "new")>0) context->is_new = 1; /* default is NOT NEW */ /* Redland default is "PRAGMA synchronous normal" */ context->synchronous = 1; if((synchronous = librdf_hash_get(options, "synchronous"))) { int i; for(i = 0; sqlite_synchronous_flags[i]; i++) { if(!strcmp(synchronous, sqlite_synchronous_flags[i])) { context->synchronous = i; break; } } LIBRDF_FREE(char*, synchronous); } /* no more options, might as well free them now */ if(options) librdf_free_hash(options); return 0; } static void librdf_storage_sqlite_terminate(librdf_storage* storage) { librdf_storage_sqlite_instance* context; context = (librdf_storage_sqlite_instance*)storage->instance; if (context == NULL) return; if(context->name) LIBRDF_FREE(char*, context->name); LIBRDF_FREE(librdf_storage_sqlite_terminate, storage->instance); } typedef struct { const char *name; const char *schema; const char *columns; /* Excluding key column, always called id */ } table_info; #define NTABLES 4 /* * INTEGER PRIMARY KEY columns can be used to implement the * equivalent of AUTOINCREMENT. If you try to insert a NULL into an * INTEGER PRIMARY KEY column, the column will actually be filled * with a integer that is one greater than the largest key already in * the table. Or if the largest key is 2147483647, then the column * will be filled with a random integer. Either way, the INTEGER * PRIMARY KEY column will be assigned a unique integer. You can * retrieve this integer using the sqlite3_last_insert_rowid() API * function or using the last_insert_rowid() SQL function in a * subsequent SELECT statement. */ typedef enum { TABLE_URIS, TABLE_BLANKS, TABLE_LITERALS, TABLE_TRIPLES } sqlite_table_numbers; static const table_info sqlite_tables[NTABLES]={ { "uris", "id INTEGER PRIMARY KEY, uri TEXT", "uri" }, { "blanks", "id INTEGER PRIMARY KEY, blank TEXT", "blank" }, { "literals", "id INTEGER PRIMARY KEY, text TEXT, language TEXT, datatype INTEGER", "text, language, datatype" }, { "triples", "subjectUri INTEGER, subjectBlank INTEGER, predicateUri INTEGER, objectUri INTEGER, objectBlank INTEGER, objectLiteral INTEGER, contextUri INTEGER", "subjectUri, subjectBlank, predicateUri, objectUri, objectBlank, objectLiteral, contextUri" }, }; typedef enum { TRIPLE_SUBJECT =0, TRIPLE_PREDICATE=1, TRIPLE_OBJECT =2, TRIPLE_CONTEXT =3, } triple_part; typedef enum { TRIPLE_URI =0, TRIPLE_BLANK =1, TRIPLE_LITERAL=2, TRIPLE_NONE =3, } triple_node_type; static const char * const triples_fields[4][3] = { { "subjectUri", "subjectBlank", NULL }, { "predicateUri", NULL, NULL }, { "objectUri", "objectBlank", "objectLiteral" }, { "contextUri", NULL, NULL } }; static int librdf_storage_sqlite_get_1int_callback(void *arg, int argc, char **argv, char **columnNames) { int* count_p = (int*)arg; if(argc == 1) { *count_p = argv[0] ? atoi(argv[0]) : 0; } return 0; } static unsigned char * sqlite_string_escape(const unsigned char *raw, size_t raw_len, size_t *len_p) { size_t escapes = 0; unsigned char *p; unsigned char *escaped; size_t len; for(p = (unsigned char*)raw, len = raw_len; len > 0; p++, len--) { if(*p == '\'') escapes++; } len = raw_len + escapes + 2; /* for '' */ escaped = LIBRDF_MALLOC(unsigned char*, len + 1); if(!escaped) return NULL; p = escaped; *p++ = '\''; while(raw_len > 0) { if(*raw == '\'') { *p++ = '\''; } *p++ = *raw++; raw_len--; } *p++ = '\''; *p = '\0'; if(len_p) *len_p = len; return escaped; } static int librdf_storage_sqlite_exec(librdf_storage* storage, unsigned char *request, sqlite3_callback callback, void *arg, int fail_ok) { librdf_storage_sqlite_instance* context; int status=SQLITE_OK; char *errmsg = NULL; context = (librdf_storage_sqlite_instance*)storage->instance; /* sqlite crashes if passed in a NULL sql string */ if(!request) return 1; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 LIBRDF_DEBUG2("SQLite exec '%s'\n", request); #endif status = sqlite3_exec(context->db, (const char*)request, callback, arg, &errmsg); if(fail_ok) status = SQLITE_OK; if(status != SQLITE_OK) { if(status == SQLITE_LOCKED && !callback && context->in_stream) { librdf_storage_sqlite_query *query; /* error message from sqlite3_exec needs to be freed on both sqlite 2 and 3 */ if(errmsg) sqlite3_free(errmsg); query = LIBRDF_CALLOC(librdf_storage_sqlite_query*, 1, sizeof(*query)); if(!query) return 1; query->query = LIBRDF_MALLOC(unsigned char*, strlen((char *)request) + 1); if(!query->query) { LIBRDF_FREE(librdf_storage_sqlite_query, query); return 1; } strcpy((char*)query->query, (char *)request); if(!context->in_stream_queries) context->in_stream_queries = query; else { librdf_storage_sqlite_query *q = context->in_stream_queries; while(q->next) q = q->next; q->next = query; } status = SQLITE_OK; } else { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s SQL exec '%s' failed - %s (%d)", context->name, request, errmsg, status); /* error message from sqlite3_exec needs to be freed on both sqlite 2 and 3 */ if(errmsg) sqlite3_free(errmsg); } } return (status != SQLITE_OK); } static int librdf_storage_sqlite_set_helper(librdf_storage *storage, int table, const unsigned char *values, size_t values_len) { librdf_storage_sqlite_instance* context; int rc; raptor_stringbuffer *sb; unsigned char *request; context = (librdf_storage_sqlite_instance*)storage->instance; sb = raptor_new_stringbuffer(); if(!sb) return -1; raptor_stringbuffer_append_string(sb, (const unsigned char*)"INSERT INTO ", 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)sqlite_tables[table].name, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)" (id, ", 6, 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)sqlite_tables[table].columns, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*) ") VALUES(NULL, ", 15, 1); raptor_stringbuffer_append_counted_string(sb, values, values_len, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)");", 2, 1); request=raptor_stringbuffer_as_string(sb); rc=librdf_storage_sqlite_exec(storage, request, NULL, /* no callback */ NULL, /* arg */ 0); raptor_free_stringbuffer(sb); if(rc) return -1; return LIBRDF_BAD_CAST(int, sqlite3_last_insert_rowid(context->db)); } static int librdf_storage_sqlite_get_helper(librdf_storage *storage, int table, const unsigned char *expression) { int id = -1; int rc; raptor_stringbuffer *sb; unsigned char *request; sb = raptor_new_stringbuffer(); if(!sb) return -1; raptor_stringbuffer_append_string(sb, (const unsigned char*)"SELECT id FROM ", 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)sqlite_tables[table].name, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)" WHERE ", 7, 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)expression, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)";", 1, 1); request=raptor_stringbuffer_as_string(sb); rc = librdf_storage_sqlite_exec(storage, request, librdf_storage_sqlite_get_1int_callback, &id, 0); raptor_free_stringbuffer(sb); if(rc) return -1; return id; } static int librdf_storage_sqlite_uri_helper(librdf_storage* storage, librdf_uri* uri, int add_new) { const unsigned char *uri_string; size_t uri_len; unsigned char *expression = NULL; unsigned char *uri_e; size_t uri_e_len; int id = -1; static const char * const field="uri"; uri_string = librdf_uri_as_counted_string(uri, &uri_len); uri_e = sqlite_string_escape(uri_string, uri_len, &uri_e_len); if(!uri_e) goto tidy; expression = LIBRDF_MALLOC(unsigned char*, strlen(field) + 3 + uri_e_len + 1); if(!expression) goto tidy; sprintf((char*)expression, "%s = %s", field, uri_e); id = librdf_storage_sqlite_get_helper(storage, TABLE_URIS, expression); if(id >= 0) goto tidy; if(add_new) id = librdf_storage_sqlite_set_helper(storage, TABLE_URIS, uri_e, uri_e_len); tidy: if(expression) LIBRDF_FREE(char*, expression); if(uri_e) LIBRDF_FREE(char*, uri_e); return id; } static int librdf_storage_sqlite_blank_helper(librdf_storage* storage, const unsigned char *blank, int add_new) { size_t blank_len; unsigned char *expression = NULL; unsigned char *blank_e; size_t blank_e_len; int id = -1; static const char * const field="blank"; blank_len = strlen((const char*)blank); blank_e = sqlite_string_escape(blank, blank_len, &blank_e_len); if(!blank_e) goto tidy; expression = LIBRDF_MALLOC(unsigned char*, strlen(field) + 3 + blank_e_len + 1); if(!expression) goto tidy; sprintf((char*)expression, "%s = %s", field, blank_e); id = librdf_storage_sqlite_get_helper(storage, TABLE_BLANKS, expression); if(id >= 0) goto tidy; if(add_new) id = librdf_storage_sqlite_set_helper(storage, TABLE_BLANKS, blank_e, blank_e_len); tidy: if(expression) LIBRDF_FREE(char*, expression); if(blank_e) LIBRDF_FREE(char*, blank_e); return id; } static int librdf_storage_sqlite_literal_helper(librdf_storage* storage, const unsigned char *value, size_t value_len, const char *language, librdf_uri *datatype, int add_new) { int id = -1; size_t len; unsigned char *value_e; size_t value_e_len; unsigned char *language_e = NULL; size_t language_e_len = 0; int datatype_id = -1; raptor_stringbuffer *sb = NULL; unsigned char *expression; value_e = sqlite_string_escape(value, value_len, &value_e_len); if(!value_e) goto tidy; sb = raptor_new_stringbuffer(); if(!sb) goto tidy; raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)"text = ", 7, 1); raptor_stringbuffer_append_counted_string(sb, value_e, value_e_len, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)" ", 1, 1); if(language) { len = strlen(language); language_e = sqlite_string_escape((unsigned const char*)language, len, &language_e_len); if(!language_e) goto tidy; raptor_stringbuffer_append_string(sb, (const unsigned char*)"AND language = ", 1); raptor_stringbuffer_append_counted_string(sb, language_e, language_e_len, 1); } else raptor_stringbuffer_append_string(sb, (const unsigned char*)"AND language IS NULL ", 1); if(datatype) { datatype_id = librdf_storage_sqlite_uri_helper(storage, datatype, add_new); raptor_stringbuffer_append_string(sb, (const unsigned char*)"AND datatype = ", 1); raptor_stringbuffer_append_decimal(sb, datatype_id); } else raptor_stringbuffer_append_string(sb, (const unsigned char*)"AND datatype IS NULL ", 1); expression = raptor_stringbuffer_as_string(sb); id = librdf_storage_sqlite_get_helper(storage, TABLE_LITERALS, expression); if(id >= 0 || !add_new) goto tidy; raptor_free_stringbuffer(sb); sb = raptor_new_stringbuffer(); if(!sb) { id = -1; goto tidy; } raptor_stringbuffer_append_counted_string(sb, value_e, value_e_len, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)", ", 2, 1); if(language_e) raptor_stringbuffer_append_counted_string(sb,language_e, language_e_len, 1); else raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)"NULL", 4, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)", ", 2, 1); if(datatype) raptor_stringbuffer_append_decimal(sb, datatype_id); else raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)"NULL", 4, 1); expression = raptor_stringbuffer_as_string(sb); id = librdf_storage_sqlite_set_helper(storage, TABLE_LITERALS, expression, raptor_stringbuffer_length(sb)); tidy: if(sb) raptor_free_stringbuffer(sb); if(value_e) LIBRDF_FREE(char*, value_e); if(language_e) LIBRDF_FREE(char*, language_e); return id; } static int librdf_storage_sqlite_node_helper(librdf_storage* storage, librdf_node* node, int* id_p, triple_node_type *node_type_p, int add_new) { int id; triple_node_type node_type; unsigned char *value; size_t value_len; if(!node) return 1; switch(librdf_node_get_type(node)) { case LIBRDF_NODE_TYPE_RESOURCE: id = librdf_storage_sqlite_uri_helper(storage, librdf_node_get_uri(node), add_new); if(id < 0 && add_new) return 1; node_type = TRIPLE_URI; break; case LIBRDF_NODE_TYPE_LITERAL: value = librdf_node_get_literal_value_as_counted_string(node, &value_len); id = librdf_storage_sqlite_literal_helper(storage, value, value_len, librdf_node_get_literal_value_language(node), librdf_node_get_literal_value_datatype_uri(node), add_new); if(id < 0 && add_new) return 1; node_type = TRIPLE_LITERAL; break; case LIBRDF_NODE_TYPE_BLANK: id = librdf_storage_sqlite_blank_helper(storage, librdf_node_get_blank_identifier(node), add_new); if(id < 0 && add_new) return 1; node_type = TRIPLE_BLANK; break; case LIBRDF_NODE_TYPE_UNKNOWN: default: librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Do not know how to store node type %d", node->type); return 1; } if(id_p) *id_p = id; if(node_type_p) *node_type_p = node_type; return 0; } static int librdf_storage_sqlite_statement_helper(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, triple_node_type node_types[4], int node_ids[4], const unsigned char* fields[4], int add_new) { librdf_node* nodes[4]; int i; nodes[0] = statement ? librdf_statement_get_subject(statement) : NULL; nodes[1] = statement ? librdf_statement_get_predicate(statement) : NULL; nodes[2] = statement ? librdf_statement_get_object(statement) : NULL; nodes[3] = context_node; for(i = 0; i < 4; i++) { if(!nodes[i]) { fields[i] = NULL; node_ids[i] = -1; node_types[i] = TRIPLE_NONE; continue; } if(librdf_storage_sqlite_node_helper(storage, nodes[i], &node_ids[i], &node_types[i], add_new)) return 1; fields[i] = (const unsigned char*)triples_fields[i][node_types[i]]; } return 0; } static int librdf_storage_sqlite_open(librdf_storage* storage, librdf_model* model) { librdf_storage_sqlite_instance* context; int rc = SQLITE_OK; char *errmsg = NULL; int db_file_exists = 0; context = (librdf_storage_sqlite_instance*)storage->instance; if(!access((const char*)context->name, F_OK)) db_file_exists = 1; if(context->is_new && db_file_exists) unlink(context->name); context->db = NULL; rc = sqlite3_open(context->name, &context->db); if(rc != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(context->db); if(rc != SQLITE_OK) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s open failed - %s", context->name, errmsg); librdf_storage_sqlite_close(storage); return 1; } if(context->synchronous >= 0) { raptor_stringbuffer *sb; unsigned char *request; sb = raptor_new_stringbuffer(); if(!sb) { librdf_storage_sqlite_close(storage); return 1; } raptor_stringbuffer_append_string(sb, (const unsigned char*)"PRAGMA synchronous=", 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)sqlite_synchronous_flags[context->synchronous], 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)";", 1, 1); request = raptor_stringbuffer_as_string(sb); rc = librdf_storage_sqlite_exec(storage, request, NULL, NULL, 0); raptor_free_stringbuffer(sb); if(rc) { librdf_storage_sqlite_close(storage); return 1; } } if(context->is_new) { int i; unsigned char request[200]; int begin; begin = librdf_storage_sqlite_transaction_start(storage); for(i = 0; i < NTABLES; i++) { #if 0 sprintf((char*)request, "DROP TABLE %s;", sqlite_tables[i].name); librdf_storage_sqlite_exec(storage, request, NULL, /* no callback */ NULL, /* arg */ 1); /* don't care if this fails */ #endif sprintf((char*)request, "CREATE TABLE %s (%s);", sqlite_tables[i].name, sqlite_tables[i].schema); if(librdf_storage_sqlite_exec(storage, request, NULL, /* no callback */ NULL, /* arg */ 0)) { if(!begin) librdf_storage_sqlite_transaction_rollback(storage); librdf_storage_sqlite_close(storage); return 1; } } /* end drop/create table loop */ strcpy((char*)request, "CREATE INDEX spindex ON triples (subjectUri, subjectBlank, predicateUri);"); if(librdf_storage_sqlite_exec(storage, request, NULL, /* no callback */ NULL, /* arg */ 0)) { if(!begin) librdf_storage_sqlite_transaction_rollback(storage); librdf_storage_sqlite_close(storage); return 1; } strcpy((char*)request, "CREATE INDEX uriindex ON uris (uri);"); if(librdf_storage_sqlite_exec(storage, request, NULL, /* no callback */ NULL, /* arg */ 0)) { if(!begin) librdf_storage_sqlite_transaction_rollback(storage); librdf_storage_sqlite_close(storage); return 1; } if(!begin) librdf_storage_sqlite_transaction_commit(storage); } /* end if is new */ return 0; } /** * librdf_storage_sqlite_close: * @storage: the storage * * Close the sqlite storage. * * Return value: non 0 on failure **/ static int librdf_storage_sqlite_close(librdf_storage* storage) { librdf_storage_sqlite_instance* context; int status = 0; context = (librdf_storage_sqlite_instance*)storage->instance; if(context->db) { sqlite3_close(context->db); context->db = NULL; } return status; } static int librdf_storage_sqlite_size(librdf_storage* storage) { int count = 0; if(librdf_storage_sqlite_exec(storage, (unsigned char*)"SELECT COUNT(*) FROM triples;", librdf_storage_sqlite_get_1int_callback, &count, 0)) return -1; return count; } static int librdf_storage_sqlite_add_statement(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_sqlite_context_add_statement(storage, NULL, statement); } static int librdf_storage_sqlite_add_statements(librdf_storage* storage, librdf_stream* statement_stream) { /*librdf_storage_sqlite_instance* context;*/ int status = 0; int begin; /*context = (librdf_storage_sqlite_instance*)storage->instance;*/ /* returns non-0 if a transaction is already active */ begin = librdf_storage_sqlite_transaction_start(storage); for(; !librdf_stream_end(statement_stream); librdf_stream_next(statement_stream)) { librdf_statement* statement; librdf_node* context_node; triple_node_type node_types[4]; int node_ids[4]; const unsigned char* fields[4]; raptor_stringbuffer *sb; int i; unsigned char* request; int rc; int max = 3; statement = librdf_stream_get_object(statement_stream); context_node = librdf_stream_get_context2(statement_stream); if(!statement) { status = 1; break; } /* Do not add duplicate statements */ if(librdf_storage_sqlite_context_contains_statement(storage, context_node, statement)) continue; if(librdf_storage_sqlite_statement_helper(storage, statement, context_node, node_types, node_ids, fields, 1)) { if(!begin) librdf_storage_sqlite_transaction_rollback(storage); return -1; } if(context_node) max++; /* FIXME no context field used */ sb = raptor_new_stringbuffer(); if(!sb) { if(!begin) librdf_storage_sqlite_transaction_rollback(storage); return -1; } raptor_stringbuffer_append_string(sb, (unsigned char*)"INSERT INTO ", 1); raptor_stringbuffer_append_string(sb, (unsigned char*)sqlite_tables[TABLE_TRIPLES].name, 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)" ( ", 3, 1); for(i = 0; i < max; i++) { raptor_stringbuffer_append_string(sb, fields[i], 1); if(i < (max-1)) raptor_stringbuffer_append_counted_string(sb, (unsigned char*)", ", 2, 1); } raptor_stringbuffer_append_counted_string(sb, (unsigned char*)") VALUES(", 9, 1); for(i = 0; i < max; i++) { raptor_stringbuffer_append_decimal(sb, node_ids[i]); if(i < (max-1)) raptor_stringbuffer_append_counted_string(sb, (unsigned char*)", ", 2, 1); } raptor_stringbuffer_append_counted_string(sb, (unsigned char*)");", 2, 1); request = raptor_stringbuffer_as_string(sb); rc = librdf_storage_sqlite_exec(storage, request, NULL, /* no callback */ NULL, /* arg */ 0); raptor_free_stringbuffer(sb); if(rc) { if(!begin) librdf_storage_sqlite_transaction_rollback(storage); return 1; } } if(!begin) librdf_storage_sqlite_transaction_commit(storage); return status; } static int librdf_storage_sqlite_remove_statement(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_sqlite_context_remove_statement(storage, NULL, statement); } static int librdf_storage_sqlite_statement_operator_helper(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, raptor_stringbuffer* sb, int add_new) { /* librdf_storage_sqlite_instance* context; */ triple_node_type node_types[4]; int node_ids[4]; const unsigned char* fields[4]; int i; int need_and = 0; int max=3; /* context = (librdf_storage_sqlite_instance*)storage->instance; */ if(context_node) max++; if(librdf_storage_sqlite_statement_helper(storage, statement, context_node, node_types, node_ids, fields, add_new)) return 1; raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)" FROM ", 6, 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)sqlite_tables[TABLE_TRIPLES].name, 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)" WHERE ", 7, 1); for(i = 0; i < max; i++) { if(need_and) raptor_stringbuffer_append_counted_string(sb, (unsigned char*)" AND ", 5, 1); raptor_stringbuffer_append_string(sb, fields[i], 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)"=", 1, 1); raptor_stringbuffer_append_decimal(sb, node_ids[i]); need_and = 1; } return 0; } static int librdf_storage_sqlite_contains_statement(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_sqlite_context_contains_statement(storage, NULL, statement); } static int librdf_storage_sqlite_context_contains_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { raptor_stringbuffer *sb; unsigned char *request; int count = 0; int rc, begin; sb = raptor_new_stringbuffer(); if(!sb) return -1; /* returns non-0 if a transaction is already active */ begin = librdf_storage_sqlite_transaction_start(storage); raptor_stringbuffer_append_string(sb, (const unsigned char*)"SELECT 1", 1); if(librdf_storage_sqlite_statement_operator_helper(storage, statement, context_node, sb, 0)) { if(!begin) librdf_storage_sqlite_transaction_rollback(storage); raptor_free_stringbuffer(sb); return -1; } raptor_stringbuffer_append_string(sb, (const unsigned char*)" LIMIT 1;", 1); request = raptor_stringbuffer_as_string(sb); rc = librdf_storage_sqlite_exec(storage, request, librdf_storage_sqlite_get_1int_callback, &count, 0); raptor_free_stringbuffer(sb); if(!begin) librdf_storage_transaction_commit(storage); if(rc) return -1; return (count > 0); } static void sqlite_construct_select_helper(raptor_stringbuffer* sb) { raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"SELECT\n", 7, 1); /* If this order is changed MUST CHANGE order in * librdf_storage_sqlite_get_next_common */ raptor_stringbuffer_append_string(sb, (unsigned char*) " SubjectURIs.uri AS subjectUri,\n\ SubjectBlanks.blank AS subjectBlank,\n\ PredicateURIs.uri AS predicateUri,\n\ ObjectURIs.uri AS objectUri,\n\ ObjectBlanks.blank AS objectBlank,\n\ ObjectLiterals.text AS objectLiteralText,\n\ ObjectLiterals.language AS objectLiteralLanguage,\n\ ObjectLiterals.datatype AS objectLiteralDatatype,\n\ ObjectDatatypeURIs.uri AS objectLiteralDatatypeUri,\n\ ContextURIs.uri AS contextUri\n", 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"FROM ", 5, 1); raptor_stringbuffer_append_string(sb, (unsigned char*)sqlite_tables[TABLE_TRIPLES].name, 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)" AS T\n", 6, 1); raptor_stringbuffer_append_string(sb, (unsigned char*) " LEFT JOIN uris AS SubjectURIs ON SubjectURIs.id = T.subjectUri\n\ LEFT JOIN blanks AS SubjectBlanks ON SubjectBlanks.id = T.subjectBlank\n\ LEFT JOIN uris AS PredicateURIs ON PredicateURIs.id = T.predicateUri\n\ LEFT JOIN uris AS ObjectURIs ON ObjectURIs.id = T.objectUri\n\ LEFT JOIN blanks AS ObjectBlanks ON ObjectBlanks.id = T.objectBlank\n\ LEFT JOIN literals AS ObjectLiterals ON ObjectLiterals.id = T.objectLiteral\n\ LEFT JOIN uris AS ObjectDatatypeURIs ON ObjectDatatypeURIs.id = objectLiteralDatatype\n\ LEFT JOIN uris AS ContextURIs ON ContextURIs.id = T.contextUri\n", 1); } typedef struct { librdf_storage *storage; librdf_storage_sqlite_instance* sqlite_context; int finished; librdf_statement *statement; librdf_node* context; /* OUT from sqlite3_prepare (V3) or sqlite_compile (V2) */ sqlite3_stmt *vm; const char *zTail; } librdf_storage_sqlite_serialise_stream_context; static librdf_stream* librdf_storage_sqlite_serialise(librdf_storage* storage) { librdf_storage_sqlite_instance* context; librdf_storage_sqlite_serialise_stream_context* scontext; librdf_stream* stream; int status; char *errmsg = NULL; raptor_stringbuffer *sb; unsigned char *request; context = (librdf_storage_sqlite_instance*)storage->instance; scontext = LIBRDF_CALLOC(librdf_storage_sqlite_serialise_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; scontext->storage = storage; librdf_storage_add_reference(scontext->storage); scontext->sqlite_context = context; context->in_stream++; sb = raptor_new_stringbuffer(); if(!sb) { librdf_storage_sqlite_serialise_finished((void*)scontext); return NULL; } sqlite_construct_select_helper(sb); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)";", 1, 1); request = raptor_stringbuffer_as_string(sb); if(!request) { raptor_free_stringbuffer(sb); librdf_storage_sqlite_serialise_finished((void*)scontext); return NULL; } #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 LIBRDF_DEBUG2("SQLite prepare '%s'\n", request); #endif status = sqlite3_prepare(context->db, (const char*)request, LIBRDF_GOOD_CAST(int, raptor_stringbuffer_length(sb)), &scontext->vm, &scontext->zTail); if(status != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(context->db); raptor_free_stringbuffer(sb); if(status != SQLITE_OK) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s SQL compile failed - %s (%d)", context->name, errmsg, status); librdf_storage_sqlite_serialise_finished((void*)scontext); return NULL; } stream = librdf_new_stream(storage->world, (void*)scontext, &librdf_storage_sqlite_serialise_end_of_stream, &librdf_storage_sqlite_serialise_next_statement, &librdf_storage_sqlite_serialise_get_statement, &librdf_storage_sqlite_serialise_finished); if(!stream) { librdf_storage_sqlite_serialise_finished((void*)scontext); return NULL; } return stream; } static int librdf_storage_sqlite_get_next_common(librdf_storage_sqlite_instance* scontext, sqlite3_stmt *vm, librdf_statement **statement, librdf_node **context_node) { int status = SQLITE_BUSY; int result = 0; /* * Each invocation of sqlite_step returns an integer code that * indicates what happened during that step. This code may be * SQLITE_BUSY, SQLITE_ROW, SQLITE_DONE, SQLITE_ERROR, or * SQLITE_MISUSE. */ do { status = sqlite3_step(vm); if(status == SQLITE_BUSY) { /* FIXME - how to handle busy? */ continue; } break; } while(1); if(status == SQLITE_ROW) { /* FIXME - turn row data into statement, scontext->context */ #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 int i; #endif librdf_node* node; const unsigned char *uri_string, *blank; /* * MUST MATCH fields order in query in librdf_storage_sqlite_serialise * i field name (all TEXT unless given) 0 subjectUri 1 subjectBlank 2 predicateUri 3 objectUri 4 objectBlank 5 objectLiteralText 6 objectLiteralLanguage 7 objectLiteralDatatype (INTEGER) 8 objectLiteralDatatypeUri 9 contextUri */ #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 for(i = 0; i < sqlite3_column_count(vm); i++) fprintf(stderr, "%s, ", sqlite3_column_name(vm, i)); fputc('\n', stderr); for(i = 0; i < sqlite3_column_count(vm); i++) { if(i == 7) fprintf(stderr, "%d, ", sqlite3_column_int(vm, i)); else fprintf(stderr, "%s, ", sqlite3_column_text(vm, i)); } fputc('\n', stderr); #endif if(!*statement) { if(!(*statement = librdf_new_statement(scontext->storage->world))) return 1; } librdf_statement_clear(*statement); /* subject */ uri_string = sqlite3_column_text(vm, 0); if(uri_string) node = librdf_new_node_from_uri_string(scontext->storage->world, uri_string); else { blank = sqlite3_column_text(vm, 1); node = librdf_new_node_from_blank_identifier(scontext->storage->world, blank); } if(!node) /* finished on error */ return 1; librdf_statement_set_subject(*statement, node); uri_string = sqlite3_column_text(vm, 2); node = librdf_new_node_from_uri_string(scontext->storage->world, uri_string); if(!node) /* finished on error */ return 1; librdf_statement_set_predicate(*statement, node); uri_string = sqlite3_column_text(vm, 3); blank = sqlite3_column_text(vm, 4); if(uri_string) node = librdf_new_node_from_uri_string(scontext->storage->world, uri_string); else if(blank) node = librdf_new_node_from_blank_identifier(scontext->storage->world, blank); else { const unsigned char *literal = sqlite3_column_text(vm, 5); const unsigned char *language = sqlite3_column_text(vm, 6); librdf_uri *datatype = NULL; /* int datatype_id= sqlite3_column_int(vm, 7); */ uri_string = sqlite3_column_text(vm, 8); if(uri_string) { datatype = librdf_new_uri(scontext->storage->world, uri_string); if(!datatype) /* finished on error */ return 1; } node = librdf_new_node_from_typed_literal(scontext->storage->world, literal, (const char*)language, datatype); if(datatype) librdf_free_uri(datatype); } if(!node) /* finished on error */ return 1; librdf_statement_set_object(*statement, node); uri_string = sqlite3_column_text(vm, 9); if(uri_string) { node = librdf_new_node_from_uri_string(scontext->storage->world, uri_string); if(!node) /* finished on error */ return 1; if(*context_node) librdf_free_node(*context_node); *context_node = node; } } if(status != SQLITE_ROW) result = 1; if(status == SQLITE_ERROR) { char *errmsg = NULL; status = sqlite3_finalize(vm); if(status != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(scontext->db); if(status != SQLITE_OK) { librdf_log(scontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s finalize failed - %s (%d)", scontext->name, errmsg, status); } result = -1; } return result; } static int librdf_storage_sqlite_serialise_end_of_stream(void* context) { librdf_storage_sqlite_serialise_stream_context* scontext; scontext = (librdf_storage_sqlite_serialise_stream_context*)context; if(scontext->finished) return 1; if(scontext->statement == NULL) { int result; result = librdf_storage_sqlite_get_next_common(scontext->sqlite_context, scontext->vm, &scontext->statement, &scontext->context); if(result) { /* error or finished */ if(result < 0) scontext->vm = NULL; scontext->finished = 1; } } return scontext->finished; } static int librdf_storage_sqlite_serialise_next_statement(void* context) { librdf_storage_sqlite_serialise_stream_context* scontext; int result; scontext = (librdf_storage_sqlite_serialise_stream_context*)context; if(scontext->finished) return 1; result = librdf_storage_sqlite_get_next_common(scontext->sqlite_context, scontext->vm, &scontext->statement, &scontext->context); if(result) { /* error or finished */ if(result < 0) scontext->vm = NULL; scontext->finished = 1; } return result; } static void* librdf_storage_sqlite_serialise_get_statement(void* context, int flags) { librdf_storage_sqlite_serialise_stream_context* scontext; scontext = (librdf_storage_sqlite_serialise_stream_context*)context; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return scontext->statement; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return scontext->context; default: librdf_log(scontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_storage_sqlite_serialise_finished(void* context) { librdf_storage_sqlite_serialise_stream_context* scontext; scontext = (librdf_storage_sqlite_serialise_stream_context*)context; if(scontext->vm) { char *errmsg = NULL; int status; status = sqlite3_finalize(scontext->vm); if(status != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(scontext->sqlite_context->db); if(status != SQLITE_OK) { librdf_log(scontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s finalize failed - %s (%d)", scontext->sqlite_context->name, errmsg, status); } } if(scontext->storage) librdf_storage_remove_reference(scontext->storage); if(scontext->statement) librdf_free_statement(scontext->statement); if(scontext->context) librdf_free_node(scontext->context); scontext->sqlite_context->in_stream--; if(!scontext->sqlite_context->in_stream) librdf_storage_sqlite_query_flush(scontext->storage); LIBRDF_FREE(librdf_storage_sqlite_serialise_stream_context, scontext); } typedef struct { librdf_storage *storage; librdf_storage_sqlite_instance* sqlite_context; int finished; librdf_statement *query_statement; librdf_statement *statement; librdf_node* context; /* OUT from sqlite3_prepare (V3) or sqlite_compile (V2) */ sqlite3_stmt *vm; const char *zTail; } librdf_storage_sqlite_find_statements_stream_context; /** * librdf_storage_sqlite_find_statements: * @storage: the storage * @statement: the statement to match * * . * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * Uses #librdf_statement_match to do the matching. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_sqlite_find_statements(librdf_storage* storage, librdf_statement* statement) { librdf_storage_sqlite_instance* context; librdf_storage_sqlite_find_statements_stream_context* scontext; librdf_stream* stream; unsigned char* request; int status; triple_node_type node_types[4]; int node_ids[4]; const unsigned char* fields[4]; char *errmsg = NULL; raptor_stringbuffer *sb; int need_where = 1; int need_and = 0; int i; context = (librdf_storage_sqlite_instance*)storage->instance; scontext = LIBRDF_CALLOC(librdf_storage_sqlite_find_statements_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; scontext->storage = storage; librdf_storage_add_reference(scontext->storage); scontext->sqlite_context = context; context->in_stream++; scontext->query_statement = librdf_new_statement_from_statement(statement); if(!scontext->query_statement) { librdf_storage_sqlite_find_statements_finished((void*)scontext); return NULL; } if(librdf_storage_sqlite_statement_helper(storage, statement, NULL, node_types, node_ids, fields, 0)) { librdf_storage_sqlite_find_statements_finished((void*)scontext); return NULL; } sb = raptor_new_stringbuffer(); if(!sb) { librdf_storage_sqlite_find_statements_finished((void*)scontext); return NULL; } sqlite_construct_select_helper(sb); for(i = 0; i < 3; i++) { if(node_types[i] == TRIPLE_NONE) continue; if(need_where) { raptor_stringbuffer_append_counted_string(sb, (unsigned char*)" WHERE ", 7, 1); need_where = 0; need_and = 1; } else if(need_and) raptor_stringbuffer_append_counted_string(sb, (unsigned char*)" AND ", 5, 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"T.", 2, 1); raptor_stringbuffer_append_string(sb, fields[i], 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"=", 1, 1); raptor_stringbuffer_append_decimal(sb, node_ids[i]); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"\n", 1, 1); } raptor_stringbuffer_append_counted_string(sb, (unsigned char*)";", 1, 1); request = raptor_stringbuffer_as_string(sb); if(!request) { raptor_free_stringbuffer(sb); librdf_storage_sqlite_find_statements_finished((void*)scontext); return NULL; } #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 LIBRDF_DEBUG2("SQLite prepare '%s'\n", request); #endif status = sqlite3_prepare(context->db, (const char*)request, LIBRDF_GOOD_CAST(int, raptor_stringbuffer_length(sb)), &scontext->vm, &scontext->zTail); if(status != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(context->db); raptor_free_stringbuffer(sb); if(status != SQLITE_OK) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s SQL compile '%s' failed - %s (%d)", context->name, request, errmsg, status); librdf_storage_sqlite_find_statements_finished((void*)scontext); return NULL; } stream = librdf_new_stream(storage->world, (void*)scontext, &librdf_storage_sqlite_find_statements_end_of_stream, &librdf_storage_sqlite_find_statements_next_statement, &librdf_storage_sqlite_find_statements_get_statement, &librdf_storage_sqlite_find_statements_finished); if(!stream) { librdf_storage_sqlite_find_statements_finished((void*)scontext); return NULL; } return stream; } static int librdf_storage_sqlite_find_statements_end_of_stream(void* context) { librdf_storage_sqlite_find_statements_stream_context* scontext; scontext = (librdf_storage_sqlite_find_statements_stream_context*)context; if(scontext->finished) return 1; if(scontext->statement == NULL) { int result; result = librdf_storage_sqlite_get_next_common(scontext->sqlite_context, scontext->vm, &scontext->statement, &scontext->context); if(result) { /* error or finished */ if(result < 0) scontext->vm = NULL; scontext->finished = 1; } } return scontext->finished; } static int librdf_storage_sqlite_find_statements_next_statement(void* context) { librdf_storage_sqlite_find_statements_stream_context* scontext; int result; scontext = (librdf_storage_sqlite_find_statements_stream_context*)context; if(scontext->finished) return 1; result = librdf_storage_sqlite_get_next_common(scontext->sqlite_context, scontext->vm, &scontext->statement, &scontext->context); if(result) { /* error or finished */ if(result < 0) scontext->vm = NULL; scontext->finished = 1; } return result; } static void* librdf_storage_sqlite_find_statements_get_statement(void* context, int flags) { librdf_storage_sqlite_find_statements_stream_context* scontext; scontext = (librdf_storage_sqlite_find_statements_stream_context*)context; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return scontext->statement; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return scontext->context; default: librdf_log(scontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_storage_sqlite_find_statements_finished(void* context) { librdf_storage_sqlite_find_statements_stream_context* scontext; scontext = (librdf_storage_sqlite_find_statements_stream_context*)context; if(scontext->vm) { char *errmsg = NULL; int status; status = sqlite3_finalize(scontext->vm); if(status != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(scontext->sqlite_context->db); if(status != SQLITE_OK) { librdf_log(scontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s finalize failed - %s (%d)", scontext->sqlite_context->name, errmsg, status); } } if(scontext->storage) librdf_storage_remove_reference(scontext->storage); if(scontext->query_statement) librdf_free_statement(scontext->query_statement); if(scontext->statement) librdf_free_statement(scontext->statement); if(scontext->context) librdf_free_node(scontext->context); scontext->sqlite_context->in_stream--; if(!scontext->sqlite_context->in_stream) librdf_storage_sqlite_query_flush(scontext->storage); LIBRDF_FREE(librdf_storage_sqlite_find_statements_stream_context, scontext); } /** * librdf_storage_sqlite_context_add_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to add * * Add a statement to a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_sqlite_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { /* librdf_storage_sqlite_instance* context; */ triple_node_type node_types[4]; int node_ids[4]; const unsigned char* fields[4]; raptor_stringbuffer *sb; unsigned char* request; int i; int rc, begin; int max=3; /* Do not add duplicate statements */ if(librdf_storage_sqlite_context_contains_statement(storage, context_node, statement)) return 0; /* context = (librdf_storage_sqlite_instance*)storage->instance; */ sb = raptor_new_stringbuffer(); if(!sb) return -1; /* returns non-0 if transaction is already active */ begin = librdf_storage_sqlite_transaction_start(storage); if(librdf_storage_sqlite_statement_helper(storage, statement, context_node, node_types, node_ids, fields, 1)) { if(!begin) librdf_storage_sqlite_transaction_rollback(storage); raptor_free_stringbuffer(sb); return -1; } if(context_node) max++; raptor_stringbuffer_append_string(sb, (unsigned char*)"INSERT INTO ", 1); raptor_stringbuffer_append_string(sb, (unsigned char*)sqlite_tables[TABLE_TRIPLES].name, 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)" ( ", 3, 1); for(i = 0; i < max; i++) { raptor_stringbuffer_append_string(sb, fields[i], 1); if(i < (max-1)) raptor_stringbuffer_append_counted_string(sb, (unsigned char*)", ", 2, 1); } raptor_stringbuffer_append_counted_string(sb, (unsigned char*)") VALUES(", 9, 1); for(i = 0; i < max; i++) { raptor_stringbuffer_append_decimal(sb, node_ids[i]); if(i < (max-1)) raptor_stringbuffer_append_counted_string(sb, (unsigned char*)", ", 2, 1); } raptor_stringbuffer_append_counted_string(sb, (unsigned char*)");", 2, 1); request = raptor_stringbuffer_as_string(sb); rc = librdf_storage_sqlite_exec(storage, request, NULL, /* no callback */ NULL, /* arg */ 0); raptor_free_stringbuffer(sb); if(rc) { if(!begin) librdf_storage_transaction_rollback(storage); return rc; } if(!begin) librdf_storage_transaction_commit(storage); return 0; } /** * librdf_storage_sqlite_context_remove_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to remove * * Remove a statement from a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_sqlite_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { /* librdf_storage_sqlite_instance* context; */ int rc; raptor_stringbuffer *sb; unsigned char *request; /* context = (librdf_storage_sqlite_instance*)storage->instance; */ sb = raptor_new_stringbuffer(); if(!sb) return -1; raptor_stringbuffer_append_string(sb, (const unsigned char*)"DELETE", 1); if(librdf_storage_sqlite_statement_operator_helper(storage, statement, context_node, sb, 0)) { raptor_free_stringbuffer(sb); return -1; } raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)";", 1, 1); request = raptor_stringbuffer_as_string(sb); rc = librdf_storage_sqlite_exec(storage, request, NULL, NULL, 0); raptor_free_stringbuffer(sb); return rc; } static int librdf_storage_sqlite_context_remove_statements(librdf_storage* storage, librdf_node* context_node) { triple_node_type node_types[4]; int node_ids[4]; const unsigned char* fields[4]; raptor_stringbuffer *sb; unsigned char *request; int rc = 0; if(librdf_storage_sqlite_statement_helper(storage, NULL, context_node, node_types, node_ids, fields, 0)) return -1; sb = raptor_new_stringbuffer(); if(!sb) return -1; raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"DELETE FROM ", 12, 1); raptor_stringbuffer_append_string(sb, (unsigned char*)sqlite_tables[TABLE_TRIPLES].name, 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)" WHERE ", 7, 1); raptor_stringbuffer_append_string(sb, fields[TRIPLE_CONTEXT], 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"=", 1, 1); raptor_stringbuffer_append_decimal(sb, node_ids[TRIPLE_CONTEXT]); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"\n", 1, 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)";", 1, 1); request = raptor_stringbuffer_as_string(sb); rc = librdf_storage_sqlite_exec(storage, request, NULL, /* no callback */ NULL, /* arg */ 0); raptor_free_stringbuffer(sb); if(rc) return -1; return 0; } typedef struct { librdf_storage *storage; librdf_storage_sqlite_instance* sqlite_context; int finished; librdf_node *context_node; librdf_statement *statement; librdf_node* context; /* OUT from sqlite3_prepare (V3) or sqlite_compile (V2) */ sqlite3_stmt *vm; const char *zTail; } librdf_storage_sqlite_context_serialise_stream_context; /** * librdf_storage_sqlite_context_serialise: * @storage: #librdf_storage object * @context_node: #librdf_node object * * Sqlite all statements in a storage context. * * Return value: #librdf_stream of statements or NULL on failure or context is empty **/ static librdf_stream* librdf_storage_sqlite_context_serialise(librdf_storage* storage, librdf_node* context_node) { librdf_storage_sqlite_instance* context; librdf_storage_sqlite_context_serialise_stream_context* scontext; librdf_stream* stream; int status; char *errmsg = NULL; triple_node_type node_types[4]; int node_ids[4]; const unsigned char* fields[4]; raptor_stringbuffer *sb; unsigned char *request; context = (librdf_storage_sqlite_instance*)storage->instance; scontext = LIBRDF_CALLOC(librdf_storage_sqlite_context_serialise_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; scontext->storage = storage; librdf_storage_add_reference(scontext->storage); scontext->sqlite_context = context; context->in_stream++; scontext->context_node = librdf_new_node_from_node(context_node); if(librdf_storage_sqlite_statement_helper(storage, NULL, scontext->context_node, node_types, node_ids, fields, 0)) { librdf_storage_sqlite_context_serialise_finished((void*)scontext); return NULL; } sb = raptor_new_stringbuffer(); if(!sb) { librdf_storage_sqlite_context_serialise_finished((void*)scontext); return NULL; } sqlite_construct_select_helper(sb); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)" WHERE ", 7, 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"T.", 2, 1); raptor_stringbuffer_append_string(sb, fields[TRIPLE_CONTEXT], 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"=", 1, 1); raptor_stringbuffer_append_decimal(sb, node_ids[TRIPLE_CONTEXT]); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)"\n", 1, 1); raptor_stringbuffer_append_counted_string(sb, (unsigned char*)";", 1, 1); request = raptor_stringbuffer_as_string(sb); if(!request) { raptor_free_stringbuffer(sb); librdf_storage_sqlite_context_serialise_finished((void*)scontext); return NULL; } #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 LIBRDF_DEBUG2("SQLite prepare '%s'\n", request); #endif status = sqlite3_prepare(context->db, (const char*)request, LIBRDF_GOOD_CAST(int, raptor_stringbuffer_length(sb)), &scontext->vm, &scontext->zTail); if(status != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(context->db); raptor_free_stringbuffer(sb); if(status != SQLITE_OK) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s SQL compile failed - %s (%d)", context->name, errmsg, status); librdf_storage_sqlite_context_serialise_finished((void*)scontext); return NULL; } stream = librdf_new_stream(storage->world, (void*)scontext, &librdf_storage_sqlite_context_serialise_end_of_stream, &librdf_storage_sqlite_context_serialise_next_statement, &librdf_storage_sqlite_context_serialise_get_statement, &librdf_storage_sqlite_context_serialise_finished); if(!stream) { librdf_storage_sqlite_context_serialise_finished((void*)scontext); return NULL; } return stream; } static int librdf_storage_sqlite_context_serialise_end_of_stream(void* context) { librdf_storage_sqlite_context_serialise_stream_context* scontext; scontext = (librdf_storage_sqlite_context_serialise_stream_context*)context; if(scontext->finished) return 1; if(scontext->statement == NULL) { int result; result = librdf_storage_sqlite_get_next_common(scontext->sqlite_context, scontext->vm, &scontext->statement, &scontext->context); if(result) { /* error or finished */ if(result < 0) scontext->vm = NULL; scontext->finished = 1; } } return scontext->finished; } static int librdf_storage_sqlite_context_serialise_next_statement(void* context) { librdf_storage_sqlite_context_serialise_stream_context* scontext; int result; scontext = (librdf_storage_sqlite_context_serialise_stream_context*)context; if(scontext->finished) return 1; result = librdf_storage_sqlite_get_next_common(scontext->sqlite_context, scontext->vm, &scontext->statement, &scontext->context); if(result) { /* error or finished */ if(result < 0) scontext->vm = NULL; scontext->finished = 1; } return result; } static void* librdf_storage_sqlite_context_serialise_get_statement(void* context, int flags) { librdf_storage_sqlite_context_serialise_stream_context* scontext; scontext = (librdf_storage_sqlite_context_serialise_stream_context*)context; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return scontext->statement; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return scontext->context; default: librdf_log(scontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); return NULL; } } static void librdf_storage_sqlite_context_serialise_finished(void* context) { librdf_storage_sqlite_context_serialise_stream_context* scontext; scontext = (librdf_storage_sqlite_context_serialise_stream_context*)context; if(scontext->vm) { char *errmsg = NULL; int status; status = sqlite3_finalize(scontext->vm); if(status != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(scontext->sqlite_context->db); if(status != SQLITE_OK) { librdf_log(scontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s finalize failed - %s (%d)", scontext->sqlite_context->name, errmsg, status); } } if(scontext->storage) librdf_storage_remove_reference(scontext->storage); if(scontext->statement) librdf_free_statement(scontext->statement); if(scontext->context) librdf_free_node(scontext->context); if(scontext->context_node) librdf_free_node(scontext->context_node); scontext->sqlite_context->in_stream--; if(!scontext->sqlite_context->in_stream) librdf_storage_sqlite_query_flush(scontext->storage); LIBRDF_FREE(librdf_storage_sqlite_context_serialise_stream_context, scontext); } typedef struct { librdf_storage *storage; librdf_storage_sqlite_instance* sqlite_context; int finished; librdf_node *current; /* OUT from sqlite3_prepare (V3) or sqlite_compile (V2) */ sqlite3_stmt *vm; const char *zTail; } librdf_storage_sqlite_get_contexts_iterator_context; static int librdf_storage_sqlite_get_next_context_common(librdf_storage_sqlite_instance* scontext, sqlite3_stmt *vm, librdf_node **context_node) { int status = SQLITE_BUSY; int result = 0; /* * Each invocation of sqlite_step returns an integer code that * indicates what happened during that step. This code may be * SQLITE_BUSY, SQLITE_ROW, SQLITE_DONE, SQLITE_ERROR, or * SQLITE_MISUSE. */ do { status = sqlite3_step(vm); if(status == SQLITE_BUSY) { /* FIXME - how to handle busy? */ continue; } break; } while(1); if(status == SQLITE_ROW) { /* Turns row data into scontext->context */ #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 int i; #endif const unsigned char *uri_string; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 for(i = 0; i < sqlite3_column_count(vm); i++) fprintf(stderr, "%s, ", sqlite3_column_name(vm, i)); fputc('\n', stderr); for(i = 0; i < sqlite3_column_count(vm); i++) { if(i == 7) fprintf(stderr, "%d, ", sqlite3_column_int(vm, i)); else fprintf(stderr, "%s, ", sqlite3_column_text(vm, i)); } fputc('\n', stderr); #endif uri_string = sqlite3_column_text(vm, 0); if(uri_string) { librdf_node *node; node = librdf_new_node_from_uri_string(scontext->storage->world, uri_string); if(!node) /* finished on error */ return 1; if(*context_node) librdf_free_node(*context_node); *context_node = node; } } if(status != SQLITE_ROW) result = 1; if(status == SQLITE_ERROR) { char *errmsg = NULL; status = sqlite3_finalize(vm); if(status != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(scontext->db); if(status != SQLITE_OK) { librdf_log(scontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s finalize failed - %s (%d)", scontext->name, errmsg, status); } result = -1; } return result; } static int librdf_storage_sqlite_get_contexts_is_end(void* iterator) { librdf_storage_sqlite_get_contexts_iterator_context* icontext; icontext = (librdf_storage_sqlite_get_contexts_iterator_context*)iterator; if(icontext->finished) return 1; if(!icontext->current) { int result; result = librdf_storage_sqlite_get_next_context_common(icontext->sqlite_context, icontext->vm, &icontext->current); if(result) { /* error or finished */ if(result < 0) icontext->vm = NULL; icontext->finished = 1; } } return icontext->finished; } static int librdf_storage_sqlite_get_contexts_next_method(void* iterator) { librdf_storage_sqlite_get_contexts_iterator_context* icontext; int result; icontext = (librdf_storage_sqlite_get_contexts_iterator_context*)iterator; if(icontext->finished) return 1; result = librdf_storage_sqlite_get_next_context_common(icontext->sqlite_context, icontext->vm, &icontext->current); if(result) { /* error or finished */ if(result < 0) icontext->vm = NULL; icontext->finished = 1; } return result; } static void* librdf_storage_sqlite_get_contexts_get_method(void* iterator, int flags) { librdf_storage_sqlite_get_contexts_iterator_context* icontext; void *result = NULL; icontext = (librdf_storage_sqlite_get_contexts_iterator_context*)iterator; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return icontext->current; break; case LIBRDF_ITERATOR_GET_METHOD_GET_KEY: case LIBRDF_ITERATOR_GET_METHOD_GET_VALUE: result = NULL; break; default: librdf_log(icontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); result = NULL; break; } return result; } static void librdf_storage_sqlite_get_contexts_finished(void* iterator) { librdf_storage_sqlite_get_contexts_iterator_context* icontext; icontext = (librdf_storage_sqlite_get_contexts_iterator_context*)iterator; if(icontext->vm) { char *errmsg = NULL; int status; status = sqlite3_finalize(icontext->vm); if(status != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(icontext->sqlite_context->db); if(status != SQLITE_OK) { librdf_log(icontext->storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s finalize failed - %s (%d)", icontext->sqlite_context->name, errmsg, status); } } if(icontext->storage) librdf_storage_remove_reference(icontext->storage); if(icontext->current) librdf_free_node(icontext->current); LIBRDF_FREE(librdf_storage_sqlite_get_contexts_iterator_context, icontext); } /** * librdf_storage_sqlite_context_get_contexts: * @storage: #librdf_storage object * * Sqlite all context nodes in a storage. * * Return value: #librdf_iterator of context_nodes or NULL on failure or no contexts **/ static librdf_iterator* librdf_storage_sqlite_get_contexts(librdf_storage* storage) { librdf_storage_sqlite_instance* context; librdf_storage_sqlite_get_contexts_iterator_context* icontext; int status; char *errmsg = NULL; raptor_stringbuffer *sb; unsigned char *request; librdf_iterator* iterator; context = (librdf_storage_sqlite_instance*)storage->instance; icontext = LIBRDF_CALLOC(librdf_storage_sqlite_get_contexts_iterator_context*, 1, sizeof(*icontext)); if(!icontext) return NULL; icontext->sqlite_context = context; sb = raptor_new_stringbuffer(); if(!sb) { LIBRDF_FREE(librdf_storage_sqlite_get_contexts_iterator_context, icontext); return NULL; } raptor_stringbuffer_append_string(sb, (unsigned char*) "SELECT DISTINCT uris.uri", 1); raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)" FROM ", 6, 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)sqlite_tables[TABLE_TRIPLES].name, 1); raptor_stringbuffer_append_string(sb, (const unsigned char*)" LEFT JOIN uris ON uris.id = contextUri WHERE contextUri NOT NULL;", 1); request = raptor_stringbuffer_as_string(sb); if(!request) { raptor_free_stringbuffer(sb); LIBRDF_FREE(librdf_storage_sqlite_get_contexts_iterator_context, icontext); return NULL; } #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 LIBRDF_DEBUG2("SQLite prepare '%s'\n", request); #endif status = sqlite3_prepare(context->db, (const char*)request, LIBRDF_GOOD_CAST(int, raptor_stringbuffer_length(sb)), &icontext->vm, &icontext->zTail); if(status != SQLITE_OK) errmsg = (char*)sqlite3_errmsg(context->db); raptor_free_stringbuffer(sb); if(status != SQLITE_OK) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "SQLite database %s SQL compile failed - %s (%d)", context->name, errmsg, status); librdf_storage_sqlite_get_contexts_finished((void*)icontext); return NULL; } icontext->storage = storage; librdf_storage_add_reference(icontext->storage); iterator = librdf_new_iterator(storage->world, (void*)icontext, &librdf_storage_sqlite_get_contexts_is_end, &librdf_storage_sqlite_get_contexts_next_method, &librdf_storage_sqlite_get_contexts_get_method, &librdf_storage_sqlite_get_contexts_finished); if(!iterator) librdf_storage_sqlite_get_contexts_finished(icontext); return iterator; } /** * librdf_storage_sqlite_get_feature: * @storage: #librdf_storage object * @feature: #librdf_uri feature property * * Get the value of a storage feature. * * Return value: #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ static librdf_node* librdf_storage_sqlite_get_feature(librdf_storage* storage, librdf_uri* feature) { /* librdf_storage_sqlite_instance* scontext; */ unsigned char *uri_string; /* scontext = (librdf_storage_sqlite_instance*)storage->instance; */ if(!feature) return NULL; uri_string = librdf_uri_as_string(feature); if(!uri_string) return NULL; if(!strcmp((const char*)uri_string, LIBRDF_MODEL_FEATURE_CONTEXTS)) { return librdf_new_node_from_typed_literal(storage->world, (const unsigned char*)"1", NULL, NULL); } return NULL; } /** * librdf_storage_sqlite_transaction_start: * @storage: #librdf_storage object * * Start a new transaction unless one is already active. * * Return value: 0 if transaction successfully started, non-0 on error * (including a transaction already active) **/ static int librdf_storage_sqlite_transaction_start(librdf_storage *storage) { librdf_storage_sqlite_instance* context; int rc; context = (librdf_storage_sqlite_instance* )storage->instance; if(context->in_transaction) return 1; rc = librdf_storage_sqlite_exec(storage, (unsigned char *)"BEGIN IMMEDIATE;", NULL, NULL, 0); if(!rc) context->in_transaction = 1; return rc; } /** * librdf_storage_sqlite_transaction_commit: * @storage: #librdf_storage object * * Commit an active transaction. * * Return value: 0 if transaction successfully committed, non-0 on error * (including no transaction active) **/ static int librdf_storage_sqlite_transaction_commit(librdf_storage *storage) { librdf_storage_sqlite_instance* context; int rc; context = (librdf_storage_sqlite_instance* )storage->instance; if(!context->in_transaction) return 1; rc = librdf_storage_sqlite_exec(storage, (unsigned char *)"END;", NULL, NULL, 0); if(!rc) context->in_transaction = 0; return rc; } /** * librdf_storage_sqlite_transaction_rollback: * @storage: #librdf_storage object * * Roll back an active transaction. * * Return value: 0 if transaction successfully committed, non-0 on error * (including no transaction active) **/ static int librdf_storage_sqlite_transaction_rollback(librdf_storage *storage) { librdf_storage_sqlite_instance* context; int rc; context = (librdf_storage_sqlite_instance* )storage->instance; if(!context->in_transaction) return 1; rc = librdf_storage_sqlite_exec(storage, (unsigned char *)"ROLLBACK;", NULL, NULL, 0); if(!rc) context->in_transaction = 0; return rc; } static void librdf_storage_sqlite_query_flush(librdf_storage *storage) { librdf_storage_sqlite_query *query; librdf_storage_sqlite_instance* context; int begin; if(!storage) return; context = (librdf_storage_sqlite_instance*)storage->instance; if(!context->in_stream_queries) return; /* returns non-0 if a transaction is already active */ begin = librdf_storage_sqlite_transaction_start(storage); while(context->in_stream_queries) { query = context->in_stream_queries; context->in_stream_queries = query->next; librdf_storage_sqlite_exec(storage, query->query, NULL, NULL, 0); LIBRDF_FREE(char*, query->query); LIBRDF_FREE(librdf_storage_sqlite_query, query); } if(!begin) librdf_storage_sqlite_transaction_commit(storage); } /** Local entry point for dynamically loaded storage module */ static void librdf_storage_sqlite_register_factory(librdf_storage_factory *factory) { LIBRDF_ASSERT_CONDITION(!strcmp(factory->name, "sqlite")); factory->version = LIBRDF_STORAGE_INTERFACE_VERSION; factory->init = librdf_storage_sqlite_init; factory->terminate = librdf_storage_sqlite_terminate; factory->open = librdf_storage_sqlite_open; factory->close = librdf_storage_sqlite_close; factory->size = librdf_storage_sqlite_size; factory->add_statement = librdf_storage_sqlite_add_statement; factory->add_statements = librdf_storage_sqlite_add_statements; factory->remove_statement = librdf_storage_sqlite_remove_statement; factory->contains_statement = librdf_storage_sqlite_contains_statement; factory->serialise = librdf_storage_sqlite_serialise; factory->find_statements = librdf_storage_sqlite_find_statements; factory->context_add_statement = librdf_storage_sqlite_context_add_statement; factory->context_remove_statement = librdf_storage_sqlite_context_remove_statement; factory->context_remove_statements = librdf_storage_sqlite_context_remove_statements; factory->context_serialise = librdf_storage_sqlite_context_serialise; factory->get_contexts = librdf_storage_sqlite_get_contexts; factory->get_feature = librdf_storage_sqlite_get_feature; factory->transaction_start = librdf_storage_sqlite_transaction_start; factory->transaction_commit = librdf_storage_sqlite_transaction_commit; factory->transaction_rollback = librdf_storage_sqlite_transaction_rollback; } #ifdef MODULAR_LIBRDF /** Entry point for dynamically loaded storage module */ void librdf_storage_module_register_factory(librdf_world *world) { librdf_storage_register_factory(world, "sqlite", "SQLite", &librdf_storage_sqlite_register_factory); } #else /* * librdf_init_storage_sqlite: * @world: world object * * INTERNAL - Initialise the built-in storage_sqlite module. */ void librdf_init_storage_sqlite(librdf_world *world) { librdf_storage_register_factory(world, "sqlite", "SQLite", &librdf_storage_sqlite_register_factory); } #endif redland-1.0.17/src/rdf_node.c0000644000175000017500000013771212002643144012654 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_term.c - RDF Term (RDF URI, Literal, Blank Node) Interface * * Copyright (C) 2010-2011, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include /* needed for utf8 functions and definition of 'byte' */ #include #ifndef STANDALONE /** * librdf_init_node: * @world: redland world object * * INTERNAL - Initialise the node module. * **/ void librdf_init_node(librdf_world* world) { } /** * librdf_finish_node: * @world: redland world object * * INTERNAL - Terminate the node module. * **/ void librdf_finish_node(librdf_world* world) { } /* constructors */ /** * librdf_new_node: * @world: redland world object * * Constructor - create a new #librdf_node object with a private identifier. * * Calls librdf_new_node_from_blank_identifier(world, NULL) to * construct a new redland blank node identifier and make a * new librdf_node object for it. * * Return value: a new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node(librdf_world *world) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); return librdf_new_node_from_blank_identifier(world, (unsigned char*)NULL); } /** * librdf_new_node_from_uri_string: * @world: redland world object * @uri_string: string representing a URI * * Constructor - create a new #librdf_node object from a URI string. * * Return value: a new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_uri_string(librdf_world *world, const unsigned char *uri_string) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); return raptor_new_term_from_uri_string(world->raptor_world_ptr, uri_string); } /** * librdf_new_node_from_counted_uri_string: * @world: redland world object * @uri_string: string representing a URI * @len: length of string * * Constructor - create a new #librdf_node object from a counted URI string. * * Return value: a new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_counted_uri_string(librdf_world *world, const unsigned char *uri_string, size_t len) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); return raptor_new_term_from_counted_uri_string(world->raptor_world_ptr, uri_string, len); } /* Create a new (Resource) Node and set the URI. */ /** * librdf_new_node_from_uri: * @world: redland world object * @uri: #librdf_uri object * * Constructor - create a new resource #librdf_node object with a given URI. * * Return value: a new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_uri(librdf_world *world, librdf_uri *uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); return raptor_new_term_from_uri(world->raptor_world_ptr, uri); } /** * librdf_new_node_from_uri_local_name: * @world: redland world object * @uri: #librdf_uri object * @local_name: local name to append to URI * * Constructor - create a new resource #librdf_node object with a given URI and local name. * * Return value: a new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_uri_local_name(librdf_world *world, librdf_uri *uri, const unsigned char *local_name) { raptor_uri *new_uri; librdf_node* node; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, raptor_uri, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(local_name, string, NULL); new_uri = raptor_new_uri_from_uri_local_name(world->raptor_world_ptr, uri, local_name); if(!new_uri) return NULL; node = raptor_new_term_from_uri(world->raptor_world_ptr, new_uri); raptor_free_uri(new_uri); return node; } /** * librdf_new_node_from_normalised_uri_string: * @world: redland world object * @uri_string: UTF-8 encoded string representing a URI * @source_uri: source URI * @base_uri: base URI * * Constructor - create a new #librdf_node object from a UTF-8 encoded URI string normalised to a new base URI. * * Return value: a new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_normalised_uri_string(librdf_world *world, const unsigned char *uri_string, librdf_uri *source_uri, librdf_uri *base_uri) { librdf_uri* new_uri; librdf_node* node; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); new_uri = librdf_new_uri_normalised_to_base(uri_string, source_uri, base_uri); if(!new_uri) return NULL; node = raptor_new_term_from_uri(world->raptor_world_ptr, new_uri); raptor_free_uri(new_uri); return node; } #define LIBRDF_XSD_BOOLEAN_TRUE (const unsigned char*)"true" #define LIBRDF_XSD_BOOLEAN_TRUE_LEN 4 #define LIBRDF_XSD_BOOLEAN_FALSE (const unsigned char*)"false" #define LIBRDF_XSD_BOOLEAN_FALSE_LEN 5 static int librdf_xsd_boolean_value_from_string(const unsigned char* string, unsigned int len) { int integer = 0; /* FIXME * Strictly only {true, false, 1, 0} are allowed according to * http://www.w3.org/TR/xmlschema-2/#boolean */ if((len == LIBRDF_XSD_BOOLEAN_TRUE_LEN && (!strcmp(LIBRDF_GOOD_CAST(const char*, string), "true") || !strcmp(LIBRDF_GOOD_CAST(const char*, string), "TRUE")) ) || (len == 1 && !strcmp(LIBRDF_GOOD_CAST(const char*, string), "1") ) ) integer = 1; return integer; } /* * librdf_node_normalize: * @world: world * @node: node * * INTERNAL - Normalize the literal of datatyped literals to canonical form * * Currently handles xsd:boolean. * * FIXME: This should be in Raptor or Rasqal since * librdf_xsd_boolean_value_from_string and the canonicalization was * ripped out of Rasqal. * * Return value: new node (or same one if no action was taken) */ static librdf_node* librdf_node_normalize(librdf_world* world, librdf_node* node) { if(!node) return NULL; if(node->value.literal.datatype) { librdf_uri* dt_uri; dt_uri = librdf_new_uri_from_uri_local_name(world->xsd_namespace_uri, LIBRDF_GOOD_CAST(const unsigned char*, "boolean")); if(raptor_uri_equals(node->value.literal.datatype, dt_uri)) { const unsigned char* value; size_t value_len; int bvalue; bvalue = librdf_xsd_boolean_value_from_string(node->value.literal.string, node->value.literal.string_len); value = bvalue ? LIBRDF_XSD_BOOLEAN_TRUE : LIBRDF_XSD_BOOLEAN_FALSE; value_len = bvalue ? LIBRDF_XSD_BOOLEAN_TRUE_LEN : LIBRDF_XSD_BOOLEAN_FALSE_LEN; if(node->value.literal.string_len != value_len || strcmp(LIBRDF_GOOD_CAST(const char*, node->value.literal.string), LIBRDF_GOOD_CAST(const char*, value))) { /* If literal is not canonical, replace the node */ librdf_free_node(node); node = NULL; /* Have to use Raptor constructor here since * librdf_new_node_from_typed_counted_literal() calls this */ node = raptor_new_term_from_counted_literal(world->raptor_world_ptr, value, value_len, dt_uri, (const unsigned char*)NULL, (unsigned char)0); } } if(dt_uri) librdf_free_uri(dt_uri); } return node; } /** * librdf_new_node_from_literal: * @world: redland world object * @string: literal UTF-8 encoded string value * @xml_language: literal XML language (or NULL, empty string) * @is_wf_xml: non 0 if literal is XML * * Constructor - create a new literal #librdf_node object. * * 0.9.12: xml_space argument deleted * * An @xml_language cannot be used when @is_wf_xml is non-0. If both * are given, NULL is returned. If @xml_language is the empty string, * it is the equivalent to NULL. * * Return value: new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_literal(librdf_world *world, const unsigned char *string, const char *xml_language, int is_wf_xml) { librdf_uri* datatype_uri; librdf_node* n; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); datatype_uri = (is_wf_xml ? LIBRDF_RS_XMLLiteral_URI(world) : NULL); n = raptor_new_term_from_literal(world->raptor_world_ptr, string, datatype_uri, (const unsigned char*)xml_language); return librdf_node_normalize(world, n); } /** * librdf_new_node_from_typed_literal: * @world: redland world object * @value: literal UTF-8 encoded string value * @xml_language: literal XML language (or NULL, empty string) * @datatype_uri: URI of typed literal datatype or NULL * * Constructor - create a new typed literal #librdf_node object. * * Only one of @xml_language or @datatype_uri may be given. If both * are given, NULL is returned. If @xml_language is the empty string, * it is the equivalent to NULL. * * Return value: new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_typed_literal(librdf_world *world, const unsigned char *value, const char *xml_language, librdf_uri *datatype_uri) { librdf_node* n; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); n = raptor_new_term_from_literal(world->raptor_world_ptr, value, datatype_uri, (const unsigned char*)xml_language); return librdf_node_normalize(world, n); } /** * librdf_new_node_from_typed_counted_literal: * @world: redland world object * @value: literal UTF-8 encoded string value * @value_len: literal string value length * @xml_language: literal XML language (or NULL, empty string) * @xml_language_len: literal XML language length (not used if @xml_language is NULL) * @datatype_uri: URI of typed literal datatype or NULL * * Constructor - create a new typed literal #librdf_node object. * * Takes copies of the passed in @value, @datatype_uri and @xml_language. * * Only one of @xml_language or @datatype_uri may be given. If both * are given, NULL is returned. If @xml_language is the empty string, * it is the equivalent to NULL. * * Return value: new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_typed_counted_literal(librdf_world *world, const unsigned char *value, size_t value_len, const char *xml_language, size_t xml_language_len, librdf_uri *datatype_uri) { librdf_node* n; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); n = raptor_new_term_from_counted_literal(world->raptor_world_ptr, value, value_len, datatype_uri, (const unsigned char*)xml_language, (unsigned char)xml_language_len); return librdf_node_normalize(world, n); } /** * librdf_new_node_from_counted_blank_identifier: * @world: redland world object * @identifier: UTF-8 encoded blank node identifier or NULL * @identifier_len: length of @identifier * * Constructor - create a new blank node #librdf_node object from a blank node counted length identifier. * * If no @identifier string is given (NULL) this creates a new * internal identifier and uses it. * * Return value: new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_counted_blank_identifier(librdf_world *world, const unsigned char *identifier, size_t identifier_len) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); return raptor_new_term_from_counted_blank(world->raptor_world_ptr, identifier, identifier_len); } /** * librdf_new_node_from_blank_identifier: * @world: redland world object * @identifier: UTF-8 encoded blank node identifier or NULL * * Constructor - create a new blank node #librdf_node object from a blank node identifier. * * If no @identifier string is given (NULL) this creates a new * internal identifier and uses it. * * Return value: new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_blank_identifier(librdf_world *world, const unsigned char *identifier) { const unsigned char *blank = identifier; librdf_node* node = NULL; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); if(!identifier) blank = librdf_world_get_genid(world); node = raptor_new_term_from_blank(world->raptor_world_ptr, blank); if(!identifier) LIBRDF_FREE(char*, (char*)blank); return node; } /** * librdf_new_node_from_node: * @node: #librdf_node object to copy * * Copy constructor - create a new librdf_node object from an existing librdf_node object. * * Return value: a new #librdf_node object or NULL on failure **/ librdf_node* librdf_new_node_from_node(librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); return raptor_term_copy(node); } /** * librdf_free_node: * @node: #librdf_node object * * Destructor - destroy an #librdf_node object. * **/ void librdf_free_node(librdf_node *node) { if(!node) return; raptor_free_term(node); } /* functions / methods */ /** * librdf_node_get_uri: * @node: the node object * * Get the URI for a node object. * * Returns a pointer to the URI object held by the node, it must be * copied if it is wanted to be used by the caller. * * Return value: URI object or NULL if node has no URI. **/ librdf_uri* librdf_node_get_uri(librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); if(node->type != RAPTOR_TERM_TYPE_URI) return NULL; return node->value.uri; } /** * librdf_node_get_type: * @node: the node object * * Get the type of the node. * * See also librdf_node_is_resource(), librdf_node_is_literal() and * librdf_node_is_blank() for testing individual types. * * Return value: the node type **/ librdf_node_type librdf_node_get_type(librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, LIBRDF_NODE_TYPE_UNKNOWN); return (librdf_node_type)node->type; } /** * librdf_node_get_literal_value: * @node: the node object * * Get the literal value of the node as a UTF-8 encoded string. * * Returns a pointer to the UTF-8 encoded literal value held by the * node, it must be copied if it is wanted to be used by the caller. * * Return value: the UTF-8 encoded literal string or NULL if node is not a literal **/ unsigned char* librdf_node_get_literal_value(librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); if(node->type != RAPTOR_TERM_TYPE_LITERAL) return NULL; return node->value.literal.string; } /** * librdf_node_get_literal_value_as_counted_string: * @node: the node object * @len_p: pointer to location to store the string length (or NULL) * * Get the literal value of the node as a counted UTF-8 encoded string. * * Returns a pointer to the UTF-8 encoded literal string value held * by the node, it must be copied if it is wanted to be used by the * caller. * * Return value: the UTF-8 encoded literal string or NULL if node is not a literal **/ unsigned char* librdf_node_get_literal_value_as_counted_string(librdf_node *node, size_t *len_p) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); if(node->type != RAPTOR_TERM_TYPE_LITERAL) return NULL; if(len_p) *len_p = node->value.literal.string_len; return node->value.literal.string; } /** * librdf_node_get_literal_value_as_latin1: * @node: the node object * * Get the string literal value of the node as ISO Latin-1. * * Returns a newly allocated string containing the conversion of the * node literal value held by the node into ISO Latin-1. Discards * characters outside the U+0000 to U+00FF range (inclusive). * * Return value: the Latin-1 literal string or NULL if node is not a literal **/ char* librdf_node_get_literal_value_as_latin1(librdf_node *node) { size_t slen; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); if(node->type != RAPTOR_TERM_TYPE_LITERAL) return NULL; if(!node->value.literal.string) return NULL; slen = LIBRDF_GOOD_CAST(size_t, node->value.literal.string_len); return (char*)librdf_utf8_to_latin1_2((const unsigned char*)node->value.literal.string, slen, '\0', NULL); } /** * librdf_node_get_literal_value_language: * @node: the node object * * Get the XML language of the node. * * Returns a pointer to the literal language value held by the node, * it must be copied if it is wanted to be used by the caller. * Language strings are ASCII, not UTF-8 encoded Unicode. * * Return value: the XML language string or NULL if node is not a literal * or there is no XML language defined. **/ char* librdf_node_get_literal_value_language(librdf_node *node) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); if(node->type != RAPTOR_TERM_TYPE_LITERAL) return NULL; return (char*)node->value.literal.language; } /** * librdf_node_get_literal_value_is_wf_xml: * @node: the node object * * Get the XML well-formness property of the node. * * Return value: 0 if the XML literal is NOT well formed XML content, or the node is not a literal **/ int librdf_node_get_literal_value_is_wf_xml(librdf_node *node) { raptor_uri* rdf_xml_literal_uri; int rc; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, 0); if(node->type != RAPTOR_TERM_TYPE_LITERAL) return 0; if(!node->value.literal.datatype) return 0; rdf_xml_literal_uri = raptor_new_uri_for_rdf_concept(node->world, (const unsigned char *)"XMLLiteral"); rc = librdf_uri_equals(node->value.literal.datatype, rdf_xml_literal_uri); raptor_free_uri(rdf_xml_literal_uri); return rc; } /** * librdf_node_get_literal_value_datatype_uri: * @node: the node object * * Get the typed literal datatype URI of the literal node. * * Return value: shared URI of the datatyped literal or NULL if the node is not a literal, or has no datatype URI **/ librdf_uri* librdf_node_get_literal_value_datatype_uri(librdf_node *node) { if(node->type != RAPTOR_TERM_TYPE_LITERAL) return NULL; return node->value.literal.datatype; } /** * librdf_node_get_li_ordinal: * @node: the node object * * Get the node li object ordinal value. * * Return value: the li ordinal value or < 1 on failure **/ int librdf_node_get_li_ordinal(librdf_node *node) { unsigned char *uri_string; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, 0); if(node->type != RAPTOR_TERM_TYPE_URI) return -1; uri_string = raptor_uri_as_string(node->value.uri); if(strncmp((const char*)uri_string, (const char*)"http://www.w3.org/1999/02/22-rdf-syntax-ns#_", 44)) return -1; return atoi((const char*)uri_string+44); } /** * librdf_node_get_blank_identifier: * @node: the node object * * Get the blank node identifier as a UTF-8 encoded string. * * Return value: the UTF-8 encoded blank node identifier value or NULL on failure **/ unsigned char* librdf_node_get_blank_identifier(librdf_node *node) { return node->value.blank.string; } /** * librdf_node_get_counted_blank_identifier: * @node: the node object * @len_p: pointer to variable to store length (or NULL) * * Get the blank node identifier as a counted UTF-8 encoded string. * * Return value: the UTF-8 encoded blank node identifier value or NULL on failure **/ unsigned char* librdf_node_get_counted_blank_identifier(librdf_node* node, size_t* len_p) { if(len_p) *len_p = node->value.blank.string_len; return node->value.blank.string; } /** * librdf_node_is_resource: * @node: the node object * * Check node is a resource. * * Return value: non-zero if the node is a resource (URI) **/ int librdf_node_is_resource(librdf_node *node) { return (node->type == RAPTOR_TERM_TYPE_URI); } /** * librdf_node_is_literal: * @node: the node object * * Check node is a literal. * * Return value: non-zero if the node is a literal **/ int librdf_node_is_literal(librdf_node *node) { return (node->type == RAPTOR_TERM_TYPE_LITERAL); } /** * librdf_node_is_blank: * @node: the node object * * Check node is a blank nodeID. * * Return value: non-zero if the node is a blank nodeID **/ int librdf_node_is_blank(librdf_node *node) { return (node->type == RAPTOR_TERM_TYPE_BLANK); } /** * librdf_node_encode: * @node: the node to serialise * @buffer: the buffer to use * @length: buffer size * * Serialise a node into a buffer. * * Encodes the given node in the buffer, which must be of sufficient * size. If buffer is NULL, no work is done but the size of buffer * required is returned. * * If the node cannot be encoded due to restrictions of the encoding * format, a redland error is generated * * Return value: the number of bytes written or 0 on failure. **/ size_t librdf_node_encode(librdf_node *node, unsigned char *buffer, size_t length) { size_t total_length = 0; unsigned char *string; size_t string_length; size_t language_length = 0; unsigned char *datatype_uri_string = NULL; size_t datatype_uri_length = 0; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, 0); switch(node->type) { case RAPTOR_TERM_TYPE_URI: string = (unsigned char*)librdf_uri_as_counted_string(node->value.uri, &string_length); total_length = 3 + string_length + 1; /* +1 for \0 at end */ if(length && total_length > length) return 0; if(string_length > 0xFFFF) return 0; if(buffer) { buffer[0] = 'R'; buffer[1] = (string_length & 0xff00) >> 8; buffer[2] = (string_length & 0x00ff); memcpy((char*)buffer + 3, string, string_length + 1); } break; case RAPTOR_TERM_TYPE_LITERAL: string = (unsigned char*)node->value.literal.string; string_length = node->value.literal.string_len; if(node->value.literal.language) language_length = LIBRDF_GOOD_CAST(size_t, node->value.literal.language_len); if(node->value.literal.datatype) { datatype_uri_string = librdf_uri_as_counted_string(node->value.literal.datatype, &datatype_uri_length); } total_length = 6 + string_length + 1; /* +1 for \0 at end */ if(string_length > 0xFFFF) /* for long literal - type 'N' */ total_length += 2; if(language_length) total_length += language_length + 1; if(datatype_uri_length) total_length += datatype_uri_length + 1; if(length && total_length > length) return 0; if(datatype_uri_length > 0xFFFF) return 0; if(buffer) { if(string_length > 0xFFFF) { /* long literal type N (string length > 0x10000) */ buffer[0] = 'N'; buffer[1] = (string_length & 0xff000000) >> 24; buffer[2] = (string_length & 0x00ff0000) >> 16; buffer[3] = (string_length & 0x0000ff00) >> 8; buffer[4] = (string_length & 0x000000ff); buffer[5] = (datatype_uri_length & 0xff00) >> 8; buffer[6] = (datatype_uri_length & 0x00ff); buffer[7] = (language_length & 0x00ff); buffer += 8; } else { /* short literal type M (string length <= 0xFFFF) */ buffer[0] = 'M'; buffer[1] = (string_length & 0xff00) >> 8; buffer[2] = (string_length & 0x00ff); buffer[3] = (datatype_uri_length & 0xff00) >> 8; buffer[4] = (datatype_uri_length & 0x00ff); buffer[5] = (language_length & 0x00ff); buffer += 6; } memcpy(buffer, string, string_length + 1); buffer += string_length + 1; if(datatype_uri_length) { memcpy(buffer, datatype_uri_string, datatype_uri_length + 1); buffer += datatype_uri_length + 1; } if(language_length) memcpy(buffer, node->value.literal.language, language_length + 1); } /* end if buffer */ break; case RAPTOR_TERM_TYPE_BLANK: string = (unsigned char*)node->value.blank.string; string_length = node->value.blank.string_len; total_length = 3 + string_length + 1; /* +1 for \0 at end */ if(length && total_length > length) return 0; if(string_length > 0xFFFF) return 0; if(buffer) { buffer[0] = 'B'; buffer[1] = (string_length & 0xff00) >> 8; buffer[2] = (string_length & 0x00ff); memcpy((char*)buffer + 3, string, string_length + 1); } break; case RAPTOR_TERM_TYPE_UNKNOWN: default: return 0; } return total_length; } /** * librdf_node_decode: * @world: librdf_world * @size_p: pointer to bytes used or NULL * @buffer: the buffer to use * @length: buffer size * * Deserialise a node from a buffer. * * Decodes the serialised node (as created by librdf_node_encode() ) * from the given buffer. * * Return value: new node or NULL on failure (bad encoding, allocation failure) **/ librdf_node* librdf_node_decode(librdf_world *world, size_t *size_p, unsigned char *buffer, size_t length) { int is_wf_xml; size_t string_length; size_t total_length; size_t language_length; unsigned char *datatype_uri_string = NULL; size_t datatype_uri_length; librdf_uri* datatype_uri = NULL; unsigned char *language = NULL; int status = 0; librdf_node* node = NULL; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); librdf_world_open(world); /* absolute minimum - first byte is type */ if (length < 1) return NULL; switch(buffer[0]) { case 'R': /* URI / Resource */ /* min */ if(length < 3) return NULL; string_length = LIBRDF_GOOD_CAST(size_t, (buffer[1] << 8) | buffer[2]); total_length = 3 + string_length + 1; node = librdf_new_node_from_uri_string(world, buffer + 3); break; case 'L': /* Old encoding form for Literal */ /* min */ if(length < 6) return NULL; is_wf_xml = (buffer[1] & 0xf0)>>8; string_length = LIBRDF_GOOD_CAST(size_t, (buffer[2] << 8) | buffer[3]); language_length = LIBRDF_GOOD_CAST(size_t, buffer[5]); total_length = 6 + string_length + 1; /* +1 for \0 at end */ if(language_length) { language = buffer + total_length; total_length += language_length + 1; } node = librdf_new_node_from_typed_counted_literal(world, buffer + 6, string_length, (const char*)language, LIBRDF_GOOD_CAST(unsigned char, language_length), is_wf_xml ? LIBRDF_RS_XMLLiteral_URI(world) : NULL); break; case 'M': /* Literal for Redland 0.9.12+ */ /* min */ if(length < 6) return NULL; string_length = LIBRDF_GOOD_CAST(size_t, (buffer[1] << 8) | buffer[2]); datatype_uri_length = LIBRDF_GOOD_CAST(size_t, (buffer[3] << 8) | buffer[4]); language_length = buffer[5]; total_length = 6 + string_length + 1; /* +1 for \0 at end */ if(datatype_uri_length) { datatype_uri_string = buffer + total_length; total_length += datatype_uri_length + 1; } if(language_length) { language = buffer + total_length; total_length += language_length + 1; } if(datatype_uri_string) datatype_uri = librdf_new_uri(world, datatype_uri_string); node = librdf_new_node_from_typed_counted_literal(world, buffer + 6, string_length, (const char*)language, LIBRDF_GOOD_CAST(unsigned char, language_length), datatype_uri); if(datatype_uri) librdf_free_uri(datatype_uri); if(status) return NULL; break; case 'N': /* Literal for redland 1.0.5+ (long literal) */ /* min */ if(length < 8) return NULL; string_length = LIBRDF_GOOD_CAST(size_t, (buffer[1] << 24) | (buffer[2] << 16) | (buffer[3] << 8) | buffer[4]); datatype_uri_length = LIBRDF_GOOD_CAST(size_t, (buffer[5] << 8) | buffer[6]); language_length = buffer[7]; total_length = 8 + string_length + 1; /* +1 for \0 at end */ if(datatype_uri_length) { datatype_uri_string = buffer + total_length; total_length += datatype_uri_length + 1; } if(language_length) { language = buffer + total_length; total_length += language_length + 1; } if(datatype_uri_string) datatype_uri = librdf_new_uri(world, datatype_uri_string); node = librdf_new_node_from_typed_counted_literal(world, buffer + 8, string_length, (const char*)language, LIBRDF_GOOD_CAST(size_t, language_length), datatype_uri); if(datatype_uri) librdf_free_uri(datatype_uri); if(status) return NULL; break; case 'B': /* RAPTOR_TERM_TYPE_BLANK */ /* min */ if(length < 3) return NULL; string_length = LIBRDF_GOOD_CAST(size_t, (buffer[1] << 8) | buffer[2]); total_length = 3 + string_length + 1; /* +1 for \0 at end */ node = librdf_new_node_from_blank_identifier(world, buffer+3); break; default: return NULL; } if(size_p) *size_p = total_length; return node; } #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_node_to_string: * @node: the node object * * Format the node as a string in a debugging format. * * Note a new string is allocated which must be freed by the caller. * * @Deprecated: Use librdf_node_write() to write to #raptor_iostream * which can be made to write to a string. Use a #librdf_serializer * to write proper syntax formats. * * Return value: a string value representing the node or NULL on failure **/ unsigned char* librdf_node_to_string(librdf_node *node) { raptor_iostream* iostr; unsigned char *s; int rc; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); iostr = raptor_new_iostream_to_string(node->world, (void**)&s, NULL, malloc); if(!iostr) return NULL; rc = librdf_node_write(node, iostr); raptor_free_iostream(iostr); if(rc) { raptor_free_memory(s); s = NULL; } return s; } #endif #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_node_to_counted_string: * @node: the node object * @len_p: pointer to location to store length * * Format the node as a counted string in a debugging format. * * Note a new string is allocated which must be freed by the caller. * * @Deprecated: Use librdf_node_write() to write to #raptor_iostream * which can be made to write to a string. Use a #librdf_serializer * to write proper syntax formats. * * Return value: a string value representing the node or NULL on failure **/ unsigned char* librdf_node_to_counted_string(librdf_node *node, size_t *len_p) { raptor_iostream* iostr; unsigned char *s; int rc; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL); iostr = raptor_new_iostream_to_string(node->world, (void**)&s, len_p, malloc); if(!iostr) return NULL; rc = librdf_node_write(node, iostr); raptor_free_iostream(iostr); if(rc) { raptor_free_memory(s); s = NULL; } return s; } #endif /** * librdf_node_print: * @node: the node * @fh: file handle * * Pretty print the node to a file descriptor. * * This method is for debugging and the format of the output should * not be relied on. * **/ void librdf_node_print(librdf_node *node, FILE *fh) { raptor_iostream *iostr; LIBRDF_ASSERT_OBJECT_POINTER_RETURN(node, librdf_node); LIBRDF_ASSERT_OBJECT_POINTER_RETURN(fh, FILE*); if(!node) return; iostr = raptor_new_iostream_to_file_handle(node->world, fh); if(!iostr) return; librdf_node_write(node, iostr); raptor_free_iostream(iostr); } /** * librdf_node_equals: * @first_node: first #librdf_node node * @second_node: second #librdf_node node * * Compare two librdf_node objects for equality. * * Note - for literal nodes, XML language, XML space and well-formness are * presently ignored in the comparison. * * Return value: non 0 if nodes are equal. 0 if not-equal or failure **/ int librdf_node_equals(librdf_node *first_node, librdf_node *second_node) { return raptor_term_equals(first_node, second_node); } /** * librdf_node_static_iterator_create: * @nodes: static array of #librdf_node objects * @size: size of array * * Create an iterator over an array of nodes (ALWAYS FAILS) * * This legacy method used to create an iterator for an existing * static array of librdf_node objects. It was intended for testing * iterator code. * * @deprecated: always returns NULL. Use * librdf_node_new_static_node_iterator() * * Return value: NULL **/ librdf_iterator* librdf_node_static_iterator_create(librdf_node **nodes, int size) { return NULL; } /** * librdf_node_write: * @node: the node * @iostr: iostream to write to * * Write the node to an iostream in N-Triples format. * * This method can be used to write a node in a relatively * readable format. To write more compact formats use a * serializer to pick a syntax and serialize triples to it. * * Return value: non-0 on failure **/ int librdf_node_write(librdf_node* node, raptor_iostream *iostr) { const unsigned char* term; size_t len; #define NULL_STRING_LENGTH 6 static const unsigned char * const null_string = (const unsigned char *)"(null)"; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(iostr, raptor_iostream, 1); if(!node) { raptor_iostream_counted_string_write(null_string, NULL_STRING_LENGTH, iostr); return 0; } switch(node->type) { case RAPTOR_TERM_TYPE_LITERAL: raptor_iostream_write_byte('"', iostr); raptor_string_ntriples_write(node->value.literal.string, node->value.literal.string_len, '"', iostr); raptor_iostream_write_byte('"', iostr); if(node->value.literal.language) { raptor_iostream_write_byte('@', iostr); raptor_iostream_string_write(node->value.literal.language, iostr); } if(node->value.literal.datatype) { raptor_iostream_counted_string_write("^^<", 3, iostr); term = librdf_uri_as_counted_string(node->value.literal.datatype, &len); raptor_string_ntriples_write(term, len, '>', iostr); raptor_iostream_write_byte('>', iostr); } break; case RAPTOR_TERM_TYPE_BLANK: raptor_iostream_counted_string_write("_:", 2, iostr); term = (unsigned char*)node->value.blank.string; len = node->value.blank.string_len; raptor_iostream_counted_string_write(term, len, iostr); break; case RAPTOR_TERM_TYPE_URI: raptor_iostream_write_byte('<', iostr); term = librdf_uri_as_counted_string(node->value.uri, &len); raptor_string_ntriples_write(term, len, '>', iostr); raptor_iostream_write_byte('>', iostr); break; case RAPTOR_TERM_TYPE_UNKNOWN: default: /*LIBRDF_FATAL1(node->world, LIBRDF_FROM_NODE, "Unknown node type");*/ return 1; } return 0; } #endif /* STANDALONE */ /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); static void dump_node_as_C(FILE* fh, const char* var, void *buffer, int size) { int i; unsigned char* p=(unsigned char*)buffer; fprintf(fh, "const unsigned char %s[%d] = {", var, size); for (i=0; i < size; i++) { if(i) fputs(", ", fh); fprintf(fh, "0x%02x", p[i]); } fputs("};\n", fh); } static int check_node(const char* program, const unsigned char *expected, void *buffer, size_t size) { unsigned int i; for(i=0; i< size; i++) { unsigned char c=((unsigned char*)buffer)[i]; if(c != expected[i]) { fprintf(stderr, "%s: Encoding node byte %d: 0x%02x expected 0x%02x\n", program, i, c, expected[i]); return(1); } } return(0); } static const char *hp_string1="http://purl.org/net/dajobe/"; static const char *hp_string2="http://purl.org/net/dajobe/"; static const char *lit_string="Dave Beckett"; static const char *genid="genid42"; static const char *datatype_lit_string="Datatyped literal value"; static const char *datatype_uri_string="http://example.org/datatypeURI"; /* Node Encoded (type R) version of hp_string1 */ static const unsigned char hp_uri_encoded[31] = {0x52, 0x00, 0x1b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x70, 0x75, 0x72, 0x6c, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x61, 0x6a, 0x6f, 0x62, 0x65, 0x2f, 0x00}; /* Node Encoded (type M) version of typed literal with literal value * datatype_lit_string and datatype URI datatype_uri_string */ static const unsigned char datatyped_literal_M_encoded[61] = {0x4d, 0x00, 0x17, 0x00, 0x1e, 0x00, 0x44, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x64, 0x20, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x55, 0x52, 0x49, 0x00}; /* Node Encoded (type N) version of big 100,000-length literal * (just the first 32 bytes, the rest are 0x58 'X') */ const unsigned char big_literal_N_encoded[32] = {0x4e, 0x00, 0x01, 0x86, 0xa0, 0x00, 0x00, 0x00, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58}; int main(int argc, char *argv[]) { librdf_node *node, *node2, *node3, *node4, *node5, *node6, *node7, *node8, *node9; librdf_uri *uri, *uri2; int size, size2; unsigned char *buffer; librdf_world *world; size_t big_literal_length; unsigned char *big_literal; unsigned int i; const char *program=librdf_basename((const char*)argv[0]); world=librdf_new_world(); librdf_world_open(world); fprintf(stderr, "%s: Creating home page node from string\n", program); node=librdf_new_node_from_uri_string(world, (const unsigned char*)hp_string1); if(!node) { fprintf(stderr, "%s: librdf_new_node_from_uri_string failed\n", program); return(1); } fprintf(stdout, "%s: Home page URI is ", program); librdf_uri_print(librdf_node_get_uri(node), stdout); fputc('\n', stdout); fprintf(stdout, "%s: Creating URI from string '%s'\n", program, hp_string2); uri=librdf_new_uri(world, (const unsigned char*)hp_string2); fprintf(stdout, "%s: Setting node URI to new URI ", program); librdf_uri_print(uri, stdout); fputc('\n', stdout); librdf_free_uri(uri); fprintf(stdout, "%s: Node is: ", program); librdf_node_print(node, stdout); fputc('\n', stdout); size=librdf_node_encode(node, NULL, 0); fprintf(stdout, "%s: Encoding node requires %d bytes\n", program, size); buffer = LIBRDF_MALLOC(unsigned char*, size); fprintf(stdout, "%s: Encoding node in buffer\n", program); size2=librdf_node_encode(node, buffer, size); if(size2 != size) { fprintf(stderr, "%s: Encoding node used %d bytes, expected it to use %d\n", program, size2, size); return(1); } if(0) dump_node_as_C(stdout, "hp_uri_encoded", buffer, size); if(check_node(program, hp_uri_encoded, buffer, size)) return(1); fprintf(stdout, "%s: Creating new node\n", program); fprintf(stdout, "%s: Decoding node from buffer\n", program); if(!(node2=librdf_node_decode(world, NULL, buffer, size))) { fprintf(stderr, "%s: Decoding node failed\n", program); return(1); } LIBRDF_FREE(char*, buffer); fprintf(stdout, "%s: New node is: ", program); librdf_node_print(node2, stdout); fputc('\n', stdout); fprintf(stdout, "%s: Creating new literal string node\n", program); node3=librdf_new_node_from_literal(world, (const unsigned char*)lit_string, NULL, 0); if(!node3) { fprintf(stderr, "%s: librdf_new_node_from_literal failed\n", program); return(1); } buffer=(unsigned char*)librdf_node_get_literal_value_as_latin1(node3); if(!buffer) { fprintf(stderr, "%s: Failed to get literal string value as Latin-1\n", program); return(1); } fprintf(stdout, "%s: Node literal string value (Latin-1) is: '%s'\n", program, buffer); LIBRDF_FREE(char*, buffer); fprintf(stdout, "%s: Creating new blank node with identifier %s\n", program, genid); node4=librdf_new_node_from_blank_identifier(world, (const unsigned char*)genid); if(!node4) { fprintf(stderr, "%s: librdf_new_node_from_blank_identifier failed\n", program); return(1); } buffer=librdf_node_get_blank_identifier(node4); if(!buffer) { fprintf(stderr, "%s: Failed to get blank node identifier\n", program); return(1); } fprintf(stdout, "%s: Node identifier is: '%s'\n", program, buffer); node5=librdf_new_node_from_node(node4); if(!node5) { fprintf(stderr, "%s: Failed to make new blank node from old one\n", program); return(1); } buffer=librdf_node_get_blank_identifier(node5); if(!buffer) { fprintf(stderr, "%s: Failed to get copied blank node identifier\n", program); return(1); } fprintf(stdout, "%s: Copied node identifier is: '%s'\n", program, buffer); fprintf(stdout, "%s: Creating a new blank node with a generated identifier\n", program); node6=librdf_new_node(world); if(!node6) { fprintf(stderr, "%s: librdf_new_node failed\n", program); return(1); } buffer=librdf_node_get_blank_identifier(node6); if(!buffer) { fprintf(stderr, "%s: Failed to get blank node identifier\n", program); return(1); } fprintf(stdout, "%s: Generated node identifier is: '%s'\n", program, buffer); uri2=librdf_new_uri(world, (const unsigned char*)datatype_uri_string); node7=librdf_new_node_from_typed_literal(world, (const unsigned char*)datatype_lit_string, NULL, uri2); librdf_free_uri(uri2); size=librdf_node_encode(node7, NULL, 0); fprintf(stdout, "%s: Encoding typed node requires %d bytes\n", program, size); buffer = LIBRDF_MALLOC(unsigned char*, size); fprintf(stdout, "%s: Encoding typed node in buffer\n", program); size2=librdf_node_encode(node7, (unsigned char*)buffer, size); if(size2 != size) { fprintf(stderr, "%s: Encoding typed node used %d bytes, expected it to use %d\n", program, size2, size); return(1); } if(0) dump_node_as_C(stdout, "datatyped_literal_M_encoded", buffer, size); if(check_node(program, datatyped_literal_M_encoded, buffer, size)) return(1); fprintf(stdout, "%s: Decoding typed node from buffer\n", program); if(!(node8=librdf_node_decode(world, NULL, (unsigned char*)buffer, size))) { fprintf(stderr, "%s: Decoding typed node failed\n", program); return(1); } LIBRDF_FREE(char*, buffer); if(librdf_new_node_from_typed_literal(world, (const unsigned char*)"Datatyped literal value", "en-GB", uri2)) { fprintf(stderr, "%s: Unexpected success allowing a datatyped literal with a language\n", program); return(1); } if(librdf_new_node_from_literal(world, (const unsigned char*)"XML literal value", "en-GB", 1)) { fprintf(stderr, "%s: Unexpected success allowing an XML literal with a language\n", program); return(1); } big_literal_length=100000; big_literal = LIBRDF_MALLOC(unsigned char*, big_literal_length + 1); for(i=0; i #endif #ifdef WIN32 #include #endif #include #include #include typedef struct { librdf_serializer *serializer; /* librdf serializer object */ raptor_serializer *rdf_serializer; /* raptor serializer object */ char *serializer_name; /* raptor serializer name to use */ int errors; int warnings; } librdf_serializer_raptor_context; /** * librdf_serializer_raptor_init: * @serializer: the serializer * @context: context * * Initialise the N-Triples RDF serializer. * * Return value: non 0 on failure **/ static int librdf_serializer_raptor_init(librdf_serializer *serializer, void *context) { librdf_serializer_raptor_context* scontext=(librdf_serializer_raptor_context*)context; scontext->serializer = serializer; scontext->serializer_name=scontext->serializer->factory->name; scontext->rdf_serializer = raptor_new_serializer(serializer->world->raptor_world_ptr, scontext->serializer_name); if(!scontext->rdf_serializer) return 1; return 0; } /** * librdf_serializer_raptor_terminate: * @context: context * * Terminate the raptor RDF serializer. * **/ static void librdf_serializer_raptor_terminate(void *context) { librdf_serializer_raptor_context* scontext=(librdf_serializer_raptor_context*)context; if(scontext->rdf_serializer) raptor_free_serializer(scontext->rdf_serializer); } /** * librdf_serializer_raptor_get_feature: * @context: context * @feature: #librdf_uri of feature * * Get a raptor parser feature. * * Return value: new #librdf_node value or NULL on failure **/ static librdf_node* librdf_serializer_raptor_get_feature(void *context, librdf_uri* feature) { librdf_serializer_raptor_context* scontext=(librdf_serializer_raptor_context*)context; unsigned char intbuffer[20]; /* FIXME */ unsigned char *uri_string; raptor_option feature_i; if(!feature) return NULL; uri_string=librdf_uri_as_string(feature); if(!uri_string) return NULL; feature_i = raptor_world_get_option_from_uri(scontext->serializer->world->raptor_world_ptr, (raptor_uri*)feature); if((int)feature_i >= 0) { int value; raptor_serializer_get_option(scontext->rdf_serializer, feature_i, NULL, &value); sprintf((char*)intbuffer, "%d", value); return librdf_new_node_from_typed_literal(scontext->serializer->world, intbuffer, NULL, NULL); } return NULL; } static int librdf_serializer_raptor_set_feature(void *context, librdf_uri *feature, librdf_node* value) { librdf_serializer_raptor_context* scontext=(librdf_serializer_raptor_context*)context; raptor_option feature_i; const unsigned char* value_s; if(!feature) return 1; /* try a raptor feature */ feature_i = raptor_world_get_option_from_uri(scontext->serializer->world->raptor_world_ptr, (raptor_uri*)feature); if((int)feature_i < 0) return 1; if(!librdf_node_is_literal(value)) return 1; value_s=(const unsigned char*)librdf_node_get_literal_value(value); return raptor_serializer_set_option(scontext->rdf_serializer, feature_i, (const char *)value_s, 0); } static int librdf_serializer_raptor_set_namespace(void* context, librdf_uri *uri, const char *prefix) { librdf_serializer_raptor_context* scontext = (librdf_serializer_raptor_context*)context; return raptor_serializer_set_namespace(scontext->rdf_serializer, (raptor_uri*)uri, (const unsigned char*)prefix); } static int librdf_serializer_raptor_serialize_statement(raptor_serializer *rserializer, librdf_statement* statement) { return raptor_serializer_serialize_statement(rserializer, statement); } static int librdf_serializer_raptor_serialize_stream_to_file_handle(void *context, FILE *handle, librdf_uri* base_uri, librdf_stream *stream) { librdf_serializer_raptor_context* scontext=(librdf_serializer_raptor_context*)context; int rc=0; if(!stream) return 1; /* start the serialize */ rc = raptor_serializer_start_to_file_handle(scontext->rdf_serializer, (raptor_uri*)base_uri, handle); if(rc) { /* free up resources on error */ raptor_serializer_serialize_end(scontext->rdf_serializer); return 1; } scontext->errors=0; scontext->warnings=0; rc=0; while(!librdf_stream_end(stream)) { librdf_statement *statement = librdf_stream_get_object(stream); librdf_node *graph = librdf_stream_get_context2(stream); statement->graph = graph; rc = librdf_serializer_raptor_serialize_statement(scontext->rdf_serializer, statement); statement->graph = NULL; if(rc) break; librdf_stream_next(stream); } raptor_serializer_serialize_end(scontext->rdf_serializer); return rc; } static int librdf_serializer_raptor_serialize_model_to_file_handle(void *context, FILE *handle, librdf_uri* base_uri, librdf_model *model) { int rc; librdf_stream *stream; stream=librdf_model_as_stream(model); if(!stream) return 1; rc=librdf_serializer_raptor_serialize_stream_to_file_handle(context, handle, base_uri, stream); librdf_free_stream(stream); return rc; } static unsigned char* librdf_serializer_raptor_serialize_stream_to_counted_string(void *context, librdf_uri* base_uri, librdf_stream *stream, size_t* length_p) { librdf_serializer_raptor_context* scontext=(librdf_serializer_raptor_context*)context; raptor_iostream *iostr; void *string=NULL; size_t string_length=0; int rc=0; if(!stream) return NULL; /* start the serialize */ iostr = raptor_new_iostream_to_string(raptor_serializer_get_world(scontext->rdf_serializer), &string, &string_length, malloc); if(!iostr) { raptor_free_memory(string); return NULL; } rc = raptor_serializer_start_to_iostream(scontext->rdf_serializer, (raptor_uri*)base_uri, iostr); if(rc) { raptor_free_iostream(iostr); raptor_free_memory(string); return NULL; } scontext->errors=0; scontext->warnings=0; rc=0; while(!librdf_stream_end(stream)) { librdf_statement *statement = librdf_stream_get_object(stream); librdf_node *graph = librdf_stream_get_context2(stream); statement->graph = graph; rc = librdf_serializer_raptor_serialize_statement(scontext->rdf_serializer, statement); statement->graph = NULL; if(rc) break; librdf_stream_next(stream); } raptor_serializer_serialize_end(scontext->rdf_serializer); /* raptor2 raptor_serialize_start_to_iostream() does not take * ownership of iostream */ raptor_free_iostream(iostr); if(rc) { raptor_free_memory(string); return NULL; } if(length_p) *length_p=string_length; return (unsigned char *)string; } static unsigned char* librdf_serializer_raptor_serialize_model_to_counted_string(void *context, librdf_uri* base_uri, librdf_model *model, size_t* length_p) { unsigned char *string=NULL; librdf_stream *stream; stream=librdf_model_as_stream(model); if(!stream) return NULL; string=librdf_serializer_raptor_serialize_stream_to_counted_string(context, base_uri, stream, length_p); librdf_free_stream(stream); return string; } static int librdf_serializer_raptor_serialize_stream_to_iostream(void *context, librdf_uri* base_uri, librdf_stream *stream, raptor_iostream* iostr) { librdf_serializer_raptor_context* scontext=(librdf_serializer_raptor_context*)context; int rc=0; if(!iostr) return 1; if(!stream) return 1; /* start the serialize */ rc = raptor_serializer_start_to_iostream(scontext->rdf_serializer, (raptor_uri*)base_uri, iostr); if(rc) { raptor_free_iostream(iostr); return 1; } scontext->errors=0; scontext->warnings=0; rc=0; while(!librdf_stream_end(stream)) { librdf_statement *statement = librdf_stream_get_object(stream); librdf_node *graph = librdf_stream_get_context2(stream); statement->graph = graph; rc = librdf_serializer_raptor_serialize_statement(scontext->rdf_serializer, statement); statement->graph = NULL; if(rc) break; librdf_stream_next(stream); } raptor_serializer_serialize_end(scontext->rdf_serializer); /* raptor1 raptor_serialize_start_to_iostream() does not take * ownership of iostr */ raptor_free_iostream(iostr); return rc; } static int librdf_serializer_raptor_serialize_model_to_iostream(void *context, librdf_uri* base_uri, librdf_model *model, raptor_iostream* iostr) { int rc=0; librdf_stream *stream; if(!iostr) return 1; stream=librdf_model_as_stream(model); if(!stream) return 1; rc=librdf_serializer_raptor_serialize_stream_to_iostream(context, base_uri, stream, iostr); librdf_free_stream(stream); return rc; } /** * librdf_serializer_raptor_register_factory: * @factory: factory * * Register the N-riples serializer with the RDF serializer factory. * **/ static void librdf_serializer_raptor_register_factory(librdf_serializer_factory *factory) { factory->context_length = sizeof(librdf_serializer_raptor_context); factory->init = librdf_serializer_raptor_init; factory->terminate = librdf_serializer_raptor_terminate; factory->get_feature = librdf_serializer_raptor_get_feature; factory->set_feature = librdf_serializer_raptor_set_feature; factory->set_namespace = librdf_serializer_raptor_set_namespace; factory->serialize_stream_to_file_handle= librdf_serializer_raptor_serialize_stream_to_file_handle; factory->serialize_model_to_file_handle = librdf_serializer_raptor_serialize_model_to_file_handle; factory->serialize_stream_to_counted_string = librdf_serializer_raptor_serialize_stream_to_counted_string; factory->serialize_model_to_counted_string = librdf_serializer_raptor_serialize_model_to_counted_string; factory->serialize_stream_to_iostream = librdf_serializer_raptor_serialize_stream_to_iostream; factory->serialize_model_to_iostream = librdf_serializer_raptor_serialize_model_to_iostream; } /** * librdf_serializer_raptor_constructor: * @world: redland world object * * INTERNAL - Initialise the serializer_raptor module. * **/ void librdf_serializer_raptor_constructor(librdf_world *world) { unsigned int i; /* enumerate from serializer 1, so the default serializer 0 is done last */ for(i = 1; 1; i++) { const char *syntax_name = NULL; const char *syntax_label = NULL; const char *mime_type = NULL; const unsigned char *uri_string = NULL; const raptor_syntax_description *desc; desc = raptor_world_get_serializer_description(world->raptor_world_ptr, i); if(!desc) { /* reached the end of the serializers, now register the default one */ i = 0; desc = raptor_world_get_serializer_description(world->raptor_world_ptr, i); if(!desc) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_PARSER, NULL, "Failed to find any Raptor serializers - Raptor may not be initialised correctly"); break; } } syntax_name = desc->names[0]; syntax_label = desc->label; if(desc->mime_types) mime_type = desc->mime_types[0].mime_type; if(desc->uri_strings) uri_string = (const unsigned char *)desc->uri_strings[0]; librdf_serializer_register_factory(world, syntax_name, syntax_label, mime_type, uri_string, &librdf_serializer_raptor_register_factory); if(!i) /* registered default serializer, end */ break; } } redland-1.0.17/src/rdf_storage_hashes.c0000644000175000017500000017502411773150065014735 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_hashes.c - RDF Storage as Hashes Implementation * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #ifdef HAVE_STDLIB_H #include #endif #include #include typedef struct { const char *name; int key_fields; /* OR of LIBRDF_STATEMENT_* fields defined in rdf_statement.h */ int value_fields; /* ditto */ } librdf_hash_descriptor; static const librdf_hash_descriptor librdf_storage_hashes_descriptions[]= { {"sp2o", LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_PREDICATE, LIBRDF_STATEMENT_OBJECT}, /* For 'get targets' */ {"po2s", LIBRDF_STATEMENT_PREDICATE|LIBRDF_STATEMENT_OBJECT, LIBRDF_STATEMENT_SUBJECT}, /* For 'get sources' */ {"so2p", LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_OBJECT, LIBRDF_STATEMENT_PREDICATE}, /* For 'get arcs' */ {"p2so", LIBRDF_STATEMENT_PREDICATE, LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_OBJECT}, /* For '(?, p, ?)' */ {"contexts", 0L, /* for contexts - do not touch when storing statements! */ 0L}, {NULL,0L,0L} }; static const librdf_hash_descriptor* librdf_storage_get_hash_description_by_name(const char *name) { int i; const librdf_hash_descriptor *d; for(i=0; (d=&librdf_storage_hashes_descriptions[i]); i++) { if(!d->name) return NULL; if(!strcmp(d->name, name)) return d; } return NULL; } typedef struct { /* from init() argument */ char *name; /* from options decoded from options hash during init() */ char *hash_type; char *db_dir; char *indexes; int mode; int is_writable; int is_new; librdf_hash *options; /* remaining options for hash open method */ /* internals */ int hash_count; /* how many hashes are present? */ /* The following are allocated arrays of size hash_count */ librdf_hash** hashes; librdf_hash_descriptor** hash_descriptions; char** names; /* hash names for hash open method */ int sources_index; int arcs_index; int targets_index; int p2so_index; /* If this is non-0, contexts are being used */ int index_contexts; int contexts_index; int all_statements_hash_index; /* growing buffers used to en/decode keys/values */ unsigned char *key_buffer; size_t key_buffer_len; unsigned char *value_buffer; size_t value_buffer_len; } librdf_storage_hashes_instance; /* helper function for implementing init and clone methods */ static int librdf_storage_hashes_register(librdf_storage *storage, const char *name, const librdf_hash_descriptor *source_desc); static int librdf_storage_hashes_init_common(librdf_storage* storage, const char *name, char *hash_type, char *db_dir, char *indexes, int mode, int is_writable, int is_new, librdf_hash* options); /* prototypes for local functions */ static int librdf_storage_hashes_init(librdf_storage* storage, const char *name, librdf_hash* options); static void librdf_storage_hashes_terminate(librdf_storage* storage); static int librdf_storage_hashes_clone(librdf_storage* new_storage, librdf_storage* old_storage); static int librdf_storage_hashes_open(librdf_storage* storage, librdf_model* model); static int librdf_storage_hashes_close(librdf_storage* storage); static int librdf_storage_hashes_size(librdf_storage* storage); static int librdf_storage_hashes_add_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_hashes_add_statements(librdf_storage* storage, librdf_stream* statement_stream); static int librdf_storage_hashes_remove_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_hashes_contains_statement(librdf_storage* storage, librdf_statement* statement); static librdf_stream* librdf_storage_hashes_serialise(librdf_storage* storage); static librdf_stream* librdf_storage_hashes_find_statements(librdf_storage* storage, librdf_statement* statement); static librdf_iterator* librdf_storage_hashes_find_sources(librdf_storage* storage, librdf_node* arc, librdf_node *target); static librdf_iterator* librdf_storage_hashes_find_arcs(librdf_storage* storage, librdf_node* source, librdf_node *target); static librdf_iterator* librdf_storage_hashes_find_targets(librdf_storage* storage, librdf_node* source, librdf_node *arc); /* serialising implementing functions */ static int librdf_storage_hashes_serialise_end_of_stream(void* context); static int librdf_storage_hashes_serialise_next_statement(void* context); static void* librdf_storage_hashes_serialise_get_statement(void* context, int flags); static void librdf_storage_hashes_serialise_finished(void* context); /* context functions */ static int librdf_storage_hashes_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_hashes_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static librdf_stream* librdf_storage_hashes_context_serialise(librdf_storage* storage, librdf_node* context_node); /* context list statement stream methods */ static int librdf_storage_hashes_context_serialise_end_of_stream(void* context); static int librdf_storage_hashes_context_serialise_next_statement(void* context); static void* librdf_storage_hashes_context_serialise_get_statement(void* context, int flags); static void librdf_storage_hashes_context_serialise_finished(void* context); static void librdf_storage_hashes_register_factory(librdf_storage_factory *factory); /* node iterator implementing functions for get sources, targets, arcs methods */ static int librdf_storage_hashes_node_iterator_is_end(void* iterator); static int librdf_storage_hashes_node_iterator_next_method(void* iterator); static void* librdf_storage_hashes_node_iterator_get_method(void* iterator, int flags); static void librdf_storage_hashes_node_iterator_finished(void* iterator); /* common initialisation code for creating get sources, targets, arcs iterators */ static librdf_iterator* librdf_storage_hashes_node_iterator_create(librdf_storage* storage, librdf_node* node1, librdf_node *node2, int hash_index, int want); static int librdf_storage_hashes_register(librdf_storage *storage, const char *name, const librdf_hash_descriptor *source_desc) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; size_t len; char *full_name=NULL; int hash_index; librdf_hash_descriptor *desc; if(!source_desc) return 1; desc = LIBRDF_MALLOC(librdf_hash_descriptor*, sizeof(*desc)); if(!desc) return 1; memcpy(desc, source_desc, sizeof(librdf_hash_descriptor)); hash_index=context->hash_count++; context->hash_descriptions[hash_index]=desc; if(name) { len = strlen(desc->name) + 1 + strlen(name) + 1; /* "%s-%s\0" */ if(context->db_dir) len += strlen(context->db_dir) +1; full_name = LIBRDF_MALLOC(char*, len); if(!full_name) return 1; /* FIXME: Implies Unix filenames */ if(context->db_dir) sprintf(full_name, "%s/%s-%s", context->db_dir, name, desc->name); else sprintf(full_name, "%s-%s", name, desc->name); } context->hashes[hash_index]=librdf_new_hash(storage->world, context->hash_type); context->names[hash_index]=full_name; return (context->hashes[hash_index] == NULL); } /* helper function for implementing init and clone methods */ static int librdf_storage_hashes_init_common(librdf_storage* storage, const char *name, char *hash_type, char *db_dir, char *indexes, int mode, int is_writable, int is_new, librdf_hash* options) { librdf_storage_hashes_instance* context; int i; int status=0; int index_predicates=0; int index_contexts=0; int hash_count=0; context = LIBRDF_CALLOC(librdf_storage_hashes_instance*, 1, sizeof(*context)); if(!context) return 1; librdf_storage_set_instance(storage, context); context->name=(char*)name; context->hash_type=hash_type; context->db_dir=db_dir; context->indexes=indexes; context->mode=mode; context->is_writable=is_writable; context->is_new=is_new; context->options=options; /* Work out the number of hashes for allocating stuff below */ hash_count=3; if((index_contexts=librdf_hash_get_as_boolean(options, "contexts"))<0) index_contexts=0; /* default is no contexts */ context->index_contexts=index_contexts; if(index_contexts) hash_count++; if((index_predicates=librdf_hash_get_as_boolean(options, "index-predicates"))<0) index_predicates=0; /* default is NO index on properties */ if(index_predicates) hash_count++; /* Start allocating the arrays */ context->hashes = LIBRDF_CALLOC(librdf_hash**, LIBRDF_GOOD_CAST(size_t, hash_count), sizeof(librdf_hash*)); if(!context->hashes) { if(context->name) LIBRDF_FREE(char*, context->name); return 1; } context->hash_descriptions = LIBRDF_CALLOC(librdf_hash_descriptor**, LIBRDF_GOOD_CAST(size_t, hash_count), sizeof(librdf_hash_descriptor*)); if(!context->hash_descriptions) { LIBRDF_FREE(librdf_hash, context->hashes); if(context->name) LIBRDF_FREE(char*, context->name); return 1; } context->names = LIBRDF_CALLOC(char**, LIBRDF_GOOD_CAST(size_t, hash_count), sizeof(char*)); if(!context->names) { LIBRDF_FREE(librdf_hash, context->hashes); LIBRDF_FREE(librdf_hash_descriptor, context->hash_descriptions); if(context->name) LIBRDF_FREE(char*, context->name); return 1; } for(i=0; i<3; i++) { status=librdf_storage_hashes_register(storage, name, &librdf_storage_hashes_descriptions[i]); if(status) break; } if(index_predicates && !status) status=librdf_storage_hashes_register(storage, name, librdf_storage_get_hash_description_by_name("p2so")); if(index_contexts && !status) librdf_storage_hashes_register(storage, name, librdf_storage_get_hash_description_by_name("contexts")); /* find indexes for get targets, sources and arcs */ context->sources_index= -1; context->arcs_index= -1; context->targets_index= -1; context->p2so_index= -1; /* and index for contexts (no key or value fields) */ context->contexts_index= -1; context->all_statements_hash_index= -1; for(i=0; ihash_count; i++) { int key_fields; int value_fields; if(!context->hash_descriptions[i]) continue; key_fields = context->hash_descriptions[i]->key_fields; value_fields = context->hash_descriptions[i]->value_fields; if(context->all_statements_hash_index <0 && ((key_fields|value_fields)==(LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_PREDICATE|LIBRDF_STATEMENT_OBJECT))) { context->all_statements_hash_index=i; } if(key_fields == (LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_PREDICATE) && value_fields == LIBRDF_STATEMENT_OBJECT) { context->targets_index=i; } else if(key_fields == (LIBRDF_STATEMENT_PREDICATE|LIBRDF_STATEMENT_OBJECT) && value_fields == LIBRDF_STATEMENT_SUBJECT) { context->sources_index=i; } else if(key_fields == (LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_OBJECT) && value_fields == LIBRDF_STATEMENT_PREDICATE) { context->arcs_index=i; } else if(key_fields == LIBRDF_STATEMENT_PREDICATE && value_fields == (LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_OBJECT)) { context->p2so_index=i; } else if(!key_fields || !value_fields) { context->contexts_index=i; } } return status; } /* functions implementing storage api */ static int librdf_storage_hashes_init(librdf_storage* storage, const char *name, librdf_hash* options) { char *hash_type, *db_dir, *indexes; int mode, is_writable, is_new; char *name_copy=NULL; if(!options) return 1; hash_type=librdf_hash_get_del(options, "hash-type"); if(!hash_type) return 1; db_dir=librdf_hash_get_del(options, "dir"); indexes=librdf_hash_get_del(options, "indexes"); /* POSIX open(2) modes are int so this cast is OKish */ mode = (int)librdf_hash_get_as_long(options, "mode"); if(mode < 0) mode = 0644; /* default mode */ if((is_writable=librdf_hash_get_as_boolean(options, "write"))<0) is_writable=1; /* default is WRITABLE */ if((is_new=librdf_hash_get_as_boolean(options, "new"))<0) is_new=0; /* default is NOT NEW */ if(name) { name_copy = LIBRDF_MALLOC(char*, strlen(name) + 1); if(!name_copy) return 1; strcpy(name_copy, name); } return librdf_storage_hashes_init_common(storage, name_copy, hash_type, db_dir, indexes, mode, is_writable, is_new, options); } static void librdf_storage_hashes_terminate(librdf_storage* storage) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; int i; if (context == NULL) return; for(i=0; ihash_count; i++) { if(context->hash_descriptions && context->hash_descriptions[i]) LIBRDF_FREE(librdf_hash_descriptor, context->hash_descriptions[i]); if(context->hashes && context->hashes[i]) librdf_free_hash(context->hashes[i]); if(context->names && context->names[i]) LIBRDF_FREE(char*, context->names[i]); } if(context->hash_descriptions) LIBRDF_FREE(librdf_hash_descriptor, context->hash_descriptions); if(context->hashes) LIBRDF_FREE(librdf_hash_descriptor, context->hashes); if(context->names) LIBRDF_FREE(char*, context->names); if(context->options) librdf_free_hash(context->options); if(context->hash_type) LIBRDF_FREE(char*, context->hash_type); if(context->db_dir) LIBRDF_FREE(char*, context->db_dir); if(context->indexes) LIBRDF_FREE(char*, context->indexes); if(context->key_buffer) LIBRDF_FREE(data, context->key_buffer); if(context->value_buffer) LIBRDF_FREE(data, context->value_buffer); if(context->name) LIBRDF_FREE(char*, context->name); LIBRDF_FREE(librdf_storage_hashes_instance, context); } static int librdf_storage_hashes_clone(librdf_storage* new_storage, librdf_storage* old_storage) { librdf_storage_hashes_instance* old_context; librdf_hash* new_options = NULL; char* new_name = NULL; char* new_hash_type = NULL; char* new_db_dir = NULL; char* new_indexes = NULL; old_context = (librdf_storage_hashes_instance*)old_storage->instance; /* Bump up old context name if any */ if(old_context->name) { new_name = librdf_heuristic_gen_name(old_context->name); if(!new_name) goto failed; } /* This is always a copy of an in-memory hash */ new_options = librdf_new_hash_from_hash(old_context->options); if(!new_options) goto failed; if(old_context->hash_type) { new_hash_type = strdup(old_context->hash_type); if(!new_hash_type) goto failed; } if(old_context->db_dir) { new_db_dir = strdup(old_context->db_dir); if(!new_db_dir) goto failed; } if(old_context->indexes) { new_indexes = strdup(old_context->indexes); if(!new_indexes) goto failed; } if(librdf_storage_hashes_init_common(new_storage, new_name, new_hash_type, new_db_dir, new_indexes, old_context->mode, old_context->is_writable, old_context->is_new, new_options)) { goto failed; } return 0; failed: if(new_name) LIBRDF_FREE(char*, new_name); if(new_hash_type) LIBRDF_FREE(char*, new_hash_type); if(new_db_dir) LIBRDF_FREE(char*, new_db_dir); if(new_indexes) LIBRDF_FREE(char*, new_indexes); if(new_options) librdf_free_hash(new_options); return 1; } static int librdf_storage_hashes_open(librdf_storage* storage, librdf_model* model) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; int i; int result=0; for(i=0; ihash_count; i++) { librdf_hash *hash=context->hashes[i]; if(!hash || librdf_hash_open(hash, context->names[i], context->mode, context->is_writable, context->is_new, context->options)) { /* I still have my "Structured Fortran" book */ int j; for (j=0; jhashes[j]); context->hashes[j]=NULL; } result=1; } if(result) break; } return result; } /* * librdf_storage_hashes_close: * @storage: storage object * * INTERNAL - Close the storage hashes storage, and free all content since there is no persistance. * * Return value: non 0 on failure **/ static int librdf_storage_hashes_close(librdf_storage* storage) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; int i; for(i=0; ihash_count; i++) { if(context->hashes[i]) librdf_hash_close(context->hashes[i]); } return 0; } static int librdf_storage_hashes_size(librdf_storage* storage) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; librdf_hash* any_hash=context->hashes[context->all_statements_hash_index]; if(!any_hash) return -1; return librdf_hash_values_count(any_hash); } static int librdf_storage_hashes_grow_buffer(unsigned char **buffer, size_t *len, size_t required_len) { if(required_len <= *len) return 0; if(*buffer) LIBRDF_FREE(data, *buffer); *len=required_len+8; *buffer = LIBRDF_MALLOC(unsigned char*, *len); if(!*buffer) *len=0; return (*len < required_len); } static int librdf_storage_hashes_add_remove_statement(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, int is_addition) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; int i; int status=0; librdf_world* world = storage->world; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 if(is_addition) LIBRDF_DEBUG1("Adding statement: "); else LIBRDF_DEBUG1("Removing statement: "); librdf_statement_print(statement, stderr); fputc('\n', stderr); #endif for(i=0; ihash_count; i++) { librdf_hash_datum hd_key, hd_value; /* on stack */ size_t key_len, value_len; /* ENCODE KEY */ librdf_statement_part fields=(librdf_statement_part)context->hash_descriptions[i]->key_fields; if(!fields) continue; key_len = librdf_statement_encode_parts2(world, statement, NULL, NULL, 0, fields); if(!key_len) return 1; if(librdf_storage_hashes_grow_buffer(&context->key_buffer, &context->key_buffer_len, key_len)) { status=1; break; } if(!librdf_statement_encode_parts2(world, statement, NULL, context->key_buffer, context->key_buffer_len, fields)) { status=1; break; } /* ENCODE VALUE */ fields=(librdf_statement_part)context->hash_descriptions[i]->value_fields; if(!fields) continue; value_len=librdf_statement_encode_parts2(world, statement, context_node, NULL, 0, fields); if(!value_len) { status=1; break; } if(librdf_storage_hashes_grow_buffer(&context->value_buffer, &context->value_buffer_len, value_len)) { status=1; break; } if(!librdf_statement_encode_parts2(world, statement, context_node, context->value_buffer, context->value_buffer_len, fields)) { status=1; break; } #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG4("Using %s hash key %d bytes -> value %d bytes\n", context->hash_descriptions[i]->name, key_len, value_len); #endif /* Finally, store / remove the sucker */ hd_key.data=context->key_buffer; hd_key.size=key_len; hd_value.data=context->value_buffer; hd_value.size=value_len; if(is_addition) status=librdf_hash_put(context->hashes[i], &hd_key, &hd_value); else status=librdf_hash_delete(context->hashes[i], &hd_key, &hd_value); if(status) break; } return status; } static int librdf_storage_hashes_add_statement(librdf_storage* storage, librdf_statement* statement) { /* Do not add duplicate statements */ if(librdf_storage_hashes_contains_statement(storage, statement)) return 0; return librdf_storage_hashes_add_remove_statement(storage, statement, NULL, 1); } static int librdf_storage_hashes_add_statements(librdf_storage* storage, librdf_stream* statement_stream) { int status=0; while(!librdf_stream_end(statement_stream)) { librdf_statement* statement=librdf_stream_get_object(statement_stream); if(statement) { status=librdf_storage_hashes_add_statement(storage, statement); } else status=1; if(status) break; librdf_stream_next(statement_stream); } return status; } static int librdf_storage_hashes_remove_statement(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_hashes_add_remove_statement(storage, statement, NULL, 0); } static int librdf_storage_hashes_contains_statement(librdf_storage* storage, librdf_statement* statement) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; librdf_hash_datum hd_key, hd_value; /* on stack */ unsigned char *key_buffer, *value_buffer; size_t key_len, value_len; int hash_index=context->all_statements_hash_index; librdf_statement_part fields; int status; librdf_world* world = storage->world; if(context->index_contexts) { /* When we have contexts, we have to use find_statements for contains * since a statement is encoded in KEY/VALUE and the VALUE may * contain some context node. */ librdf_stream *stream=librdf_storage_hashes_find_statements(storage, statement); if(!stream) return 0; /* librdf_stream_end returns 0 if have more, non-0 at end */ status=!librdf_stream_end(stream); /* convert to 0 if at end (not found) and non-zero otherwise (found) */ librdf_free_stream(stream); return status; } /* ENCODE KEY */ fields=(librdf_statement_part)context->hash_descriptions[hash_index]->key_fields; key_len = librdf_statement_encode_parts2(world, statement, NULL, NULL, 0, fields); if(!key_len) return 1; key_buffer = LIBRDF_MALLOC(unsigned char*, key_len); if(!key_buffer) return 1; if(!librdf_statement_encode_parts2(world, statement, NULL, key_buffer, key_len, fields)) { LIBRDF_FREE(data, key_buffer); return 1; } /* ENCODE VALUE */ fields=(librdf_statement_part)context->hash_descriptions[hash_index]->value_fields; value_len = librdf_statement_encode_parts2(world, statement, NULL, NULL, 0, fields); if(!value_len) { LIBRDF_FREE(data, key_buffer); return 1; } value_buffer = LIBRDF_MALLOC(unsigned char*, value_len); if(!value_buffer) { LIBRDF_FREE(data, key_buffer); return 1; } if(!librdf_statement_encode_parts2(world, statement, NULL, value_buffer, value_len, fields)) { LIBRDF_FREE(data, key_buffer); LIBRDF_FREE(data, value_buffer); return 1; } #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 LIBRDF_DEBUG4("Using %s hash key %d bytes -> value %d bytes\n", context->hash_descriptions[hash_index]->name, key_len, value_len); #endif hd_key.data=key_buffer; hd_key.size=key_len; hd_value.data=value_buffer; hd_value.size=value_len; status=librdf_hash_exists(context->hashes[hash_index], &hd_key, &hd_value); LIBRDF_FREE(data, key_buffer); LIBRDF_FREE(data, value_buffer); /* DO NOT free statement, ownership was not passed in */ return status; } typedef struct { librdf_storage *storage; librdf_storage_hashes_instance* hash_context; int index; librdf_iterator* iterator; librdf_hash_datum *key; librdf_hash_datum *value; librdf_node *search_node; librdf_statement current; /* static, shared when search_node not used */ int index_contexts; /* true if this storage indexes contexts */ librdf_node *context_node; int current_is_ok; /* true when current statement and context_node fresh */ } librdf_storage_hashes_serialise_stream_context; static librdf_stream* librdf_storage_hashes_serialise_common(librdf_storage* storage, int hash_index, librdf_node* search_node, int want) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; librdf_storage_hashes_serialise_stream_context *scontext; librdf_hash *hash; librdf_stream *stream; scontext = LIBRDF_CALLOC(librdf_storage_hashes_serialise_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; scontext->hash_context=context; librdf_statement_init(storage->world, &scontext->current); hash=context->hashes[scontext->index]; scontext->key=librdf_new_hash_datum(storage->world, NULL, 0); if(!scontext->key) return NULL; scontext->value=librdf_new_hash_datum(storage->world, NULL, 0); if(!scontext->value) { librdf_free_hash_datum(scontext->key); return NULL; } /* scurrent->current_is_ok=0; */ scontext->index_contexts=context->index_contexts; if(search_node) { scontext->search_node=search_node; scontext->iterator=librdf_storage_hashes_node_iterator_create(storage, search_node, NULL, hash_index, want); } else { scontext->iterator=librdf_hash_get_all(hash, scontext->key, scontext->value); } if(!scontext->iterator) { librdf_storage_hashes_serialise_finished((void*)scontext); return librdf_new_empty_stream(storage->world); } scontext->storage=storage; librdf_storage_add_reference(scontext->storage); stream=librdf_new_stream(storage->world, (void*)scontext, &librdf_storage_hashes_serialise_end_of_stream, &librdf_storage_hashes_serialise_next_statement, &librdf_storage_hashes_serialise_get_statement, &librdf_storage_hashes_serialise_finished); if(!stream) { librdf_storage_hashes_serialise_finished((void*)scontext); return NULL; } return stream; } static librdf_stream* librdf_storage_hashes_serialise(librdf_storage* storage) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; return librdf_storage_hashes_serialise_common(storage, context->all_statements_hash_index, NULL, 0); } static int librdf_storage_hashes_serialise_end_of_stream(void* context) { librdf_storage_hashes_serialise_stream_context* scontext=(librdf_storage_hashes_serialise_stream_context*)context; return librdf_iterator_end(scontext->iterator); } static int librdf_storage_hashes_serialise_next_statement(void* context) { librdf_storage_hashes_serialise_stream_context* scontext=(librdf_storage_hashes_serialise_stream_context*)context; scontext->current_is_ok=0; return librdf_iterator_next(scontext->iterator); } static void* librdf_storage_hashes_serialise_get_statement(void* context, int flags) { librdf_storage_hashes_serialise_stream_context* scontext=(librdf_storage_hashes_serialise_stream_context*)context; librdf_hash_datum* hd; librdf_node** cnp=NULL; librdf_world* world; world = scontext->storage->world; if(scontext->search_node) { switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return librdf_iterator_get_object(scontext->iterator); case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return librdf_iterator_get_context(scontext->iterator); default: librdf_log(scontext->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unimplemented flags %d seen", flags); return NULL; } } switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: if(scontext->current_is_ok) { if(flags==LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT) return &scontext->current; else return scontext->context_node; } /* current stuff is out of date - get new cached answers */ if(scontext->index_contexts) { if(scontext->context_node) librdf_free_node(scontext->context_node); scontext->context_node=NULL; cnp=&scontext->context_node; } librdf_statement_clear(&scontext->current); hd=(librdf_hash_datum*)librdf_iterator_get_key(scontext->iterator); /* decode key content */ if(!librdf_statement_decode2(world, &scontext->current, NULL, (unsigned char*)hd->data, hd->size)) { return NULL; } hd=(librdf_hash_datum*)librdf_iterator_get_value(scontext->iterator); /* decode value content and optional context */ if(!librdf_statement_decode2(world, &scontext->current, cnp, (unsigned char*)hd->data, hd->size)) { return NULL; } scontext->current_is_ok=1; if(flags==LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT) return &scontext->current; else return scontext->context_node; default: librdf_log(scontext->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unimplemented flags %d seen", flags); return NULL; } } static void librdf_storage_hashes_serialise_finished(void* context) { librdf_storage_hashes_serialise_stream_context* scontext=(librdf_storage_hashes_serialise_stream_context*)context; if(scontext->iterator) librdf_free_iterator(scontext->iterator); if(scontext->context_node) librdf_free_node(scontext->context_node); if(scontext->key) { scontext->key->data=NULL; librdf_free_hash_datum(scontext->key); } if(scontext->value) { scontext->value->data=NULL; librdf_free_hash_datum(scontext->value); } librdf_statement_clear(&scontext->current); if(scontext->storage) librdf_storage_remove_reference(scontext->storage); LIBRDF_FREE(librdf_storage_hashes_serialise_stream_context, scontext); } /** * librdf_storage_hashes_find_statements: * @storage: the storage * @statement: the statement to match * * . * * Return a stream of statements matching the given statement (or * all statements if NULL). Parts (subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * Uses #librdf_statement_match to do the matching. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_hashes_find_statements(librdf_storage* storage, librdf_statement* statement) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; librdf_stream* stream; if(!librdf_statement_get_subject(statement) && librdf_statement_get_predicate(statement) && !librdf_statement_get_object(statement) && context->p2so_index >= 0) { /* (? p ?) -> (s p o) wanted */ stream=librdf_storage_hashes_serialise_common(storage, context->p2so_index, librdf_statement_get_predicate(statement), LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_OBJECT); } else { statement=librdf_new_statement_from_statement(statement); if(!statement) return NULL; stream=librdf_storage_hashes_serialise(storage); if(stream) librdf_stream_add_map(stream, &librdf_stream_statement_find_map, (librdf_stream_map_free_context_handler)&librdf_free_statement, (void*)statement); } return stream; } typedef struct { librdf_storage* storage; /* (shared) pointer to storage */ int hash_index; /* index of hash in storage list of hashes */ librdf_iterator* iterator; /* owned iterator over above hash */ int want; /* part of decoded statement to return */ librdf_statement statement; /* NOTE: stored here, never allocated */ librdf_statement statement2; /* NOTE: stored here, never allocated */ librdf_hash_datum key; librdf_hash_datum value; librdf_node *search_node; int index_contexts; librdf_node *context_node; } librdf_storage_hashes_node_iterator_context; static int librdf_storage_hashes_node_iterator_is_end(void* iterator) { librdf_storage_hashes_node_iterator_context* context=(librdf_storage_hashes_node_iterator_context*)iterator; return librdf_iterator_end(context->iterator); } static int librdf_storage_hashes_node_iterator_next_method(void* iterator) { librdf_storage_hashes_node_iterator_context* context=(librdf_storage_hashes_node_iterator_context*)iterator; if(librdf_iterator_end(context->iterator)) return 1; return librdf_iterator_next(context->iterator); } static void* librdf_storage_hashes_node_iterator_get_method(void* iterator, int flags) { librdf_storage_hashes_node_iterator_context* context=(librdf_storage_hashes_node_iterator_context*)iterator; librdf_node* node; librdf_hash_datum* value; librdf_world* world; world = context->storage->world; if(librdf_iterator_end(context->iterator)) return NULL; if(flags == LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT) { /* current stuff is out of date - get new cached answers */ if(!context->index_contexts) return NULL; value=(librdf_hash_datum*)librdf_iterator_get_value(context->iterator); if(context->context_node) librdf_free_node(context->context_node); context->context_node=NULL; /* decode value content and optional context */ if(!librdf_statement_decode2(world, &context->statement, &context->context_node, (unsigned char*)value->data, value->size)) return NULL; librdf_statement_clear(&context->statement); return context->context_node; } if(flags != LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT) { librdf_log(context->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unimplemented iterator method %d", flags); return NULL; } /* get object */ switch(context->want) { case LIBRDF_STATEMENT_SUBJECT: /* SOURCES (subjects) */ if((node=librdf_statement_get_subject(&context->statement))) librdf_free_node(node); break; case LIBRDF_STATEMENT_PREDICATE: /* ARCS (predicates) */ if((node=librdf_statement_get_predicate(&context->statement))) librdf_free_node(node); break; case LIBRDF_STATEMENT_OBJECT: /* TARGETS (objects) */ if((node=librdf_statement_get_object(&context->statement))) librdf_free_node(node); break; case (LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_OBJECT): /* p2so */ if((node=librdf_statement_get_subject(&context->statement))) librdf_free_node(node); if((node=librdf_statement_get_object(&context->statement))) librdf_free_node(node); break; default: /* error */ librdf_log(context->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Illegal statement part %d seen", context->want); return NULL; } value=(librdf_hash_datum*)librdf_iterator_get_value(context->iterator); if(!value) return NULL; if(!librdf_statement_decode2(world, &context->statement, NULL, (unsigned char*)value->data, value->size)) return NULL; switch(context->want) { case LIBRDF_STATEMENT_SUBJECT: /* SOURCES (subjects) */ node=librdf_statement_get_subject(&context->statement); break; case LIBRDF_STATEMENT_PREDICATE: /* ARCS (predicates) */ node=librdf_statement_get_predicate(&context->statement); break; case LIBRDF_STATEMENT_OBJECT: /* TARGETS (objects) */ node=librdf_statement_get_object(&context->statement); break; case (LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_OBJECT): /* p2so */ librdf_statement_set_subject(&context->statement2, librdf_statement_get_subject(&context->statement)); /* fill in the only blank from the node stored in our context */ node=librdf_new_node_from_node(context->search_node); if(!node) return NULL; librdf_statement_set_predicate(&context->statement2, node); librdf_statement_set_object(&context->statement2, librdf_statement_get_object(&context->statement)); return (void*)&context->statement2; break; default: /* error */ librdf_log(context->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Illegal statement part %d seen", context->want); return NULL; } return (void*)node; } static void librdf_storage_hashes_node_iterator_finished(void* iterator) { librdf_storage_hashes_node_iterator_context* icontext=(librdf_storage_hashes_node_iterator_context*)iterator; librdf_node* node; if(icontext->search_node) librdf_free_node(icontext->search_node); if(icontext->context_node) librdf_free_node(icontext->context_node); if(icontext->iterator) librdf_free_iterator(icontext->iterator); librdf_statement_clear(&icontext->statement); if((node=librdf_statement_get_predicate(&icontext->statement2))) librdf_free_node(node); if(icontext->storage) librdf_storage_remove_reference(icontext->storage); LIBRDF_FREE(librdf_storage_hashes_node_iterator_context, icontext); } /* * librdf_storage_hashes_node_iterator_create - Create a node iterator for get sources, targets or arcs methods * @storage: the storage hashes object to iterate * @node1: the first node to encode in the key * @node2: the second node to encode in the key * @hash_index: the index of the hash to iterate over * @want: the field required from the hash value * * Return value: a new #librdf_iterator or NULL on failure **/ static librdf_iterator* librdf_storage_hashes_node_iterator_create(librdf_storage* storage, librdf_node* node1, librdf_node *node2, int hash_index, int want) { librdf_storage_hashes_instance* scontext=(librdf_storage_hashes_instance*)storage->instance; librdf_storage_hashes_node_iterator_context* icontext; librdf_hash *hash; librdf_statement_part fields; unsigned char *key_buffer; librdf_iterator* iterator; librdf_world* world = storage->world; icontext = LIBRDF_CALLOC(librdf_storage_hashes_node_iterator_context*, 1, sizeof(*icontext)); if(!icontext) return NULL; icontext->storage=storage; icontext->hash_index=hash_index; icontext->want=want; icontext->index_contexts=scontext->index_contexts; node1=librdf_new_node_from_node(node1); if(!node1) { LIBRDF_FREE(librdf_storage_hashes_node_iterator_context, icontext); return NULL; } if(node2) { node2=librdf_new_node_from_node(node2); if(!node2) { librdf_free_node(node2); LIBRDF_FREE(librdf_storage_hashes_node_iterator_context, icontext); return NULL; } } librdf_statement_init(storage->world, &icontext->statement); librdf_statement_init(storage->world, &icontext->statement2); hash=scontext->hashes[icontext->hash_index]; /* set the fields in the static statement contained in the context */ switch(icontext->want) { case LIBRDF_STATEMENT_SUBJECT: /* SOURCES (subjects) */ librdf_statement_set_predicate(&icontext->statement, node1); librdf_statement_set_object(&icontext->statement, node2); break; case LIBRDF_STATEMENT_PREDICATE: /* PREDICATES (arcs) */ librdf_statement_set_subject(&icontext->statement, node1); librdf_statement_set_object(&icontext->statement, node2); break; case LIBRDF_STATEMENT_OBJECT: /* OBJECTS (targets) */ librdf_statement_set_subject(&icontext->statement, node1); librdf_statement_set_predicate(&icontext->statement, node2); break; case (LIBRDF_STATEMENT_SUBJECT|LIBRDF_STATEMENT_OBJECT): /* p2so */ icontext->search_node=librdf_new_node_from_node(node1); librdf_statement_set_predicate(&icontext->statement, node1); break; default: /* error */ LIBRDF_FREE(librdf_storage_hashes_node_iterator_context, icontext); librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Illegal statement part %d seen", want); return NULL; } /* ENCODE KEY */ fields=(librdf_statement_part)scontext->hash_descriptions[hash_index]->key_fields; icontext->key.size=librdf_statement_encode_parts2(world, &icontext->statement, NULL, NULL, 0, fields); if(!icontext->key.size) { LIBRDF_FREE(librdf_storage_hashes_node_iterator_context, icontext); return NULL; } key_buffer = LIBRDF_MALLOC(unsigned char*, icontext->key.size); if(!key_buffer) { LIBRDF_FREE(librdf_storage_hashes_node_iterator_context, icontext); return NULL; } /* after this point the finished method is called on errors * so must bump the reference count */ librdf_storage_add_reference(icontext->storage); if(!librdf_statement_encode_parts2(world, &icontext->statement, NULL, key_buffer, icontext->key.size, fields)) { LIBRDF_FREE(data, key_buffer); librdf_storage_hashes_node_iterator_finished(icontext); return NULL; } icontext->key.data=key_buffer; icontext->iterator=librdf_hash_get_all(hash, &icontext->key, &icontext->value); if(!icontext->iterator) { LIBRDF_FREE(data, key_buffer); librdf_storage_hashes_node_iterator_finished(icontext); return librdf_new_empty_iterator(storage->world); } LIBRDF_FREE(data, key_buffer); iterator=librdf_new_iterator(storage->world, (void*)icontext, librdf_storage_hashes_node_iterator_is_end, librdf_storage_hashes_node_iterator_next_method, librdf_storage_hashes_node_iterator_get_method, librdf_storage_hashes_node_iterator_finished); if(!iterator) librdf_storage_hashes_node_iterator_finished(icontext); return iterator; } static librdf_iterator* librdf_storage_hashes_find_sources(librdf_storage* storage, librdf_node* arc, librdf_node *target) { librdf_storage_hashes_instance* scontext=(librdf_storage_hashes_instance*)storage->instance; return librdf_storage_hashes_node_iterator_create(storage, arc, target, scontext->sources_index, LIBRDF_STATEMENT_SUBJECT); } static librdf_iterator* librdf_storage_hashes_find_arcs(librdf_storage* storage, librdf_node* source, librdf_node *target) { librdf_storage_hashes_instance* scontext=(librdf_storage_hashes_instance*)storage->instance; return librdf_storage_hashes_node_iterator_create(storage, source, target, scontext->arcs_index, LIBRDF_STATEMENT_PREDICATE); } static librdf_iterator* librdf_storage_hashes_find_targets(librdf_storage* storage, librdf_node* source, librdf_node *arc) { librdf_storage_hashes_instance* scontext=(librdf_storage_hashes_instance*)storage->instance; return librdf_storage_hashes_node_iterator_create(storage, source, arc, scontext->targets_index, LIBRDF_STATEMENT_OBJECT); } /** * librdf_storage_hashes_context_add_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to add * * Add a statement to a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_hashes_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; librdf_hash_datum key, value; /* on stack - not allocated */ size_t size; int status; librdf_world* world = storage->world; if(context->contexts_index <0) { librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, "Storage was created without context support"); return 1; } if(librdf_storage_hashes_add_remove_statement(storage, statement, context_node, 1)) return 1; size = librdf_node_encode(context_node, NULL, 0); key.data = LIBRDF_MALLOC(char*, size); key.size=librdf_node_encode(context_node, (unsigned char*)key.data, size); size = librdf_statement_encode2(world, statement, NULL, 0); value.data = LIBRDF_MALLOC(char*, size); value.size=librdf_statement_encode2(world, statement, (unsigned char*)value.data, size); status=librdf_hash_put(context->hashes[context->contexts_index], &key, &value); LIBRDF_FREE(data, key.data); LIBRDF_FREE(data, value.data); return status; } /** * librdf_storage_hashes_context_remove_statement: * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to remove * * Remove a statement from a storage context. * * Return value: non 0 on failure **/ static int librdf_storage_hashes_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; librdf_hash_datum key, value; /* on stack - not allocated */ size_t size; int status; librdf_world* world = storage->world; if(context_node && context->contexts_index <0) { librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, "Storage was created without context support"); } if(librdf_storage_hashes_add_remove_statement(storage, statement, context_node, 0)) return 1; size = librdf_node_encode(context_node, NULL, 0); key.data = LIBRDF_MALLOC(char*, size); key.size=librdf_node_encode(context_node, (unsigned char*)key.data, size); size = librdf_statement_encode2(world, statement, NULL, 0); value.data = LIBRDF_MALLOC(char*, size); value.size=librdf_statement_encode2(world, statement, (unsigned char*)value.data, size); status=librdf_hash_delete(context->hashes[context->contexts_index], &key, &value); LIBRDF_FREE(data, key.data); LIBRDF_FREE(data, value.data); return status; } typedef struct { librdf_storage *storage; librdf_iterator* iterator; librdf_hash_datum *key; librdf_hash_datum *value; librdf_statement current; /* static, shared statement */ int index_contexts; /* true if this storage indexes contexts */ librdf_node *context_node; char *context_node_data; int current_is_ok; /* true when current statement and context_node fresh */ } librdf_storage_hashes_context_serialise_stream_context; /** * librdf_storage_hashes_context_serialise: * @storage: #librdf_storage object * @context_node: #librdf_node object * * List all statements in a storage context. * * Return value: #librdf_stream of statements or NULL on failure or context is empty **/ static librdf_stream* librdf_storage_hashes_context_serialise(librdf_storage* storage, librdf_node* context_node) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; librdf_storage_hashes_context_serialise_stream_context* scontext; librdf_stream* stream; size_t size; if(context->contexts_index <0) { librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, "Storage was created without context support"); return NULL; } scontext = LIBRDF_CALLOC(librdf_storage_hashes_context_serialise_stream_context*, 1, sizeof(*scontext)); if(!scontext) return NULL; librdf_statement_init(storage->world, &scontext->current); scontext->key=librdf_new_hash_datum(storage->world, NULL, 0); if(!scontext->key) return NULL; scontext->value=librdf_new_hash_datum(storage->world, NULL, 0); if(!scontext->value) { librdf_free_hash_datum(scontext->key); return NULL; } /* scurrent->current_is_ok=0; */ scontext->index_contexts=context->index_contexts; scontext->context_node=librdf_new_node_from_node(context_node); size=librdf_node_encode(context_node, NULL, 0); scontext->key->data = scontext->context_node_data=LIBRDF_MALLOC(char*, size); scontext->key->size=librdf_node_encode(context_node, (unsigned char*)scontext->key->data, size); scontext->iterator=librdf_hash_get_all(context->hashes[context->contexts_index], scontext->key, scontext->value); if(!scontext->iterator) return librdf_new_empty_stream(storage->world); scontext->storage=storage; librdf_storage_add_reference(scontext->storage); stream=librdf_new_stream(storage->world, (void*)scontext, &librdf_storage_hashes_context_serialise_end_of_stream, &librdf_storage_hashes_context_serialise_next_statement, &librdf_storage_hashes_context_serialise_get_statement, &librdf_storage_hashes_context_serialise_finished); if(!stream) { librdf_storage_hashes_context_serialise_finished((void*)scontext); return NULL; } return stream; } static int librdf_storage_hashes_context_serialise_end_of_stream(void* context) { librdf_storage_hashes_context_serialise_stream_context* scontext=(librdf_storage_hashes_context_serialise_stream_context*)context; return librdf_iterator_end(scontext->iterator); } static int librdf_storage_hashes_context_serialise_next_statement(void* context) { librdf_storage_hashes_context_serialise_stream_context* scontext=(librdf_storage_hashes_context_serialise_stream_context*)context; scontext->current_is_ok=0; return librdf_iterator_next(scontext->iterator); } static void* librdf_storage_hashes_context_serialise_get_statement(void* context, int flags) { librdf_storage_hashes_context_serialise_stream_context* scontext; librdf_hash_datum* v; librdf_world* world; scontext = (librdf_storage_hashes_context_serialise_stream_context*)context; world = scontext->storage->world; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: if(scontext->current_is_ok) { if(flags == LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT) return &scontext->current; else return scontext->context_node; } librdf_statement_clear(&scontext->current); v = (librdf_hash_datum*)librdf_iterator_get_value(scontext->iterator); /* decode value content and optional context */ if(!librdf_statement_decode2(world, &scontext->current, NULL, (unsigned char*)v->data, v->size)) { return NULL; } scontext->current_is_ok = 1; if(flags == LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT) return &scontext->current; else return scontext->context_node; default: librdf_log(scontext->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unimplemented flags %d seen", flags); return NULL; } } static void librdf_storage_hashes_context_serialise_finished(void* context) { librdf_storage_hashes_context_serialise_stream_context* scontext=(librdf_storage_hashes_context_serialise_stream_context*)context; if(scontext->context_node) librdf_free_node(scontext->context_node); if(scontext->iterator) librdf_free_iterator(scontext->iterator); if(scontext->key) { librdf_free_hash_datum(scontext->key); } if(scontext->value) { scontext->value->data=NULL; librdf_free_hash_datum(scontext->value); } librdf_statement_clear(&scontext->current); if(scontext->context_node_data) LIBRDF_FREE(char*, scontext->context_node_data); if(scontext->storage) librdf_storage_remove_reference(scontext->storage); LIBRDF_FREE(librdf_storage_hashes_context_serialise_stream_context, scontext); } static int librdf_storage_hashes_sync(librdf_storage *storage) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; int i; for(i=0; ihash_count; i++) librdf_hash_sync(context->hashes[i]); return 0; } typedef struct { librdf_storage *storage; librdf_iterator *iterator; librdf_hash_datum *key; librdf_node *current; } librdf_storage_hashes_get_contexts_iterator_context; static int librdf_storage_hashes_get_contexts_is_end(void* iterator) { librdf_storage_hashes_get_contexts_iterator_context* icontext=(librdf_storage_hashes_get_contexts_iterator_context*)iterator; return librdf_iterator_end(icontext->iterator); } static int librdf_storage_hashes_get_contexts_next_method(void* iterator) { librdf_storage_hashes_get_contexts_iterator_context* icontext=(librdf_storage_hashes_get_contexts_iterator_context*)iterator; return librdf_iterator_next(icontext->iterator); } static void* librdf_storage_hashes_get_contexts_get_method(void* iterator, int flags) { librdf_storage_hashes_get_contexts_iterator_context* icontext=(librdf_storage_hashes_get_contexts_iterator_context*)iterator; void *result=NULL; librdf_hash_datum* k; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: if(!(k=(librdf_hash_datum*)librdf_iterator_get_key(icontext->iterator))) return NULL; if(icontext->current) librdf_free_node(icontext->current); /* decode value content */ icontext->current=librdf_node_decode(icontext->storage->world, NULL, (unsigned char*)k->data, k->size); result=icontext->current; break; case LIBRDF_ITERATOR_GET_METHOD_GET_KEY: case LIBRDF_ITERATOR_GET_METHOD_GET_VALUE: result=NULL; break; default: librdf_log(icontext->iterator->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unknown iterator method flag %d", flags); result=NULL; break; } return result; } static void librdf_storage_hashes_get_contexts_finished(void* iterator) { librdf_storage_hashes_get_contexts_iterator_context* icontext=(librdf_storage_hashes_get_contexts_iterator_context*)iterator; if(icontext->iterator) librdf_free_iterator(icontext->iterator); librdf_free_hash_datum(icontext->key); if(icontext->current) librdf_free_node(icontext->current); if(icontext->storage) librdf_storage_remove_reference(icontext->storage); LIBRDF_FREE(librdf_storage_hashes_get_contexts_iterator_context, icontext); } /** * librdf_storage_hashes_context_get_contexts: * @storage: #librdf_storage object * * List all context nodes in a storage. * * Return value: #librdf_iterator of context_nodes or NULL on failure or no contexts **/ static librdf_iterator* librdf_storage_hashes_get_contexts(librdf_storage* storage) { librdf_storage_hashes_instance* context=(librdf_storage_hashes_instance*)storage->instance; librdf_storage_hashes_get_contexts_iterator_context* icontext; librdf_iterator* iterator; if(context->index_contexts <0) { librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, "Storage was created without context support"); return NULL; } icontext = LIBRDF_CALLOC(librdf_storage_hashes_get_contexts_iterator_context*, 1, sizeof(*icontext)); if(!icontext) return NULL; icontext->key=librdf_new_hash_datum(storage->world, NULL, 0); if(!icontext->key) { LIBRDF_FREE(librdf_storage_hashes_get_contexts_iterator_context, icontext); return NULL; } icontext->iterator=librdf_hash_keys(context->hashes[context->contexts_index], icontext->key); if(!icontext->iterator) { librdf_storage_hashes_get_contexts_finished(icontext); return NULL; } icontext->storage=storage; librdf_storage_add_reference(icontext->storage); iterator=librdf_new_iterator(storage->world, (void*)icontext, &librdf_storage_hashes_get_contexts_is_end, &librdf_storage_hashes_get_contexts_next_method, &librdf_storage_hashes_get_contexts_get_method, &librdf_storage_hashes_get_contexts_finished); if(!iterator) librdf_storage_hashes_get_contexts_finished(icontext); return iterator; } /** * librdf_storage_hashes_get_feature: * @storage: #librdf_storage object * @feature: #librdf_uri feature property * * Get the value of a storage feature. * * Return value: new #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ static librdf_node* librdf_storage_hashes_get_feature(librdf_storage* storage, librdf_uri* feature) { librdf_storage_hashes_instance* scontext=(librdf_storage_hashes_instance*)storage->instance; unsigned char *uri_string; if(!feature) return NULL; uri_string=librdf_uri_as_string(feature); if(!uri_string) return NULL; if(!strcmp((const char*)uri_string, LIBRDF_MODEL_FEATURE_CONTEXTS)) { unsigned char value[2]; sprintf((char*)value, "%d", (scontext->index_contexts != 0)); return librdf_new_node_from_typed_literal(storage->world, value, NULL, NULL); } return NULL; } /** Local entry point for dynamically loaded storage module */ static void librdf_storage_hashes_register_factory(librdf_storage_factory *factory) { LIBRDF_ASSERT_CONDITION(!strcmp(factory->name, "hashes")); factory->version = LIBRDF_STORAGE_INTERFACE_VERSION; factory->init = librdf_storage_hashes_init; factory->clone = librdf_storage_hashes_clone; factory->terminate = librdf_storage_hashes_terminate; factory->open = librdf_storage_hashes_open; factory->close = librdf_storage_hashes_close; factory->size = librdf_storage_hashes_size; factory->add_statement = librdf_storage_hashes_add_statement; factory->add_statements = librdf_storage_hashes_add_statements; factory->remove_statement = librdf_storage_hashes_remove_statement; factory->contains_statement = librdf_storage_hashes_contains_statement; factory->serialise = librdf_storage_hashes_serialise; factory->find_statements = librdf_storage_hashes_find_statements; factory->find_sources = librdf_storage_hashes_find_sources; factory->find_arcs = librdf_storage_hashes_find_arcs; factory->find_targets = librdf_storage_hashes_find_targets; factory->context_add_statement = librdf_storage_hashes_context_add_statement; factory->context_remove_statement = librdf_storage_hashes_context_remove_statement; factory->context_serialise = librdf_storage_hashes_context_serialise; factory->sync = librdf_storage_hashes_sync; factory->get_contexts = librdf_storage_hashes_get_contexts; factory->get_feature = librdf_storage_hashes_get_feature; } /* * librdf_init_storage_hashes: * @world: world object * * INTERNAL - Initialise the built-in storage_hashes module. */ void librdf_init_storage_hashes(librdf_world *world) { librdf_storage_register_factory(world, "hashes", "Indexed hashes", &librdf_storage_hashes_register_factory); } redland-1.0.17/src/rdf_iterator.h0000644000175000017500000000723011170437145013563 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_iterator.h - RDF Iterator definition * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_ITERATOR_H #define LIBRDF_ITERATOR_H #ifdef __cplusplus extern "C" { #endif /** * librdf_iterator_map_handler: * @iterator: Iterator that this map is operating over. * @map_context: Map data context pointer. * @item: Pointer to the current item in the iteration. * * Map function for a #librdf_iterator map operation. * * See librdf_iterator_add_map(). * * Returns: item in keep the iteration or NULL to remove it */ typedef void* (*librdf_iterator_map_handler)(librdf_iterator *iterator, void *map_context, void *item); /** * librdf_iterator_map_free_context_handler: * @map_context: Map data context pointer. * * Free handler function for a #librdf_iterator map operation. * * See librdf_iterator_add_map(). */ typedef void (*librdf_iterator_map_free_context_handler)(void *map_context); #ifdef LIBRDF_INTERNAL #include #endif /** * librdf_iterator_get_method_flags: * @LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: get context from iterator - implementing librdf_iterator_get_object() * @LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: get object from iterator - implementing librdf_iterator_get_context() * @LIBRDF_ITERATOR_GET_METHOD_GET_KEY: get iterator key object from iterator - implementing librdf_iterator_get_key() * @LIBRDF_ITERATOR_GET_METHOD_GET_VALUE: get iterator value from iterator - implementing librdf_iterator_get_value() * * Flags for librdf_new_iterator() get_method function pointer. */ /* iterator get_method flags */ typedef enum { LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT = 0, LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT = 1, LIBRDF_ITERATOR_GET_METHOD_GET_KEY = 2, LIBRDF_ITERATOR_GET_METHOD_GET_VALUE = 3 } librdf_iterator_get_method_flags; REDLAND_API librdf_iterator* librdf_new_iterator(librdf_world *world, void *context, int (*is_end_method)(void*), int (*next_method)(void*), void* (*get_method)(void*, int), void (*finished_method)(void*)); REDLAND_API void librdf_free_iterator(librdf_iterator* iterator); REDLAND_API int librdf_iterator_end(librdf_iterator* iterator); REDLAND_API REDLAND_DEPRECATED int librdf_iterator_have_elements(librdf_iterator* iterator); REDLAND_API int librdf_iterator_next(librdf_iterator* iterator); REDLAND_API void* librdf_iterator_get_object(librdf_iterator* iterator); REDLAND_API void* librdf_iterator_get_context(librdf_iterator* iterator); REDLAND_API void* librdf_iterator_get_key(librdf_iterator* iterator); REDLAND_API void* librdf_iterator_get_value(librdf_iterator* iterator); REDLAND_API int librdf_iterator_add_map(librdf_iterator* iterator, librdf_iterator_map_handler map_function, librdf_iterator_map_free_context_handler free_context, void *map_context); REDLAND_API librdf_iterator* librdf_new_empty_iterator(librdf_world *world); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_uri.h0000644000175000017500000000561611425734771012547 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_uri.h - RDF URI Definition * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_URI_H #define LIBRDF_URI_H #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif /** * librdf_uri_filter_func: * @user_data: user data * @uri: #librdf_uri URI to check * * Callback function for librdf_parser_set_uri_filter() * * Return value: non-0 to filter the URI */ typedef int (*librdf_uri_filter_func)(void *user_data, librdf_uri* uri); /* constructors */ REDLAND_API librdf_uri* librdf_new_uri (librdf_world *world, const unsigned char *uri_string); REDLAND_API librdf_uri* librdf_new_uri2 (librdf_world *world, const unsigned char *uri_string, size_t length); /* Create a new URI from an existing URI - CLONE */ REDLAND_API librdf_uri* librdf_new_uri_from_uri (librdf_uri* old_uri); /* Create a new URI from an existing URI and local name */ REDLAND_API librdf_uri* librdf_new_uri_from_uri_local_name (librdf_uri* old_uri, const unsigned char *local_name); /* destructor */ REDLAND_API void librdf_free_uri(librdf_uri *uri); /* methods */ REDLAND_API unsigned char* librdf_uri_as_string (librdf_uri *uri); REDLAND_API unsigned char* librdf_uri_as_counted_string (librdf_uri *uri, size_t *len_p); REDLAND_API void librdf_uri_print (librdf_uri* uri, FILE *fh); REDLAND_API unsigned char* librdf_uri_to_string (librdf_uri* uri); REDLAND_API unsigned char* librdf_uri_to_counted_string (librdf_uri* uri, size_t* len_p); REDLAND_API int librdf_uri_equals(librdf_uri* first_uri, librdf_uri* second_uri); REDLAND_API int librdf_uri_compare(librdf_uri* uri1, librdf_uri* uri2); REDLAND_API int librdf_uri_is_file_uri(librdf_uri* uri); REDLAND_API const char* librdf_uri_to_filename(librdf_uri* uri); REDLAND_API librdf_uri* librdf_new_uri_normalised_to_base(const unsigned char *uri_string, librdf_uri* source_uri, librdf_uri* base_uri); REDLAND_API librdf_uri* librdf_new_uri_relative_to_base(librdf_uri* base_uri, const unsigned char *uri_string); REDLAND_API librdf_uri* librdf_new_uri_from_filename(librdf_world* world, const char *filename); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_model_storage.c0000644000175000017500000006201011167024222014540 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_model_storage.c - RDF Model Storage implementation * * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include /* for exit() */ #endif #include typedef struct { librdf_storage *storage; } librdf_model_storage_context; static void librdf_model_storage_init(void) { } static void librdf_model_storage_terminate(void) { } /** * librdf_model_storage_create: * @model: #librdf_model to initialise * @storage: #librdf_storage storage to use * @options: #librdf_hash of options to use * * Constructor - Create a new #librdf_model with storage. * * Options are presently not used. * * Return value: non 0 on failure **/ static int librdf_model_storage_create(librdf_model *model, librdf_storage *storage, librdf_hash* options) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; if(!storage) return 1; if(librdf_storage_open(storage, model)) return 1; context->storage=storage; librdf_storage_add_reference(storage); return 0; } /** * librdf_model_storage_clone: * @old_model: the existing #librdf_model * * Copy constructor - create a new librdf_model from an existing one. * * Creates a new model as a copy of the existing model in the same * storage context. * * Return value: a new #librdf_model or NULL on failure **/ static librdf_model* librdf_model_storage_clone(librdf_model* old_model) { librdf_model_storage_context *old_context=(librdf_model_storage_context *)old_model->context; librdf_storage *new_storage; librdf_model *new_model; new_storage=librdf_new_storage_from_storage(old_context->storage); if(!new_storage) return NULL; new_model=librdf_new_model_with_options(old_model->world, new_storage, NULL); if(!new_model) librdf_free_storage(new_storage); return new_model; } /** * librdf_model_storage_destroy: * @model: #librdf_model model to destroy * * Destructor - Destroy a #librdf_model object. * **/ static void librdf_model_storage_destroy(librdf_model *model) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; if(context->storage) { librdf_storage_close(context->storage); librdf_storage_remove_reference(context->storage); } } /** * librdf_model_storage_size: * @model: #librdf_model object * * Get the number of statements in the model. * * Return value: the number of statements **/ static int librdf_model_storage_size(librdf_model* model) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_size(context->storage); } /** * librdf_model_storage_add_statement: * @model: model object * @statement: statement object * * Add a statement to the model. * * The passed-in statement is copied when added to the model, not * shared with the model. * * Return value: non 0 on failure **/ static int librdf_model_storage_add_statement(librdf_model* model, librdf_statement* statement) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_add_statement(context->storage, statement); } /** * librdf_model_storage_add_statements: * @model: model object * @statement_stream: stream of statements to use * * Add a stream of statements to the model. * * Return value: non 0 on failure **/ static int librdf_model_storage_add_statements(librdf_model* model, librdf_stream* statement_stream) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_add_statements(context->storage, statement_stream); } /** * librdf_model_storage_remove_statement: * @model: the model object * @statement: the statement * * Remove a known statement from the model. * * Return value: non 0 on failure **/ static int librdf_model_storage_remove_statement(librdf_model* model, librdf_statement* statement) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_remove_statement(context->storage, statement); } /** * librdf_model_storage_contains_statement: * @model: the model object * @statement: the statement * * Check for a statement in the model. * * Return value: non 0 if the model contains the statement **/ static int librdf_model_storage_contains_statement(librdf_model* model, librdf_statement* statement) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_contains_statement(context->storage, statement); } /** * librdf_model_storage_serialise: * @model: the model object * * Serialise the entire model as a stream. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_model_storage_serialise(librdf_model* model) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_serialise(context->storage); } /** * librdf_model_storage_find_statements: * @model: the model object * @statement: the partial statement to match * * Find matching statements in the model. * * The partial statement is a statement where the subject, predicate * and/or object can take the value NULL which indicates a match with * any value in the model * * Return value: a #librdf_stream of statements (can be empty) or NULL * on failure. **/ static librdf_stream* librdf_model_storage_find_statements(librdf_model* model, librdf_statement* statement) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_find_statements(context->storage, statement); } /** * librdf_model_storage_get_sources: * @model: #librdf_model object * @arc: #librdf_node arc * @target: #librdf_node target * * Return the sources (subjects) of arc in an RDF graph given arc (predicate) and target (object). * * Searches the model for arcs matching the given arc and target * and returns a list of the source #librdf_node objects as an iterator * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ static librdf_iterator* librdf_model_storage_get_sources(librdf_model *model, librdf_node *arc, librdf_node *target) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_get_sources(context->storage, arc, target); } /** * librdf_model_storage_get_arcs: * @model: #librdf_model object * @source: #librdf_node source * @target: #librdf_node target * * Return the arcs (predicates) of an arc in an RDF graph given source (subject) and target (object). * * Searches the model for arcs matching the given source and target * and returns a list of the arc #librdf_node objects as an iterator * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ static librdf_iterator* librdf_model_storage_get_arcs(librdf_model *model, librdf_node *source, librdf_node *target) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_get_arcs(context->storage, source, target); } /** * librdf_model_storage_get_targets: * @model: #librdf_model object * @source: #librdf_node source * @arc: #librdf_node arc * * Return the targets (objects) of an arc in an RDF graph given source (subject) and arc (predicate). * * Searches the model for targets matching the given source and arc * and returns a list of the source #librdf_node objects as an iterator * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ static librdf_iterator* librdf_model_storage_get_targets(librdf_model *model, librdf_node *source, librdf_node *arc) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_get_targets(context->storage, source, arc); } /** * librdf_model_storage_get_arcs_in: * @model: #librdf_model object * @node: #librdf_node resource node * * Return the properties pointing to the given resource. * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ static librdf_iterator* librdf_model_storage_get_arcs_in(librdf_model *model, librdf_node *node) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_get_arcs_in(context->storage, node); } /** * librdf_model_storage_get_arcs_out: * @model: #librdf_model object * @node: #librdf_node resource node * * Return the properties pointing from the given resource. * * Return value: #librdf_iterator of #librdf_node objects (may be empty) or NULL on failure **/ static librdf_iterator* librdf_model_storage_get_arcs_out(librdf_model *model, librdf_node *node) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_get_arcs_out(context->storage, node); } /** * librdf_model_storage_has_arc_in: * @model: #librdf_model object * @node: #librdf_node resource node * @property: #librdf_node property node * * Check if a node has a given property pointing to it. * * Return value: non 0 if arc property does point to the resource node **/ static int librdf_model_storage_has_arc_in(librdf_model *model, librdf_node *node, librdf_node *property) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_has_arc_in(context->storage, node, property); } /** * librdf_model_storage_has_arc_out: * @model: #librdf_model object * @node: #librdf_node resource node * @property: #librdf_node property node * * Check if a node has a given property pointing from it. * * Return value: non 0 if arc property does point from the resource node **/ static int librdf_model_storage_has_arc_out(librdf_model *model, librdf_node *node, librdf_node *property) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_has_arc_out(context->storage, node, property); } /** * librdf_model_storage_context_add_statement: * @model: #librdf_model object * @context: #librdf_node context * @statement: #librdf_statement statement object * * Add a statement to a model with a context. * * Return value: Non 0 on failure **/ static int librdf_model_storage_context_add_statement(librdf_model* model, librdf_node* context, librdf_statement* statement) { librdf_model_storage_context *mcontext=(librdf_model_storage_context *)model->context; return librdf_storage_context_add_statement(mcontext->storage, context, statement); } /** * librdf_model_storage_context_add_statements: * @model: #librdf_model object * @context: #librdf_node context * @stream: #librdf_stream stream object * * Add statements to a model with a context. * * Return value: Non 0 on failure **/ static int librdf_model_storage_context_add_statements(librdf_model* model, librdf_node* context, librdf_stream* stream) { librdf_model_storage_context *mcontext=(librdf_model_storage_context *)model->context; return librdf_storage_context_add_statements(mcontext->storage, context, stream); } /** * librdf_model_storage_context_remove_statement: * @model: #librdf_model object * @context: #librdf_uri context * @statement: #librdf_statement statement * * Remove a statement from a model in a context. * * Return value: Non 0 on failure **/ static int librdf_model_storage_context_remove_statement(librdf_model* model, librdf_node* context, librdf_statement* statement) { librdf_model_storage_context *mcontext=(librdf_model_storage_context *)model->context; return librdf_storage_context_remove_statement(mcontext->storage, context, statement); } /** * librdf_model_storage_context_remove_statements: * @model: #librdf_model object * @context: #librdf_uri context * * Remove statements from a model with the given context. * * Return value: Non 0 on failure **/ static int librdf_model_storage_context_remove_statements(librdf_model* model, librdf_node* context) { librdf_model_storage_context *mcontext=(librdf_model_storage_context *)model->context; return librdf_storage_context_remove_statements(mcontext->storage, context); } /** * librdf_model_storage_context_serialize: * @model: #librdf_model object * @context: #librdf_uri context * * List all statements in a model context. * * Return value: #librdf_stream of statements or NULL on failure **/ static librdf_stream* librdf_model_storage_context_serialize(librdf_model* model, librdf_node* context) { librdf_model_storage_context *mcontext=(librdf_model_storage_context *)model->context; return librdf_storage_context_as_stream(mcontext->storage, context); } /** * librdf_model_storage_find_statements_in_context: * @model: #librdf_model object * @statement: #librdf_statement partial statement to find * @context_node: context #librdf_node (or NULL) * * Search the model for matching statements in a given context. * * Searches the model for a (partial) statement as described in * librdf_statement_match() in the given context and returns a * #librdf_stream of matching #librdf_statement objects. If * context is NULL, this is equivalent to librdf_model_find_statements. * * Return value: #librdf_stream of matching statements (may be empty) or NULL on failure **/ static librdf_stream* librdf_model_storage_find_statements_in_context(librdf_model* model, librdf_statement* statement, librdf_node* context_node) { librdf_model_storage_context *mcontext=(librdf_model_storage_context *)model->context; librdf_stream *stream; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(model, librdf_model, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, NULL); if(mcontext->storage->factory->find_statements_in_context) return mcontext->storage->factory->find_statements_in_context(mcontext->storage, statement, context_node); statement=librdf_new_statement_from_statement(statement); if(!statement) return NULL; stream=librdf_model_context_as_stream(model, context_node); if(!stream) { librdf_free_statement(statement); return librdf_new_empty_stream(model->world); } librdf_stream_add_map(stream, &librdf_stream_statement_find_map, (librdf_stream_map_free_context_handler)&librdf_free_statement, (void*)statement); return stream; } /** * librdf_model_storage_query_execute: * @model: #librdf_model object * @query: #librdf_query object * * Run a query against the model returning librdf_query_results. * * Run the given query against the model and return a #librdf_query_results * * Return value: #librdf_query_results or NULL on failure **/ static librdf_query_results* librdf_model_storage_query_execute(librdf_model* model, librdf_query *query) { librdf_model_storage_context *mcontext=(librdf_model_storage_context *)model->context; if(librdf_storage_supports_query(mcontext->storage, query)) return librdf_storage_query_execute(mcontext->storage, query); else return librdf_query_execute(query,model); } /** * librdf_model_storage_sync: * @model: #librdf_model object * * Synchronise the model to the storage. * * Return-value: Non-0 on failure **/ static int librdf_model_storage_sync(librdf_model* model) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_sync(context->storage); } /** * librdf_model_storage_get_storage: * @model: #librdf_model object * * Get the storage for the model. * **/ static librdf_storage* librdf_model_storage_get_storage(librdf_model* model) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return context->storage; } /** * librdf_model_storage_get_contexts: * @storage: #librdf_storage object * * Return the list of contexts in the store. * * Returns an iterator of #librdf_node context nodes for each * context in the store. * * Return value: #librdf_iterator of context nodes or NULL on failure or if contexts are not supported **/ static librdf_iterator* librdf_model_storage_get_contexts(librdf_model* model) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_get_contexts(context->storage); } /** * librdf_model_storage_get_feature: * @storage: #librdf_storage object * @feature: #librdf_uri feature property * * Get the value of a model storage feature. * * Return value: new #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ static librdf_node* librdf_model_storage_get_feature(librdf_model* model, librdf_uri* feature) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_get_feature(context->storage, feature); } /** * librdf_model_storage_set_feature: * @storage: #librdf_storage object * @feature: #librdf_uri feature property * @value: #librdf_node feature property value * * Get the value of a model storage feature. * * Return value: #librdf_node feature value or NULL if no such feature * exists or the value is empty. **/ static int librdf_model_storage_set_feature(librdf_model* model, librdf_uri* feature, librdf_node* value) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_set_feature(context->storage, feature, value); } static librdf_stream* librdf_model_storage_find_statements_with_options(librdf_model* model, librdf_statement* statement, librdf_node* context_node, librdf_hash* options) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_find_statements_with_options(context->storage, statement, context_node, options); } /** * librdf_model_storage_transaction_start: * @storage: the storage object * * Start a transaction * * Return value: non-0 on failure **/ static int librdf_model_storage_transaction_start(librdf_model* model) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_transaction_start(context->storage); } /** * librdf_model_storage_transaction_start_with_handle: * @storage: the storage object * @handle: the transaction object * * Start a transaction using an existing external transaction object. * * Return value: non-0 on failure **/ static int librdf_model_storage_transaction_start_with_handle(librdf_model* model, void* handle) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_transaction_start_with_handle(context->storage, handle); } /** * librdf_model_storage_transaction_commit: * @storage: the storage object * * Commit a transaction. * * Return value: non-0 on failure **/ static int librdf_model_storage_transaction_commit(librdf_model* model) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_transaction_commit(context->storage); } /** * librdf_model_storage_transaction_rollback: * @storage: the storage object * * Rollback a transaction. * * Return value: non-0 on failure **/ static int librdf_model_storage_transaction_rollback(librdf_model* model) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_transaction_rollback(context->storage); } /** * librdf_model_storage_transaction_get_handle: * @storage: the storage object * * Get the current transaction handle. * * Return value: non-0 on failure **/ static void* librdf_model_storage_transaction_get_handle(librdf_model* model) { librdf_model_storage_context *context=(librdf_model_storage_context *)model->context; return librdf_storage_transaction_get_handle(context->storage); } /* local function to register model_storage functions */ static void librdf_model_storage_register_factory(librdf_model_factory *factory) { factory->context_length = sizeof(librdf_model_storage_context); factory->init = librdf_model_storage_init; factory->terminate = librdf_model_storage_terminate; factory->create = librdf_model_storage_create; factory->clone = librdf_model_storage_clone; factory->destroy = librdf_model_storage_destroy; factory->size = librdf_model_storage_size; factory->add_statement = librdf_model_storage_add_statement; factory->add_statements = librdf_model_storage_add_statements; factory->remove_statement = librdf_model_storage_remove_statement; factory->contains_statement = librdf_model_storage_contains_statement; factory->serialise = librdf_model_storage_serialise; factory->find_statements = librdf_model_storage_find_statements; factory->get_sources = librdf_model_storage_get_sources; factory->get_arcs = librdf_model_storage_get_arcs; factory->get_targets = librdf_model_storage_get_targets; factory->get_arcs_in = librdf_model_storage_get_arcs_in; factory->get_arcs_out = librdf_model_storage_get_arcs_out; factory->has_arc_in = librdf_model_storage_has_arc_in; factory->has_arc_out = librdf_model_storage_has_arc_out; factory->context_add_statement = librdf_model_storage_context_add_statement; factory->context_add_statements = librdf_model_storage_context_add_statements; factory->context_remove_statement = librdf_model_storage_context_remove_statement; factory->context_remove_statements = librdf_model_storage_context_remove_statements; factory->context_serialize = librdf_model_storage_context_serialize; factory->find_statements_in_context = librdf_model_storage_find_statements_in_context; factory->query_execute = librdf_model_storage_query_execute; factory->sync = librdf_model_storage_sync; factory->get_storage = librdf_model_storage_get_storage; factory->get_contexts = librdf_model_storage_get_contexts; factory->get_feature = librdf_model_storage_get_feature; factory->set_feature = librdf_model_storage_set_feature; factory->find_statements_with_options = librdf_model_storage_find_statements_with_options; factory->transaction_start = librdf_model_storage_transaction_start; factory->transaction_start_with_handle = librdf_model_storage_transaction_start_with_handle; factory->transaction_commit = librdf_model_storage_transaction_commit; factory->transaction_rollback = librdf_model_storage_transaction_rollback; factory->transaction_get_handle = librdf_model_storage_transaction_get_handle; } /** * librdf_init_model_storage: * @world: world object * * INTERNAL - Initialise the model_storage module **/ void librdf_init_model_storage(librdf_world *world) { librdf_model_register_factory(world, "storage", "Model backed by a Redland storage", &librdf_model_storage_register_factory); } redland-1.0.17/src/rdf_node_internal.h0000644000175000017500000000423311516326266014560 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_node_internal.h - Internal RDF Node definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_NODE_INTERNAL_H #define LIBRDF_NODE_INTERNAL_H #ifdef __cplusplus extern "C" { #endif struct librdf_node_s { librdf_world *world; librdf_node_type type; int usage; union { struct { /* rdf:Resource and rdf:Property-s have URIs */ librdf_uri *uri; } resource; struct { /* literals are UTF-8 string values ... */ unsigned char *string; /* up to 2^31-1 bytes long */ unsigned int string_len; /* datatype URI or null */ librdf_uri* datatype_uri; /* XML defines these additional attributes for literals */ /* Language of literal (xml:lang) */ char *xml_language; /* up to 255 bytes long */ unsigned char xml_language_len; /* Hash key & size */ unsigned char *key; size_t size; } literal; struct { /* blank nodes have an identifier */ unsigned char *identifier; int identifier_len; } blank; } value; }; /* initialising functions / constructors */ /* class methods */ void librdf_init_node(librdf_world* world); void librdf_finish_node(librdf_world* world); /* exported public in error but never usable */ librdf_digest* librdf_node_get_digest(librdf_node* node); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_storage_sql_test.c0000644000175000017500000000460111167022714015304 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_sql_test.c - RDF Storage SQL config test program * * Copyright (C) 2008, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include /* one prototype needed */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { librdf_world* world; int failures=0; int i; const char *program=librdf_basename((const char*)argv[0]); const char* storage="mysql"; const char* dir; if(argc>1) dir=argv[1]; else dir="."; world=librdf_new_world(); librdf_world_open(world); for(i=0; i<2; i++) { const char* layout=(i == 0) ? "v1" : "v2"; librdf_sql_config* config; fprintf(stderr, "%s: Opening SQL config for storage %s layout %s\n", program, storage, layout); config=librdf_new_sql_config(world, storage, layout, dir, librdf_storage_sql_dbconfig_predicates); if(config) { const char* value=config->values[DBCONFIG_CREATE_TABLE_BNODES]; if(value) fprintf(stderr, "%s: Bnode table declaration found of %zu bytes size\n", program, strlen(value)); else { fprintf(stderr, "%s: FAILED Bnode table declaration not found\n", program); failures++; } librdf_free_sql_config(config); } else { fprintf(stderr, "%s: FAILED to get complete SQL configuration\n", program); failures++; } } librdf_free_world(world); return failures; } redland-1.0.17/src/rdf_raptor.c0000644000175000017500000001510711702657222013237 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_raptor.c - librdf Raptor integration * * Copyright (C) 2008, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #ifdef HAVE_STDLIB_H #include #endif #include /** * librdf_world_set_raptor: * @world: librdf_world object * @raptor_world_ptr: raptor_world object * * Set the #raptor_world instance to be used with this #librdf_world. * * If no raptor_world instance is set with this function, * librdf_world_open() creates a new instance. * * Ownership of the raptor_world is not taken. If the raptor library * instance is set with this function, librdf_free_world() will not * free it. * **/ void librdf_world_set_raptor(librdf_world* world, raptor_world* raptor_world_ptr) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN(world, librdf_world); world->raptor_world_ptr = raptor_world_ptr; world->raptor_world_allocated_here = 0; } /** * librdf_world_get_raptor: * @world: librdf_world object * * Get the #raptor_world instance used by this #librdf_world. * * Return value: raptor_world object or NULL on failure (e.g. not initialized) **/ raptor_world* librdf_world_get_raptor(librdf_world* world) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL); return world->raptor_world_ptr; } static void librdf_raptor_log_handler(void *data, raptor_log_message *message) { librdf_world *world = (librdf_world *)data; librdf_log_level level; /* Map raptor2 fatal/error/warning log levels to librdf log levels, ignore others */ switch(message->level) { case RAPTOR_LOG_LEVEL_FATAL: level = LIBRDF_LOG_FATAL; break; case RAPTOR_LOG_LEVEL_ERROR: level = LIBRDF_LOG_ERROR; break; case RAPTOR_LOG_LEVEL_WARN: level = LIBRDF_LOG_WARN; break; case RAPTOR_LOG_LEVEL_INFO: case RAPTOR_LOG_LEVEL_DEBUG: case RAPTOR_LOG_LEVEL_TRACE: case RAPTOR_LOG_LEVEL_NONE: default: return; } librdf_log_simple(world, 0, level, LIBRDF_FROM_RAPTOR, message->locator, message->text); } int librdf_raptor_free_bnode_hash(librdf_world* world) { if(world->bnode_hash) { librdf_free_hash(world->bnode_hash); world->bnode_hash = NULL; } return 0; } int librdf_raptor_reset_bnode_hash(librdf_world* world) { librdf_raptor_free_bnode_hash(world); world->bnode_hash = librdf_new_hash(world, NULL); if(!world->bnode_hash) return 1; return 0; } static unsigned char* librdf_raptor_generate_id_handler(void *user_data, unsigned char *user_bnodeid) { librdf_world* world = (librdf_world*)user_data; if(user_bnodeid && world->bnode_hash) { unsigned char *mapped_id; mapped_id = (unsigned char*)librdf_hash_get(world->bnode_hash, (const char*)user_bnodeid); if(!mapped_id) { mapped_id = librdf_world_get_genid(world); if(mapped_id && librdf_hash_put_strings(world->bnode_hash, (char*)user_bnodeid, (char*)mapped_id)) { /* error -> free mapped_id and return NULL */ LIBRDF_FREE(char*, mapped_id); mapped_id = NULL; } } /* always free passed in bnodeid */ raptor_free_memory(user_bnodeid); return mapped_id; } else return librdf_world_get_genid(world); } /** * librdf_init_raptor: * @world: librdf_world object * * INTERNAL - Initialize the raptor library. * * Initializes the raptor library unless a raptor instance is provided * externally with librdf_world_set_raptor() (and using raptor v2 APIs). * Sets raptor uri handlers to work with #librdf_uri objects. * * Return value: non-0 on failure **/ int librdf_init_raptor(librdf_world* world) { if(!world->raptor_world_ptr) { world->raptor_world_ptr = raptor_new_world(); world->raptor_world_allocated_here = 1; if(world->raptor_world_ptr && world->raptor_init_handler) { world->raptor_init_handler(world->raptor_init_handler_user_data, world->raptor_world_ptr); } if(!world->raptor_world_ptr || raptor_world_open(world->raptor_world_ptr)) { LIBRDF_FATAL1(world, LIBRDF_FROM_PARSER, "failed to initialize raptor"); return 1; } } /* New in-memory hash for mapping bnode IDs */ world->bnode_hash = librdf_new_hash(world, NULL); if(!world->bnode_hash) return 1; /* set up log handler */ raptor_world_set_log_handler(world->raptor_world_ptr, world, librdf_raptor_log_handler); /* set up blank node identifier generation handler */ raptor_world_set_generate_bnodeid_handler(world->raptor_world_ptr, world, librdf_raptor_generate_id_handler); return 0; } /** * librdf_world_set_raptor_init_handler: * @world: librdf_world object * @user_data: user data * @handler: handler to call * * Set the raptor initialization handler to be called if a new raptor_world is constructed. */ void librdf_world_set_raptor_init_handler(librdf_world* world, void* user_data, librdf_raptor_init_handler handler) { world->raptor_init_handler = handler; world->raptor_init_handler_user_data = user_data; } /** * librdf_finish_raptor: * @world: librdf_world object * * INTERNAL - Terminate the raptor library. * * Frees the raptor library resources unless a raptor instance was provided * externally via librdf_world_set_raptor() (and using raptor v2 APIs) prior * to librdf_init_raptor(). **/ void librdf_finish_raptor(librdf_world* world) { if(world->raptor_world_ptr && world->raptor_world_allocated_here) { raptor_free_world(world->raptor_world_ptr); world->raptor_world_ptr = NULL; } if(world->bnode_hash) librdf_free_hash(world->bnode_hash); } redland-1.0.17/src/rdf_query.h0000644000175000017500000001510711523037545013103 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_query.h - RDF Query Adaptor Factory and Query interfaces and definitions * * Copyright (C) 2002-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2002-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_QUERY_H #define LIBRDF_QUERY_H #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif /* class methods */ REDLAND_API void librdf_query_register_factory(librdf_world *world, const char *name, const unsigned char *uri_string, void (*factory) (librdf_query_factory*)); REDLAND_API REDLAND_DEPRECATED int librdf_query_languages_enumerate(librdf_world* world, const unsigned int counter, const char **name, const unsigned char **uri_string); REDLAND_API const raptor_syntax_description* librdf_query_language_get_description(librdf_world* world, unsigned int counter); /* constructor */ REDLAND_API librdf_query* librdf_new_query(librdf_world* world, const char *name, librdf_uri* uri, const unsigned char *query_string, librdf_uri* base_uri); REDLAND_API librdf_query* librdf_new_query_from_query (librdf_query* old_query); REDLAND_API librdf_query* librdf_new_query_from_factory(librdf_world* world, librdf_query_factory* factory, const char *name, librdf_uri* uri, const unsigned char* query_string, librdf_uri* base_uri); /* destructor */ REDLAND_API void librdf_free_query(librdf_query *query); /* methods */ REDLAND_API librdf_query_results* librdf_query_execute(librdf_query* query, librdf_model *model); REDLAND_API int librdf_query_get_limit(librdf_query *query); REDLAND_API int librdf_query_set_limit(librdf_query *query, int limit); REDLAND_API int librdf_query_get_offset(librdf_query *query); REDLAND_API int librdf_query_set_offset(librdf_query *query, int offset); REDLAND_API librdf_stream* librdf_query_results_as_stream(librdf_query_results* query_results); REDLAND_API int librdf_query_results_get_count(librdf_query_results* query_results); REDLAND_API int librdf_query_results_next(librdf_query_results* query_results); REDLAND_API int librdf_query_results_finished(librdf_query_results* query_results); REDLAND_API int librdf_query_results_get_bindings(librdf_query_results* query_results, const char ***names, librdf_node **values); REDLAND_API librdf_node* librdf_query_results_get_binding_value(librdf_query_results* query_results, int offset); REDLAND_API const char* librdf_query_results_get_binding_name(librdf_query_results* query_results, int offset); REDLAND_API librdf_node* librdf_query_results_get_binding_value_by_name(librdf_query_results* query_results, const char *name); REDLAND_API int librdf_query_results_get_bindings_count(librdf_query_results* query_results); REDLAND_API REDLAND_DEPRECATED unsigned char* librdf_query_results_to_counted_string(librdf_query_results *query_results, librdf_uri *format_uri, librdf_uri *base_uri, size_t *length_p); REDLAND_API unsigned char* librdf_query_results_to_counted_string2(librdf_query_results *query_results, const char *name, const char *mime_type, librdf_uri *format_uri, librdf_uri *base_uri, size_t *length_p); REDLAND_API REDLAND_DEPRECATED unsigned char* librdf_query_results_to_string(librdf_query_results *query_results, librdf_uri *format_uri, librdf_uri *base_uri); REDLAND_API unsigned char* librdf_query_results_to_string2(librdf_query_results *query_results, const char *name, const char *mime_type, librdf_uri *format_uri, librdf_uri *base_uri); REDLAND_API REDLAND_DEPRECATED int librdf_query_results_to_file_handle(librdf_query_results *query_results, FILE *handle, librdf_uri *format_uri, librdf_uri *base_uri); REDLAND_API int librdf_query_results_to_file_handle2(librdf_query_results *query_results, FILE *handle, const char *name, const char *mime_type, librdf_uri *format_uri, librdf_uri *base_uri); REDLAND_API REDLAND_DEPRECATED int librdf_query_results_to_file(librdf_query_results *query_results, const char *name, librdf_uri *format_uri, librdf_uri *base_uri); REDLAND_API int librdf_query_results_to_file2(librdf_query_results *query_results, const char *name, const char *mime_type, librdf_uri *format_uri, librdf_uri *base_uri); REDLAND_API void librdf_free_query_results(librdf_query_results* query_results); REDLAND_API int librdf_query_results_is_bindings(librdf_query_results *query_results); REDLAND_API int librdf_query_results_is_boolean(librdf_query_results *query_results); REDLAND_API int librdf_query_results_is_graph(librdf_query_results *query_results); REDLAND_API int librdf_query_results_is_syntax(librdf_query_results* query_results); REDLAND_API int librdf_query_results_get_boolean(librdf_query_results *query_results); /* query results formatter class */ REDLAND_API librdf_query_results_formatter* librdf_new_query_results_formatter2(librdf_query_results* query_results, const char *name, const char* mime_type, librdf_uri* uri); REDLAND_API REDLAND_DEPRECATED librdf_query_results_formatter* librdf_new_query_results_formatter(librdf_query_results* query_results, const char *name, librdf_uri* uri); REDLAND_API REDLAND_DEPRECATED librdf_query_results_formatter* librdf_new_query_results_formatter_by_mime_type(librdf_query_results* query_results, const char *mime_type); REDLAND_API void librdf_free_query_results_formatter(librdf_query_results_formatter* formatter); REDLAND_API int librdf_query_results_formatter_write(raptor_iostream *iostr, librdf_query_results_formatter* formatter, librdf_query_results* query_results, librdf_uri *base_uri); REDLAND_API int librdf_query_results_formats_check(librdf_world* world, const char *name, librdf_uri* uri, const char *mime_type); REDLAND_API REDLAND_DEPRECATED int librdf_query_results_formats_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label, const unsigned char **uri_string, const char **mime_type); REDLAND_API const raptor_syntax_description* librdf_query_results_formats_get_description(librdf_world* world, unsigned int counter); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_storage.h0000644000175000017500000001446011170172511013372 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage.h - RDF Storage Factory and Storage interfaces and definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_STORAGE_H #define LIBRDF_STORAGE_H #include #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif /* class methods */ REDLAND_API int librdf_storage_register_factory(librdf_world *world, const char *name, const char *label, void (*factory) (librdf_storage_factory*)); REDLAND_API int librdf_storage_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label); /* constructor */ REDLAND_API librdf_storage* librdf_new_storage(librdf_world *world, const char *storage_name, const char *name, const char *options_string); REDLAND_API librdf_storage* librdf_new_storage_with_options(librdf_world *world, const char *storage_name, const char *name, librdf_hash *options); REDLAND_API librdf_storage* librdf_new_storage_from_storage(librdf_storage* old_storage); REDLAND_API librdf_storage* librdf_new_storage_from_factory(librdf_world *world, librdf_storage_factory* factory, const char *name, librdf_hash* options); /* destructor */ REDLAND_API void librdf_free_storage(librdf_storage *storage); /* methods */ REDLAND_API void librdf_storage_add_reference(librdf_storage *storage); REDLAND_API void librdf_storage_remove_reference(librdf_storage *storage); REDLAND_API void librdf_storage_set_instance(librdf_storage *storage, librdf_storage_instance instance); REDLAND_API librdf_storage_instance librdf_storage_get_instance(librdf_storage *storage); REDLAND_API librdf_world *librdf_storage_get_world(librdf_storage *storage); REDLAND_API int librdf_storage_open(librdf_storage* storage, librdf_model *model); REDLAND_API int librdf_storage_close(librdf_storage* storage); REDLAND_API int librdf_storage_size(librdf_storage* storage); REDLAND_API int librdf_storage_add_statement(librdf_storage* storage, librdf_statement* statement); REDLAND_API int librdf_storage_add_statements(librdf_storage* storage, librdf_stream* statement_stream); REDLAND_API int librdf_storage_remove_statement(librdf_storage* storage, librdf_statement* statement); REDLAND_API int librdf_storage_contains_statement(librdf_storage* storage, librdf_statement* statement); REDLAND_API librdf_stream* librdf_storage_serialise(librdf_storage* storage); REDLAND_API librdf_stream* librdf_storage_find_statements(librdf_storage* storage, librdf_statement* statement); REDLAND_API librdf_stream* librdf_storage_find_statements_with_options(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options); REDLAND_API librdf_iterator* librdf_storage_get_sources(librdf_storage *storage, librdf_node *arc, librdf_node *target); REDLAND_API librdf_iterator* librdf_storage_get_arcs(librdf_storage *storage, librdf_node *source, librdf_node *target); REDLAND_API librdf_iterator* librdf_storage_get_targets(librdf_storage *storage, librdf_node *source, librdf_node *arc); /* return list of properties to/from a node */ REDLAND_API librdf_iterator* librdf_storage_get_arcs_in(librdf_storage *storage, librdf_node *node); REDLAND_API librdf_iterator* librdf_storage_get_arcs_out(librdf_storage *storage, librdf_node *node); /* check for [node, property, ?] */ REDLAND_API int librdf_storage_has_arc_in(librdf_storage *storage, librdf_node *node, librdf_node *property); /* check for [?, property, node] */ REDLAND_API int librdf_storage_has_arc_out(librdf_storage *storage, librdf_node *node, librdf_node *property); /* context methods */ REDLAND_API int librdf_storage_context_add_statement(librdf_storage* storage, librdf_node* context, librdf_statement* statement); REDLAND_API int librdf_storage_context_add_statements(librdf_storage* storage, librdf_node* context, librdf_stream* stream); REDLAND_API int librdf_storage_context_remove_statement(librdf_storage* storage, librdf_node* context, librdf_statement* statement); REDLAND_API int librdf_storage_context_remove_statements(librdf_storage* storage, librdf_node* context); REDLAND_API librdf_stream* librdf_storage_context_as_stream(librdf_storage* storage, librdf_node* context); REDLAND_API REDLAND_DEPRECATED librdf_stream* librdf_storage_context_serialise(librdf_storage* storage, librdf_node* context); /* querying methods */ REDLAND_API int librdf_storage_supports_query(librdf_storage* storage, librdf_query *query); REDLAND_API librdf_query_results* librdf_storage_query_execute(librdf_storage* storage, librdf_query *query); /* synchronise a storage to the backing store */ REDLAND_API int librdf_storage_sync(librdf_storage *storage); /* find statements in a given context */ REDLAND_API librdf_stream* librdf_storage_find_statements_in_context(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node); REDLAND_API librdf_iterator* librdf_storage_get_contexts(librdf_storage* storage); /* features */ REDLAND_API librdf_node* librdf_storage_get_feature(librdf_storage* storage, librdf_uri* feature); REDLAND_API int librdf_storage_set_feature(librdf_storage* storage, librdf_uri* feature, librdf_node* value); REDLAND_API int librdf_storage_transaction_start(librdf_storage* storage); REDLAND_API int librdf_storage_transaction_start_with_handle(librdf_storage* storage, void* handle); REDLAND_API int librdf_storage_transaction_commit(librdf_storage* storage); REDLAND_API int librdf_storage_transaction_rollback(librdf_storage* storage); REDLAND_API void* librdf_storage_transaction_get_handle(librdf_storage* storage); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_init.h0000644000175000017500000000710611702657222012700 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_init.h - Overall library initialisation / termination and memory * management prototypes * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_INIT_H #define LIBRDF_INIT_H typedef void (*librdf_raptor_init_handler)(void* user_data, raptor_world* raptor_world_ptr); typedef void (*librdf_rasqal_init_handler)(void* user_data, rasqal_world* rasqal_world_ptr); #ifdef LIBRDF_INTERNAL #include #endif #ifndef LIBRDF_OBJC_FRAMEWORK #include #else #include #endif #ifdef __cplusplus extern "C" { #endif REDLAND_API librdf_world* librdf_new_world(void); REDLAND_API void librdf_free_world(librdf_world *world); REDLAND_API void librdf_world_open(librdf_world *world); REDLAND_API void librdf_world_init_mutex(librdf_world *world); REDLAND_API void librdf_world_set_rasqal(librdf_world* world, rasqal_world* rasqal_world_ptr); REDLAND_API void librdf_world_set_raptor_init_handler(librdf_world* world, void* user_data, librdf_raptor_init_handler handler); REDLAND_API void librdf_world_set_rasqal_init_handler(librdf_world* world, void* user_data, librdf_rasqal_init_handler handler); REDLAND_API rasqal_world* librdf_world_get_rasqal(librdf_world* world); REDLAND_API void librdf_world_set_error(librdf_world* world, void *user_data, librdf_log_level_func error_handler); REDLAND_API void librdf_world_set_warning(librdf_world* world, void *user_data, librdf_log_level_func warning_handler); REDLAND_API void librdf_world_set_logger(librdf_world* world, void *user_data, librdf_log_func log_handler); REDLAND_API void librdf_world_set_digest(librdf_world* world, const char *name); REDLAND_API void librdf_free_memory(void *ptr); REDLAND_API void* librdf_alloc_memory(size_t size); REDLAND_API void* librdf_calloc_memory(size_t nmemb, size_t size); /** * LIBRDF_WORLD_FEATURE_GENID_BASE: * * World feature to set the generated ID base. * * Must be set before the world is opened with librdf_world_open(). */ #define LIBRDF_WORLD_FEATURE_GENID_BASE "http://feature.librdf.org/genid-base" /** * LIBRDF_WORLD_FEATURE_GENID_COUNTER: * * World feature to set the generated ID counter. * * Must be set before the world is opened with librdf_world_open(). */ #define LIBRDF_WORLD_FEATURE_GENID_COUNTER "http://feature.librdf.org/genid-counter" REDLAND_API librdf_node* librdf_world_get_feature(librdf_world* world, librdf_uri *feature); REDLAND_API int librdf_world_set_feature(librdf_world* world, librdf_uri *feature, librdf_node* value); /* OLD INTERFACES */ REDLAND_API REDLAND_DEPRECATED void librdf_init_world(char *digest_factory_name, void* not_used2); REDLAND_API REDLAND_DEPRECATED void librdf_destroy_world(void); #ifdef LIBRDF_INTERNAL const char* librdf_basename(const char *name); #endif #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_digest_sha1.c0000644000175000017500000002351511772470733014134 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_digest_sha1.c - SHA1 Message Digest Algorithm * * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * Based on the public domain version with the credits below. * */ /* SHA-1 in C By Steve Reid 100% Public Domain ----------------- Modified 7/98 By James H. Brown Still 100% Public Domain Corrected a problem which generated improper hash values on 16 bit machines Routine SHA1Update changed from void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len) to void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned long len) The 'len' parameter was declared an int which works fine on 32 bit machines. However, on 16 bit machines an int is too small for the shifts being done against it. This caused the hash function to generate incorrect values if len was greater than 8191 (8K - 1) due to the 'len << 3' on line 3 of SHA1Update(). Since the file IO in main() reads 16K at a time, any file 8K or larger would be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million "a"s). I also changed the declaration of variables i & j in SHA1Update to unsigned long from unsigned int for the same reason. These changes should make no difference to any 32 bit implementations since an int and a long are the same size in those environments. -- I also corrected a few compiler warnings generated by Borland C. 1. Added #include for exit() prototype 2. Removed unused variable 'j' in SHA1Final 3. Changed exit(0) to return(0) at end of main. ALL changes I made can be located by searching for comments containing 'JHB' ----------------- Modified 8/98 By Steve Reid Still 100% public domain 1- Removed #include and used return() instead of exit() 2- Fixed overwriting of finalcount in SHA1Final() (discovered by Chris Hall) 3- Changed email address from steve@edmweb.com to sreid@sea-to-sky.net */ /* Test Vectors (from FIPS PUB 180-1) "abc" A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 A million repetitions of "a" 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include /* for u32 here - never used in a public interface */ #include /* #define SHA1HANDSOFF * Copies data before messing with it. */ /* Using return() instead of exit() - SWR */ #define SHA1_DIGEST_LENGTH 20 typedef struct { u32 state[5]; u32 count[2]; unsigned char buffer[64]; unsigned char digest[SHA1_DIGEST_LENGTH]; } SHA1Context; static void SHA1Transform(u32 state[5], const unsigned char buffer[64]); static void SHA1Init(SHA1Context* context); static void SHA1Update(SHA1Context* context, const unsigned char* data, size_t len); /* JHB */ static void SHA1Final(SHA1Context* context); #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /* blk0() and blk() perform the initial expand. */ /* I got the idea of expanding during the round function from SSLeay */ #ifdef WORDS_BIGENDIAN #define blk0(i) block->l[i] #else #define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \ |(rol(block->l[i],8)&0x00FF00FF)) #endif #define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ ^block->l[(i+2)&15]^block->l[i&15],1)) /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ #define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); #define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); #define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); #define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); /* Hash a single 512-bit block. This is the core of the algorithm. */ static void SHA1Transform(u32 state[5], const unsigned char buffer[64]) { u32 a, b, c, d, e; typedef union { unsigned char c[64]; u32 l[16]; } CHAR64LONG16; CHAR64LONG16* block; #ifdef SHA1HANDSOFF static unsigned char workspace[64]; block = (CHAR64LONG16*)workspace; memcpy(block, buffer, 64); #else block = (CHAR64LONG16*)buffer; #endif /* Copy context->state[] to working vars */ a = state[0]; b = state[1]; c = state[2]; d = state[3]; e = state[4]; /* 4 rounds of 20 operations each. Loop unrolled. */ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); /* Add the working vars back into context.state[] */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; state[4] += e; /* Wipe variables */ /* a = b = c = d = e = 0; */ /* CLANG: useless */ } /* SHA1Init - Initialize new context */ static void SHA1Init(SHA1Context* context) { /* SHA1 initialization constants */ context->state[0] = 0x67452301; context->state[1] = 0xEFCDAB89; context->state[2] = 0x98BADCFE; context->state[3] = 0x10325476; context->state[4] = 0xC3D2E1F0; context->count[0] = context->count[1] = 0; } /* Run your data through this. */ static void SHA1Update(SHA1Context* context, const unsigned char* data, size_t len) /* JHB */ { u32 i, j; /* JHB */ u32 ulen = LIBRDF_BAD_CAST(u32, len); j = (context->count[0] >> 3) & 63; if ((context->count[0] += ulen << 3) < (ulen << 3)) context->count[1]++; context->count[1] += (ulen >> 29); if ((j + ulen) > 63) { memcpy(&context->buffer[j], data, (i = 64-j)); SHA1Transform(context->state, context->buffer); for ( ; i + 63 < ulen; i += 64) { SHA1Transform(context->state, &data[i]); } j = 0; } else i = 0; memcpy(&context->buffer[j], &data[i], ulen - i); } /* Add padding and return the message digest. */ static void SHA1Final(SHA1Context* context) { u32 i; /* JHB */ unsigned char finalcount[8]; for (i = 0; i < 8; i++) { finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ } SHA1Update(context, (const unsigned char*)"\200", 1); while ((context->count[0] & 504) != 448) { SHA1Update(context, (const unsigned char*)"\0", 1); } SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */ for (i = 0; i < SHA1_DIGEST_LENGTH; i++) { context->digest[i] = (unsigned char) ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); } /* Wipe variables */ /* i = 0; */ /* JHB */ /* CLANG: useless */ memset(context->buffer, 0, 64); memset(context->state, 0, SHA1_DIGEST_LENGTH); memset(context->count, 0, 8); memset(finalcount, 0, 8); /* SWR */ #ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */ SHA1Transform(context->state, context->buffer); #endif } /* DJB code from here */ static unsigned char * librdf_digest_sha1_get_digest(SHA1Context *c) { return c->digest; } static void librdf_digest_sha1_register_factory(librdf_digest_factory *factory) { factory->context_length = sizeof(SHA1Context); factory->digest_length = SHA1_DIGEST_LENGTH; factory->init = (void (*)(void *))SHA1Init; factory->update = (void (*)(void *, const unsigned char*, size_t))SHA1Update; factory->final = (void (*)(void *))SHA1Final; factory->get_digest = (unsigned char *(*)(void *))librdf_digest_sha1_get_digest; } /** * librdf_digest_sha1_constructor: * @world: redland world object * * Initialise the SHA1 digest factory. * **/ void librdf_digest_sha1_constructor(librdf_world *world) { librdf_digest_register_factory(world, "SHA1", &librdf_digest_sha1_register_factory); } redland-1.0.17/src/rdf_log.h0000644000175000017500000001156011610752752012517 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_log.h - RDF logging interfaces * * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_LOG_H #define LIBRDF_LOG_H #ifdef __cplusplus extern "C" { #endif #include /** * librdf_log_level: * @LIBRDF_LOG_NONE: No level * @LIBRDF_LOG_DEBUG: Debug. * @LIBRDF_LOG_INFO: Information. * @LIBRDF_LOG_WARN: Warning. * @LIBRDF_LOG_ERROR: Recoverable error. Program can continue. * @LIBRDF_LOG_FATAL: Fatal error. Program will abort if this is not caught. * @LIBRDF_LOG_LAST: Internal, never returned. * * Indicates the level of the log message. */ typedef enum { LIBRDF_LOG_NONE = 0, LIBRDF_LOG_DEBUG, LIBRDF_LOG_INFO, LIBRDF_LOG_WARN, LIBRDF_LOG_ERROR, LIBRDF_LOG_FATAL, LIBRDF_LOG_LAST=LIBRDF_LOG_FATAL } librdf_log_level; /** * librdf_log_facility: * @LIBRDF_FROM_CONCEPTS: Concepts * @LIBRDF_FROM_DIGEST: Digest * @LIBRDF_FROM_FILES: Files * @LIBRDF_FROM_HASH: Hash * @LIBRDF_FROM_INIT: Init * @LIBRDF_FROM_ITERATOR: Iterator * @LIBRDF_FROM_LIST: List * @LIBRDF_FROM_MODEL: Model * @LIBRDF_FROM_NODE: Node * @LIBRDF_FROM_PARSER: Parser * @LIBRDF_FROM_QUERY: Query * @LIBRDF_FROM_SERIALIZER: Serializer * @LIBRDF_FROM_STATEMENT: Statement * @LIBRDF_FROM_STORAGE: Storage * @LIBRDF_FROM_STREAM: Stream * @LIBRDF_FROM_URI: URI * @LIBRDF_FROM_UTF8: UTF8 * @LIBRDF_FROM_MEMORY: Memory * @LIBRDF_FROM_NONE: Associated with no part. * @LIBRDF_FROM_RAPTOR: Raptor library (parser or serializer; Raptor 2.0.0+). * @LIBRDF_FROM_LAST: Internal, never returned. * * Indicates the part of the system that generated the log message. */ typedef enum { LIBRDF_FROM_NONE = 0, LIBRDF_FROM_CONCEPTS, LIBRDF_FROM_DIGEST, LIBRDF_FROM_FILES, LIBRDF_FROM_HASH, LIBRDF_FROM_INIT, LIBRDF_FROM_ITERATOR, LIBRDF_FROM_LIST, LIBRDF_FROM_MODEL, LIBRDF_FROM_NODE, LIBRDF_FROM_PARSER, LIBRDF_FROM_QUERY, LIBRDF_FROM_SERIALIZER, LIBRDF_FROM_STATEMENT, LIBRDF_FROM_STORAGE, LIBRDF_FROM_STREAM, LIBRDF_FROM_URI, LIBRDF_FROM_UTF8, LIBRDF_FROM_MEMORY, LIBRDF_FROM_RAPTOR, LIBRDF_FROM_LAST=LIBRDF_FROM_RAPTOR } librdf_log_facility; /** * librdf_log_message: * * Structure for storing parts of a log message generated by Redland. */ typedef struct { int code; /* The error code */ librdf_log_level level; librdf_log_facility facility; const char *message; /* valid for certain facilities such as LIBRDF_FROM_PARSER */ raptor_locator *locator; } librdf_log_message; /** * librdf_log_level_func: * @user_data: User data pointer * @message: Log message. * @arguments: Message arguments. * * Handler for one log level, for the warning and error levels ONLY. * Used by #librdf_world_set_warning and #librdf_world_set_error. * * Return value: non-zero to indicate log message has been handled */ typedef int (REDLAND_CALLBACK_STDCALL *librdf_log_level_func)(void *user_data, const char *message, va_list arguments); /** * librdf_log_func: * @user_data: User data pointer * @message: Log message structure pointer. * * Handler for all log levels. * * Return value: non-zero to indicate log message has been handled */ typedef int (REDLAND_CALLBACK_STDCALL *librdf_log_func)(void *user_data, librdf_log_message *message); #ifdef LIBRDF_INTERNAL #include #endif /* log message accessors */ REDLAND_API int librdf_log_message_code(librdf_log_message *message); REDLAND_API librdf_log_level librdf_log_message_level(librdf_log_message *message); REDLAND_API librdf_log_facility librdf_log_message_facility(librdf_log_message *message); REDLAND_API const char * librdf_log_message_message(librdf_log_message *message); REDLAND_API raptor_locator* librdf_log_message_locator(librdf_log_message *message); /* logging functions */ REDLAND_API void librdf_log_simple(librdf_world* world, int code, librdf_log_level level, librdf_log_facility facility, void *locator, const char *message); REDLAND_API void librdf_log(librdf_world* world, int code, librdf_log_level level, librdf_log_facility facility, void *locator, const char *message, ...) REDLAND_PRINTF_FORMAT(6, 7); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_files.c0000644000175000017500000000576511615421777013052 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_files.c - RDF File and directory handling utilities * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #ifdef HAVE_STDLIB_H #include /* for mktemp(), mkstemp(), getenv() */ #endif #ifdef HAVE_MKSTEMP #ifdef HAVE_UNISTD_H #include /* for close(), unlink() */ #endif #endif #ifdef STANDALONE #define LIBRDF_DEBUG 1 #endif #include #ifndef STANDALONE #ifndef REDLAND_DISABLE_DEPRECATED /** * librdf_files_temporary_file_name: * * Create a temporary file name. * * @deprecated: Do not use this, it is unsafe. * * Return value: a new filename or NULL on failure. **/ char * librdf_files_temporary_file_name(void) { #if defined(HAVE_MKSTEMP) || defined(HAVE_MKTEMP) const char *tmp_dir; size_t length; char *name; static const char * const file_template="librdf_tmp_XXXXXX"; /* FIXME */ #ifdef HAVE_MKSTEMP int fd; #endif /* FIXME: unix dependencies */ tmp_dir=getenv("TMPDIR"); if(!tmp_dir) tmp_dir="/tmp"; length=strlen(tmp_dir) + strlen(file_template) + 2; /* 2: / sep and \/0 */ name = LIBRDF_MALLOC(char*, length); if(!name) return NULL; /* FIXME: unix dependency - file/dir separator */ sprintf(name, "%s/%s", tmp_dir, file_template); #ifdef HAVE_MKSTEMP /* Proritise mkstemp() since GNU libc says: Never use mktemp(). */ fd=mkstemp(name); if(fd<0) { LIBRDF_FREE(char*, name); return NULL; } close(fd); unlink(name); return name; #else return mktemp(name); #endif #else #ifdef HAVE_TMPNAM /* GNU libc says: Never use this function. Use mkstemp(3) instead. */ char *name; char *new_name; name=tmpnam(NULL); /* NULL ensures statically allocated */ new_name = LIBRDF_MALLOC(char*, strlen(name) + 1); if(!new_name) return NULL; strcpy(new_name, name); return name; #else /* not tmpnam(), mkstemp() or mktemp() */ HELP #endif #endif } #endif #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { /* keep gcc -Wall happy */ return(0); } #endif redland-1.0.17/src/rdf_list.c0000644000175000017500000003162011773150065012702 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_list.c - RDF List Implementation * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include #include /* prototypes for local functions */ static librdf_list_node* librdf_list_find_node(librdf_list* list, void *data); static int librdf_list_iterator_is_end(void* iterator); static int librdf_list_iterator_next_method(void* iterator); static void* librdf_list_iterator_get_method(void* iterator, int flags); static void librdf_list_iterator_finished(void* iterator); static void librdf_list_iterators_replace_node(librdf_list* list, librdf_list_node* old_node, librdf_list_node* new_node); /* helper functions */ static librdf_list_node* librdf_list_find_node(librdf_list* list, void *data) { librdf_list_node* node; for(node=list->first; node; node=node->next) { if(list->equals) { if(list->equals(node->data, data)) break; } else { if(node->data == data) break; } } return node; } /** * librdf_new_list: * @world: redland world object * * Constructor - create a new #librdf_list. * * Return value: a new #librdf_list or NULL on failure **/ librdf_list* librdf_new_list(librdf_world *world) { librdf_list* new_list; librdf_world_open(world); new_list = LIBRDF_CALLOC(librdf_list*, 1, sizeof(*new_list)); if(!new_list) return NULL; new_list->world=world; return new_list; } /** * librdf_free_list: * @list: #librdf_list object * * Destructor - destroy a #librdf_list object. * **/ void librdf_free_list(librdf_list* list) { if(!list) return; LIBRDF_ASSERT_RETURN(list->iterator_count, "Iterators were active on freeing list", ); librdf_list_clear(list); LIBRDF_FREE(librdf_list, list); } /** * librdf_list_clear: * @list: #librdf_list object * * Empty an librdf_list. * **/ void librdf_list_clear(librdf_list* list) { librdf_list_node *node, *next; for(node=list->first; node; node=next) { next=node->next; LIBRDF_FREE(librdf_list_node, node); } } /** * librdf_list_add: * @list: #librdf_list object * @data: the data value * * Add a data item to the end of a librdf_list. * * Equivalent to the list 'push' notion, thus if librdf_list_pop() * is called after this, it will return the value added here. * * Return value: non 0 on failure **/ int librdf_list_add(librdf_list* list, void *data) { librdf_list_node* node; /* need new node */ node = LIBRDF_CALLOC(librdf_list_node*, 1, sizeof(*node)); if(!node) return 1; node->data=data; /* if there is a list, connect the new node to the last node */ if(list->last) { node->prev=list->last; list->last->next=node; } /* make this node the last node always */ list->last=node; /* if there is no list at all, make this the first to */ if(!list->first) list->first=node; /* node->next = NULL implicitly */ list->length++; return 0; } /** * librdf_list_unshift: * @list: #librdf_list object * @data: the data value * * Add a data item to the start of a librdf_list. * * if librdf_list_shift() is called after this, it will return the value * added here. * * Return value: non 0 on failure **/ int librdf_list_unshift(librdf_list* list, void *data) { librdf_list_node* node; /* need new node */ node = LIBRDF_CALLOC(librdf_list_node*, 1, sizeof(*node)); if(!node) return 1; node->data=data; /* if there is a list, connect the new node to the first node */ if(list->first) { node->next=list->first; list->first->prev=node; } /* make this node the first node always */ list->first=node; /* if there is no list at all, make this the last too */ if(!list->last) list->last=node; /* node->next = NULL implicitly */ list->length++; return 0; } /** * librdf_list_remove: * @list: #librdf_list object * @data: the data item * * Remove a data item from an librdf_list. * * The search is done using the 'equals' function which may be set * by librdf_list_set_equals() or by straight comparison of pointers * if not set. * * Return value: the data stored or NULL on failure (not found or list empty) **/ void * librdf_list_remove(librdf_list* list, void *data) { librdf_list_node *node; node=librdf_list_find_node(list, data); if(!node) /* not found */ return NULL; librdf_list_iterators_replace_node(list, node, node->next); if(node == list->first) list->first=node->next; if(node->prev) node->prev->next=node->next; if(node == list->last) list->last=node->prev; if(node->next) node->next->prev=node->prev; /* retrieve actual stored data */ data=node->data; /* free node */ LIBRDF_FREE(librdf_list_node, node); list->length--; return data; } /** * librdf_list_shift: * @list: #librdf_list object * * Remove and return the data at the start of the list. * * Return value: the data object or NULL if the list is empty **/ void* librdf_list_shift(librdf_list* list) { librdf_list_node *node; void *data; node=list->first; if(!node) return NULL; list->first=node->next; if(list->first) /* if list not empty, fix pointers */ list->first->prev=NULL; else /* list is now empty, zap last pointer */ list->last=NULL; /* save data */ data=node->data; /* free node */ LIBRDF_FREE(librdf_list_node, node); list->length--; return data; } /** * librdf_list_pop: * @list: #librdf_list object * * Remove and return the data at the end of the list. * * Return value: the data object or NULL if the list is empty **/ void* librdf_list_pop(librdf_list* list) { librdf_list_node *node; void *data; node=list->last; if(!node) return NULL; list->last=node->prev; if(list->last) /* if list not empty, fix pointers */ list->last->next=NULL; else /* list is now empty, zap last pointer */ list->first=NULL; /* save data */ data=node->data; /* free node */ LIBRDF_FREE(librdf_list_node, node); list->length--; return data; } /** * librdf_list_contains: * @list: #librdf_list object * @data: the data value * * Check for presence of data item in list. * * The search is done using the 'equals' function which may be set * by librdf_list_set_equals() or by straight comparison of pointers * if not set. * * Return value: non 0 if item was found **/ int librdf_list_contains(librdf_list* list, void *data) { librdf_list_node *node; node=librdf_list_find_node(list, data); return (node != NULL); } /** * librdf_list_size: * @list: #librdf_list object * * Return the length of the list. * * Return value: length of the list **/ int librdf_list_size(librdf_list* list) { return list->length; } /** * librdf_list_set_equals: * @list: #librdf_list object * @equals: the equals function * * Set the equals function for the list. * * The function given is used when comparing items in the list * during searches such as those done in librdf_list_remove() or * librdf_list_contains(). * **/ REDLAND_EXTERN_C void librdf_list_set_equals(librdf_list* list, int (*equals) (void* data1, void *data2)) { list->equals=equals; } static void librdf_list_add_iterator_context(librdf_list* list, librdf_list_iterator_context* node) { if(list->last_iterator) { node->prev_ic=list->last_iterator; list->last_iterator->next_ic=node; } list->last_iterator=node; if(!list->first_iterator) list->first_iterator=node; list->iterator_count++; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 LIBRDF_DEBUG4("Added iterator %p to list %p giving %d iterators\n", node->iterator, list, list->iterator_count); #endif } static void librdf_list_remove_iterator_context(librdf_list* list, librdf_list_iterator_context* node) { if(node == list->first_iterator) list->first_iterator=node->next_ic; if(node->prev_ic) node->prev_ic->next_ic=node->next_ic; if(node == list->last_iterator) list->last_iterator=node->prev_ic; if(node->next_ic) node->next_ic->prev_ic=node->prev_ic; list->iterator_count--; #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 LIBRDF_DEBUG4("Removed iterator %p from list %p leaving %d iterators\n", node->iterator, list, list->iterator_count); #endif } static void librdf_list_iterators_replace_node(librdf_list* list, librdf_list_node* old_node, librdf_list_node* new_node) { librdf_list_iterator_context *node, *next; if(!list->iterator_count) return; for(node=list->first_iterator; node; node=next) { next=node->next_ic; if(node->next == old_node) { #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 2 LIBRDF_DEBUG4("Moved iterator %p pointing from next node %p to %p\n", node->iterator, old_node, new_node); #endif node->next = new_node; } } } /** * librdf_list_get_iterator: * @list: #librdf_list object * * Get an iterator for the list. * * Return value: a new #librdf_iterator object or NULL on failure **/ librdf_iterator* librdf_list_get_iterator(librdf_list* list) { librdf_list_iterator_context* context; librdf_iterator* iterator; context = LIBRDF_CALLOC(librdf_list_iterator_context*, 1, sizeof(*context)); if(!context) return NULL; context->list=list; context->current=list->first; context->next=context->current != NULL ? context->current->next : NULL; /* librdf_list_iterator_finished() calls librdf_list_remove_iterator_context(), * librdf_list_iterator_finished() is called if librdf_new_iterator() fails */ librdf_list_add_iterator_context(list, context); iterator=librdf_new_iterator(list->world, (void*)context, librdf_list_iterator_is_end, librdf_list_iterator_next_method, librdf_list_iterator_get_method, librdf_list_iterator_finished); if(!iterator) librdf_list_iterator_finished(context); else context->iterator=iterator; return iterator; } static int librdf_list_iterator_is_end(void* iterator) { librdf_list_iterator_context* context=(librdf_list_iterator_context*)iterator; librdf_list_node *node=context->current; return (node == NULL); } static int librdf_list_iterator_next_method(void* iterator) { librdf_list_iterator_context* context=(librdf_list_iterator_context*)iterator; librdf_list_node *node=context->current; if(!node) return 1; context->current = context->next; context->next = context->current != NULL ? context->current->next : NULL; return (context->current == NULL); } static void* librdf_list_iterator_get_method(void* iterator, int flags) { librdf_list_iterator_context* context=(librdf_list_iterator_context*)iterator; librdf_list_node *node=context->current; if(!node) return NULL; if(flags == LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT) return node->data; librdf_log(context->list->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_LIST, NULL, "Unsupported iterator method flag %d", flags); return NULL; } static void librdf_list_iterator_finished(void* iterator) { librdf_list_iterator_context* context=(librdf_list_iterator_context*)iterator; if(!context) return; librdf_list_remove_iterator_context(context->list, context); LIBRDF_FREE(librdf_list_iterator_context, context); } /** * librdf_list_foreach: * @list: #librdf_list object * @fn: pointer to function to apply that takes data pointer and user data parameters * @user_data: user data for applied function * * Apply a function for each data item in a librdf_list. * **/ REDLAND_EXTERN_C void librdf_list_foreach(librdf_list* list, void (*fn)(void *, void *), void *user_data) { librdf_list_node *node, *next; for(node=list->first; node; node=next) { next=node->next; (*fn)(node->data, user_data); } } redland-1.0.17/src/win32_rdf_config.h0000644000175000017500000001645112257576330014235 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * win32_rdf_config.h - redland WIN32 hard-coded config * * Copyright (C) 2004-2011, David Beckett http://www.dajobe.org/ * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * */ #ifndef WIN32_RDF_CONFIG_H #define WIN32_RDF_CONFIG_H #ifdef __cplusplus extern "C" { #endif #define WIN32_LEAN_AND_MEAN 1 /* getopt is not in standard win32 C library - define if we have it */ /* #define HAVE_GETOPT_H 1 */ #define HAVE_STDLIB_H 1 /* For using expat on win32 */ /*#define RAPTOR_XML_EXPAT 1 #define HAVE_EXPAT_H 1*/ #define HAVE_STRICMP 1 /* MS names for these functions */ // next line breaks build on wntmsci12 //#define vsnprintf _vsnprintf #define snprintf _snprintf #define access _access #define stricmp _stricmp #define strnicmp _strnicmp #define close _close #define unlink _unlink #define mktemp _mktemp #define HAVE_C99_VSNPRINTF 1 /* Define the following if you are calling the librdf from C# or any language which uses stdcall */ #define USE_STDCALL_CALLBACKS 1 /* for access() which is POSIX but doesn't seem to have the defines in VC */ #ifndef R_OK #define F_OK 0 #define R_OK 4 #endif /* __func__ doesn't exist in Visual Studio 6 */ #define __func__ "" #undef REDLAND_INLINE #define REDLAND_INLINE __inline /* * Defines that come from rdf_config.h */ /* BDB has close method with 2 args */ #define HAVE_BDB_CLOSE_2_ARGS 1 /* BDB defines DBC */ #define HAVE_BDB_CURSOR 1 /* BDB cursor method has 4 arguments */ #define HAVE_BDB_CURSOR_4_ARGS 1 /* BDB defines DB_TXN */ #define HAVE_BDB_DB_TXN 1 /* BDB has fd method with 2 args */ #define HAVE_BDB_FD_2_ARGS 1 /* Have BDB hash support */ #define HAVE_BDB_HASH 1 /* BDB has open method with 6 args */ /* #undef HAVE_BDB_OPEN_6_ARGS */ /* BDB has open method with 7 args */ #define HAVE_BDB_OPEN_7_ARGS 1 /* BDB has set_flags method */ #define HAVE_BDB_SET_FLAGS 1 /* BDB has dbopen method */ /* #undef HAVE_DBOPEN */ /* BDB has db_create method */ #define HAVE_DB_CREATE 1 /* Define to 1 if you have the header file. */ #define HAVE_DB_H 1 /* Define to 1 if you have the header file. */ /* undef HAVE_DLFCN_H */ /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the `getenv' function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the `getopt' function. */ #define HAVE_GETOPT 1 /* Define to 1 if you have the header file. */ #define HAVE_GETOPT_H 1 /* Define to 1 if you have the `getopt_long' function. */ #define HAVE_GETOPT_LONG 1 /* Define to 1 if you have the `gettimeofday' function. */ /* #undef HAVE_GETTIMEOFDAY */ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* W3C libwww is present */ /* #undef HAVE_LIBWWW */ /* Have local MD5 digest */ #define HAVE_LOCAL_MD5_DIGEST 1 /* Have local RIPEMD160 digest */ /* #undef HAVE_LOCAL_RIPEMD160_DIGEST */ /* Have local SHA1 digest */ #define HAVE_LOCAL_SHA1_DIGEST 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mkstemp' function. */ /* #undef HAVE_MKSTEMP */ /* Define to 1 if you have the `mktemp' function. */ #define HAVE_MKTEMP 1 /* MySQL libraries are present */ #define HAVE_MYSQL 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_OPENSSL_CRYPTO_H */ /* Have openssl MD5 digest */ /* #undef HAVE_OPENSSL_CRYPTO_MD5_DIGEST */ /* Have openssl RIPEMD160 digest */ /* #undef HAVE_OPENSSL_CRYPTO_RIPEMD160_DIGEST */ /* Have openssl SHA1 digest */ /* #undef HAVE_OPENSSL_CRYPTO_SHA1_DIGEST */ /* Have openssl digests */ /* #undef HAVE_OPENSSL_DIGESTS */ /* Define to 1 if you have the header file. */ /* #undef HAVE_PTHREAD_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ /*#define HAVE_SYS_TIME_H*/ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the `tmpnam' function. */ #define HAVE_TMPNAM 1 /* Have 3store available */ /* #undef HAVE_TSTORE */ /* Define to 1 if you have the header file. */ /* #define HAVE_UNISTD_H */ /* Disable run time assertion checks. */ /* #undef LIBRDF_DISABLE_ASSERT */ /* Disable run time assertion check messages. */ /* #undef LIBRDF_DISABLE_ASSERT_MESSAGES */ /* Release version as a decimal */ #define LIBRDF_VERSION_DECIMAL 10017 /* Major version number */ #define LIBRDF_VERSION_MAJOR 1 /* Minor version number */ #define LIBRDF_VERSION_MINOR 0 /* Release version number */ #define LIBRDF_VERSION_RELEASE 17 /* The size of a `unsigned char', as computed by sizeof. */ #define SIZEOF_UNSIGNED_CHAR 1 /* The size of a `unsigned short', as computed by sizeof. */ #define SIZEOF_UNSIGNED_SHORT 2 /* The size of a `unsigned int', as computed by sizeof. */ #define SIZEOF_UNSIGNED_INT 4 /* The size of a `unsigned long', as computed by sizeof. */ #define SIZEOF_UNSIGNED_LONG 4 /* The size of a `unsigned long long', as computed by sizeof. */ #define SIZEOF_UNSIGNED_LONG_LONG 8 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Building file storage */ #define STORAGE_FILE 1 #define STORAGE_HASHES 1 #define STORAGE_MEMORY 1 #define STORAGE_TREES 1 /* Building MySQL storage */ /* #define STORAGE_MYSQL 1 */ /* Building PostgreSQL storage */ /*#undef STORAGE_POSTGRESQL*/ /* Building SQLite storage */ #define STORAGE_SQLITE 1 /* Building 3store storage */ /*#undef STORAGE_TSTORE*/ /* Define to 1 if you can safely include both and . */ /* #define TIME_WITH_SYS_TIME*/ /* Version number of package */ #define VERSION "1.0.17" /* Use POSIX threads */ #undef WITH_THREADS /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ #include #include #include /* get _isnan() since it is not in math.h */ #include #ifndef isnan #define isnan(d) (_isnan(d)) #endif #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_internal.h0000644000175000017500000001056211772662730013560 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_internal.h - Redland RDF Application Framework internal API (header never shipped) * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ /* This file is never shipped outside the source tree and neither * are any of the included headers files. It is only included * inside librdf.h when LIBRDF_INTERNAL is defined; when compiling * Redland. */ #ifndef RDF_INTERNAL_H #define RDF_INTERNAL_H #ifdef __cplusplus #define REDLAND_EXTERN_C extern "C" #else #define REDLAND_EXTERN_C #endif /* Can be over-ridden or undefined in a config.h file or -Ddefine */ #ifndef REDLAND_INLINE #define REDLAND_INLINE inline #endif /* error handling */ #ifdef LIBRDF_DEBUG /* DEBUGGING TURNED ON */ /* Debugging messages */ #define LIBRDF_DEBUG1(msg) do {fprintf(stderr, "%s:%d:%s: " msg, __FILE__, __LINE__, __func__); } while(0) #define LIBRDF_DEBUG2(msg, arg1) do {fprintf(stderr, "%s:%d:%s: " msg, __FILE__, __LINE__, __func__, arg1);} while(0) #define LIBRDF_DEBUG3(msg, arg1, arg2) do {fprintf(stderr, "%s:%d:%s: " msg, __FILE__, __LINE__, __func__, arg1, arg2);} while(0) #define LIBRDF_DEBUG4(msg, arg1, arg2, arg3) do {fprintf(stderr, "%s:%d:%s: " msg, __FILE__, __LINE__, __func__, arg1, arg2, arg3);} while(0) #define SYSTEM_MALLOC(size) malloc(size) #define SYSTEM_FREE(ptr) free(ptr) #ifndef LIBRDF_ASSERT_DIE #define LIBRDF_ASSERT_DIE abort(); #endif #else /* DEBUGGING TURNED OFF */ /* No debugging messages */ #define LIBRDF_DEBUG1(msg) #define LIBRDF_DEBUG2(msg, arg1) #define LIBRDF_DEBUG3(msg, arg1, arg2) #define LIBRDF_DEBUG4(msg, arg1, arg2, arg3) #define SYSTEM_MALLOC(size) malloc(size) #define SYSTEM_FREE(ptr) free(ptr) #ifndef LIBRDF_ASSERT_DIE #define LIBRDF_ASSERT_DIE #endif #endif #ifdef LIBRDF_ASSERT_MESSAGES #define LIBRDF_ASSERT_REPORT(msg) fprintf(stderr, "%s:%d: (%s) assertion failed: " msg "\n", __FILE__, __LINE__, __func__); #else #define LIBRDF_ASSERT_REPORT(line) #endif #ifdef LIBRDF_ASSERT #define LIBRDF_ASSERT_CONDITION(condition) do { \ if(!condition) { \ LIBRDF_ASSERT_REPORT("assertion " #condition " failed.") \ LIBRDF_ASSERT_DIE \ return; \ } \ } while(0) #define LIBRDF_ASSERT_RETURN(condition, msg, ret) do { \ if(condition) { \ LIBRDF_ASSERT_REPORT(msg) \ LIBRDF_ASSERT_DIE \ return ret; \ } \ } while(0) #define LIBRDF_ASSERT_OBJECT_POINTER_RETURN(pointer, type) do { \ if(!pointer) { \ LIBRDF_ASSERT_REPORT("object pointer of type " #type " is NULL.") \ LIBRDF_ASSERT_DIE \ return; \ } \ } while(0) #define LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(pointer, type, ret) do { \ if(!pointer) { \ LIBRDF_ASSERT_REPORT("object pointer of type " #type " is NULL.") \ LIBRDF_ASSERT_DIE \ return ret; \ } \ } while(0) #else #define LIBRDF_ASSERT_CONDITION(condition) #define LIBRDF_ASSERT_RETURN(condition, msg, ret) #define LIBRDF_ASSERT_OBJECT_POINTER_RETURN(pointer, type) #define LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(pointer, type, ret) #endif /* for the memory allocation functions */ #ifdef HAVE_STDLIB_H #include #undef HAVE_STDLIB_H #endif #define LIBRDF_MALLOC(type, size) (type)malloc(size) #define LIBRDF_CALLOC(type, size, count) (type)calloc(size, count) #define LIBRDF_FREE(type, ptr) free(ptr) /* Fatal errors - always happen */ #define LIBRDF_FATAL1(world, facility, message) librdf_fatal(world, facility, __FILE__, __LINE__ , __func__, message) /* Safe casts: widening a value */ #define LIBRDF_GOOD_CAST(t, v) (t)(v) /* Unsafe casts: narrowing a value */ #define LIBRDF_BAD_CAST(t, v) (t)(v) #include #include #include #endif redland-1.0.17/src/rdf_parser.h0000644000175000017500000001235411536446751013242 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_parser.h - RDF Parser Factory / Parser interfaces and definition * * Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_PARSER_H #define LIBRDF_PARSER_H #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif /* class methods */ REDLAND_API void librdf_parser_register_factory(librdf_world *world, const char *name, const char *label, const char *mime_type, const unsigned char *uri_string, void (*factory) (librdf_parser_factory*)); REDLAND_API REDLAND_DEPRECATED int librdf_parser_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label); REDLAND_API const raptor_syntax_description* librdf_parser_get_description(librdf_world* world, unsigned int counter); REDLAND_API int librdf_parser_check_name(librdf_world* world, const char *name); /* constructor */ REDLAND_API librdf_parser* librdf_new_parser(librdf_world* world, const char *name, const char *mime_type, librdf_uri *type_uri); REDLAND_API librdf_parser* librdf_new_parser_from_factory(librdf_world* world, librdf_parser_factory *factory); /* destructor */ REDLAND_API void librdf_free_parser(librdf_parser *parser); /* methods */ REDLAND_API librdf_stream* librdf_parser_parse_as_stream(librdf_parser* parser, librdf_uri* uri, librdf_uri* base_uri); REDLAND_API int librdf_parser_parse_into_model(librdf_parser* parser, librdf_uri* uri, librdf_uri* base_uri, librdf_model* model); REDLAND_API librdf_stream* librdf_parser_parse_string_as_stream(librdf_parser* parser, const unsigned char* string, librdf_uri* base_uri); REDLAND_API int librdf_parser_parse_string_into_model(librdf_parser* parser, const unsigned char *string, librdf_uri* base_uri, librdf_model* model); REDLAND_API librdf_stream* librdf_parser_parse_iostream_as_stream(librdf_parser* parser, raptor_iostream *iostream, librdf_uri* base_uri); REDLAND_API int librdf_parser_parse_iostream_into_model(librdf_parser* parser, raptor_iostream *iostream, librdf_uri* base_uri, librdf_model* model); REDLAND_API librdf_stream* librdf_parser_parse_file_handle_as_stream(librdf_parser* parser, FILE* fh, int close_fh, librdf_uri* base_uri); REDLAND_API int librdf_parser_parse_file_handle_into_model(librdf_parser* parser, FILE *fh, int close_fh, librdf_uri* base_uri, librdf_model* model); REDLAND_API REDLAND_DEPRECATED void librdf_parser_set_error(librdf_parser* parser, void *user_data, void (*error_fn)(void *user_data, const char *msg, ...)); REDLAND_API REDLAND_DEPRECATED void librdf_parser_set_warning(librdf_parser* parser, void *user_data, void (*warning_fn)(void *user_data, const char *msg, ...)); REDLAND_API librdf_stream* librdf_parser_parse_counted_string_as_stream(librdf_parser* parser, const unsigned char *string, size_t length, librdf_uri* base_uri); REDLAND_API int librdf_parser_parse_counted_string_into_model(librdf_parser* parser, const unsigned char *string, size_t length, librdf_uri* base_uri, librdf_model* model); REDLAND_API void librdf_parser_set_uri_filter(librdf_parser* parser, librdf_uri_filter_func filter, void* user_data); REDLAND_API librdf_uri_filter_func librdf_parser_get_uri_filter(librdf_parser* parser, void** user_data_p); /** * LIBRDF_PARSER_FEATURE_ERROR_COUNT: * * Parser feature URI string for getting the error count of the last parse. */ #define LIBRDF_PARSER_FEATURE_ERROR_COUNT "http://feature.librdf.org/parser-error-count" /** * LIBRDF_PARSER_FEATURE_WARNING_COUNT: * * Parser feature URI string for getting the warning count of the last parse. */ #define LIBRDF_PARSER_FEATURE_WARNING_COUNT "http://feature.librdf.org/parser-warning-count" REDLAND_API librdf_node* librdf_parser_get_feature(librdf_parser* parser, librdf_uri *feature); REDLAND_API int librdf_parser_set_feature(librdf_parser* parser, librdf_uri* feature, librdf_node* value); REDLAND_API char* librdf_parser_get_accept_header(librdf_parser* parser); REDLAND_API REDLAND_DEPRECATED const char* librdf_parser_guess_name(const char *mime_type, const unsigned char *buffer, const unsigned char *identifier); REDLAND_API const char* librdf_parser_guess_name2(librdf_world* world, const char *mime_type, const unsigned char *buffer, const unsigned char *identifier); REDLAND_API const char* librdf_parser_get_namespaces_seen_prefix(librdf_parser* parser, int offset); REDLAND_API librdf_uri* librdf_parser_get_namespaces_seen_uri(librdf_parser* parser, int offset); REDLAND_API int librdf_parser_get_namespaces_seen_count(librdf_parser* parser); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_raptor_internal.h0000644000175000017500000000225311541510160015124 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_raptor_internal.h - librdf Raptor integration internals * * Copyright (C) 2008, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_RAPTOR_INTERNAL_H #define LIBRDF_RAPTOR_INTERNAL_H #ifdef __cplusplus extern "C" { #endif int librdf_init_raptor(librdf_world* world); void librdf_finish_raptor(librdf_world* world); int librdf_raptor_free_bnode_hash(librdf_world* world); int librdf_raptor_reset_bnode_hash(librdf_world* world); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_uri_internal.h0000644000175000017500000000321311336565507014432 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_uri_internal.h - Internal RDF URI definitions * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_URI_INTERNAL_H #define LIBRDF_URI_INTERNAL_H #ifdef __cplusplus extern "C" { #endif #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 struct librdf_uri_s { librdf_world *world; unsigned char *string; int string_length; /* useful for fast comparisons (that fail) */ int usage; int max_usage; }; #else struct librdf_uri_s { librdf_world *world; unsigned char *string; int string_length; /* useful for fast comparisons (that fail) */ int usage; }; #endif /* class methods */ void librdf_init_uri(librdf_world *world); void librdf_finish_uri(librdf_world *world); /* exported public in error but never usable */ librdf_digest* librdf_uri_get_digest (librdf_world *world, librdf_uri *uri); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_uri.c0000644000175000017500000004043711772470733012542 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_uri.c - RDF URI interface * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include /* for isalnum */ #ifdef WITH_THREADS #include #endif #ifdef HAVE_STDLIB_H #include #endif #include #ifndef STANDALONE /* class methods */ /** * librdf_init_uri: * @world: redland world object * * INTERNAL - Initialise the uri module. * **/ void librdf_init_uri(librdf_world *world) { } /** * librdf_finish_uri: * @world: redland world object * * INTERNAL - Terminate the uri module. * **/ void librdf_finish_uri(librdf_world *world) { } /** * librdf_new_uri2: * @world: redland world object * @uri_string: URI in string form * @length: length of string * * Constructor - create a new #librdf_uri object from a counted URI string. * * A new URI is constructed from a copy of the string. If the string * is a NULL pointer or 0 length or empty (first byte is 0) then the * result is NULL. * * Return value: a new #librdf_uri object or NULL on failure **/ librdf_uri* librdf_new_uri2(librdf_world *world, const unsigned char *uri_string, size_t length) { return raptor_new_uri_from_counted_string(world->raptor_world_ptr, uri_string, length); } /** * librdf_new_uri: * @world: redland world object * @uri_string: URI in string form * * Constructor - create a new #librdf_uri object from a URI string. * * A new URI is constructed from a copy of the string. If the * string is a NULL pointer or empty (0 length) then the result is NULL. * * Return value: a new #librdf_uri object or NULL on failure **/ librdf_uri* librdf_new_uri(librdf_world *world, const unsigned char *uri_string) { librdf_world_open(world); if(!uri_string || !*uri_string) return NULL; return librdf_new_uri2(world, uri_string, strlen((const char*)uri_string)); } /** * librdf_new_uri_from_uri: * @old_uri: #librdf_uri object * * Copy constructor - create a new librdf_uri object from an existing librdf_uri object. * * Return value: a new #librdf_uri object or NULL on failure **/ librdf_uri* librdf_new_uri_from_uri (librdf_uri* old_uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(old_uri, librdf_uri, NULL); return raptor_uri_copy(old_uri); } /** * librdf_new_uri_from_uri_local_name: * @old_uri: #librdf_uri object * @local_name: local name to append to URI * * Copy constructor - create a new librdf_uri object from an existing librdf_uri object and a local name. * * Return value: a new #librdf_uri object or NULL on failure **/ librdf_uri* librdf_new_uri_from_uri_local_name (librdf_uri* old_uri, const unsigned char *local_name) { return raptor_new_uri_from_uri_local_name(raptor_uri_get_world(old_uri), old_uri, local_name); } /** * librdf_new_uri_normalised_to_base: * @uri_string: URI in string form * @source_uri: source URI to remove * @base_uri: base URI to add * * Constructor - create a new #librdf_uri object from a URI string stripped of the source URI, made relative to the base URI. * * Return value: a new #librdf_uri object or NULL on failure **/ librdf_uri* librdf_new_uri_normalised_to_base(const unsigned char *uri_string, librdf_uri* source_uri, librdf_uri* base_uri) { size_t uri_string_len; size_t len; unsigned char *new_uri_string; librdf_uri *new_uri; unsigned char* source_uri_string; size_t source_uri_string_length; unsigned char* base_uri_string; size_t base_uri_string_length; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(source_uri, librdf_uri, NULL); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(base_uri, librdf_uri, NULL); if(!uri_string) return NULL; /* empty URI - easy, just make from base_uri */ if(!*uri_string && base_uri) { return raptor_uri_copy(base_uri); } source_uri_string = librdf_uri_as_counted_string(source_uri, &source_uri_string_length); base_uri_string = librdf_uri_as_counted_string(base_uri, &base_uri_string_length); /* not a fragment, and no match - easy */ if(*uri_string != '#' && strncmp((const char*)uri_string, (const char*)source_uri_string, source_uri_string_length)) { raptor_world* rworld = raptor_uri_get_world(base_uri); return raptor_new_uri(rworld, uri_string); } /* darn - is a fragment or matches, is a prefix of the source URI */ /* move uri_string pointer to first non-matching char * unless a fragment, when all of the uri_string will * be appended */ if(*uri_string != '#') uri_string += source_uri_string_length; /* size of remaining bytes to copy from uri_string */ uri_string_len = strlen((const char*)uri_string); /* total bytes */ len = uri_string_len + 1 + base_uri_string_length; new_uri_string = LIBRDF_MALLOC(unsigned char*, len); if(!new_uri_string) return NULL; strncpy((char*)new_uri_string, (const char*)base_uri_string, base_uri_string_length); /* strcpy not strncpy since I want a \0 on the end */ strcpy((char*)new_uri_string + base_uri_string_length, (const char*)uri_string); new_uri = raptor_new_uri(raptor_uri_get_world(source_uri), new_uri_string); LIBRDF_FREE(char*, new_uri_string); /* always free this even on failure */ return new_uri; /* new URI or NULL from librdf_new_uri failure */ } /** * librdf_new_uri_relative_to_base: * @base_uri: absolute base URI * @uri_string: relative URI string * * Constructor - create a new #librdf_uri object from a URI string relative to a base URI. * * An empty uri_string or NULL is equivalent to * librdf_new_uri_from_uri(base_uri) * * Return value: a new #librdf_uri object or NULL on failure **/ librdf_uri* librdf_new_uri_relative_to_base(librdf_uri* base_uri, const unsigned char *uri_string) { return raptor_new_uri_relative_to_base(raptor_uri_get_world(base_uri), base_uri, uri_string); } /** * librdf_new_uri_from_filename: * @world: Redland #librdf_world object * @filename: filename * * Constructor - create a new #librdf_uri object from a filename. * * Return value: a new #librdf_uri object or NULL on failure **/ librdf_uri* librdf_new_uri_from_filename(librdf_world* world, const char *filename) { librdf_uri* new_uri; unsigned char *uri_string; librdf_world_open(world); if(!filename) return NULL; uri_string=raptor_uri_filename_to_uri_string(filename); if(!uri_string) return NULL; new_uri=librdf_new_uri(world, uri_string); raptor_free_memory(uri_string); return new_uri; } /** * librdf_free_uri: * @uri: #librdf_uri object * * Destructor - destroy a #librdf_uri object. * **/ void librdf_free_uri(librdf_uri* uri) { if(!uri) return; raptor_free_uri(uri); } /** * librdf_uri_as_string: * @uri: #librdf_uri object * * Get a pointer to the string representation of the URI. * * Returns a shared pointer to the URI string representation. * Note: does not allocate a new string so the caller must not free it. * * Return value: string representation of URI **/ unsigned char* librdf_uri_as_string (librdf_uri *uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, NULL); return raptor_uri_as_string(uri); } /** * librdf_uri_as_counted_string: * @uri: #librdf_uri object * @len_p: pointer to location to store length * * Get a pointer to the string representation of the URI with length. * * Returns a shared pointer to the URI string representation. * Note: does not allocate a new string so the caller must not free it. * * Return value: string representation of URI **/ unsigned char* librdf_uri_as_counted_string(librdf_uri *uri, size_t* len_p) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, NULL); return raptor_uri_as_counted_string(uri, len_p); } /** * librdf_uri_get_digest: * @world: #librdf_world object * @uri: #librdf_uri object * * Get a digest for the URI. * * Generates a digest object for the URI. The digest factory used is * determined at class initialisation time by librdf_init_uri(). * * Return value: new #librdf_digest object or NULL on failure. **/ librdf_digest* librdf_uri_get_digest(librdf_world* world, librdf_uri* uri) { librdf_digest* d; unsigned char *str; size_t len; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, NULL); d = librdf_new_digest_from_factory(world, world->digest_factory); if(!d) return NULL; str = librdf_uri_as_counted_string(uri, &len); librdf_digest_update(d, str, len); librdf_digest_final(d); return d; } /** * librdf_uri_print: * @uri: #librdf_uri object * @fh: file handle * * Print the URI to the given file handle. * **/ void librdf_uri_print (librdf_uri* uri, FILE *fh) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN(uri, librdf_uri); fputs((const char*)librdf_uri_as_string(uri), fh); } /** * librdf_uri_to_string: * @uri: #librdf_uri object * * Format the URI as a string. * * Note: this method allocates a new string since this is a _to_ method * and the caller must free the resulting memory. * * Return value: string representation of the URI or NULL on failure **/ unsigned char* librdf_uri_to_string (librdf_uri* uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, NULL); return librdf_uri_to_counted_string(uri, NULL); } /** * librdf_uri_to_counted_string: * @uri: #librdf_uri object * @len_p: pointer to location to store length * * Format the URI as a counted string. * * Note: this method allocates a new string since this is a _to_ method * and the caller must free the resulting memory. * * Return value: string representation of the URI or NULL on failure **/ unsigned char* librdf_uri_to_counted_string (librdf_uri* uri, size_t* len_p) { return raptor_uri_to_counted_string(uri, len_p); } /** * librdf_uri_equals: * @first_uri: #librdf_uri object 1 * @second_uri: #librdf_uri object 2 * * Compare two librdf_uri objects for equality. * * Return value: non 0 if the objects are equal **/ int librdf_uri_equals(librdf_uri* first_uri, librdf_uri* second_uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(first_uri, librdf_uri, 0); LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(second_uri, librdf_uri, 0); return raptor_uri_equals(first_uri, second_uri); } /** * librdf_uri_is_file_uri: * @uri: #librdf_uri object * * Test if a URI points to a filename. * * Return value: Non zero if the URI points to a file **/ int librdf_uri_is_file_uri(librdf_uri* uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, 1); return raptor_uri_uri_string_is_file_uri(librdf_uri_as_string(uri)); } /** * librdf_uri_to_filename: * @uri: #librdf_uri object * * Return pointer to filename of URI. * * Returns a pointer to a newly allocated buffer that * the caller must free. This will fail if the URI * is not a file: URI. This can be checked with #librdf_uri_is_file_uri * * Return value: pointer to filename or NULL on failure **/ const char* librdf_uri_to_filename(librdf_uri* uri) { LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, NULL); return raptor_uri_uri_string_to_filename(librdf_uri_as_string(uri)); } /** * librdf_uri_compare: * @uri1: #librdf_uri object 1 or NULL * @uri2: #librdf_uri object 2 or NULL * * Compare two librdf_uri objects lexicographically. * * A NULL URI is always less than (never equal to) a non-NULL URI. * * Return value: <0 if @uri1 is less than @uri2, 0 if equal, >0 if @uri1 is greater than @uri2 **/ int librdf_uri_compare(librdf_uri* uri1, librdf_uri* uri2) { return raptor_uri_compare(uri1, uri2); } #endif /* TEST CODE */ #ifdef STANDALONE /* one more prototype */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { const unsigned char *hp_string=(const unsigned char*)"http://purl.org/net/dajobe/"; librdf_uri *uri1, *uri2, *uri3, *uri4, *uri5, *uri6, *uri7, *uri8, *uri9; librdf_digest *d; const char *program=librdf_basename((const char*)argv[0]); const char *file_string="/big/long/directory/file"; const unsigned char *file_uri_string=(const unsigned char*)"file:///big/long/directory/file"; const unsigned char *uri_string=(const unsigned char*)"http://example.com/big/long/directory/blah#frag"; const unsigned char *relative_uri_string1=(const unsigned char*)"#foo"; const unsigned char *relative_uri_string2=(const unsigned char*)"bar"; librdf_world *world; world=librdf_new_world(); librdf_world_open(world); fprintf(stderr, "%s: Creating new URI from string\n", program); uri1=librdf_new_uri(world, hp_string); if(!uri1) { fprintf(stderr, "%s: Failed to create URI from string '%s'\n", program, hp_string); return(1); } fprintf(stderr, "%s: Home page URI is ", program); librdf_uri_print(uri1, stderr); fputs("\n", stderr); fprintf(stderr, "%s: Creating URI from URI\n", program); uri2=librdf_new_uri_from_uri(uri1); if(!uri2) { fprintf(stderr, "%s: Failed to create new URI from old one\n", program); return(1); } fprintf(stderr, "%s: New URI is ", program); librdf_uri_print(uri2, stderr); fputs("\n", stderr); fprintf(stderr, "%s: Getting digest for URI\n", program); d = librdf_uri_get_digest(world, uri2); if(!d) { fprintf(stderr, "%s: Failed to get digest for URI %s\n", program, librdf_uri_as_string(uri2)); return(1); } fprintf(stderr, "%s: Digest is: ", program); librdf_digest_print(d, stderr); fputs("\n", stderr); librdf_free_digest(d); uri3=librdf_new_uri(world, (const unsigned char*)"file:/big/long/directory/"); uri4=librdf_new_uri(world, (const unsigned char*)"http://somewhere/dir/"); fprintf(stderr, "%s: Source URI is ", program); librdf_uri_print(uri3, stderr); fputs("\n", stderr); fprintf(stderr, "%s: Base URI is ", program); librdf_uri_print(uri4, stderr); fputs("\n", stderr); fprintf(stderr, "%s: URI string is '%s'\n", program, uri_string); uri5=librdf_new_uri_normalised_to_base(uri_string, uri3, uri4); fprintf(stderr, "%s: Normalised URI is ", program); librdf_uri_print(uri5, stderr); fputs("\n", stderr); uri6=librdf_new_uri_relative_to_base(uri5, relative_uri_string1); fprintf(stderr, "%s: URI + Relative URI %s gives ", program, relative_uri_string1); librdf_uri_print(uri6, stderr); fputs("\n", stderr); uri7=librdf_new_uri_relative_to_base(uri5, relative_uri_string2); fprintf(stderr, "%s: URI + Relative URI %s gives ", program, relative_uri_string2); librdf_uri_print(uri7, stderr); fputs("\n", stderr); uri8=librdf_new_uri_from_filename(world, file_string); uri9=librdf_new_uri(world, file_uri_string); if(!librdf_uri_equals(uri8, uri9)) { fprintf(stderr, "%s: URI string from filename %s returned %s, expected %s\n", program, file_string, librdf_uri_as_string(uri8), file_uri_string); return(1); } fprintf(stderr, "%s: Freeing URIs\n", program); librdf_free_uri(uri1); librdf_free_uri(uri2); librdf_free_uri(uri3); librdf_free_uri(uri4); librdf_free_uri(uri5); librdf_free_uri(uri6); librdf_free_uri(uri7); librdf_free_uri(uri8); librdf_free_uri(uri9); librdf_free_world(world); /* keep gcc -Wall happy */ return(0); } #endif redland-1.0.17/src/rdf_statement.h0000644000175000017500000001247211655006762013747 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_statement.h - RDF Statement definition * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_STATEMENT_H #define LIBRDF_STATEMENT_H #ifdef LIBRDF_INTERNAL #include #endif #ifdef __cplusplus extern "C" { #endif /** * librdf_statement_part: * @LIBRDF_STATEMENT_SUBJECT: Subject of a statement. * @LIBRDF_STATEMENT_PREDICATE: Predicate of a statement. * @LIBRDF_STATEMENT_OBJECT: Object of a statement. * @LIBRDF_STATEMENT_ALL: All parts of a statement. * * Flags that are or-ed to indicate statement parts. * * Used in fields arguments to methods such as the public * librdf_statement_encode_parts() librdf_statement_decode_parts() * librdf_new_stream_from_node_iterator(). */ typedef enum { LIBRDF_STATEMENT_SUBJECT = 1 << 0, LIBRDF_STATEMENT_PREDICATE = 1 << 1, LIBRDF_STATEMENT_OBJECT = 1 << 2, /* must be a combination of all of the above */ LIBRDF_STATEMENT_ALL = (LIBRDF_STATEMENT_SUBJECT| LIBRDF_STATEMENT_PREDICATE| LIBRDF_STATEMENT_OBJECT) } librdf_statement_part; /* initialising functions / constructors */ /* Create a new Statement. */ REDLAND_API librdf_statement* librdf_new_statement(librdf_world* world); /* Create a new Statement from an existing Statement - DEEP CLONE */ REDLAND_API librdf_statement* librdf_new_statement_from_statement(librdf_statement* statement); /* Create a new Statement from an existing Statement - SHALLOW CLONE */ REDLAND_API librdf_statement* librdf_new_statement_from_statement2(librdf_statement* statement); /* Create a new Statement from existing Nodes */ REDLAND_API librdf_statement* librdf_new_statement_from_nodes(librdf_world *world, librdf_node* subject, librdf_node* predicate, librdf_node* object); /* Init a statically allocated statement */ REDLAND_API void librdf_statement_init(librdf_world *world, librdf_statement *statement); /* Clear a statically allocated statement */ REDLAND_API void librdf_statement_clear(librdf_statement *statement); /* destructor */ REDLAND_API void librdf_free_statement(librdf_statement* statement); /* functions / methods */ REDLAND_API librdf_node* librdf_statement_get_subject(librdf_statement *statement); REDLAND_API void librdf_statement_set_subject(librdf_statement *statement, librdf_node *node); REDLAND_API librdf_node* librdf_statement_get_predicate(librdf_statement *statement); REDLAND_API void librdf_statement_set_predicate(librdf_statement *statement, librdf_node *node); REDLAND_API librdf_node* librdf_statement_get_object(librdf_statement *statement); REDLAND_API void librdf_statement_set_object(librdf_statement *statement, librdf_node *node); /* if statement has all fields */ REDLAND_API int librdf_statement_is_complete(librdf_statement *statement); /* convert to a string */ REDLAND_API REDLAND_DEPRECATED unsigned char *librdf_statement_to_string(librdf_statement *statement); /* print it prettily */ REDLAND_API int librdf_statement_write(librdf_statement *statement, raptor_iostream *iostr); REDLAND_API void librdf_statement_print(librdf_statement *statement, FILE *fh); /* compare two statements */ REDLAND_API int librdf_statement_equals(librdf_statement* statement1, librdf_statement* statement2); /* match statement against one with partial content */ REDLAND_API int librdf_statement_match(librdf_statement* statement, librdf_statement* partial_statement); /* serialising/deserialising */ REDLAND_API REDLAND_DEPRECATED size_t librdf_statement_encode(librdf_statement* statement, unsigned char *buffer, size_t length); REDLAND_API size_t librdf_statement_encode2(librdf_world* world, librdf_statement* statement, unsigned char *buffer, size_t length); REDLAND_API REDLAND_DEPRECATED size_t librdf_statement_encode_parts(librdf_statement* statement, librdf_node* context_node, unsigned char *buffer, size_t length, librdf_statement_part fields); REDLAND_API size_t librdf_statement_encode_parts2(librdf_world* world, librdf_statement* statement, librdf_node* context_node, unsigned char *buffer, size_t length, librdf_statement_part fields); REDLAND_API REDLAND_DEPRECATED size_t librdf_statement_decode(librdf_statement* statement, unsigned char *buffer, size_t length); REDLAND_API size_t librdf_statement_decode2(librdf_world* world, librdf_statement* statement, librdf_node** context_node, unsigned char *buffer, size_t length); REDLAND_API REDLAND_DEPRECATED size_t librdf_statement_decode_parts(librdf_statement* statement, librdf_node** context_node, unsigned char *buffer, size_t length); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_files.h0000644000175000017500000000213411167024223013025 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_files.h - RDF File and directory handling interfaces * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifndef LIBRDF_FILES_H #define LIBRDF_FILES_H #ifdef __cplusplus extern "C" { #endif REDLAND_DEPRECATED char* librdf_files_temporary_file_name(void); #ifdef __cplusplus } #endif #endif redland-1.0.17/src/rdf_storage_virtuoso.c0000644000175000017500000027064512241001460015342 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdf_storage_virtuoso.c - RDF Storage using Virtuoso interface definition * * Copyright (C) 2008, Openlink Software http://www.openlinksw.com/ * * Based in part on rdf_storage_mysql * * Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License(LGPL) V2.1 or any newer version * 2. GNU General Public License(GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #include #include #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #include #include #include #if defined(__APPLE__) /* Ignore /usr/include/sql.h deprecated warnings on OSX 10.8 */ #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif /* Virtuoso specific */ #include #include /*#define VIRTUOSO_STORAGE_DEBUG 1*/ #include static int librdf_storage_virtuoso_init(librdf_storage* storage, const char *name, librdf_hash* options); static void librdf_storage_virtuoso_terminate(librdf_storage* storage); static int librdf_storage_virtuoso_open(librdf_storage* storage, librdf_model* model); static int librdf_storage_virtuoso_close(librdf_storage* storage); static int librdf_storage_virtuoso_sync(librdf_storage* storage); static int librdf_storage_virtuoso_size(librdf_storage* storage); static int librdf_storage_virtuoso_add_statement(librdf_storage* storage,librdf_statement* statement); static int librdf_storage_virtuoso_add_statements(librdf_storage* storage, librdf_stream* statement_stream); static int librdf_storage_virtuoso_remove_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_virtuoso_contains_statement(librdf_storage* storage, librdf_statement* statement); static int librdf_storage_virtuoso_context_contains_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_virtuoso_start_bulk(librdf_storage* storage); static int librdf_storage_virtuoso_stop_bulk(librdf_storage* storage); static librdf_stream* librdf_storage_virtuoso_serialise(librdf_storage* storage); static librdf_stream* librdf_storage_virtuoso_find_statements(librdf_storage* storage, librdf_statement* statement); static librdf_stream* librdf_storage_virtuoso_find_statements_with_options(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options); /* context functions */ static int librdf_storage_virtuoso_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_virtuoso_context_add_statements(librdf_storage* storage, librdf_node* context_node, librdf_stream* statement_stream); static int librdf_storage_virtuoso_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static int librdf_storage_virtuoso_context_remove_statements(librdf_storage* storage, librdf_node* context_node); static librdf_stream* librdf_storage_virtuoso_context_serialise(librdf_storage* storage, librdf_node* context_node); static librdf_stream* librdf_storage_virtuoso_find_statements_in_context(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node); static librdf_iterator* librdf_storage_virtuoso_get_contexts(librdf_storage* storage); static void librdf_storage_virtuoso_register_factory(librdf_storage_factory *factory); static librdf_node* librdf_storage_virtuoso_get_feature(librdf_storage* storage, librdf_uri* feature); static int librdf_storage_virtuoso_transaction_start(librdf_storage* storage); static int librdf_storage_virtuoso_transaction_start_with_handle(librdf_storage* storage, void* handle); static int librdf_storage_virtuoso_transaction_commit(librdf_storage* storage); static int librdf_storage_virtuoso_transaction_rollback(librdf_storage* storage); static void* librdf_storage_virtuoso_transaction_get_handle(librdf_storage* storage); static int rdf_virtuoso_ODBC_Errors(const char *where, librdf_world *world, librdf_storage_virtuoso_connection *handle); static int librdf_storage_virtuoso_context_add_statement_helper(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement); static void librdf_storage_virtuoso_release_handle(librdf_storage* storage, librdf_storage_virtuoso_connection *handle); #ifdef MODULAR_LIBRDF void librdf_storage_module_register_factory(librdf_world *world); #endif /* * Report any pending Virtuoso SQL errors to redland error logging mechanism */ static int rdf_virtuoso_ODBC_Errors(const char *where, librdf_world *world, librdf_storage_virtuoso_connection* handle) { SQLCHAR buf[512]; SQLCHAR sqlstate[15]; while(SQLError(handle->henv, handle->hdbc, handle->hstmt, sqlstate, NULL, buf, sizeof(buf), NULL) == SQL_SUCCESS) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "%s ||%s, SQLSTATE=%s\n", where, buf, sqlstate); #endif librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Virtuoso %s failed [%s] %s", where, sqlstate, buf); } while(SQLError(handle->henv, handle->hdbc, SQL_NULL_HSTMT, sqlstate, NULL, buf, sizeof(buf), NULL) == SQL_SUCCESS) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "%s ||%s, SQLSTATE=%s\n", where, buf, sqlstate); #endif librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Virtuoso %s failed [%s] %s", where, sqlstate, buf); } while(SQLError(handle->henv, SQL_NULL_HDBC, SQL_NULL_HSTMT, sqlstate, NULL, buf, sizeof(buf), NULL) == SQL_SUCCESS) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "%s ||%s, SQLSTATE=%s\n", where, buf, sqlstate); #endif librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Virtuoso %s failed [%s] %s", where, sqlstate, buf); } return -1; } /* * vGetDataCHAR: * @world: redland world * @handle: virtoso storage connection handle * @col: column number * @is_null: pointer to NULL flag to set * * INTERNAL - Get the string value of the given column in current result row * * Return value: string value or NULL on failure or SQL NULL * value. SQL NULLness is distinguished from error by the *is_null * being non-0. */ static char* vGetDataCHAR(librdf_world *world, librdf_storage_virtuoso_connection *handle, int col, int *is_null) { int rc; SQLLEN len; SQLCHAR buf[255]; *is_null = 0; rc = SQLGetData(handle->hstmt, LIBRDF_GOOD_CAST(SQLUSMALLINT, col), SQL_C_CHAR, buf, 0, &len); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLGetData()", world, handle); return NULL; } if(len == SQL_NULL_DATA) { *is_null = 1; return NULL; } else { char *pLongData = NULL; SQLLEN bufsize = len + 4; pLongData = LIBRDF_MALLOC(char*, LIBRDF_GOOD_CAST(size_t, bufsize)); if(pLongData == NULL) { librdf_log(world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Not enough memory to allocate resultset element"); return NULL; } if(len == 0) { pLongData[0]='\0'; } else { rc = SQLGetData(handle->hstmt, col, SQL_C_CHAR, pLongData, bufsize, &len); if(!SQL_SUCCEEDED(rc)) { LIBRDF_FREE(char*, pLongData); rdf_virtuoso_ODBC_Errors("SQLGetData()", world, handle); return NULL; } } return pLongData; } } /* * vGetDataINT: * @world: redland world * @handle: virtoso storage connection handle * @col: column number * @is_null: pointer to NULL flag to set * @val: pointer to store integer value * * INTERNAL - Get the integer value of the given column in current result row * * Return value: 0 on success or < 0 on failure. SQL NULLness is * distinguished from error by the *is_null being non-0. */ static int vGetDataINT(librdf_world *world, librdf_storage_virtuoso_connection *handle, int col, int *is_null, int *val) { int rc; SQLLEN len; *is_null = 0; rc = SQLGetData(handle->hstmt, col, SQL_C_LONG, val, 0, &len); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLGetData()", world, handle); return -1; } if(len == SQL_NULL_DATA) { *is_null = 1; return 0; } return 0; } /* * rdf_lang2string: * @world: redland world * @handle: virtoso storage connection handle * @key: language ID key * * INTERNAL - turn an rdf_language ID into a language string * * Return value: language string or NULL on failure. */ static char* rdf_lang2string(librdf_world *world, librdf_storage_virtuoso_connection *handle, short key) { char *val = NULL; char query[]="select RL_ID from DB.DBA.RDF_LANGUAGE where RL_TWOBYTE=?"; int rc; HSTMT hstmt; SQLLEN m_ind = 0; librdf_hash_datum hd_key, hd_value; librdf_hash_datum* old_value; hd_key.data = &key; hd_key.size = sizeof(short); old_value = librdf_hash_get_one(handle->h_lang, &hd_key); if(old_value) val = (char *)old_value->data; if(val) return val; hstmt = handle->hstmt; rc = SQLAllocHandle(SQL_HANDLE_STMT, handle->hdbc, &handle->hstmt); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLAllocHandle(hstmt)", world, handle); handle->hstmt = hstmt; return NULL; } rc = SQLBindParameter(handle->hstmt, 1, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_SMALLINT, 0, 0, &key, 0, &m_ind); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLBindParameter()", world, handle); goto end; } rc = SQLExecDirect(handle->hstmt,(UCHAR *) query, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", world, handle); goto end; } rc = SQLFetch(handle->hstmt); if(SQL_SUCCEEDED(rc)) { int is_null; val = vGetDataCHAR(world, handle, 1, &is_null); if(!val || is_null) goto end; hd_value.data = val; hd_value.size = strlen(val); librdf_hash_put(handle->h_lang, &hd_key, &hd_value); } end: SQLCloseCursor(handle->hstmt); SQLFreeHandle(SQL_HANDLE_STMT, handle->hstmt); handle->hstmt = hstmt; return val; } /* * rdf_type2string: * @world: redland world * @handle: virtoso storage connection handle * @key: type ID key * * INTERNAL - turn an rdf_type ID into a URI string * * Return value: type URI string or NULL on failure. */ static char* rdf_type2string(librdf_world *world, librdf_storage_virtuoso_connection *handle, short key) { char *val = NULL; char query[] = "select RDT_QNAME from DB.DBA.RDF_DATATYPE where RDT_TWOBYTE=?"; int rc; HSTMT hstmt; SQLLEN m_ind = 0; librdf_hash_datum hd_key, hd_value; librdf_hash_datum* old_value; hd_key.data = &key; hd_key.size = sizeof(short); old_value = librdf_hash_get_one(handle->h_type,&hd_key); if(old_value) val = (char*)old_value->data; if(val) return val; hstmt = handle->hstmt; rc = SQLAllocHandle(SQL_HANDLE_STMT, handle->hdbc, &handle->hstmt); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLAllocHandle(hstmt)", world, handle); handle->hstmt = hstmt; return NULL; } rc = SQLBindParameter(handle->hstmt, 1, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_SMALLINT, 0, 0, &key, 0, &m_ind); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLBindParameter()", world, handle); goto end; } rc = SQLExecDirect(handle->hstmt,(UCHAR *) query, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", world, handle); goto end; } rc = SQLFetch(handle->hstmt); if(SQL_SUCCEEDED(rc)) { int is_null; val = vGetDataCHAR(world, handle, 1, &is_null); if(!val || is_null) goto end; hd_value.data = val; hd_value.size = strlen(val); librdf_hash_put(handle->h_type, &hd_key, &hd_value); } end: SQLCloseCursor(handle->hstmt); SQLFreeHandle(SQL_HANDLE_STMT, handle->hstmt); handle->hstmt = hstmt; return val; } /* * rdf2node: * @storage: storage object * @handle: virtoso storage connection handle * @col: column * @data: data at column * * INTERNAL - turn result data from a column cell into an #librdf_node * * Return value: node or NULL on failure. */ static librdf_node* rdf2node(librdf_storage *storage, librdf_storage_virtuoso_connection *handle, int col, char *data) { librdf_node *node = NULL; #if 0 #ifdef SQL_DESC_COL_LITERAL_LANG SQLCHAR langbuf[100]; SQLINTEGER lang_len = 0; #endif #ifdef SQL_DESC_COL_LITERAL_TYPE SQLCHAR typebuff[100]; SQLINTEGER type_len = 0; #endif #else short l_lang; short l_type; #endif SQLHDESC hdesc = NULL; librdf_uri *u_type = NULL; int dvtype = 0; int dv_dt_type = 0; int flag = 0; int rc; /* Get row descriptor for this statement */ rc = SQLGetStmtAttr(handle->hstmt, SQL_ATTR_IMP_ROW_DESC, &hdesc, SQL_IS_POINTER, NULL); if(!SQL_SUCCEEDED(rc)) return NULL; /* Get datatype of column 'col' in row */ rc = SQLGetDescField(hdesc, col, SQL_DESC_COL_DV_TYPE, &dvtype, SQL_IS_INTEGER, NULL); if(!SQL_SUCCEEDED(rc)) return NULL; /* Try to get timestamp / date / time / datetime value for column 'col' */ rc = SQLGetDescField(hdesc, col, SQL_DESC_COL_DT_DT_TYPE, &dv_dt_type, SQL_IS_INTEGER, NULL); if(!SQL_SUCCEEDED(rc)) return NULL; /* FIXME Should be converted to these: * SQL_DESC_COL_LITERAL_LANG and SQL_DESC_COL_LITERAL_TYPE * * The docs says about SQL_DESC_COL_LITERAL_ATTR: * "This call is deprecated in favor of using the * SQL_DESC_COL_LITERAL_LANG and SQL_DESC_LITERAL_TYPE options * of SQLGetDescField which caches these lookups to speed up * describe operations." * -- http://docs.openlinksw.com/virtuoso/odbcimplementation.html * * instead of doing the lookup here then rdf_type2string() and * rdf_lang2string() on the decoded flags. */ #if 0 #ifdef SQL_DESC_COL_LITERAL_LANG rc = SQLGetDescField(hdesc, colNum, SQL_DESC_COL_LITERAL_LANG, langbuf, sizeof(langbuf), &lang_len); if(!SQL_SUCCEEDED(rc)) return NULL; #endif #ifdef SQL_DESC_COL_LITERAL_TYPE rc = SQLGetDescField(hdesc, colNum, SQL_DESC_COL_LITERAL_TYPE, typebuf, sizeof(typebuff), &type_len); if(!SQL_SUCCEEDED(rc)) return NULL; #endif #else /* Get RDF literal attributes flags */ rc = SQLGetDescField(hdesc, col, SQL_DESC_COL_LITERAL_ATTR, &flag, SQL_IS_INTEGER, NULL); if(!SQL_SUCCEEDED(rc)) return NULL; /* literal language ID (16 bits) */ l_lang = (short)((flag >> 16) & 0xFFFF); /* literal datatype ID (16 bits) */ l_type = (short)(flag & 0xFFFF); #endif rc = SQLGetDescField(hdesc, col, SQL_DESC_COL_BOX_FLAGS, &flag, SQL_IS_INTEGER, NULL); if(!SQL_SUCCEEDED(rc)) return NULL; switch(dvtype) { case VIRTUOSO_DV_STRING: if(flag) { if(!strncmp((char*)data, "_:", 2)) { node = librdf_new_node_from_blank_identifier(storage->world, (const unsigned char*)data + 2); } else { node = librdf_new_node_from_uri_string(storage->world, (const unsigned char*)data); } } else { if(!strncmp((char*)data, "nodeID://", 9)) { node = librdf_new_node_from_blank_identifier(storage->world, (const unsigned char*)data + 9); } else { node = librdf_new_node_from_literal(storage->world, (const unsigned char *)data, NULL, 0); } } break; case VIRTUOSO_DV_RDF: if(1) { char *s_type = rdf_type2string(storage->world, handle, l_type); char *s_lang = rdf_lang2string(storage->world, handle, l_lang); if(s_type) u_type = librdf_new_uri(storage->world,(unsigned char *)s_type); node = librdf_new_node_from_typed_literal(storage->world, (const unsigned char *)data, s_lang, u_type); break; } case VIRTUOSO_DV_LONG_INT: /* integer */ u_type = librdf_new_uri(storage->world, (unsigned char *)"http://www.w3.org/2001/XMLSchema#integer"); node = librdf_new_node_from_typed_literal(storage->world, (const unsigned char *)data, NULL, u_type); break; case VIRTUOSO_DV_SINGLE_FLOAT: /* float */ u_type = librdf_new_uri(storage->world, (unsigned char *)"http://www.w3.org/2001/XMLSchema#float"); node = librdf_new_node_from_typed_literal(storage->world, (const unsigned char *)data, NULL, u_type); break; case VIRTUOSO_DV_DOUBLE_FLOAT: /* double */ u_type = librdf_new_uri(storage->world, (unsigned char *)"http://www.w3.org/2001/XMLSchema#double"); node = librdf_new_node_from_typed_literal(storage->world, (const unsigned char *)data, NULL, u_type); break; case VIRTUOSO_DV_NUMERIC: /* decimal */ u_type = librdf_new_uri(storage->world, (unsigned char *)"http://www.w3.org/2001/XMLSchema#decimal"); node = librdf_new_node_from_typed_literal(storage->world, (const unsigned char *)data, NULL, u_type); break; case VIRTUOSO_DV_TIMESTAMP: /* datetime */ case VIRTUOSO_DV_DATE: case VIRTUOSO_DV_TIME: case VIRTUOSO_DV_DATETIME: switch(dv_dt_type) { case VIRTUOSO_DT_TYPE_DATE: u_type = librdf_new_uri(storage->world, (unsigned char *)"http://www.w3.org/2001/XMLSchema#date"); break; case VIRTUOSO_DT_TYPE_TIME: u_type = librdf_new_uri(storage->world, (unsigned char *)"http://www.w3.org/2001/XMLSchema#time"); break; default: u_type = librdf_new_uri(storage->world, (unsigned char *)"http://www.w3.org/2001/XMLSchema#dateTime"); break; } node = librdf_new_node_from_typed_literal(storage->world, (const unsigned char *)data, NULL, u_type); break; case VIRTUOSO_DV_TIMESTAMP_OBJ: /* ? what is this */ return NULL; break; case VIRTUOSO_DV_IRI_ID: node = librdf_new_node_from_literal(storage->world, (const unsigned char *)data, NULL, 0); break; default: return NULL; /* printf("*unexpected result type %d*", dtp); */ } return node; } static char* librdf_storage_virtuoso_node2string(librdf_storage *storage, librdf_node *node) { librdf_node_type type = librdf_node_get_type(node); size_t nodelen; char *ret = NULL; if(type == LIBRDF_NODE_TYPE_RESOURCE) { /* Get hash */ char *uri = (char*)librdf_uri_as_counted_string(librdf_node_get_uri(node), &nodelen); ret = LIBRDF_MALLOC(char*, nodelen + 3); if(!ret) goto end; strcpy(ret, "<"); strcat(ret, uri); strcat(ret, ">"); } else if(type == LIBRDF_NODE_TYPE_LITERAL) { /* Get hash */ char *value, *datatype = 0; char *lang; librdf_uri *dt; size_t valuelen, langlen = 0, datatypelen = 0; value = (char *)librdf_node_get_literal_value_as_counted_string(node, &valuelen); lang = librdf_node_get_literal_value_language(node); if(lang) langlen = strlen(lang); dt = librdf_node_get_literal_value_datatype_uri(node); if(dt) datatype = (char *)librdf_uri_as_counted_string(dt, &datatypelen); if(datatype) datatypelen = strlen((const char*)datatype); /* Create composite node string for hash generation */ ret = LIBRDF_MALLOC(char*, valuelen + langlen + datatypelen + 8); if(!ret) goto end; strcpy(ret, "\""); strcat(ret,(const char*)value); strcat(ret, "\""); if(lang && strlen(lang)) { strcat(ret, "@"); strcat(ret, lang); } if(datatype) { strcat(ret, "^^<"); strcat(ret,(const char*)datatype); strcat(ret, ">"); } } else if(type == LIBRDF_NODE_TYPE_BLANK) { char *value = (char *)librdf_node_get_blank_identifier(node); ret = LIBRDF_MALLOC(char*, strlen(value) + 5); if(!ret) goto end; #if 1 strcpy(ret, "<_:"); strcat(ret, value); strcat(ret, ">"); #else strcpy(ret, "_:"); strcat(ret, value); #endif } end: return ret; } static char * librdf_storage_virtuoso_icontext2string(librdf_storage *storage, librdf_node *node) { librdf_storage_virtuoso_instance* context; context = (librdf_storage_virtuoso_instance*)storage->instance; if(node) return(char *)librdf_uri_as_string(librdf_node_get_uri(node)); else return context->model_name; } static char * librdf_storage_virtuoso_context2string(librdf_storage *storage, librdf_node *node) { librdf_storage_virtuoso_instance* context; char *ctxt_node = NULL; context = (librdf_storage_virtuoso_instance*)storage->instance; if(node) { ctxt_node = librdf_storage_virtuoso_node2string(storage, node); } else { ctxt_node = LIBRDF_MALLOC(char*, strlen(context->model_name) + 4); if(!ctxt_node) return NULL; sprintf(ctxt_node, "<%s>", context->model_name); } return ctxt_node; } static char * librdf_storage_virtuoso_fcontext2string(librdf_storage *storage, librdf_node *node) { char *ctxt_node = NULL; if(node) { ctxt_node = librdf_storage_virtuoso_node2string(storage, node); } else { ctxt_node = LIBRDF_MALLOC(char*, 5); if(!ctxt_node) return NULL; strcpy(ctxt_node, ""); } return ctxt_node; } /* * librdf_storage_virtuoso_init_connections: * @storage: the storage * * INTERNAL - Initialize Virtuoso connection pool. * * Return value: Non-zero on success. **/ static int librdf_storage_virtuoso_init_connections(librdf_storage* storage) { librdf_storage_virtuoso_instance* context; context = (librdf_storage_virtuoso_instance*)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_init_connections \n"); #endif /* Reset connection pool */ context->connections = NULL; context->connections_count = 0; return 1; } /* * librdf_storage_virtuoso_finish_connections: * @storage: the storage * * INTERNAL - Finish all connections in Virtuoso connection pool and free structures. * * Return value: None. **/ static void librdf_storage_virtuoso_finish_connections(librdf_storage* storage) { librdf_storage_virtuoso_instance* context; librdf_storage_virtuoso_connection *handle; int i; context = (librdf_storage_virtuoso_instance*)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_finish_connections \n"); #endif /* Loop through connections and close */ for(i = 0; i < context->connections_count; i++) { if(VIRTUOSO_CONNECTION_CLOSED != context->connections[i]->status) { #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("virtuoso_close connection handle %p\n", context->connections[i]->handle); #endif handle=context->connections[i]; if(handle->hstmt) { SQLCloseCursor(handle->hstmt); SQLFreeHandle(SQL_HANDLE_STMT, handle->hstmt); } if(handle->hdbc) { SQLDisconnect(handle->hdbc); SQLFreeHandle(SQL_HANDLE_DBC, handle->hdbc); } if(handle->henv) { SQLFreeHandle(SQL_HANDLE_ENV, handle->henv); } } LIBRDF_FREE(librdf_storage_virtuoso_connection*, context->connections[i]); } /* Free structure and reset */ if(context->connections_count) { LIBRDF_FREE(librdf_storage_virtuoso_connection**, context->connections); context->connections = NULL; context->connections_count = 0; } } /* * librdf_storage_virtuoso_get_handle: * @storage: the storage * * INTERNAL - get a connection handle to the Virtuoso server * * This attempts to reuses any existing available pooled connection * otherwise creates a new connection to the server. * * Return value: Non-zero on succes. **/ static librdf_storage_virtuoso_connection * librdf_storage_virtuoso_get_handle(librdf_storage* storage) { librdf_storage_virtuoso_instance* context; librdf_storage_virtuoso_connection* connection= NULL; int i; int rc; short buflen; context = (librdf_storage_virtuoso_instance*)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_connection \n"); #endif if(context->transaction_handle) return context->transaction_handle; /* Look for an open connection handle to return */ for(i = 0; i < context->connections_count; i++) { if(VIRTUOSO_CONNECTION_OPEN == context->connections[i]->status) { context->connections[i]->status = VIRTUOSO_CONNECTION_BUSY; return context->connections[i]; } } /* Look for a closed connection */ for(i = 0; i < context->connections_count && !connection; i++) { if(VIRTUOSO_CONNECTION_CLOSED == context->connections[i]->status) { connection=context->connections[i]; break; } } /* Expand connection pool if no closed connection was found */ if(!connection) { /* Allocate new buffer with two extra slots */ librdf_storage_virtuoso_connection** connections; connections = LIBRDF_CALLOC(librdf_storage_virtuoso_connection**, LIBRDF_GOOD_CAST(size_t, context->connections_count + 2), sizeof(librdf_storage_virtuoso_connection*)); if(!connections) return NULL; connections[context->connections_count] = LIBRDF_CALLOC(librdf_storage_virtuoso_connection*, 1, sizeof(librdf_storage_virtuoso_connection)); if(!connections[context->connections_count]) { LIBRDF_FREE(librdf_storage_virtuoso_connection**, connections); return NULL; } connections[context->connections_count + 1] = LIBRDF_CALLOC(librdf_storage_virtuoso_connection*, 1, sizeof(librdf_storage_virtuoso_connection)); if(!connections[context->connections_count + 1]) { LIBRDF_FREE(librdf_storage_virtuoso_connection*, connections[context->connections_count]); LIBRDF_FREE(librdf_storage_virtuoso_connection**, connections); return NULL; } if(context->connections_count) { /* Copy old buffer to new */ memcpy(connections, context->connections, sizeof(librdf_storage_virtuoso_connection*) * LIBRDF_GOOD_CAST(size_t, context->connections_count)); /* Free old buffer */ LIBRDF_FREE(librdf_storage_virtuoso_connection**, context->connections); } /* Update buffer size and reset new connections */ context->connections_count += 2; connection = connections[context->connections_count - 2]; if(!connection) { LIBRDF_FREE(librdf_storage_virtuoso_connection**, connections); return NULL; } connection->status = VIRTUOSO_CONNECTION_CLOSED; connection->henv = NULL; connection->hdbc = NULL; connection->hstmt = NULL; connections[context->connections_count - 1]->status = VIRTUOSO_CONNECTION_CLOSED; connections[context->connections_count - 1]->henv = NULL; connections[context->connections_count - 1]->hdbc = NULL; connections[context->connections_count - 1]->hstmt = NULL; context->connections = connections; } /* Initialize closed Virtuoso connection handle */ rc = SQLAllocHandle(SQL_HANDLE_ENV, NULL, &connection->henv); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLAllocHandle(henv)", storage->world, connection); goto end; } SQLSetEnvAttr(connection->henv, SQL_ATTR_ODBC_VERSION,(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_UINTEGER); rc = SQLAllocHandle(SQL_HANDLE_DBC, connection->henv, &connection->hdbc); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLAllocHandle(hdbc)", storage->world, connection); goto end; } rc = SQLDriverConnect(connection->hdbc, 0,(UCHAR *) context->conn_str, SQL_NTS, context->outdsn, LIBRDF_VIRTUOSO_CONTEXT_DSN_SIZE, &buflen, SQL_DRIVER_COMPLETE); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLConnect()", storage->world, connection); goto end; } rc = SQLAllocHandle(SQL_HANDLE_STMT, connection->hdbc, &connection->hstmt); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLAllocHandle(hstmt)", storage->world, connection); goto end; } /* Update status and return */ connection->h_lang = context->h_lang; connection->h_type = context->h_type; connection->v_release_connection = librdf_storage_virtuoso_release_handle; connection->v_rdf2node = rdf2node; connection->v_GetDataCHAR = vGetDataCHAR; connection->v_GetDataINT = vGetDataINT; connection->status = VIRTUOSO_CONNECTION_BUSY; return connection; end: if(connection) { if(connection->hstmt) { SQLFreeHandle(SQL_HANDLE_STMT, connection->hstmt); connection->hstmt = NULL; } if(connection->hdbc) { SQLDisconnect(connection->hdbc); SQLFreeHandle(SQL_HANDLE_DBC, connection->hdbc); connection->hdbc = NULL; } if(connection->henv) { SQLFreeHandle(SQL_HANDLE_ENV, connection->henv); connection->henv = NULL; } } return NULL; } /* * librdf_storage_virtuoso_release_handle; * @storage: the storage * @handle: the Viruoso handle to release * * INTERNAL - Release a connection handle to Virtuoso server back to the pool * * Return value: None. **/ static void librdf_storage_virtuoso_release_handle(librdf_storage* storage, librdf_storage_virtuoso_connection *handle) { librdf_storage_virtuoso_instance* context; int i; context = (librdf_storage_virtuoso_instance*)storage->instance; if(handle == context->transaction_handle) return; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_release_handle %p \n", handle); #endif /* Look for busy connection handle to drop */ for(i = 0; i < context->connections_count; i++) { if(VIRTUOSO_CONNECTION_BUSY == context->connections[i]->status && context->connections[i] == handle) { context->connections[i]->status = VIRTUOSO_CONNECTION_OPEN; return; } } librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Unable to find busy connection(in pool of %i connections)", context->connections_count); } /* * librdf_storage_virtuoso_init: * @storage: the storage * @name: model name * @options: dsn, user, password, host, database, [bulk]. * * INTERNAL - Create connection to database. * * The boolean bulk option can be set to true if optimized inserts(table * locks and temporary key disabling) is wanted. Note that this will block * all other access, and requires table locking and alter table privileges. * * Return value: Non-zero on failure. **/ static int librdf_storage_virtuoso_init(librdf_storage* storage, const char *name, librdf_hash* options) { librdf_storage_virtuoso_instance* context; size_t len = 0; context = LIBRDF_CALLOC(librdf_storage_virtuoso_instance*, 1, sizeof(*context)); storage->instance = context; /* Must have connection parameters passed as options */ if(!options) return 1; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_init \n"); #endif context->connections = NULL; context->connections_count = 0; context->storage = storage; context->password = librdf_hash_get_del(options, "password"); context->user = librdf_hash_get_del(options, "user"); context->dsn = librdf_hash_get_del(options, "dsn"); context->host = librdf_hash_get_del(options, "host"); context->database = librdf_hash_get_del(options, "database"); context->charset = librdf_hash_get_del(options, "charset"); context->h_lang = librdf_new_hash(storage->world, NULL); if(!context->h_lang) LIBRDF_FATAL1(storage->world, LIBRDF_FROM_STORAGE, "Failed to create Virtuoso language hash from factory"); if(librdf_hash_open(context->h_lang, NULL, 0, 1, 1, NULL)) LIBRDF_FATAL1(storage->world, LIBRDF_FROM_STORAGE, "Failed to open Virtuoso language hash"); context->h_type = librdf_new_hash(storage->world, NULL); if(!context->h_type) LIBRDF_FATAL1(storage->world, LIBRDF_FROM_STORAGE, "Failed to create Virtuoso type hash from factory"); if(librdf_hash_open(context->h_type, NULL, 0, 1, 1, NULL)) LIBRDF_FATAL1(storage->world, LIBRDF_FROM_STORAGE, "Failed to open Virtuoso type hash"); if(!name) name="virt:DEFAULT"; if(context->password) len += (strlen(context->password) + strlen("PWD=;")); if(context->user) len += (strlen(context->user) + strlen("UID=;")); if(context->dsn) len += (strlen(context->dsn) + strlen("DSN=;")); if(context->host) len += (strlen(context->host) + strlen("HOST=;")); if(context->database) len += (strlen(context->database) + strlen("DATABASE=;")); if(context->charset) len += (strlen(context->charset) + strlen("CHARSET=;")); context->conn_str = LIBRDF_MALLOC(char*, len + 16); if(!context->conn_str) return 1; context->model_name = LIBRDF_MALLOC(char*, strlen(name) + 1); if(!context->model_name) return 1; strcpy(context->model_name, name); /* Optimize loads? */ context->bulk = (librdf_hash_get_as_boolean(options, "bulk") > 0); /* Truncate model? */ #if 0 /* ?? FIXME */ if(!status && (librdf_hash_get_as_boolean(options, "new") > 0)) status = librdf_storage_virtuoso_context_remove_statements(storage, NULL); #endif if(!context->model_name || !context->dsn || !context->user || !context->password) return 1; strcpy(context->conn_str, ""); if(context->dsn) { strcat(context->conn_str, "DSN="); strcat(context->conn_str, context->dsn); strcat(context->conn_str, ";"); } if(context->host) { strcat(context->conn_str, "HOST="); strcat(context->conn_str, context->host); strcat(context->conn_str, ";"); } if(context->database) { strcat(context->conn_str, "DATABASE="); strcat(context->conn_str, context->database); strcat(context->conn_str, ";"); } if(context->user) { strcat(context->conn_str, "UID="); strcat(context->conn_str, context->user); strcat(context->conn_str, ";"); } if(context->password) { strcat(context->conn_str, "PWD="); strcat(context->conn_str, context->password); strcat(context->conn_str, ";"); } if(context->charset) { strcat(context->conn_str, "CHARSET="); strcat(context->conn_str, context->charset); strcat(context->conn_str, ";"); } /* Initialize Virtuoso connections */ librdf_storage_virtuoso_init_connections(storage); return 0; } /* * librdf_storage_virtuoso_terminate: * @storage: the storage * * . * * Close the storage and database connections. * * Return value: None. **/ static void librdf_storage_virtuoso_terminate(librdf_storage* storage) { librdf_storage_virtuoso_instance *context; context = (librdf_storage_virtuoso_instance*)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_terminate \n"); #endif librdf_storage_virtuoso_finish_connections(storage); if(context->password) LIBRDF_FREE(char*, (char*)context->password); if(context->user) LIBRDF_FREE(char*, (char*)context->user); if(context->model_name) LIBRDF_FREE(char*, (char*)context->model_name); if(context->dsn) LIBRDF_FREE(char*, (char*)context->dsn); if(context->database) LIBRDF_FREE(char*, (char*)context->database); if(context->charset) LIBRDF_FREE(char*, (char*)context->charset); if(context->host) LIBRDF_FREE(char*, (char*)context->host); if(context->conn_str) LIBRDF_FREE(char*, (char*)context->conn_str); if(context->transaction_handle) librdf_storage_virtuoso_transaction_rollback(storage); if(context->h_lang) { librdf_free_hash(context->h_lang); context->h_lang = NULL; } if(context->h_type) { librdf_free_hash(context->h_type); context->h_type = NULL; } } /* * librdf_storage_virtuoso_open: * @storage: the storage * @model: the model * * . * * Create or open model in database(nop). * * Return value: Non-zero on failure. **/ static int librdf_storage_virtuoso_open(librdf_storage* storage, librdf_model* model) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_open \n"); #endif return 0; } /* * librdf_storage_virtuoso_close: * @storage: the storage * * . * * Close model(nop). * * Return value: Non-zero on failure. **/ static int librdf_storage_virtuoso_close(librdf_storage* storage) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_close \n"); #endif librdf_storage_virtuoso_transaction_rollback(storage); return librdf_storage_virtuoso_sync(storage); } /* * librdf_storage_virtuoso_sync: * @storage: the storage * * Flush all tables, making sure they are saved on disk. * * Return value: Non-zero on failure. **/ static int librdf_storage_virtuoso_sync(librdf_storage* storage) { librdf_storage_virtuoso_instance *context; context = (librdf_storage_virtuoso_instance*)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_sync \n"); #endif /* Make sure optimizing for bulk operations is stopped? */ if(context->bulk) librdf_storage_virtuoso_stop_bulk(storage); return 0; } /* * librdf_storage_virtuoso_size: * @storage: the storage * * . * * Close model(nop). * * Return value: Negative on failure. **/ static int librdf_storage_virtuoso_size(librdf_storage* storage) { librdf_storage_virtuoso_instance *context; char model_size[]="select count(*) from(sparql define input:storage \"\" select * from named <%s> where { graph ?g {?s ?p ?o}})f"; char *query; int count = -1; int rc; librdf_storage_virtuoso_connection *handle; context = (librdf_storage_virtuoso_instance*)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_size \n"); #endif /* Get Virtuoso connection handle */ handle = librdf_storage_virtuoso_get_handle(storage); if(!handle) return -1; /* Query for number of statements */ query = LIBRDF_MALLOC(char*, strlen(model_size) + strlen(context->model_name) + 2); if(!query) { librdf_storage_virtuoso_release_handle(storage, handle); return -1; } sprintf(query, model_size, context->model_name); #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif rc = SQLExecDirect(handle->hstmt,(UCHAR *) query, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", storage->world, handle); count = -1; goto end; } rc = SQLFetch(handle->hstmt); if(SQL_SUCCEEDED(rc)) { int is_null; if(vGetDataINT(storage->world, handle, 1, &is_null, &count) == -1) count = -1; } SQLCloseCursor(handle->hstmt); end: LIBRDF_FREE(char*, query); librdf_storage_virtuoso_release_handle(storage, handle); return count; } static int librdf_storage_virtuoso_add_statement(librdf_storage* storage, librdf_statement* statement) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_add_statement \n"); #endif return librdf_storage_virtuoso_context_add_statement_helper(storage, NULL, statement); } /* * librdf_storage_virtuoso_context_add_statement - Add a statement to a storage context * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to add * * Return value: non 0 on failure **/ static int librdf_storage_virtuoso_context_add_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_context_add_statements \n"); #endif return librdf_storage_virtuoso_context_add_statement_helper(storage, context_node, statement); } /* * librdf_storage_virtuoso_add_statements: * @storage: the storage * @statement_stream: the stream of statements * * . * * Add statements in stream to storage, without context. * * Return value: Non-zero on failure. **/ static int librdf_storage_virtuoso_add_statements(librdf_storage* storage, librdf_stream* statement_stream) { int helper = 0; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_add_statements \n"); #endif while(!helper && !librdf_stream_end(statement_stream)) { librdf_statement* statement = librdf_stream_get_object(statement_stream); helper = librdf_storage_virtuoso_context_add_statement_helper(storage, NULL, statement); librdf_stream_next(statement_stream); } return helper; } /* * librdf_storage_virtuoso_context_add_statements: * @storage: the storage * @statement_stream: the stream of statements * * . * * Add statements in stream to storage, without context. * * Return value: Non-zero on failure. **/ static int librdf_storage_virtuoso_context_add_statements(librdf_storage* storage, librdf_node* context_node, librdf_stream* statement_stream) { librdf_storage_virtuoso_instance* context; int helper = 0; context = (librdf_storage_virtuoso_instance*)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_context_add_statements \n"); #endif /* Optimize for bulk loads? */ if(context->bulk) { if(librdf_storage_virtuoso_start_bulk(storage)) return 1; } while(!helper && !librdf_stream_end(statement_stream)) { librdf_statement* statement = librdf_stream_get_object(statement_stream); helper = librdf_storage_virtuoso_context_add_statement_helper(storage, context_node, statement); librdf_stream_next(statement_stream); } /* Optimize for bulk loads? */ if(context->bulk) { if(librdf_storage_virtuoso_stop_bulk(storage)) return 1; } return helper; } static int BindCtxt(librdf_storage* storage, librdf_storage_virtuoso_connection *handle, SQLUSMALLINT col, char *data, SQLLEN *ind) { SQLUINTEGER ulen; int rc; *ind = SQL_NTS; ulen = LIBRDF_BAD_CAST(SQLUINTEGER, strlen(data)); rc = SQLBindParameter(handle->hstmt, col, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0,(SQLPOINTER)data, 0, ind); if(!SQL_SUCCEEDED(rc)) goto error; return 0; error: rdf_virtuoso_ODBC_Errors("SQLBindParameter()", storage->world, handle); return -1; } static int BindSP(librdf_storage* storage, librdf_storage_virtuoso_connection *handle, SQLUSMALLINT col, librdf_node *node, char **data, SQLLEN *ind) { librdf_node_type type = librdf_node_get_type(node); SQLUINTEGER ulen; int rc; *ind = SQL_NTS; if(type == LIBRDF_NODE_TYPE_RESOURCE) { char *uri = (char *)librdf_uri_as_string(librdf_node_get_uri(node)); ulen = LIBRDF_BAD_CAST(SQLUINTEGER, strlen(uri)); rc = SQLBindParameter(handle->hstmt, col, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, uri, 0, ind); if(!SQL_SUCCEEDED(rc)) goto error; } else if(type == LIBRDF_NODE_TYPE_BLANK) { char *value = (char *)librdf_node_get_blank_identifier(node); char *bnode = NULL; bnode = LIBRDF_MALLOC(char*, strlen(value) + 5); if(!bnode) return -1; strcpy(bnode, "_:"); strcat(bnode, value); *data = bnode; ulen = LIBRDF_BAD_CAST(SQLUINTEGER, strlen(bnode)); rc = SQLBindParameter(handle->hstmt, col, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, bnode, 0, ind); if(!SQL_SUCCEEDED(rc)) goto error; } else { return -1; } return 0; error: rdf_virtuoso_ODBC_Errors("SQLBindParameter()", storage->world, handle); return -1; } static int BindObject(librdf_storage* storage, librdf_storage_virtuoso_connection *handle, SQLUSMALLINT col, librdf_node *node, char **data, long *iData, SQLLEN *ind1, SQLLEN *ind2, SQLLEN *ind3) { librdf_node_type type = librdf_node_get_type(node); SQLUINTEGER ulen; int rc; if(type == LIBRDF_NODE_TYPE_RESOURCE) { char *uri = (char *)librdf_uri_as_string(librdf_node_get_uri(node)); *iData = 1; *ind1 = 0; rc = SQLBindParameter(handle->hstmt, col, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, iData, 0, ind1); if(!SQL_SUCCEEDED(rc)) goto error; ulen = LIBRDF_BAD_CAST(SQLUINTEGER, strlen(uri)); *ind2 = SQL_NTS; rc = SQLBindParameter(handle->hstmt, col+1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, uri, 0, ind2); if(!SQL_SUCCEEDED(rc)) goto error; *ind3 = SQL_NULL_DATA; rc = SQLBindParameter(handle->hstmt, col + 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, NULL, 0, ind3); if(!SQL_SUCCEEDED(rc)) goto error; } else if(type == LIBRDF_NODE_TYPE_BLANK) { char *value = (char *)librdf_node_get_blank_identifier(node); char *bnode = NULL; bnode = LIBRDF_MALLOC(char*, strlen(value) + 5); if(!bnode) return -1; *data = bnode; strcpy(bnode, "_:"); strcat(bnode, value); *iData = 1; *ind1 = 0; rc = SQLBindParameter(handle->hstmt, col, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, iData, 0, ind1); if(!SQL_SUCCEEDED(rc)) goto error; ulen = LIBRDF_BAD_CAST(SQLUINTEGER, strlen(bnode)); *ind2 = SQL_NTS; rc = SQLBindParameter(handle->hstmt, col+1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, bnode, 0, ind2); if(!SQL_SUCCEEDED(rc)) goto error; *ind3 = SQL_NULL_DATA; rc = SQLBindParameter(handle->hstmt, col + 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, NULL, 0, ind3); if(!SQL_SUCCEEDED(rc)) goto error; } else if(type == LIBRDF_NODE_TYPE_LITERAL) { char *value, *datatype = 0; char *lang; librdf_uri *dt; value = (char *)librdf_node_get_literal_value(node); lang = librdf_node_get_literal_value_language(node); dt = librdf_node_get_literal_value_datatype_uri(node); if(lang) { *iData = 5; *ind1 = 0; rc = SQLBindParameter(handle->hstmt, col, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, iData, 0, ind1); if(!SQL_SUCCEEDED(rc)) goto error; ulen = LIBRDF_BAD_CAST(SQLUINTEGER, strlen(value)); *ind2 = SQL_NTS; rc = SQLBindParameter(handle->hstmt, col+1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, value, 0, ind2); if(!SQL_SUCCEEDED(rc)) goto error; ulen = LIBRDF_BAD_CAST(SQLUINTEGER, strlen(lang)); *ind3 = SQL_NTS; rc = SQLBindParameter(handle->hstmt, col + 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, lang, 0, ind3); if(!SQL_SUCCEEDED(rc)) goto error; } else if(dt) { *iData = 4; *ind1 = 0; rc = SQLBindParameter(handle->hstmt, col, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, iData, 0, ind1); if(!SQL_SUCCEEDED(rc)) goto error; ulen = LIBRDF_BAD_CAST(SQLUINTEGER, strlen(value)); *ind2 = SQL_NTS; rc = SQLBindParameter(handle->hstmt, col+1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, value, 0, ind2); if(!SQL_SUCCEEDED(rc)) goto error; datatype = (char *)librdf_uri_as_string(dt); ulen = LIBRDF_BAD_CAST(SQLUINTEGER, strlen(datatype)); *ind3 = SQL_NTS; rc = SQLBindParameter(handle->hstmt, col + 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, datatype, 0, ind3); if(!SQL_SUCCEEDED(rc)) goto error; } else { *iData = 3; *ind1 = 0; rc = SQLBindParameter(handle->hstmt, col, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, iData, 0, ind1); if(!SQL_SUCCEEDED(rc)) goto error; ulen = LIBRDF_BAD_CAST(SQLUINTEGER, strlen(value)); *ind2 = SQL_NTS; rc = SQLBindParameter(handle->hstmt, col+1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, ulen, 0, value, 0, ind2); if(!SQL_SUCCEEDED(rc)) goto error; *ind3 = SQL_NULL_DATA; rc = SQLBindParameter(handle->hstmt, col + 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, 0, 0, NULL, 0, ind3); if(!SQL_SUCCEEDED(rc)) goto error; } } else { return -1; } return 0; error: rdf_virtuoso_ODBC_Errors("SQLBindParameter()", storage->world, handle); return -1; } /* * librdf_storage_virtuoso_context_add_statement_helper - Perform actual addition of a statement to a storage context * @storage: #librdf_storage object * @statement: #librdf_statement statement to add * * Return value: non-zero on failure **/ static int librdf_storage_virtuoso_context_add_statement_helper(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { const char *insert_statement="sparql define output:format '_JAVA_' insert into graph iri(\?\?) { `iri(\?\?)` `iri(\?\?)` `bif:__rdf_long_from_batch_params(\?\?,\?\?,\?\?)` }"; librdf_storage_virtuoso_connection *handle = NULL; int rc; int ret = 0; char *subject = NULL; char *predicate = NULL; char *object = NULL; char *ctxt_node = NULL; librdf_node* nsubject = NULL; librdf_node* npredicate = NULL; librdf_node* nobject = NULL; SQLLEN ind, ind1, ind2; SQLLEN ind31, ind32, ind33; long iData; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_context_add_statement_helper \n"); #endif /* Get Virtuoso connection handle */ handle = librdf_storage_virtuoso_get_handle(storage); if(!handle) return 1; ctxt_node = librdf_storage_virtuoso_icontext2string(storage, context_node); nsubject = librdf_statement_get_subject(statement); npredicate = librdf_statement_get_predicate(statement); nobject = librdf_statement_get_object(statement); if(!nsubject || !npredicate || !nobject || !ctxt_node) { ret = 1; goto end; } rc = BindCtxt(storage, handle, 1, ctxt_node, &ind); if(rc) { ret = 1; goto end; } rc = BindSP(storage, handle, 2, nsubject, &subject, &ind1); if(rc) { ret = 1; goto end; } rc = BindSP(storage, handle, 3, npredicate, &predicate, &ind2); if(rc) { ret = 1; goto end; } rc = BindObject(storage, handle, 4, nobject, &object, &iData, &ind31, &ind32, &ind33); if(rc) { ret = 1; goto end; } #ifdef VIRTUOSO_STORAGE_DEBUG printf("SQL: >>%s<<\n", insert_statement); #endif #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", insert_statement); #endif rc = SQLExecDirect(handle->hstmt,(SQLCHAR *)insert_statement, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", storage->world, handle); ret = -1; goto end; } end: SQLFreeStmt(handle->hstmt, SQL_RESET_PARAMS); if(subject) LIBRDF_FREE(char*, subject); if(predicate) LIBRDF_FREE(char*, predicate); if(object) LIBRDF_FREE(char*, object); if(handle) librdf_storage_virtuoso_release_handle(storage, handle); return ret; } /* * librdf_storage_virtuoso_start_bulk - Prepare for bulk insert operation * @storage: the storage * * Return value: Non-zero on failure. */ static int librdf_storage_virtuoso_start_bulk(librdf_storage* storage) { return 1; } /* * librdf_storage_virtuoso_stop_bulk - End bulk insert operation * @storage: the storage * * Return value: Non-zero on failure. */ static int librdf_storage_virtuoso_stop_bulk(librdf_storage* storage) { return 1; } /* * librdf_storage_virtuoso_contains_statement: * @storage: the storage * @statement: a complete statement * * Test if a given complete statement is present in the model. * * Return value: Non-zero if the model contains the statement. **/ static int librdf_storage_virtuoso_contains_statement(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_virtuoso_context_contains_statement(storage, NULL, statement); } /* * librdf_storage_virtuoso_contains_statement: * @storage: the storage * @statement: a complete statement * * Test if a given complete statement is present in the model. * * Return value: Non-zero if the model contains the statement. **/ static int librdf_storage_virtuoso_context_contains_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { char find_statement[]="sparql define input:storage \"\" select * where {graph %s { %s %s %s }} limit 1"; char *query = NULL; librdf_storage_virtuoso_connection *handle = NULL; int rc; int ret = 0; char *subject = NULL; char *predicate = NULL; char *object = NULL; char *ctxt_node = NULL; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_contains_statement \n"); #endif /* Get Virtuoso connection handle */ handle = librdf_storage_virtuoso_get_handle(storage); if(!handle) return 0; subject = librdf_storage_virtuoso_node2string(storage, librdf_statement_get_subject(statement)); predicate = librdf_storage_virtuoso_node2string(storage, librdf_statement_get_predicate(statement)); object = librdf_storage_virtuoso_node2string(storage, librdf_statement_get_object(statement)); if(!subject || !predicate || !object) { ret = 0; goto end; } ctxt_node = librdf_storage_virtuoso_context2string(storage, context_node); if(!ctxt_node) { ret = 1; goto end; } query = LIBRDF_MALLOC(char*, strlen(find_statement)+ strlen(ctxt_node)+ strlen(subject) + strlen(predicate) + strlen(object) + 1); if(!query) { ret = 0; goto end; } sprintf(query, find_statement, ctxt_node, subject, predicate, object); #ifdef VIRTUOSO_STORAGE_DEBUG printf("SQL: >>%s<<\n", query); #endif #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif rc = SQLExecDirect(handle->hstmt,(SQLCHAR *)query, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", storage->world, handle); ret = 0; goto end; } rc = SQLFetch(handle->hstmt); if(SQL_SUCCEEDED(rc)) { ret = 1; } else if(rc == SQL_NO_DATA_FOUND) { ret = 0; } SQLCloseCursor(handle->hstmt); end: if(query) LIBRDF_FREE(char*, query); if(ctxt_node) LIBRDF_FREE(char*, ctxt_node); if(subject) LIBRDF_FREE(char*, subject); if(predicate) LIBRDF_FREE(char*, predicate); if(object) LIBRDF_FREE(char*, object); if(handle) librdf_storage_virtuoso_release_handle(storage, handle); return ret; } /* * librdf_storage_virtuoso_remove_statement: * @storage: #librdf_storage object * @statement: #librdf_statement statement to remove * * Remove a statement from storage. * * Return value: non-zero on failure **/ static int librdf_storage_virtuoso_remove_statement(librdf_storage* storage, librdf_statement* statement) { return librdf_storage_virtuoso_context_remove_statement(storage, NULL, statement); } /* * librdf_storage_virtuoso_context_remove_statement - Remove a statement from a storage context * @storage: #librdf_storage object * @context_node: #librdf_node object * @statement: #librdf_statement statement to remove * * Remove a statement from storage. * * Return value: non-zero on failure **/ static int librdf_storage_virtuoso_context_remove_statement(librdf_storage* storage, librdf_node* context_node, librdf_statement* statement) { const char *sdelete="sparql define output:format '_JAVA_' delete from graph iri(\?\?) {`iri(\?\?)` `iri(\?\?)` `bif:__rdf_long_from_batch_params(\?\?,\?\?,\?\?)`}"; const char *sdelete_match="sparql delete from graph <%s> { %s %s %s } from <%s> where { %s %s %s }"; const char *sdelete_graph="sparql clear graph iri(\?\?)"; char *query = NULL; librdf_storage_virtuoso_connection *handle = NULL; int rc; int ret = 0; char *subject = NULL; char *predicate = NULL; char *object = NULL; char *ctxt_node = NULL; librdf_node* nsubject = NULL; librdf_node* npredicate = NULL; librdf_node* nobject = NULL; SQLLEN ind, ind1, ind2; SQLLEN ind31, ind32, ind33; long iData; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_context_remove_statement \n"); #endif /* Get Virtuoso connection handle */ handle = librdf_storage_virtuoso_get_handle(storage); if(!handle) return 1; ctxt_node = librdf_storage_virtuoso_icontext2string(storage, context_node); if(!ctxt_node) { ret = 1; goto end; } nsubject = librdf_statement_get_subject(statement); npredicate = librdf_statement_get_predicate(statement); nobject = librdf_statement_get_object(statement); if(nsubject == NULL && npredicate == NULL && nobject == NULL && ctxt_node != NULL) { ind = SQL_NTS; rc = BindCtxt(storage, handle, 1, ctxt_node, &ind); if(rc) { ret = 1; goto end; } rc = SQLExecDirect(handle->hstmt,(SQLCHAR *)sdelete_graph, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", storage->world, handle); ret = -1; goto end; } } else if(nsubject != NULL && npredicate != NULL && nobject != NULL && ctxt_node != NULL) { ind = SQL_NTS; rc = BindCtxt(storage, handle, 1, ctxt_node, &ind); if(rc) { ret = 1; goto end; } ind1 = SQL_NTS; rc = BindSP(storage, handle, 2, nsubject, &subject, &ind1); if(rc) { ret = 1; goto end; } ind2 = SQL_NTS; rc = BindSP(storage, handle, 3, npredicate, &predicate, &ind2); if(rc) { ret = 1; goto end; } rc = BindObject(storage, handle, 4, nobject, &object, &iData, &ind31, &ind32, &ind33); if(rc) { ret = 1; goto end; } #ifdef VIRTUOSO_STORAGE_DEBUG printf("SQL: >>%s<<\n", sdelete); #endif rc = SQLExecDirect(handle->hstmt,(SQLCHAR *)sdelete, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", storage->world, handle); ret = -1; goto end; } } else { subject = librdf_storage_virtuoso_node2string(storage, nsubject); predicate = librdf_storage_virtuoso_node2string(storage, npredicate); object = librdf_storage_virtuoso_node2string(storage, nobject); if(subject && predicate && object) query = LIBRDF_MALLOC(char*, strlen(sdelete_match) + strlen(ctxt_node)*2 + strlen(subject)*2 + strlen(predicate)*2 + strlen(object)*2 +1); if(!query) { ret = 1; goto end; } sprintf(query, sdelete_match, ctxt_node, subject, predicate, object, ctxt_node, subject, predicate, object); #ifdef VIRTUOSO_STORAGE_DEBUG printf("SQL: >>%s<<\n", query); #endif #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif rc = SQLExecDirect(handle->hstmt,(SQLCHAR *)query, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", storage->world, handle); ret = -1; goto end; } } end: SQLFreeStmt(handle->hstmt, SQL_RESET_PARAMS); if(query) LIBRDF_FREE(char*, query); if(ctxt_node) LIBRDF_FREE(char*, ctxt_node); if(subject) LIBRDF_FREE(char*, subject); if(predicate) LIBRDF_FREE(char*, predicate); if(object) LIBRDF_FREE(char*, object); if(handle) { librdf_storage_virtuoso_release_handle(storage, handle); } return ret; } /* * librdf_storage_virtuoso_context_remove_statements - Remove all statement from a storage context * @storage: #librdf_storage object * @context_node: #librdf_node object * * Remove statements from storage. * * Return value: non-zero on failure **/ static int librdf_storage_virtuoso_context_remove_statements(librdf_storage* storage, librdf_node* context_node) { const char *remove_statements="sparql clear graph iri(\?\?)"; librdf_storage_virtuoso_connection *handle = NULL; int rc; int ret = 0; char *ctxt_node = NULL; SQLLEN ind = SQL_NTS; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_context_remove_statements \n"); #endif /* Get Virtuoso connection handle */ handle = librdf_storage_virtuoso_get_handle(storage); if(!handle) return 1; ctxt_node = librdf_storage_virtuoso_context2string(storage, context_node); if(!ctxt_node) { ret = 1; goto end; } rc = BindCtxt(storage, handle, 1, ctxt_node, &ind); if(rc) { ret = 1; goto end; } #ifdef VIRTUOSO_STORAGE_DEBUG printf("SQL: >>%s<<\n", remove_statements); #endif #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", remove_statements); #endif rc = SQLExecDirect(handle->hstmt,(SQLCHAR *)remove_statements, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", storage->world, handle); ret = -1; goto end; } end: SQLFreeStmt(handle->hstmt, SQL_RESET_PARAMS); if(ctxt_node) LIBRDF_FREE(char*, ctxt_node); if(handle) { librdf_storage_virtuoso_release_handle(storage, handle); } return ret; } /* * librdf_storage_virtuoso_serialise - Return a stream of all statements in a storage * @storage: the storage * * Return a stream of all statements in a storage. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_virtuoso_serialise(librdf_storage* storage) { librdf_storage_virtuoso_instance* context; librdf_node *node; context = (librdf_storage_virtuoso_instance*)storage->instance; node = librdf_new_node_from_uri_string(storage->world,(const unsigned char*)context->model_name); return librdf_storage_virtuoso_find_statements_in_context(storage,NULL,node); } /* * librdf_storage_virtuoso_context_serialise - List all statements in a storage context * @storage: #librdf_storage object * @context_node: #librdf_node object * * Return a stream of all statements in a storage. * * Return value: #librdf_stream of statements or NULL on failure or context is empty **/ static librdf_stream* librdf_storage_virtuoso_context_serialise(librdf_storage* storage, librdf_node* context_node) { return librdf_storage_virtuoso_find_statements_in_context(storage, NULL, context_node); } static int librdf_storage_virtuoso_find_statements_in_context_end_of_stream(void* context); static int librdf_storage_virtuoso_find_statements_in_context_next_statement(void* context); static void* librdf_storage_virtuoso_find_statements_in_context_get_statement(void* context, int flags); static void librdf_storage_virtuoso_find_statements_in_context_finished(void* context); /* * librdf_storage_virtuoso_find_statements - Find a graph of statements in storage. * @storage: the storage * @statement: the statement to match * * Return a stream of statements matching the given statement(or * all statements if NULL). Parts(subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_virtuoso_find_statements(librdf_storage* storage, librdf_statement* statement) { librdf_storage_virtuoso_instance* context; librdf_node *node; context = (librdf_storage_virtuoso_instance*)storage->instance; node = librdf_new_node_from_uri_string(storage->world,(const unsigned char*)context->model_name); return librdf_storage_virtuoso_find_statements_in_context(storage, statement, node); } /* * librdf_storage_virtuoso_find_statements_in_context - Find a graph of statements in a storage context. * @storage: the storage * @statement: the statement to match * @context_node: the context to search * * Return a stream of statements matching the given statement(or * all statements if NULL). Parts(subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_virtuoso_find_statements_in_context(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node) { char find_statement[]="sparql select * from %s where { %s %s %s }"; char *query = NULL; librdf_storage_virtuoso_sos_context *sos = NULL; int rc = 0; librdf_node *subject = NULL, *predicate = NULL, *object = NULL; const char *s_subject = NULL; const char *s_predicate = NULL; const char *s_object = NULL; const char *ctxt_node = NULL; librdf_stream *stream = NULL; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_find_statements_in_context \n"); #endif /* Initialize sos context */ sos = LIBRDF_CALLOC(librdf_storage_virtuoso_sos_context*, 1, sizeof(*sos)); if(!sos) return NULL; sos->storage = storage; librdf_storage_add_reference(sos->storage); if(statement) sos->query_statement = librdf_new_statement_from_statement(statement); if(context_node) sos->query_context = librdf_new_node_from_node(context_node); sos->current_statement = NULL; sos->current_context = NULL; /* Get Vrtuoso connection handle */ sos->handle = librdf_storage_virtuoso_get_handle(storage); if(!sos->handle) { librdf_storage_virtuoso_find_statements_in_context_finished((void*)sos); goto end; } if(statement) { subject = librdf_statement_get_subject(statement); predicate = librdf_statement_get_predicate(statement); object = librdf_statement_get_object(statement); } if(subject) { s_subject = librdf_storage_virtuoso_node2string(storage, subject); if(strlen(s_subject) == 0) { subject = NULL; LIBRDF_FREE(char*, (char*)s_subject); } } if(predicate) { s_predicate = librdf_storage_virtuoso_node2string(storage, predicate); if(strlen(s_predicate) == 0) { predicate = NULL; LIBRDF_FREE(char*, (char*)s_predicate); } } if(object) { s_object = librdf_storage_virtuoso_node2string(storage, object); if(strlen(s_object) == 0) { object = NULL; LIBRDF_FREE(char*, (char*)s_object); } } if(!subject) s_subject="?s"; if(!predicate) s_predicate="?p"; if(!object) s_object="?o"; ctxt_node = librdf_storage_virtuoso_fcontext2string(storage, context_node); if(!ctxt_node) goto end; query = LIBRDF_MALLOC(char*, strlen(find_statement) + strlen(ctxt_node) + strlen(s_subject) + strlen(s_predicate) + strlen(s_object)+1); if(!query) { librdf_storage_virtuoso_find_statements_in_context_finished((void*)sos); goto end; } sprintf(query, find_statement, ctxt_node, s_subject, s_predicate, s_object); #ifdef VIRTUOSO_STORAGE_DEBUG printf("SQL: >>%s<<\n", query); #endif #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", query); #endif rc = SQLExecDirect(sos->handle->hstmt,(SQLCHAR *)query, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", storage->world, sos->handle); librdf_storage_virtuoso_find_statements_in_context_finished((void*)sos); goto end; } /* Get first statement, if any, and initialize stream */ if(librdf_storage_virtuoso_find_statements_in_context_next_statement(sos) ) { librdf_storage_virtuoso_find_statements_in_context_finished((void*)sos); return librdf_new_empty_stream(storage->world); } #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_find_statements \n"); #endif stream = librdf_new_stream(storage->world,(void*)sos, &librdf_storage_virtuoso_find_statements_in_context_end_of_stream, &librdf_storage_virtuoso_find_statements_in_context_next_statement, &librdf_storage_virtuoso_find_statements_in_context_get_statement, &librdf_storage_virtuoso_find_statements_in_context_finished); if(!stream) librdf_storage_virtuoso_find_statements_in_context_finished((void*)sos); end: if(query) LIBRDF_FREE(char*, (char*)query); if(ctxt_node) LIBRDF_FREE(char*, (char*)ctxt_node); if(subject) LIBRDF_FREE(char*, (char*)s_subject); if(predicate) LIBRDF_FREE(char*, (char*)s_predicate); if(object) LIBRDF_FREE(char*, (char*)s_object); return stream; } /* * librdf_storage_virtuoso_find_statements_with_options - Find a graph of statements in a storage context with options. * @storage: the storage * @statement: the statement to match * @context_node: the context to search * @options: #librdf_hash of match options or NULL * * Return a stream of statements matching the given statement(or * all statements if NULL). Parts(subject, predicate, object) of the * statement can be empty in which case any statement part will match that. * * Return value: a #librdf_stream or NULL on failure **/ static librdf_stream* librdf_storage_virtuoso_find_statements_with_options(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options) { return librdf_storage_virtuoso_find_statements_in_context(storage, statement, context_node); } static int librdf_storage_virtuoso_find_statements_in_context_end_of_stream(void* context) { librdf_storage_virtuoso_sos_context* sos = (librdf_storage_virtuoso_sos_context*)context; return (sos->current_statement == NULL); } static int librdf_storage_virtuoso_find_statements_in_context_next_statement(void* context) { librdf_storage_virtuoso_sos_context* sos = (librdf_storage_virtuoso_sos_context*)context; librdf_node *subject = NULL, *predicate = NULL, *object = NULL; librdf_node *node; SQLUSMALLINT colNum; short numCols; int rc; #ifdef VIRTUOSO_STORAGE_DEBUG printf("librdf_storage_virtuoso_find_statements_in_context_next_statement\n"); #endif rc = SQLNumResultCols(sos->handle->hstmt, &numCols); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLNumResultCols()", sos->storage->world, sos->handle); return 1; } rc = SQLFetch(sos->handle->hstmt); if(rc == SQL_NO_DATA_FOUND) { if(sos->current_statement) librdf_free_statement(sos->current_statement); sos->current_statement = NULL; if(sos->current_context) librdf_free_node(sos->current_context); sos->current_context = NULL; return 0; } else if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { rdf_virtuoso_ODBC_Errors((char *)"SQLFetch", sos->storage->world, sos->handle); return 1; } /* Get ready for context */ if(sos->current_context) librdf_free_node(sos->current_context); sos->current_context = NULL; if(sos->query_statement) { subject = librdf_statement_get_subject(sos->query_statement); predicate = librdf_statement_get_predicate(sos->query_statement); object = librdf_statement_get_object(sos->query_statement); } /* Make sure we have a statement object to return */ if(!sos->current_statement) { sos->current_statement = librdf_new_statement(sos->storage->world); if(!sos->current_statement) return 1; } librdf_statement_clear(sos->current_statement); /* Query without variables? */ if(subject && predicate && object && sos->query_context) { librdf_statement_set_subject(sos->current_statement,librdf_new_node_from_node(subject)); librdf_statement_set_predicate(sos->current_statement,librdf_new_node_from_node(predicate)); librdf_statement_set_object(sos->current_statement,librdf_new_node_from_node(object)); sos->current_context = librdf_new_node_from_node(sos->query_context); } else { char * data; int is_null; colNum = 1; if(sos->query_context) { sos->current_context = librdf_new_node_from_node(sos->query_context); } else { data = vGetDataCHAR(sos->storage->world, sos->handle, colNum, &is_null); if(!data || is_null) return 1; sos->current_context = rdf2node(sos->storage, sos->handle, colNum, data); LIBRDF_FREE(char*, (char*)data); if(!sos->current_context) return 1; colNum++; } if(subject) { librdf_statement_set_subject(sos->current_statement,librdf_new_node_from_node(subject)); } else { data = vGetDataCHAR(sos->storage->world, sos->handle, colNum, &is_null); if(!data || is_null) return 1; node = rdf2node(sos->storage, sos->handle, colNum, data); LIBRDF_FREE(char*, (char*)data); if(!node) return 1; librdf_statement_set_subject(sos->current_statement, node); colNum++; } if(predicate) { librdf_statement_set_predicate(sos->current_statement,librdf_new_node_from_node(predicate)); } else { data = vGetDataCHAR(sos->storage->world, sos->handle, colNum, &is_null); if(!data || is_null) return 1; node = rdf2node(sos->storage, sos->handle, colNum, data); LIBRDF_FREE(char*, (char*)data); if(!node) return 1; librdf_statement_set_predicate(sos->current_statement, node); colNum++; } if(object) { librdf_statement_set_object(sos->current_statement,librdf_new_node_from_node(object)); } else { data = vGetDataCHAR(sos->storage->world, sos->handle, colNum, &is_null); if(!data || is_null) return 1; node = rdf2node(sos->storage, sos->handle, colNum, data); LIBRDF_FREE(char*, (char*)data); if(!node) return 1; librdf_statement_set_object(sos->current_statement, node); } } return 0; } static void* librdf_storage_virtuoso_find_statements_in_context_get_statement(void* context, int flags) { librdf_storage_virtuoso_sos_context* sos; sos = (librdf_storage_virtuoso_sos_context*)context; switch(flags) { case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: return sos->current_statement; case LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: return sos->current_context; default: LIBRDF_DEBUG2("Unknown flags %d\n", flags); return NULL; } } static void librdf_storage_virtuoso_find_statements_in_context_finished(void* context) { librdf_storage_virtuoso_sos_context* sos; sos = (librdf_storage_virtuoso_sos_context*)context; if(sos->handle) { SQLCloseCursor(sos->handle->hstmt); librdf_storage_virtuoso_release_handle(sos->storage, sos->handle); } if(sos->current_statement) librdf_free_statement(sos->current_statement); if(sos->current_context) librdf_free_node(sos->current_context); if(sos->query_statement) librdf_free_statement(sos->query_statement); if(sos->query_context) librdf_free_node(sos->query_context); if(sos->storage) librdf_storage_remove_reference(sos->storage); LIBRDF_FREE(librdf_storage_virtuoso_sos_context, sos); } static librdf_node* librdf_storage_virtuoso_get_feature(librdf_storage* storage, librdf_uri* feature) { unsigned char *uri_string; if(!feature) return NULL; uri_string = librdf_uri_as_string(feature); if(!uri_string) return NULL; if(!strcmp((const char*)uri_string, LIBRDF_MODEL_FEATURE_CONTEXTS)) { unsigned char value[2]; sprintf((char*)value, "%d", 1); return librdf_new_node_from_typed_literal(storage->world, value, NULL, NULL); } return NULL; } /* methods for iterator for contexts */ static int librdf_storage_virtuoso_get_contexts_end_of_iterator(void* context); static int librdf_storage_virtuoso_get_contexts_next_context(void* context); static void* librdf_storage_virtuoso_get_contexts_get_context(void* context, int flags); static void librdf_storage_virtuoso_get_contexts_finished(void* context); /* * librdf_storage_virtuoso_get_contexts: * @storage: the storage * * Return an iterator with the context nodes present in storage. * * Return value: a #librdf_iterator or NULL on failure **/ static librdf_iterator* librdf_storage_virtuoso_get_contexts(librdf_storage* storage) { librdf_storage_virtuoso_get_contexts_context* gccontext; char find_statement[]="DB.DBA.SPARQL_SELECT_KNOWN_GRAPHS()"; int rc = 0; librdf_iterator *iterator = NULL; if(!storage) return NULL; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_get_contexts \n"); #endif /* Initialize get_contexts context */ gccontext = LIBRDF_CALLOC(librdf_storage_virtuoso_get_contexts_context*, 1, sizeof(*gccontext)); if(!gccontext) return NULL; gccontext->storage = storage; librdf_storage_add_reference(gccontext->storage); gccontext->current_context = NULL; /* Get Virtuoso connection handle */ gccontext->handle = librdf_storage_virtuoso_get_handle(storage); if(!gccontext->handle) { librdf_storage_virtuoso_get_contexts_finished((void*)gccontext); goto end; } #ifdef VIRTUOSO_STORAGE_DEBUG printf("SQL: >>%s<<\n", find_statement); #endif #ifdef LIBRDF_DEBUG_SQL LIBRDF_DEBUG2("SQL: >>%s<<\n", find_statement); #endif rc = SQLExecDirect(gccontext->handle->hstmt,(SQLCHAR *)find_statement, SQL_NTS); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLExecDirect()", storage->world, gccontext->handle); librdf_storage_virtuoso_get_contexts_finished((void*)gccontext); goto end; } /* Get first statement, if any, and initialize stream */ if(librdf_storage_virtuoso_get_contexts_next_context(gccontext) || !gccontext->current_context) { librdf_storage_virtuoso_get_contexts_finished((void*)gccontext); return librdf_new_empty_iterator(storage->world); } iterator = librdf_new_iterator(storage->world, (void*)gccontext, &librdf_storage_virtuoso_get_contexts_end_of_iterator, &librdf_storage_virtuoso_get_contexts_next_context, &librdf_storage_virtuoso_get_contexts_get_context, &librdf_storage_virtuoso_get_contexts_finished); if(!iterator) librdf_storage_virtuoso_get_contexts_finished((void*)gccontext); end: return iterator; } static int librdf_storage_virtuoso_get_contexts_end_of_iterator(void* context) { librdf_storage_virtuoso_get_contexts_context* gccontext; gccontext = (librdf_storage_virtuoso_get_contexts_context*)context; return gccontext->current_context == NULL; } static int librdf_storage_virtuoso_get_contexts_next_context(void* context) { librdf_storage_virtuoso_get_contexts_context* gccontext; int rc; SQLUSMALLINT colNum; short numCols; char *data; int is_null; gccontext = (librdf_storage_virtuoso_get_contexts_context*)context; rc = SQLNumResultCols(gccontext->handle->hstmt, &numCols); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLNumResultCols()", gccontext->storage->world, gccontext->handle); return 1; } rc = SQLFetch(gccontext->handle->hstmt); if(rc == SQL_NO_DATA_FOUND) { if(gccontext->current_context) librdf_free_node(gccontext->current_context); gccontext->current_context = NULL; return 0; } else if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { rdf_virtuoso_ODBC_Errors((char *)"SQLFetch", gccontext->storage->world, gccontext->handle); return 1; } /* Free old context node, if allocated */ if(gccontext->current_context) librdf_free_node(gccontext->current_context); colNum = 1; data = vGetDataCHAR(gccontext->storage->world, gccontext->handle, colNum, &is_null); if(!data || is_null) return 1; gccontext->current_context = rdf2node(gccontext->storage, gccontext->handle, colNum, data); LIBRDF_FREE(char*, (char*)data); if(!gccontext->current_context) return 1; return 0; } static void* librdf_storage_virtuoso_get_contexts_get_context(void* context, int flags) { librdf_storage_virtuoso_get_contexts_context* gccontext; gccontext = (librdf_storage_virtuoso_get_contexts_context*)context; return gccontext->current_context; } static void librdf_storage_virtuoso_get_contexts_finished(void* context) { librdf_storage_virtuoso_get_contexts_context* gccontext; gccontext = (librdf_storage_virtuoso_get_contexts_context*)context; if(gccontext->handle) { SQLCloseCursor(gccontext->handle->hstmt); librdf_storage_virtuoso_release_handle(gccontext->storage, gccontext->handle); } if(gccontext->current_context) librdf_free_node(gccontext->current_context); if(gccontext->storage) librdf_storage_remove_reference(gccontext->storage); LIBRDF_FREE(librdf_storage_virtuoso_get_contexts_context, gccontext); } /* * librdf_storage_virtuoso_transaction_start: * @storage: the storage object * * Start a transaction * * Return value: non-0 on failure **/ static int librdf_storage_virtuoso_transaction_start(librdf_storage* storage) { librdf_storage_virtuoso_instance *context; int rc; context = (librdf_storage_virtuoso_instance *)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_transaction_start \n"); #endif if(context->transaction_handle) { librdf_log(storage->world, 0, LIBRDF_LOG_ERROR, LIBRDF_FROM_STORAGE, NULL, "Virtuoso transaction already started"); return 1; } context->transaction_handle = librdf_storage_virtuoso_get_handle(storage); if(!context->transaction_handle) return 1; rc = SQLSetConnectAttr(context->transaction_handle->hdbc, SQL_ATTR_AUTOCOMMIT,(SQLPOINTER)SQL_AUTOCOMMIT_ON, 0); if(!SQL_SUCCEEDED(rc)) { rdf_virtuoso_ODBC_Errors("SQLSetConnectAttr(hdbc)", storage->world, context->transaction_handle); librdf_storage_virtuoso_release_handle(storage, context->transaction_handle); context->transaction_handle = NULL; return 1; } return 0; } /* * librdf_storage_virtuoso_transaction_start_with_handle: * @storage: the storage object * @handle: the transaction object * * Start a transaction using an existing external transaction object. * * Return value: non-0 on failure **/ static int librdf_storage_virtuoso_transaction_start_with_handle(librdf_storage* storage, void* handle) { #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_transaction_start_with_handle \n"); #endif return librdf_storage_virtuoso_transaction_start(storage); } /* * librdf_storage_virtuoso_transaction_commit: * @storage: the storage object * * Commit a transaction. * * Return value: non-0 on failure **/ static int librdf_storage_virtuoso_transaction_commit(librdf_storage* storage) { librdf_storage_virtuoso_instance *context; int rc; context = (librdf_storage_virtuoso_instance *)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_transaction_commit \n"); #endif if(!context->transaction_handle) return 1; rc = SQLEndTran(SQL_HANDLE_DBC, context->transaction_handle->hdbc, SQL_COMMIT); if(!SQL_SUCCEEDED(rc)) rdf_virtuoso_ODBC_Errors("SQLEndTran(hdbc,COMMIT)", storage->world, context->transaction_handle); librdf_storage_virtuoso_release_handle(storage, context->transaction_handle); context->transaction_handle = NULL; return(SQL_SUCCEEDED(rc) ? 0 : 1); } /* * librdf_storage_virtuoso_transaction_rollback: * @storage: the storage object * * Rollback a transaction. * * Return value: non-0 on failure **/ static int librdf_storage_virtuoso_transaction_rollback(librdf_storage* storage) { librdf_storage_virtuoso_instance *context; int rc; context = (librdf_storage_virtuoso_instance *)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_transaction_rollback \n"); #endif if(!context->transaction_handle) return 1; rc = SQLEndTran(SQL_HANDLE_DBC, context->transaction_handle->hdbc, SQL_ROLLBACK); if(!SQL_SUCCEEDED(rc)) rdf_virtuoso_ODBC_Errors("SQLEndTran(hdbc,ROLLBACK)", storage->world, context->transaction_handle); librdf_storage_virtuoso_release_handle(storage, context->transaction_handle); context->transaction_handle = NULL; return(SQL_SUCCEEDED(rc) ? 0 : 1); } /* * librdf_storage_virtuoso_transaction_get_handle: * @storage: the storage object * * Get the current transaction handle. * * Return value: non-0 on failure **/ static void* librdf_storage_virtuoso_transaction_get_handle(librdf_storage* storage) { librdf_storage_virtuoso_instance *context; context = (librdf_storage_virtuoso_instance *)storage->instance; #ifdef VIRTUOSO_STORAGE_DEBUG fprintf(stderr, "librdf_storage_virtuoso_transaction_get_handle \n"); #endif return context->transaction_handle; } /** * librdf_storage_virtuoso_supports_query: * @storage: #librdf_storage object * @query: #librdf_query query object * * Check if a storage system supports a query language. * * Not implemented. * * Return value: non-0 if the query is supported. **/ static int librdf_storage_virtuoso_supports_query(librdf_storage* storage, librdf_query *query) { librdf_uri *uri; uri = librdf_new_uri(storage->world, (unsigned char *)"http://www.w3.org/TR/rdf-vsparql-query/"); if(uri && query->factory->uri && librdf_uri_equals(query->factory->uri, uri)) { librdf_free_uri(uri); return 1; } librdf_free_uri(uri); if(!strcmp(query->factory->name, "vsparql")) return 1; else return 0; } /** * librdf_storage_query_execute: * @storage: #librdf_storage object * @query: #librdf_query query object * * Run the given query against the storage. * * Not implemented. * * Return value: #librdf_query_results or NULL on failure **/ static librdf_query_results* librdf_storage_virtuoso_query_execute(librdf_storage* storage, librdf_query *query) { librdf_query_virtuoso_context *qcontext; librdf_query_results* results = NULL; /* This storage only accepts query languages that it executes * ('vsparql') so we know the query context is a pointer to a * #librdf_query_virtuoso_context object as initialised by * librdf_query_virtuoso_init() */ qcontext = (librdf_query_virtuoso_context*)query->context; qcontext->storage = storage; librdf_storage_add_reference(storage); /* get a server connection (type #librdf_storage_virtuoso_connection) */ qcontext->vc = librdf_storage_virtuoso_get_handle(storage); if(query->factory->execute) { /* calls librdf_query_virtuoso_execute() with NULL model * having tied the query to this storage. */ if((results = query->factory->execute(query, NULL))) librdf_query_add_query_result(query, results); } return results; } /* local function to register Virtuoso storage functions */ static void librdf_storage_virtuoso_register_factory(librdf_storage_factory *factory) { factory->version = LIBRDF_STORAGE_INTERFACE_VERSION; factory->init = librdf_storage_virtuoso_init; factory->terminate = librdf_storage_virtuoso_terminate; factory->open = librdf_storage_virtuoso_open; factory->close = librdf_storage_virtuoso_close; factory->sync = librdf_storage_virtuoso_sync; factory->size = librdf_storage_virtuoso_size; factory->add_statement = librdf_storage_virtuoso_add_statement; factory->add_statements = librdf_storage_virtuoso_add_statements; factory->remove_statement = librdf_storage_virtuoso_remove_statement; factory->contains_statement = librdf_storage_virtuoso_contains_statement; factory->serialise = librdf_storage_virtuoso_serialise; factory->find_statements = librdf_storage_virtuoso_find_statements; factory->find_statements_with_options = librdf_storage_virtuoso_find_statements_with_options; factory->context_add_statement = librdf_storage_virtuoso_context_add_statement; factory->context_add_statements = librdf_storage_virtuoso_context_add_statements; factory->context_remove_statement = librdf_storage_virtuoso_context_remove_statement; factory->context_remove_statements = librdf_storage_virtuoso_context_remove_statements; factory->context_serialise = librdf_storage_virtuoso_context_serialise; factory->find_statements_in_context = librdf_storage_virtuoso_find_statements_in_context; factory->get_contexts = librdf_storage_virtuoso_get_contexts; factory->get_feature = librdf_storage_virtuoso_get_feature; factory->transaction_start = librdf_storage_virtuoso_transaction_start; factory->transaction_start_with_handle = librdf_storage_virtuoso_transaction_start_with_handle; factory->transaction_commit = librdf_storage_virtuoso_transaction_commit; factory->transaction_rollback = librdf_storage_virtuoso_transaction_rollback; factory->transaction_get_handle = librdf_storage_virtuoso_transaction_get_handle; factory->supports_query = librdf_storage_virtuoso_supports_query; factory->query_execute = librdf_storage_virtuoso_query_execute; } #ifdef MODULAR_LIBRDF /* Entry point for dynamically loaded storage module */ void librdf_storage_module_register_factory(librdf_world *world) { librdf_storage_register_factory(world, "virtuoso", "OpenLink Virtuoso Universal Server store", &librdf_storage_virtuoso_register_factory); } #else /* * librdf_init_storage_virtuoso: * @world: world object * * INTERNAL - initialise the storage_virtuoso module. **/ void librdf_init_storage_virtuoso(librdf_world *world) { librdf_storage_register_factory(world, "virtuoso", "OpenLink Virtuoso Universal Server store", &librdf_storage_virtuoso_register_factory); } #endif redland-1.0.17/src/redland.spec.in0000644000175000017500000001327111522560567013630 00000000000000# -*- RPM-SPEC -*- # Note that this is NOT a relocatable package %define name @PACKAGE@ %define version @VERSION@ %define release SNAP %define prefix /usr Summary: Redland RDF Application Framework Name: %{name} Version: %{version} Release: %{release} Prefix: %{_prefix} License: LGPLv2+ or ASL 2.0 Group: Development/Libraries Source: http://download.librdf.org/source/%{name}-%{version}.tar.gz URL: http://librdf.org/ BuildRoot: /tmp/%{name}-%{version} BuildRequires: libxml2-devel >= 2.4.0 BuildRequires: curl-devel BuildRequires: raptor2-devel >= @RAPTOR_MIN_VERSION@ BuildRequires: rasqal-devel >= @RASQAL_MIN_VERSION@, rasqal-devel <= @RASQAL_MAX_VERSION@ BuildRequires: perl >= 5.8.0 BuildRequires: db4-devel BuildRequires: mysql-devel BuildRequires: sqlite-devel BuildRequires: postgresql-devel BuildRequires: gtk-doc BuildRequires: libtool Packager: Dave Beckett Docdir: %{prefix}/doc Requires: libxml2 Requires: curl Requires: raptor2 Requires: rasqal Requires: mysql %description Redland is a library that provides a high-level interface for RDF (Resource Description Framework) implemented in an object-based API. It is modular and supports different RDF parsers, serializers, storage and query languages. Redland is designed for developers to provide RDF support in their applications as well as a core library for RDF developers to start with. %package devel Summary: Libraries and header files for programs that use Redland. Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: raptor2 >= @RAPTOR_MIN_VERSION@ Requires: rasqal >= @RASQAL_MIN_VERSION@, rasqal <= @RASQAL_MAX_VERSION@ %description devel Header files for development with Redland %prep %setup -q %build %configure \ --enable-release \ --with-threestore=no %{__make} OPTIMIZE="$RPM_OPT_FLAGS" %check make check %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %makeinstall find $RPM_BUILD_ROOT -print | xargs chmod u+w %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %{_libdir}/librdf*.so.* %{_bindir}/rdfproc %{_bindir}/redland-db-upgrade %dir %{_datadir}/redland %{_datadir}/redland/mysql-v1.ttl %{_datadir}/redland/mysql-v2.ttl %doc AUTHORS COPYING COPYING.LIB ChangeLog LICENSE.txt NEWS README %doc LICENSE-2.0.txt NOTICE %doc *.html %doc %{_mandir}/man1/redland-db-upgrade.1* %doc %{_mandir}/man1/rdfproc.1* %doc %{_mandir}/man3/redland.3* %files devel %defattr(-, root, root,-) %{_bindir}/redland-config %{_libdir}/librdf*.a %{_libdir}/librdf*.la %{_libdir}/librdf*.so %{_libdir}/pkgconfig/redland.pc %dir %{_datadir}/redland %{_datadir}/redland/Redland.i %{_includedir}/redland.h %{_includedir}/librdf.h %{_includedir}/rdf_*.h %doc AUTHORS COPYING COPYING.LIB ChangeLog LICENSE.txt NEWS README %doc LICENSE-2.0.txt NOTICE %doc docs/README.html %doc %{_datadir}/gtk-doc/html %doc %{_mandir}/man1/redland-config.1* %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %changelog * Tue Feb 1 2011 Dave Beckett - Require Raptor 2 - Do not use removed configure options --with-raptor and --with-rasqal * Sun Dec 16 2007 Dave Beckett - rasqal-devel has a max and a min version now - use macros like %{_bindir} and %{_includedir} - add postgresql-devel, gtk-doc and libtool to BuildRequires - create some new dirs explicitly * Sat May 5 2007 Dave Beckett - Add /usr/share/redland/mysql-v1.ttl and /usr/share/redland/mysql-v2.ttl * Wed Feb 15 2006 Dave Beckett - Require db4-devel - Disable postgresql for now * Thu Aug 11 2005 Dave Beckett - Update Source: - Do not require python-devel at build time - Add sqlite-devel build requirement. - Use %configure and %makeinstall * Thu Jul 21 2005 Dave Beckett - Updated for gtk-doc locations * Mon Nov 1 2004 Dave Beckett - License now LGPL/Apache 2 - Added LICENSE-2.0.txt and NOTICE * Mon Jul 19 2004 Dave Beckett - move perl, python packages into redland-bindings * Mon Jul 12 2004 Dave Beckett - put /usr/share/redland/Redland.i in redland-devel * Wed May 5 2004 Dave Beckett - require raptor 1.3.0 - require rasqal 0.2.0 * Fri Jan 30 2004 Dave Beckett - require raptor 1.2.0 - update for removal of python distutils - require python 2.2.0+ - require perl 5.8.0+ - build and require mysql - do not build and require threestore * Sun Jan 4 2004 Dave Beckett - added redland-python package - export some more docs * Mon Dec 15 2003 Dave Beckett - require raptor 1.1.0 - require libxml 2.4.0 or newer - added pkgconfig redland.pc - split redland/devel package shared libs correctly * Mon Sep 8 2003 Dave Beckett - require raptor 1.0.0 * Thu Sep 4 2003 Dave Beckett - added rdfproc * Thu Aug 28 2003 Dave Beckett - patches added post 0.9.13 to fix broken perl UNIVERSAL::isa * Thu Aug 21 2003 Dave Beckett - Add redland-db-upgrade.1 - Removed duplicate perl CORE shared objects * Sun Aug 17 2003 Dave Beckett - Updates for new perl module names. * Tue Apr 22 2003 Dave Beckett - Updated for Redhat 9, RPM 4 * Fri Feb 12 2003 Dave Beckett - Updated for redland 0.9.12 * Fri Jan 4 2002 Dave Beckett - Updated for new Perl module names * Fri Sep 14 2001 Dave Beckett - Added shared libraries redland-1.0.17/autogen.sh0000755000175000017500000002447412130425525012145 00000000000000#!/bin/sh # # autogen.sh - Generates initial makefiles from a pristine source tree # # USAGE: # autogen.sh [configure options] # # Configuration is affected by environment variables as follows: # # DRYRUN # If set to any value it will do no configuring but will emit the # programs that would be run. # e.g. DRYRUN=1 ./autogen.sh # # NOCONFIGURE # If set to any value it will generate all files but not invoke the # generated configure script. # e.g. NOCONFIGURE=1 ./autogen.sh # # AUTOMAKE ACLOCAL AUTOCONF AUTOHEADER LIBTOOLIZE GTKDOCIZE # If set (named after program) then this overrides any searching for # the programs on the current PATH. # e.g. AUTOMAKE=automake-1.7 ACLOCAL=aclocal-1.7 ./autogen.sh # # CONFIG_DIR (default ../config) # The directory where fresh GNU config.guess and config.sub can be # found for automatic copying in-place. # # PATH # Where the programs are searched for # # SRCDIR (default .) # Source directory # # This script is based on similar scripts used in various tools # commonly made available via CVS and used with GNU automake. # Try 'locate autogen.sh' on your system and see what you get. # # This script is in the public domain # # Directory for the sources SRCDIR=${SRCDIR-.} # Where the GNU config.sub, config.guess might be found CONFIG_DIR=${CONFIG_DIR-../config} # GIT sub modules file GITMODULES='.gitmodules' # The programs required for configuring which will be searched for # in the current PATH. # Set an envariable of the same name in uppercase, to override scan # programs="automake aclocal autoconf autoheader libtoolize" confs=`find . -name configure.ac -print | grep -v /releases/` gtkdoc_args= if grep "^GTK_DOC_CHECK" $confs >/dev/null; then programs="$programs gtkdocize" gtkdoc_args="--enable-gtk-doc" fi if grep "^AC_CHECK_PROGS.SWIG" $confs >/dev/null; then programs="$programs swig" fi ltdl_args= if grep "^AC_LIBLTDL_" $confs >/dev/null; then ltdl_args="--ltdl" fi silent_args= if grep "^AM_SILENT_RULES" $confs >/dev/null; then silent_args="--enable-silent-rules" fi # Some dependencies for autotools: # automake 1.13 requires autoconf 2.65 # automake 1.12 requires autoconf 2.62 # automake 1.11 requires autoconf 2.62 (needed for AM_SILENT_RULES) automake_min_vers=011102 aclocal_min_vers=$automake_min_vers autoconf_min_vers=026200 autoheader_min_vers=$autoconf_min_vers # libtool 2.2 required for LT_INIT language fix libtoolize_min_vers=020200 gtkdocize_min_vers=010300 swig_min_vers=010324 # Default program arguments automake_args="--gnu --add-missing --force --copy -Wall" aclocal_args="-Wall" autoconf_args="-Wall" libtoolize_args="--force --copy --automake $ltdl_args" gtkdocize_args="--copy" # --enable-gtk-doc does no harm if it's not available configure_args="--enable-maintainer-mode $gtkdoc_args $silent_args" # You should not need to edit below here ###################################################################### # number comparisons may need a C locale LANG=C LC_NUMERIC=C program=`basename $0` if test "X$DRYRUN" != X; then DRYRUN=echo fi cat > autogen-get-version.pl <&1 |") || next; while() { chomp; next if @vnums; # drain pipe if we got a vnums next unless /^\$mname/i; my(\$v)=/(\S+)\$/i; \$v =~ s/-.*\$//; @vnums=grep { defined \$_ && !/^\s*\$/} map { s/\D//g; \$_; } split(/\./, \$v); } close(PIPE); last if @vnums; } @vnums=(@vnums, 0, 0, 0)[0..2]; \$vn=join('', map { sprintf('%02d', \$_) } @vnums); print "\$vn\n"; exit 0; EOF autogen_get_version="`pwd`/autogen-get-version.pl" trap "rm -f $autogen_get_version" 0 1 9 15 update_prog_version() { dir=$1 prog=$2 # If there exists an envariable PROG in uppercase, use that and do not scan ucprog=`echo $prog | tr 'a-z' 'A-Z' ` eval env=\$${ucprog} if test X$env != X; then prog_name=$env prog_vers=`perl $autogen_get_version $prog_name $prog` if test X$prog_vers = X; then prog_vers=0 fi eval ${prog}_name=${prog_name} eval ${prog}_vers=${prog_vers} eval ${prog}_dir=environment return fi eval prog_name=\$${prog}_name eval prog_vers=\$${prog}_vers eval prog_dir=\$${prog}_dir if test X$prog_vers = X; then prog_vers=0 fi save_PATH="$PATH" cd "$dir" PATH=".:$PATH" nameglob="$prog*" if [ -x /usr/bin/uname ]; then if [ `/usr/bin/uname` = 'Darwin' -a $prog = 'libtoolize' ] ; then nameglob="g$nameglob" fi fi names=`ls $nameglob 2>/dev/null` if [ "X$names" != "X" ]; then for name in $names; do vers=`perl $autogen_get_version $dir/$name $prog` if [ "X$vers" = "X" ]; then continue fi if expr $vers '>' $prog_vers >/dev/null; then prog_name=$name prog_vers=$vers prog_dir="$dir" fi done fi eval ${prog}_name=${prog_name} eval ${prog}_vers=${prog_vers} eval ${prog}_dir=${prog_dir} PATH="$save_PATH" } check_prog_version() { prog=$1 eval min=\$${prog}_min_vers eval prog_name=\$${prog}_name eval prog_vers=\$${prog}_vers eval prog_dir=\$${prog}_dir echo "$program: $prog program '$prog_name' V $prog_vers (min $min) in $prog_dir" 1>&2 rc=1 if test $prog_vers != 0; then if expr $prog_vers '<' $min >/dev/null; then echo "$program: ERROR: \`$prog' version $prog_vers in $prog_dir is too old." echo " (version $min or newer is required)" rc=0 else # Things are ok, so set the ${prog} name eval ${prog}=${prog_name} fi else echo "$program: ERROR: You must have \`$prog' installed to compile this package." echo " (version $min or newer is required)" rc=0 fi return $rc } # Find newest version of programs in the current PATH save_args=${1+"$*"} save_ifs="$IFS" IFS=":" set - $PATH IFS="$save_ifs" echo "$program: Looking for programs: $programs" here=`pwd` while [ $# -ne 0 ] ; do dir=$1 shift if [ ! -d "$dir" ]; then continue fi for prog in $programs; do update_prog_version "$dir" $prog done done cd $here set - $save_args # END Find programs # Check the versions meet the requirements for prog in $programs; do if check_prog_version $prog; then exit 1 fi done echo "$program: Dependencies satisfied" if test -d $SRCDIR/libltdl; then touch $SRCDIR/libltdl/NO-AUTO-GEN fi config_dir= if test -d $CONFIG_DIR; then config_dir=`cd $CONFIG_DIR; pwd` fi # Initialise and/or update GIT submodules if test -f $GITMODULES ; then echo " " modules=`sed -n -e 's/^.*path = \(.*\)/\1/p' $GITMODULES` for module in $modules; do if test `ls -1 $module | wc -l` -eq 0; then echo "$program: Initializing git submodule in $module" $DRYRUN git submodule init $module fi done echo "$program: Updating git submodules: $modules" $DRYRUN git submodule update fi for coin in `find $SRCDIR -name configure.ac -print | grep -v /releases/` do status=0 dir=`dirname $coin` if test -f "$dir/NO-AUTO-GEN"; then echo "$program: Skipping $dir -- flagged as no auto-generation" else echo " " echo $program: Processing directory $dir ( cd "$dir" # Ensure that these are created by the versions on this system # (indirectly via automake) $DRYRUN rm -f ltconfig ltmain.sh libtool stamp-h* # Made by automake $DRYRUN rm -f missing depcomp # automake junk $DRYRUN rm -rf autom4te*.cache config_macro_dir=`sed -ne 's/^AC_CONFIG_MACRO_DIR(\([^)]*\).*/\1/p' configure.ac` if test "X$config_macro_dir" = X; then config_macro_dir=. else aclocal_args="$aclocal_args -I $config_macro_dir " fi config_aux_dir=`sed -ne 's/^AC_CONFIG_AUX_DIR(\([^)]*\).*/\1/p' configure.ac` if test "X$config_aux_dir" = X; then config_aux_dir=. fi if test "X$config_dir" != X; then echo "$program: Updating config.guess and config.sub" for file in config.guess config.sub; do cfile=$config_dir/$file xfile=$config_aux_dir/$file if test -f $cfile; then $DRYRUN rm -f $xfile $DRYRUN cp -p $cfile $xfile fi done fi echo "$program: Running $libtoolize $libtoolize_args" $DRYRUN rm -f ltmain.sh libtool eval $DRYRUN $libtoolize $libtoolize_args status=$? if test $status != 0; then break fi if grep "^GTK_DOC_CHECK" configure.ac >/dev/null; then # gtkdocize junk $DRYRUN rm -rf gtk-doc.make echo "$program: Running $gtkdocize $gtkdocize_args" $DRYRUN $gtkdocize $gtkdocize_args status=$? if test $status != 0; then break fi fi if test ! -f NEWS; then echo "$program: Creating empty NEWS file to allow configure to work" $DRYRUN touch -t 200001010000 NEWS fi echo "$program: Running $aclocal $aclocal_args" $DRYRUN $aclocal $aclocal_args if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then echo "$program: Running $autoheader" $DRYRUN $autoheader status=$? if test $status != 0; then break fi fi echo "$program: Running $automake $automake_args" $DRYRUN $automake $automake_args status=$? if test $status != 0; then break fi echo "$program: Running $autoconf $autoconf_args" $DRYRUN $autoconf $autoconf_args status=$? if test $status != 0; then break fi ) fi if test $status != 0; then echo "$program: FAILED to configure $dir" exit $status fi done rm -f config.cache AUTOMAKE=$automake AUTOCONF=$autoconf ACLOCAL=$aclocal export AUTOMAKE AUTOCONF ACLOCAL if test "X$NOCONFIGURE" = X; then echo " " if test -z "$*"; then echo "$program: WARNING: Running \`configure' with no arguments." echo "If you wish to pass any to it, please specify them on the" echo "\`$program' command line." fi echo "$program: Running ./configure $configure_args $@" if test "X$DRYRUN" = X; then $DRYRUN ./configure $configure_args "$@" \ && echo "$program: Now type \`make' to compile this package" || exit 1 else $DRYRUN ./configure $configure_args "$@" fi fi exit $status redland-1.0.17/FAQS.html0000644000175000017500000002144212071146235011556 00000000000000 Redland librdf RDF API Library - Frequently Asked Questions (FAQs)

Redland librdf RDF API Library - Frequently Asked Questions (FAQs)

  1. What is the license?

    Redland is Free Software, or Open Source if you prefer.

  2. Why is the code released under two licenses - LGPL and Apache 2?

    I originally considered solely a GPL version of the library but this was too restrictive, hence the LGPL version. LGPL also allows the user, at their choice, to license the software under the GPL (See LGPL Term 3) in which case this software can also be used with all the other GPLed code -- see next answer.

    As an alternative, the entire library can be used under the terms of the Apache License, Version 2.0 which allows you use the library in most situations.

  3. Can I link this library with code under license XXX?

    Firstly, I am not a lawyer, so seek your own legal advice if you care about it seriously. However, here is an overview of how you can use this software:

    • If you choose the LGPL/GPL licenses, the GNU project list of licenses page says that you can link the following licensed software with the code:
      GPLed, LGPLed, Guile, GNU Ada, X11, Expat, Standard ML of NJ, Cryptix, modified BSD, zlib,iMatrix, W3C, Berkeley/Sleepycat Database, OpenLDAP, Python 1.6a2 earlier, Python 2.0.1,2.1.1 and later, Perl (as GPL), Clarified Artistic, Artistic 2.0, Zope 2.0, Intel OSL, Netscape JavaScript, eCOS 2.0, Eiffel V2
      and not these types:
      Affero, Arphic, original BSD, Original BSD, AFL 1.1, OSL 1.0, Apache 1.0, Apache 1.1, Zope V1, xinetd, Python 1.6b1+ and 2.0 and 2.1, OpenLDAP V2.3, Vim 5.7, IBM PL 1.0, Phorum V1.2, LaTeX (LPPL), MPL, NOSL 1.0, Interbase 1.0, Sun PL, Nokia OSL, Netscape PL, Jabber OSL 1.0, Sun ISSL 1.0, QPL 1.0, Freetype License, PHP License, Zend License
      check the link above for updates, since the above is not a definitive list.
    • If you choose Apache 2.0, you should be able to link with most anything. There is presently a debate on whether the (L)GPL2 is compatible with Apache 2.0 (FSF says no, ASF says yes) so when linking with LGPL or GPLed code it makes sense to pick either of the LGPL or GPL licenses.
  4. Why is Redland written in C?

    Writing in C allows reuse in lots of ways and the library should be easy to call from languages since most of them allow importing of C libraries or calling of C functions.

    C is also more "portable" (subject to the usual C problems) and should be compilable on many different systems. I have access to and have built it on (at various times):

    Redhat 7-9, RHEL 4, 5; Fedora Core 9-13, Gentoo ~ 2007-2009, Debian 3.0/unstable GNU/Linux (x86); Ubuntu 'D' - 'J' 9.04; Solaris 2.5, 7-9 (Sparc); Open SOlaris 10 (Intel); OSX 10.2-10.4 (PPC); OSX 10.4-10.6 (intel); Debian GNU/Linux (DEC Alpha); FreeBSD 4.7-4.9 (x86); HP-UX 10, OpenBSD, NetBSD and more more.

    it configured, built and tested out of the box on all of these (C interface; the other language APIs depend on the particular support of each OS).

    See also the W3C Library note on C++ in C which covers some of these issues, although I wrote the library before finding this.

  5. Why is it called Redland?

    Well, librdf was too boring :)! When I originally created it, I worked for the University of Bristol and lived in the Redland area of Bristol which has an 'R' and a 'D' in the name. Plus I couldn't find a decent word with the letters 'RDF' in it. Years later I realised there's an area of Bristol called Redcliffe, but that opportunity has passed.

  6. Redlands?

    No. It is named after Redland which is a region of Bristol, UK. Not related to an area near Los Angeles, California, USA.

  7. Redmond?

    No. It is named after Redland which is a region of Bristol, UK. Not related to an area near Seattle, Washington State, USA.

  8. Where is the LANG higher-level language interface?

    Redland provides multiple higher-leval language interfaces via SWIG. If SWIG does another language you want and supports it, you should be able to build one yourself relatively easily, following the existing scheme.

  9. Does it support an RDF query language?

    Yes. Rasqal provides query language syntax, formatting and execution of both SPARQL 1.0 and RDQL.

  10. Does it run on MS Windows?

    Yes, from reports others have had success compiling the Redland libraries for win32. As of Redland 1.0.0 there are packaged pre-built DLLs for redland available from the download site, including some language bindings.

    With respect to portability and "unix"-isms in the code, they are flagged in comments and only related to file name handling and maybe in creating temporary files. Raptor's URI module handles win32 file URI combinations which have been working for win32 users.

    The Redland libraries all build under the Cygwin environment relatively easily using the standard configure and make system.

  11. Does it run on Apple OSX?

    Yes but may need some development libraries and headers from MacPorts or Fink.

  12. Redland and Raptor - what are they?

    Redland is the RDF library written in C and including several high-level language APIs providing RDF manipulation and storage. Redland requires Raptor and cannot be used without it since it uses URI and WWW retrieval parts even if no parsing is being performed. The Redland sources currently include Raptor, although this may change.

    Raptor is the RDF parser library written in C dealing with reading RDF/XML and N-Triples syntaxes (more eventually) into RDF triples. It is an entirely standalone and separate library from Redland, developed and released on a different schedule.

  13. Rasqal?

    The RDF Syntax and Query Library for Redland, pronounced "rascal" - thanks to Phil McCarthy for the name. You can also blame Talk Like a Pirate Day and Pirates of the Caribbean -- The Curse of The Black Pearl (2003). Arrrr!

  14. Why was the license changed from LGPL/MPL to LGPL/Apache?

    I outlined my reasons in my message to redland-dev 2004-08-27:

    In my opinion, the MPL isn't very widely used - it is mostly used by the Mozilla project for the browser and it's components. It is based in US law and rather long(*). This means there is a cost in evaluating it, so people tend to use Redland's LGPL/GPL terms since they are one of the most used licenses.

    The Apache 2.0 license[1] has had widespread and detailed consideration including issues with international law. It is a modern license, clear to read and easy to apply. All the Apache Software Foundation (ASF) projects either use it or will be switching to it, and there are lots of similarly licensed BSD-style work that are compatible. It provides good terms for commercial users, requiring just acknowledgement notices. I've not written the notices I'd use for Redland yet.

    I think anyone who was using the Redland libraries under the MPL will be fine with the Apache 2.0 license. Of the commercial users I am aware of, they are using the libraries under the LGPL so this shouldn't affect them, or even be beneficial.

    So why not Apache 2.0 alone? There is still a dispute if it is compatible with the GPL, and until the FSF and the ASF both agree that they are compatible, I will be including explicit GPL compatibility by using the LGPL 2.1.

    ... Dave

    (*) Yes so is the GPL/LGPL, but they are very common and familiar.


Copyright (C) 2000-2013 Dave Beckett
Copyright (C) 2000-2004, University of Bristol

redland-1.0.17/examples/0000755000175000017500000000000012257576340012043 500000000000000redland-1.0.17/examples/Makefile.am0000644000175000017500000000225111772662730014017 00000000000000# -*- Mode: Makefile -*- # # Makefile.am - example automake file for Redland # EXAMPLES=example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT) example6$(EXEEXT) example7$(EXEEXT) example8$(EXEEXT) OTHER_EXAMPLES=redland_dbus rss2ical rss2atom EXTRA_PROGRAMS = $(EXAMPLES) $(OTHER_EXAMPLES) CLEANFILES=$(TESTS) $(EXAMPLES) $(OTHER_EXAMPLES) test*db examples: $(EXAMPLES) AM_CPPFLAGS=@CPPFLAGS@ @LIBRDF_CPPFLAGS@ @LIBRDF_INTERNAL_CPPFLAGS@ -I$(top_srcdir)/src @LIBRDF_EXTERNAL_CPPFLAGS@ LDADD=@LIBRDF_DIRECT_LIBS@ $(top_builddir)/src/librdf.la AM_LDFLAGS=@LIBRDF_LDFLAGS@ example1_SOURCES = example1.c example2_SOURCES = example2.c example3_SOURCES = example3.c example4_SOURCES = example4.c example5_SOURCES = example5.c example6_SOURCES = example6.c example7_SOURCES = example7.c example8_SOURCES = example8.c rss2ical_SOURCES = rss2ical.c rss2atom_SOURCES = rss2atom.c redland_dbus_SOURCES = redland_dbus.c redland_dbus_CFLAGS=`pkg-config --cflags dbus-1 glib-2.0 dbus-glib-1 gthread` redland_dbus_LDFLAGS=`pkg-config --libs dbus-1 glib-2.0 dbus-glib-1 gthread` $(top_builddir)/src/librdf.la: cd $(top_builddir)/src && $(MAKE) librdf.la redland-1.0.17/examples/Makefile.in0000644000175000017500000006260712257575714014047 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- Mode: Makefile -*- # # Makefile.am - example automake file for Redland # VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ EXTRA_PROGRAMS = $(EXAMPLES) $(am__EXEEXT_1) subdir = examples DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/rdf_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = redland_dbus$(EXEEXT) rss2ical$(EXEEXT) \ rss2atom$(EXEEXT) am_example1_OBJECTS = example1.$(OBJEXT) example1_OBJECTS = $(am_example1_OBJECTS) example1_LDADD = $(LDADD) example1_DEPENDENCIES = $(top_builddir)/src/librdf.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am_example2_OBJECTS = example2.$(OBJEXT) example2_OBJECTS = $(am_example2_OBJECTS) example2_LDADD = $(LDADD) example2_DEPENDENCIES = $(top_builddir)/src/librdf.la am_example3_OBJECTS = example3.$(OBJEXT) example3_OBJECTS = $(am_example3_OBJECTS) example3_LDADD = $(LDADD) example3_DEPENDENCIES = $(top_builddir)/src/librdf.la am_example4_OBJECTS = example4.$(OBJEXT) example4_OBJECTS = $(am_example4_OBJECTS) example4_LDADD = $(LDADD) example4_DEPENDENCIES = $(top_builddir)/src/librdf.la am_example5_OBJECTS = example5.$(OBJEXT) example5_OBJECTS = $(am_example5_OBJECTS) example5_LDADD = $(LDADD) example5_DEPENDENCIES = $(top_builddir)/src/librdf.la am_example6_OBJECTS = example6.$(OBJEXT) example6_OBJECTS = $(am_example6_OBJECTS) example6_LDADD = $(LDADD) example6_DEPENDENCIES = $(top_builddir)/src/librdf.la am_example7_OBJECTS = example7.$(OBJEXT) example7_OBJECTS = $(am_example7_OBJECTS) example7_LDADD = $(LDADD) example7_DEPENDENCIES = $(top_builddir)/src/librdf.la am_example8_OBJECTS = example8.$(OBJEXT) example8_OBJECTS = $(am_example8_OBJECTS) example8_LDADD = $(LDADD) example8_DEPENDENCIES = $(top_builddir)/src/librdf.la am_redland_dbus_OBJECTS = redland_dbus-redland_dbus.$(OBJEXT) redland_dbus_OBJECTS = $(am_redland_dbus_OBJECTS) redland_dbus_LDADD = $(LDADD) redland_dbus_DEPENDENCIES = $(top_builddir)/src/librdf.la redland_dbus_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(redland_dbus_CFLAGS) \ $(CFLAGS) $(redland_dbus_LDFLAGS) $(LDFLAGS) -o $@ am_rss2atom_OBJECTS = rss2atom.$(OBJEXT) rss2atom_OBJECTS = $(am_rss2atom_OBJECTS) rss2atom_LDADD = $(LDADD) rss2atom_DEPENDENCIES = $(top_builddir)/src/librdf.la am_rss2ical_OBJECTS = rss2ical.$(OBJEXT) rss2ical_OBJECTS = $(am_rss2ical_OBJECTS) rss2ical_LDADD = $(LDADD) rss2ical_DEPENDENCIES = $(top_builddir)/src/librdf.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(example1_SOURCES) $(example2_SOURCES) $(example3_SOURCES) \ $(example4_SOURCES) $(example5_SOURCES) $(example6_SOURCES) \ $(example7_SOURCES) $(example8_SOURCES) \ $(redland_dbus_SOURCES) $(rss2atom_SOURCES) \ $(rss2ical_SOURCES) DIST_SOURCES = $(example1_SOURCES) $(example2_SOURCES) \ $(example3_SOURCES) $(example4_SOURCES) $(example5_SOURCES) \ $(example6_SOURCES) $(example7_SOURCES) $(example8_SOURCES) \ $(redland_dbus_SOURCES) $(rss2atom_SOURCES) \ $(rss2ical_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIGEST_OBJS = @DIGEST_OBJS@ DIGEST_SRCS = @DIGEST_SRCS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HASH_OBJS = @HASH_OBJS@ HASH_SRCS = @HASH_SRCS@ HAVE_RAPTOR2_API = @HAVE_RAPTOR2_API@ HTML_DIR = @HTML_DIR@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IODBC_CONFIG = @IODBC_CONFIG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBRDF_CPPFLAGS = @LIBRDF_CPPFLAGS@ LIBRDF_DIRECT_LIBS = @LIBRDF_DIRECT_LIBS@ LIBRDF_EXTERNAL_CPPFLAGS = @LIBRDF_EXTERNAL_CPPFLAGS@ LIBRDF_EXTERNAL_LIBS = @LIBRDF_EXTERNAL_LIBS@ LIBRDF_INTERNAL_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ LIBRDF_INTERNAL_DEPS = @LIBRDF_INTERNAL_DEPS@ LIBRDF_INTERNAL_LIBS = @LIBRDF_INTERNAL_LIBS@ LIBRDF_LDFLAGS = @LIBRDF_LDFLAGS@ LIBRDF_LIBTOOLLIBS = @LIBRDF_LIBTOOLLIBS@ LIBRDF_LIBTOOL_VERSION = @LIBRDF_LIBTOOL_VERSION@ LIBRDF_PKGCONFIG_PRIVATE_LIBS = @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ LIBRDF_VERSION_DECIMAL = @LIBRDF_VERSION_DECIMAL@ LIBRDF_VERSION_MAJOR = @LIBRDF_VERSION_MAJOR@ LIBRDF_VERSION_MINOR = @LIBRDF_VERSION_MINOR@ LIBRDF_VERSION_RELEASE = @LIBRDF_VERSION_RELEASE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEM = @MEM@ MEM_LIBS = @MEM_LIBS@ MKDIR_P = @MKDIR_P@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ODBC_CFLAGS = @ODBC_CFLAGS@ ODBC_LIBS = @ODBC_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSTGRESQL_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ POSTGRESQL_LIBS = @POSTGRESQL_LIBS@ RANLIB = @RANLIB@ RAPTOR2_CFLAGS = @RAPTOR2_CFLAGS@ RAPTOR2_LIBS = @RAPTOR2_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ RASQAL_CFLAGS = @RASQAL_CFLAGS@ RASQAL_LIBS = @RASQAL_LIBS@ RASQAL_MAX_VERSION = @RASQAL_MAX_VERSION@ RASQAL_MIN_VERSION = @RASQAL_MIN_VERSION@ RECHO = @RECHO@ RECHO_C = @RECHO_C@ RECHO_N = @RECHO_N@ REDLAND_MODULE_PATH = @REDLAND_MODULE_PATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TAR = @TAR@ TSTORE_CONFIG = @TSTORE_CONFIG@ TSTORE_CPPFLAGS = @TSTORE_CPPFLAGS@ TSTORE_LIBS = @TSTORE_LIBS@ VERSION = @VERSION@ VIRTUOSO_CPPFLAGS = @VIRTUOSO_CPPFLAGS@ VIRTUOSO_LIBS = @VIRTUOSO_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXAMPLES = example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT) example6$(EXEEXT) example7$(EXEEXT) example8$(EXEEXT) OTHER_EXAMPLES = redland_dbus rss2ical rss2atom CLEANFILES = $(TESTS) $(EXAMPLES) $(OTHER_EXAMPLES) test*db AM_CPPFLAGS = @CPPFLAGS@ @LIBRDF_CPPFLAGS@ @LIBRDF_INTERNAL_CPPFLAGS@ -I$(top_srcdir)/src @LIBRDF_EXTERNAL_CPPFLAGS@ LDADD = @LIBRDF_DIRECT_LIBS@ $(top_builddir)/src/librdf.la AM_LDFLAGS = @LIBRDF_LDFLAGS@ example1_SOURCES = example1.c example2_SOURCES = example2.c example3_SOURCES = example3.c example4_SOURCES = example4.c example5_SOURCES = example5.c example6_SOURCES = example6.c example7_SOURCES = example7.c example8_SOURCES = example8.c rss2ical_SOURCES = rss2ical.c rss2atom_SOURCES = rss2atom.c redland_dbus_SOURCES = redland_dbus.c redland_dbus_CFLAGS = `pkg-config --cflags dbus-1 glib-2.0 dbus-glib-1 gthread` redland_dbus_LDFLAGS = `pkg-config --libs dbus-1 glib-2.0 dbus-glib-1 gthread` all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): example1$(EXEEXT): $(example1_OBJECTS) $(example1_DEPENDENCIES) $(EXTRA_example1_DEPENDENCIES) @rm -f example1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example1_OBJECTS) $(example1_LDADD) $(LIBS) example2$(EXEEXT): $(example2_OBJECTS) $(example2_DEPENDENCIES) $(EXTRA_example2_DEPENDENCIES) @rm -f example2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example2_OBJECTS) $(example2_LDADD) $(LIBS) example3$(EXEEXT): $(example3_OBJECTS) $(example3_DEPENDENCIES) $(EXTRA_example3_DEPENDENCIES) @rm -f example3$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example3_OBJECTS) $(example3_LDADD) $(LIBS) example4$(EXEEXT): $(example4_OBJECTS) $(example4_DEPENDENCIES) $(EXTRA_example4_DEPENDENCIES) @rm -f example4$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example4_OBJECTS) $(example4_LDADD) $(LIBS) example5$(EXEEXT): $(example5_OBJECTS) $(example5_DEPENDENCIES) $(EXTRA_example5_DEPENDENCIES) @rm -f example5$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example5_OBJECTS) $(example5_LDADD) $(LIBS) example6$(EXEEXT): $(example6_OBJECTS) $(example6_DEPENDENCIES) $(EXTRA_example6_DEPENDENCIES) @rm -f example6$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example6_OBJECTS) $(example6_LDADD) $(LIBS) example7$(EXEEXT): $(example7_OBJECTS) $(example7_DEPENDENCIES) $(EXTRA_example7_DEPENDENCIES) @rm -f example7$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example7_OBJECTS) $(example7_LDADD) $(LIBS) example8$(EXEEXT): $(example8_OBJECTS) $(example8_DEPENDENCIES) $(EXTRA_example8_DEPENDENCIES) @rm -f example8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example8_OBJECTS) $(example8_LDADD) $(LIBS) redland_dbus$(EXEEXT): $(redland_dbus_OBJECTS) $(redland_dbus_DEPENDENCIES) $(EXTRA_redland_dbus_DEPENDENCIES) @rm -f redland_dbus$(EXEEXT) $(AM_V_CCLD)$(redland_dbus_LINK) $(redland_dbus_OBJECTS) $(redland_dbus_LDADD) $(LIBS) rss2atom$(EXEEXT): $(rss2atom_OBJECTS) $(rss2atom_DEPENDENCIES) $(EXTRA_rss2atom_DEPENDENCIES) @rm -f rss2atom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rss2atom_OBJECTS) $(rss2atom_LDADD) $(LIBS) rss2ical$(EXEEXT): $(rss2ical_OBJECTS) $(rss2ical_DEPENDENCIES) $(EXTRA_rss2ical_DEPENDENCIES) @rm -f rss2ical$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rss2ical_OBJECTS) $(rss2ical_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example6.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example7.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redland_dbus-redland_dbus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rss2atom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rss2ical.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< redland_dbus-redland_dbus.o: redland_dbus.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(redland_dbus_CFLAGS) $(CFLAGS) -MT redland_dbus-redland_dbus.o -MD -MP -MF $(DEPDIR)/redland_dbus-redland_dbus.Tpo -c -o redland_dbus-redland_dbus.o `test -f 'redland_dbus.c' || echo '$(srcdir)/'`redland_dbus.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/redland_dbus-redland_dbus.Tpo $(DEPDIR)/redland_dbus-redland_dbus.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='redland_dbus.c' object='redland_dbus-redland_dbus.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(redland_dbus_CFLAGS) $(CFLAGS) -c -o redland_dbus-redland_dbus.o `test -f 'redland_dbus.c' || echo '$(srcdir)/'`redland_dbus.c redland_dbus-redland_dbus.obj: redland_dbus.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(redland_dbus_CFLAGS) $(CFLAGS) -MT redland_dbus-redland_dbus.obj -MD -MP -MF $(DEPDIR)/redland_dbus-redland_dbus.Tpo -c -o redland_dbus-redland_dbus.obj `if test -f 'redland_dbus.c'; then $(CYGPATH_W) 'redland_dbus.c'; else $(CYGPATH_W) '$(srcdir)/redland_dbus.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/redland_dbus-redland_dbus.Tpo $(DEPDIR)/redland_dbus-redland_dbus.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='redland_dbus.c' object='redland_dbus-redland_dbus.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(redland_dbus_CFLAGS) $(CFLAGS) -c -o redland_dbus-redland_dbus.obj `if test -f 'redland_dbus.c'; then $(CYGPATH_W) 'redland_dbus.c'; else $(CYGPATH_W) '$(srcdir)/redland_dbus.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am examples: $(EXAMPLES) $(top_builddir)/src/librdf.la: cd $(top_builddir)/src && $(MAKE) librdf.la # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: redland-1.0.17/examples/example4.c0000644000175000017500000000427111047402716013641 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * example4.c - Redland example code using the serializing * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #include #include #include #include #include /* one prototype needed */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { librdf_world* world; librdf_storage *storage; librdf_model* model; librdf_uri* uri, *base_uri; librdf_parser* parser; librdf_serializer* serializer; world=librdf_new_world(); librdf_world_open(world); model=librdf_new_model(world, storage=librdf_new_storage(world, "hashes", "test", "hash-type='bdb',dir='.'"), NULL); parser=librdf_new_parser(world,"rdfxml","application/rdf+xml",NULL); uri=librdf_new_uri(world, (const unsigned char*)"file:../data/dc.rdf"); librdf_parser_parse_into_model(parser,uri,uri,model); librdf_free_uri(uri); librdf_free_parser(parser); serializer=librdf_new_serializer(world, "rdfxml", NULL, NULL); base_uri=librdf_new_uri(world, (const unsigned char*)"http://exampe.org/base.rdf"); librdf_serializer_serialize_model_to_file_handle(serializer, stdout, base_uri, model); librdf_free_serializer(serializer); librdf_free_uri(base_uri); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return(0); } redland-1.0.17/examples/redland_dbus.c0000644000175000017500000001204311317770025014545 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * redland_dbus.c - Redland D-BUS example code * * $Id$ * * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * */ #include #include #include #ifdef HAVE_STDLIB_H #include #endif #include /* for the memory allocation functions */ #if defined(HAVE_DMALLOC_H) && defined(RAPTOR_MEMORY_DEBUG_DMALLOC) #include #endif /* Redland includes */ #include #define DBUS_API_SUBJECT_TO_CHANGE 1 /* glib */ #include /* with threads*/ #include /* D-BUS */ #include /* D-BUS glib */ #include static DBusMessageHandler *disconnect_handler; static dbus_int32_t handler_slot = -1; typedef void TestData; static TestData* test_message_data_new(void) { return NULL; } static void test_message_data_free(TestData *data) { } static DBusHandlerResult handle_test_message (DBusMessageHandler *handler, DBusConnection *connection, DBusMessage *message, void *user_data) { dbus_connection_flush (connection); return DBUS_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } static DBusHandlerResult handle_disconnect (DBusMessageHandler *handler, DBusConnection *connection, DBusMessage *message, void *user_data) { g_print ("connection disconnected\n"); dbus_connection_unref (connection); return DBUS_HANDLER_RESULT_ALLOW_MORE_HANDLERS; } static void new_connection_callback (DBusServer *server, DBusConnection *new_connection, void *user_data) { const char *test_messages[] = { "org.librdf.redland.Test" }; const char *disconnect_messages[] = { "org.freedesktop.Local.Disconnect" }; DBusMessageHandler *test_message_handler; TestData *data; g_print ("new_connection_callback\n"); dbus_connection_ref (new_connection); dbus_connection_setup_with_g_main (new_connection, NULL); data = test_message_data_new(); test_message_handler = dbus_message_handler_new (handle_test_message, data, (DBusFreeFunction)test_message_data_free); if (!dbus_connection_register_handler (new_connection, test_message_handler, test_messages, 1)) goto nomem; if (!dbus_connection_set_data (new_connection, handler_slot, test_message_handler, (DBusFreeFunction)dbus_message_handler_unref)) goto nomem; if (!dbus_connection_register_handler (new_connection, disconnect_handler, disconnect_messages, 1)) goto nomem; return; nomem: g_error ("Out of memory in setting up new connection"); } int main(int argc, char *argv[]) { librdf_world* world; GMainLoop *loop; DBusServer *server; DBusError error; char *program=argv[0]; if (argc < 2) { fprintf (stderr, "%s: USAGE [server address]\n", program); return 1; } world=librdf_new_world(); librdf_world_open(world); g_thread_init (NULL); dbus_gthread_init (); dbus_error_init (&error); server = dbus_server_listen (argv[1], &error); if (server == NULL) { fprintf (stderr, "Failed to start server on %s: %s\n", argv[1], error.message); dbus_error_free (&error); return 1; } if (!dbus_connection_allocate_data_slot (&handler_slot)) g_error ("no memory for data slot"); disconnect_handler = dbus_message_handler_new (handle_disconnect, NULL, NULL); if (disconnect_handler == NULL) g_error ("no memory for handler"); dbus_server_set_new_connection_function (server, new_connection_callback, NULL, NULL); dbus_server_setup_with_g_main (server, NULL); loop = g_main_loop_new (NULL, FALSE); g_main_run (loop); librdf_free_world(world); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return 0; } redland-1.0.17/examples/rss2atom.c0000644000175000017500000001252011023633521013662 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rss2atom.c - read from a file 'file.rdf' (rdfxml) and serialize to atom * * Compile with: * gcc -o rss2atom `redland-config --cflags` rss2atom.c `redland-config --libs` * * Copyright (C) 2008, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * */ #include #include #include #include #include #define NSPACE_COUNT 3 static struct { const char* prefix; const char* ns_uri; librdf_uri* uri; } local_nspaces[NSPACE_COUNT]= { { "my", "http://example.org/my-ns#" }, { "owl", "http://www.w3.org/2002/07/owl#", }, { "rdfs", "http://www.w3.org/2000/01/rdf-schema#" } }; #define FEATURE_COUNT 3 static struct { const char* predicate; const char* value; } local_features[NSPACE_COUNT]= { /* Enable atom triples output for atom */ { "http://feature.librdf.org/raptor-rssTriples" , "atom-triples" }, /* Tell it to not write xml:base */ { "http://feature.librdf.org/raptor-writeBaseURI", "0" }, /* This is used to generate an atom entry feed */ { "http://feature.librdf.org/raptor-atomEntryUri", "http://example.org/2006/03/28/blog-item" } }; int main(int argc, char *argv[]) { librdf_world* world; librdf_storage* storage; librdf_parser* parser; librdf_model* model; char *program; char *p; librdf_uri *uri; const char *parser_name="rdfxml"; librdf_serializer* serializer; const char* serializer_name="atom"; unsigned char *string; size_t length; int i; program=argv[0]; if((p=strrchr(program, '/'))) program=p+1; else if((p=strrchr(program, '\\'))) program=p+1; argv[0]=program; if(argc <2 || argc >2) { fprintf(stderr, "USAGE: %s: \n", program); return(1); } world=librdf_new_world(); librdf_world_open(world); uri=librdf_new_uri_from_filename(world, argv[1]); if(!uri) { fprintf(stderr, "%s: Failed to create URI\n", program); return(1); } storage=librdf_new_storage(world, "memory", "test", NULL); if(!storage) { fprintf(stderr, "%s: Failed to create new storage\n", program); return(1); } model=librdf_new_model(world, storage, NULL); if(!model) { fprintf(stderr, "%s: Failed to create model\n", program); return(1); } parser=librdf_new_parser(world, parser_name, NULL, NULL); if(!parser) { fprintf(stderr, "%s: Failed to create new %s parser\n", program, parser_name); return(1); } /* PARSE the file as RDF/XML */ fprintf(stderr, "%s: Parsing file %s\n", program, librdf_uri_as_string(uri)); if(librdf_parser_parse_into_model(parser, uri, uri, model)) { fprintf(stderr, "%s: Failed to parse RDF into model\n", program); return(1); } librdf_free_parser(parser); fprintf(stderr, "%s: Resulting model is %d triples\n", program, librdf_model_size(model)); /* SERIALIZE the file as ATOM 1.0 */ serializer = librdf_new_serializer(world, serializer_name, NULL, NULL); if(!serializer) { fprintf(stderr, "%s: Failed to create %s serialize\n", program, serializer_name); return(1); } /* set the atom serializer namespaces */ for(i=0; i < NSPACE_COUNT; i++) { local_nspaces[i].uri=librdf_new_uri(world, (const unsigned char*)local_nspaces[i].ns_uri); librdf_serializer_set_namespace(serializer, local_nspaces[i].uri, local_nspaces[i].prefix); } /* set the atom serializer features */ for(i=0; i < FEATURE_COUNT; i++) { librdf_uri* predicate_uri; librdf_node* value_node; predicate_uri=librdf_new_uri(world, (const unsigned char*)local_features[i].predicate); value_node=librdf_new_node_from_literal(world, (const unsigned char*)local_features[i].value, NULL, 0); librdf_serializer_set_feature(serializer, predicate_uri, value_node); librdf_free_uri(predicate_uri); librdf_free_node(value_node); } string=librdf_serializer_serialize_model_to_counted_string(serializer, NULL /* librdf_uri* base_uri */, model, &length); fprintf(stderr, "%s: Serialized model (%d bytes)\n", program, (int)length); fputs((const char*)string, stdout); free(string); for(i=0; i < NSPACE_COUNT; i++) { if(local_nspaces[i].uri) librdf_free_uri(local_nspaces[i].uri); } librdf_free_serializer(serializer); librdf_free_model(model); librdf_free_storage(storage); librdf_free_uri(uri); librdf_free_world(world); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return(0); } redland-1.0.17/examples/example7.c0000644000175000017500000000411711047403274013643 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * example7.c - read from a file 'file.rdf', add a triple, write it again * * Compile with: * gcc -o example7 `redland-config --cflags` example7.c `redland-config --libs` * * Copyright (C) 2005-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2005-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * */ #include #include #include #include int main(int argc, char *argv[]) { librdf_world* world; librdf_storage* storage; librdf_model* model; librdf_statement *statement; /* See example1.c for the error checking that should be here */ world=librdf_new_world(); librdf_world_open(world); storage=librdf_new_storage(world, "file", "file.rdf", NULL); model=librdf_new_model(world, storage, NULL); statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/"), librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/title"), librdf_new_node_from_literal(world, (const unsigned char*)"Blah", NULL, 0) ); librdf_model_add_statement(model, statement); librdf_free_statement(statement); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); return(0); } redland-1.0.17/examples/example8.c0000644000175000017500000001016112241752733013644 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * example8.c - Redland example code SPARQL querying and formatting * * Copyright (C) 2010, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * USAGE: * To get json variable bindings * ./example8 http://librdf.org/redland.rdf json 'select * where { ?s ?p ?o}' * To get json triples (graph formatted): * ./example8 http://librdf.org/redland.rdf json 'construct {?s ?p ?o} where { ?s ?p ?o}' * */ #include #include #include #include #include #include /* one prototype needed */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { char *program = argv[0]; librdf_world* world; librdf_storage *storage; librdf_model* model = NULL; const char *parser_name; librdf_parser* parser; librdf_query* query; librdf_query_results* results; librdf_uri *uri; const unsigned char *query_string = NULL; const char *format; unsigned char* string = NULL; size_t length; world = librdf_new_world(); librdf_world_open(world); if(argc != 4) { fprintf(stderr, "USAGE: %s DATA-URI FORMAT|- QUERY-STRING\n", program); return 1; } uri = librdf_new_uri(world, (const unsigned char*)argv[1]); format = argv[2]; if(!strcmp(format, "-")) format = NULL; query_string = (const unsigned char*)argv[3]; storage = librdf_new_storage(world, "memory", "test", NULL); if(storage) model = librdf_new_model(world, storage, NULL); if(!model || !storage) { fprintf(stderr, "%s: Failed to make model or storage\n", program); return 1; } parser_name = librdf_parser_guess_name2(world, NULL, NULL, librdf_uri_as_string(uri)); parser = librdf_new_parser(world, parser_name, NULL, NULL); librdf_parser_parse_into_model(parser, uri, NULL, model); librdf_free_parser(parser); librdf_free_uri(uri); query = librdf_new_query(world, "sparql", NULL, query_string, NULL); results = librdf_model_query_execute(model, query); if(!results) { fprintf(stderr, "%s: Query of model with '%s' failed\n", program, query_string); return 1; } if(librdf_query_results_is_bindings(results) || librdf_query_results_is_boolean(results)) { string = librdf_query_results_to_counted_string2(results, format, NULL, NULL, NULL, &length); if(!string) { fprintf(stderr, "%s: Failed to turn query results to format '%s'\n", program, format); return 1; } } else { /* triples */ librdf_serializer* serializer; librdf_stream* stream; serializer = librdf_new_serializer(world, format, NULL, NULL); if(!serializer) { fprintf(stderr, "%s: Failed to create triples serializer for format '%s'\n", program, format); return 1; } stream = librdf_query_results_as_stream(results); string = librdf_serializer_serialize_stream_to_counted_string(serializer, NULL, stream, &length); librdf_free_stream(stream); if(!string) { fprintf(stderr, "%s: Failed to turn query results to format '%s'\n", program, format); return 1; } } fprintf(stderr, "%s: query returned %ld bytes string\n", program, length); fwrite(string, sizeof(char), length, stdout); free(string); librdf_free_query_results(results); librdf_free_query(query); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); /* keep gcc -Wall happy */ return(0); } redland-1.0.17/examples/example3.c0000644000175000017500000000475611455350447013656 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * example3.c - Redland example code creating model, statement and storing it in 10 lines * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #include #include #include #include #include /* one prototype needed */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { librdf_world* world; librdf_storage *storage; librdf_model* model; librdf_statement* statement; raptor_world *raptor_world_ptr; raptor_iostream* iostr; world=librdf_new_world(); librdf_world_open(world); raptor_world_ptr = librdf_world_get_raptor(world); model=librdf_new_model(world, storage=librdf_new_storage(world, "hashes", "test", "hash-type='bdb',dir='.'"), NULL); librdf_model_add_statement(model, statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://www.dajobe.org/"), librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/creator"), librdf_new_node_from_literal(world, (const unsigned char*)"Dave Beckett", NULL, 0) ) ); librdf_free_statement(statement); iostr = raptor_new_iostream_to_file_handle(raptor_world_ptr, stdout); librdf_model_write(model, iostr); raptor_free_iostream(iostr); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return(0); } redland-1.0.17/examples/rss2ical.c0000644000175000017500000002561311032336130013635 00000000000000/* rss2ical.c: Turn RSS into ical * * Copyright (C) 2008, David Beckett http://www.dajobe.org/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * * USAGE: rss2ical [URI of RSS/Atom Feed] [Calendar Title] > result.ics * */ #include #include #include #include #undef RSS2ICAL_DEBUG #define DO_ESCAPE_NL 0 static const unsigned char* get_items_query=(const unsigned char*) "PREFIX rss: \n\ PREFIX dc: \n\ PREFIX content: \n\ SELECT ?item ?date ?title ?description ?creator\n\ WHERE {\n\ ?item a rss:item;\n\ dc:date ?date;\n\ rss:title ?title;\n\ rss:description ?description .\n\ OPTIONAL { ?item dc:creator ?creator . }\n\ }"; /* Removed for now as OPTIONAL in Rasqal is fragile/broken: OPTIONAL { ?item dc:source ?source } \n\ OPTIONAL { ?item content:encoded ?htmldesc } \n \ */ /* %s-prod id %s-cal name id %s-rel cal id %s-tzone %s-tzone */ static const char *ical_header_format="\ BEGIN:VCALENDAR\r\n\ VERSION:2.0\r\n\ PRODID:%s\r\n\ X-WR-CALNAME:%s\r\n\ X-WR-RELCALID:%s\r\n\ X-WR-TIMEZONE:%s\r\n\ CALSCALE:GREGORIAN\r\n\ METHOD:PUBLISH\r\n\ BEGIN:VTIMEZONE\r\n\ TZID:%s\r\n\ BEGIN:DAYLIGHT\r\n\ DTSTART:20060326T020000\r\n\ TZOFFSETTO:+0100\r\n\ TZOFFSETFROM:+0000\r\n\ TZNAME:BST\r\n\ END:DAYLIGHT\r\n\ BEGIN:STANDARD\r\n\ DTSTART:20061029T020000\r\n\ TZOFFSETTO:+0000\r\n\ TZOFFSETFROM:+0100\r\n\ TZNAME:GMT\r\n\ END:STANDARD\r\n\ END:VTIMEZONE\r\n\ "; static const char *ical_footer_format="\ END:VCALENDAR\r\n\ "; static const char *tzone="Europe/London"; static char *program=NULL; static void ical_print(FILE *fh, const char *line) { fputs(line, fh); fwrite("\r\n", 1, 2, fh); } static void ical_format(FILE *fh, const char *key, const char *attr, const char *escapes, const unsigned char *value) { int col=0; int i=0; size_t len; int c; int lineno=0; len=strlen(key); fwrite(key, 1, len, fh); col += len; if(attr) { fputc(';', fh); col++; len=strlen(attr); fwrite(attr, 1, len, fh); col += len; } fputc(':', fh); col++; for(i=0; (c=value[i]); i++) { if(col == 75) { fwrite("\r\n ", 1, 3, fh); col=0; lineno++; } if(c == '\\' || (escapes && (strchr(escapes, c) != NULL))) { fputc('\\', fh); col++; } if(c == '\n') { #ifdef DO_ESCAPE_NL fputc('\\', fh); col++; c='n'; #else c=' '; #endif } fputc(c, fh); col++; } fwrite("\r\n", 1, 2, fh); } static unsigned char* iso2vcaldate(const unsigned char* iso_date) { unsigned char* vcaldate; unsigned char c; int i, j; /* YYYY-MM-DDTHH:MM:SSZ } * YYYY-MM-DDTHH:MMZ } to YYYYMMDDTHHMMSSZ * ... } */ vcaldate=(unsigned char*)malloc(17); strncpy((char*)vcaldate, "00000000T000000Z", 17); for(i=0, j=0; (c=iso_date[i]); i++) { if(c == 'Z') break; if(c != ':' && c != '-') vcaldate[j++]=iso_date[i]; } return vcaldate; } static unsigned char* remove_html_entities(unsigned char* html_desc, size_t len) { int i, j; unsigned char* description; unsigned char c; description=malloc(len+1); /* Trim leading white space */ for(i=0, j=0; (c=html_desc[i]) && (c == ' ' || c == '\n'); i++) ; for(; (c=html_desc[i]); i++) { if(c == '\n') c=' '; else if(c == '&') { c=html_desc[++i]; /* Expand { to UTF-8 for codepoint decimal 123 */ if(c == '#') { unsigned char *orig_p=&html_desc[i]; unsigned long d=0; int ulen; i++; while(c) { c=html_desc[i++]; if(c<'0' || c>'9') break; d=d*10; d+= (c - '0'); } if(c != ';') { fprintf(stderr, "%s: Expected ';' after &#NNN in '%s'\n", program, orig_p); abort(); } #ifdef RSS2ICAL_DEBUG fprintf(stderr, "%s: Encoding char %d\n", program, d); #endif ulen=raptor_unicode_char_to_utf8(d, &description[j]); #ifdef RSS2ICAL_DEBUG fprintf(stderr, "%s: UTF-8 len was %d\n", program, ulen); #endif j+= ulen; } else { const char* here=(const char*)&html_desc[i]; if(!strncmp(here, "amp;", 4)) { i+= 4; c='&'; } else if(!strncmp(here, "lt;", 3)) { i+= 3; c='<'; } else if(!strncmp(here, "gt;", 3)) { i+= 3; c='>'; } description[j++]=c; } continue; } description[j++]=c; } description[j]='\0'; return description; } static char* uri_to_calid(librdf_uri* uri) { size_t len; unsigned char* uri_string; char* calid; unsigned char c; int i, j; uri_string=librdf_uri_as_counted_string(uri, &len); calid=(char*)malloc(len+1); for(i=0, j=0; (c=uri_string[i]); i++) { if(c <= 0x20 || c >= 0x7f) continue; if(c == '\\' || c == ';' || c == ':' || c == '\"' || c == ',' || c == '/') calid[j++]='-'; else calid[j++]=c; } return calid; } int main(int argc, char *argv[]) { librdf_world* world; librdf_storage* storage; librdf_model* model; librdf_parser* parser; librdf_query* query; librdf_query_results* results; librdf_uri *uri; char *p; char* calendar_name; char* calendar_id; program=argv[0]; if((p=strrchr(program, '/'))) program=p+1; else if((p=strrchr(program, '\\'))) program=p+1; argv[0]=program; if(argc != 3) { fprintf(stderr, "USAGE: %s RSS-URI CALENDAR-NAME\n", program); return 1; } world=librdf_new_world(); librdf_world_open(world); storage=librdf_new_storage(world, "memory", NULL, NULL); model=librdf_new_model(world, storage, NULL); if(!model || !storage) { fprintf(stderr, "%s: Failed to make model or storage\n", program); return 1; } uri=librdf_new_uri(world, (unsigned char*)argv[1]); calendar_name=argv[2]; fprintf(stderr, "%s: Reading RSS from %s\n", program, librdf_uri_as_string(uri)); parser=librdf_new_parser(world, "rss-tag-soup", NULL, NULL); librdf_parser_parse_into_model(parser, uri, NULL, model); librdf_free_parser(parser); fprintf(stderr, "%s: Querying model for RSS items\n", program); query=librdf_new_query(world, "sparql", NULL, get_items_query, uri); results=librdf_model_query_execute(model, query); if(!results) { fprintf(stderr, "%s: Query of model with SPARQL query '%s' failed\n", program, get_items_query); return 1; } fprintf(stderr, "%s: Processing results\n", program); calendar_id=uri_to_calid(uri); fprintf(stdout, ical_header_format, "-//librdf/rss2ical Version 1.0//EN", calendar_name, calendar_id, tzone, tzone); free(calendar_id); while(!librdf_query_results_finished(results)) { unsigned char *uid=NULL; unsigned char *summary=NULL; unsigned char *dtstart=NULL; unsigned char *location=NULL; unsigned char *html_desc=NULL; size_t html_desc_len; unsigned char *description=NULL; unsigned char *url=NULL; librdf_node* node; char *creator=NULL; node=librdf_query_results_get_binding_value_by_name(results, "item"); if(!librdf_node_is_resource(node)) goto nextresult; url=librdf_uri_as_string(librdf_node_get_uri(node)); /* uid is a new string */ uid=(unsigned char*)uri_to_calid(librdf_node_get_uri(node)); node=librdf_query_results_get_binding_value_by_name(results, "date"); if(!librdf_node_is_literal(node)) { fprintf(stderr, "%s: Date in item %s is not a literal\n", program, url); goto nextresult; } dtstart=librdf_node_get_literal_value(node); dtstart=iso2vcaldate(dtstart); node=librdf_query_results_get_binding_value_by_name(results, "title"); if(!librdf_node_is_literal(node)) summary=(unsigned char*)"(No Title)"; else summary=librdf_node_get_literal_value(node); node=librdf_query_results_get_binding_value_by_name(results, "htmldesc"); if(node && librdf_node_is_literal(node)) html_desc=librdf_node_get_literal_value_as_counted_string(node, &html_desc_len); if(!description) { node=librdf_query_results_get_binding_value_by_name(results, "description"); if(node && librdf_node_is_literal(node)) html_desc=librdf_node_get_literal_value_as_counted_string(node, &html_desc_len); } if(html_desc) { description=remove_html_entities(html_desc, html_desc_len); } node=librdf_query_results_get_binding_value_by_name(results, "source"); if(node && librdf_node_is_literal(node)) location=librdf_node_get_literal_value(node); node=librdf_query_results_get_binding_value_by_name(results, "creator"); if(node && librdf_node_is_literal(node)) { unsigned char *value=librdf_node_get_literal_value(node); creator=malloc(strlen((const char*)value)+6); sprintf(creator, "CN=\"%s\"", value); } ical_print(stdout, "BEGIN:VEVENT"); ical_format(stdout, "UID", NULL, NULL, uid); ical_format(stdout, "SUMMARY", NULL, NULL, summary); if(location) ical_format(stdout, "LOCATION", NULL, NULL, location); if(creator) { ical_format(stdout, "ATTENDEE", creator, NULL, (const unsigned char*)"invalid:nomail"); free(creator); } ical_format(stdout, "DTSTART", NULL, NULL, dtstart); ical_format(stdout, "DTSTAMP", NULL, NULL, dtstart); ical_format(stdout, "LAST-MODIFIED", NULL, NULL, dtstart); ical_format(stdout, "DESCRIPTION", NULL, ";,\"", description); if(url) ical_format(stdout, "URL", "VALUE=URI", ";", url); ical_format(stdout, "CLASS", NULL, NULL, (const unsigned char*)"PUBLIC"); ical_print(stdout, "END:VEVENT"); free(description); free(uid); nextresult: librdf_query_results_next(results); } fputs(ical_footer_format, stdout); librdf_free_query_results(results); librdf_free_query(query); librdf_free_uri(uri); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); /* keep gcc -Wall happy */ return(0); } redland-1.0.17/examples/example1.c0000644000175000017500000001425211455350447013644 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * example.c - Redland example parsing RDF from a URI, storing on disk as BDB hashes and querying the results * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #include #include #include #include /* one prototype needed */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { librdf_world* world; librdf_storage* storage; librdf_parser* parser; librdf_model* model; librdf_stream* stream; librdf_node *subject, *predicate; librdf_iterator* iterator; librdf_statement *partial_statement, *statement2; char *program=argv[0]; librdf_uri *uri; char *parser_name=NULL; int count; raptor_world *raptor_world_ptr; raptor_iostream* iostr; if(argc <2 || argc >3) { fprintf(stderr, "USAGE: %s: [rdf parser name]\n", program); return(1); } world = librdf_new_world(); librdf_world_open(world); raptor_world_ptr = librdf_world_get_raptor(world); uri=librdf_new_uri(world, (const unsigned char*)argv[1]); if(!uri) { fprintf(stderr, "%s: Failed to create URI\n", program); return(1); } storage=librdf_new_storage(world, "memory", "test", NULL); if(!storage) { fprintf(stderr, "%s: Failed to create new storage\n", program); return(1); } model=librdf_new_model(world, storage, NULL); if(!model) { fprintf(stderr, "%s: Failed to create model\n", program); return(1); } if(argc==3) parser_name=argv[2]; parser=librdf_new_parser(world, parser_name, NULL, NULL); if(!parser) { fprintf(stderr, "%s: Failed to create new parser\n", program); return(1); } /* PARSE the URI as RDF/XML*/ fprintf(stdout, "%s: Parsing URI %s\n", program, librdf_uri_as_string(uri)); if(librdf_parser_parse_into_model(parser, uri, uri, model)) { fprintf(stderr, "%s: Failed to parse RDF into model\n", program); return(1); } librdf_free_parser(parser); statement2=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://www.dajobe.org/"), librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/title"), librdf_new_node_from_literal(world, (const unsigned char*)"My Home Page", NULL, 0) ); librdf_model_add_statement(model, statement2); /* Free what we just used to add to the model - now it should be stored */ librdf_free_statement(statement2); /* Print out the model*/ fprintf(stdout, "%s: Resulting model is:\n", program); iostr = raptor_new_iostream_to_file_handle(raptor_world_ptr, stdout); librdf_model_write(model, iostr); raptor_free_iostream(iostr); /* Construct the query predicate (arc) and object (target) * and partial statement bits */ subject=librdf_new_node_from_uri_string(world, (const unsigned char*)"http://www.dajobe.org/"); predicate=librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/title"); if(!subject || !predicate) { fprintf(stderr, "%s: Failed to create nodes for searching\n", program); return(1); } partial_statement=librdf_new_statement(world); librdf_statement_set_subject(partial_statement, subject); librdf_statement_set_predicate(partial_statement, predicate); /* QUERY TEST 1 - use find_statements to match */ fprintf(stdout, "%s: Trying to find_statements\n", program); stream=librdf_model_find_statements(model, partial_statement); if(!stream) { fprintf(stderr, "%s: librdf_model_find_statements returned NULL stream\n", program); } else { count=0; while(!librdf_stream_end(stream)) { librdf_statement *statement=librdf_stream_get_object(stream); if(!statement) { fprintf(stderr, "%s: librdf_stream_next returned NULL\n", program); break; } fputs(" Matched statement: ", stdout); librdf_statement_print(statement, stdout); fputc('\n', stdout); librdf_stream_next(stream); count++; } librdf_free_stream(stream); fprintf(stderr, "%s: got %d matching statements\n", program, count); } /* QUERY TEST 2 - use get_targets to do match */ fprintf(stdout, "%s: Trying to get targets\n", program); iterator=librdf_model_get_targets(model, subject, predicate); if(!iterator) { fprintf(stderr, "%s: librdf_model_get_targets failed to return iterator for searching\n", program); return(1); } count=0; while(!librdf_iterator_end(iterator)) { librdf_node *target; target=(librdf_node*)librdf_iterator_get_object(iterator); if(!target) { fprintf(stderr, "%s: librdf_iterator_get_object returned NULL\n", program); break; } fputs(" Matched target: ", stdout); librdf_node_print(target, stdout); fputc('\n', stdout); count++; librdf_iterator_next(iterator); } librdf_free_iterator(iterator); fprintf(stderr, "%s: got %d target nodes\n", program, count); librdf_free_statement(partial_statement); /* the above does this since they are still attached */ /* librdf_free_node(predicate); */ /* librdf_free_node(object); */ librdf_free_model(model); librdf_free_storage(storage); librdf_free_uri(uri); librdf_free_world(world); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return(0); } redland-1.0.17/examples/example5.c0000644000175000017500000000717011455350447013651 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * example5.c - Redland example code using querying * * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #include #include #include #include #include /* one prototype needed */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { char *program=argv[0]; librdf_world* world; librdf_storage *storage; librdf_model* model; const char *parser_name; librdf_parser* parser; librdf_query* query; librdf_query_results* results; librdf_uri *uri; const unsigned char *query_string=NULL; raptor_world *raptor_world_ptr; world=librdf_new_world(); librdf_world_open(world); raptor_world_ptr = librdf_world_get_raptor(world); if(argc !=3) { fprintf(stderr, "USAGE: %s CONTENT-URI QUERY-STRING\n", program); return 1; } uri=librdf_new_uri(world, (const unsigned char*)argv[1]); query_string=(const unsigned char*)argv[2]; model=librdf_new_model(world, storage=librdf_new_storage(world, "hashes", "test", "new='yes',hash-type='bdb',dir='.'"), NULL); if(!model || !storage) { fprintf(stderr, "%s: Failed to make model or storage\n", program); return 1; } #ifdef RAPTOR_V2_AVAILABLE parser_name = raptor_world_guess_parser_name(raptor_world_ptr, NULL, NULL, NULL, 0, librdf_uri_as_string(uri)); #else parser_name = raptor_guess_parser_name(NULL, NULL, NULL, 0, librdf_uri_as_string(uri)); #endif parser=librdf_new_parser(world, parser_name, NULL, NULL); librdf_parser_parse_into_model(parser, uri, NULL, model); librdf_free_parser(parser); librdf_free_uri(uri); query=librdf_new_query(world, "rdql", NULL, query_string, NULL); results=librdf_model_query_execute(model, query); if(!results) { fprintf(stderr, "%s: Query of model with '%s' failed\n", program, query_string); return 1; } while(!librdf_query_results_finished(results)) { const char **names=NULL; librdf_node* values[10]; if(librdf_query_results_get_bindings(results, &names, values)) break; fputs("result: [", stdout); if(names) { int i; for(i=0; names[i]; i++) { fprintf(stdout, "%s=", names[i]); if(values[i]) { librdf_node_print(values[i], stdout); librdf_free_node(values[i]); } else fputs("NULL", stdout); if(names[i+1]) fputs(", ", stdout); } } fputs("]\n", stdout); librdf_query_results_next(results); } fprintf(stdout, "%s: Query returned %d results\n", program, librdf_query_results_get_count(results)); librdf_free_query_results(results); librdf_free_query(query); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return(0); } redland-1.0.17/examples/example6.c0000644000175000017500000000374111455350447013652 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * example6.c - Redland example code using model methods load and to_string * * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #include #include #include #include #include #include /* one prototype needed */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { librdf_world* world; librdf_storage *storage; librdf_model* model; librdf_uri* uri; unsigned char *string; librdf_world_open(world=librdf_new_world()); model=librdf_new_model(world, storage=librdf_new_storage(world, "memory", NULL, NULL), NULL); uri=librdf_new_uri(world, (const unsigned char*)"http://planetrdf.com/index.rdf"); librdf_model_load(model, uri, NULL, NULL, NULL); string=librdf_model_to_string(model, uri, "ntriples", NULL, NULL); if(!string) printf("Failed to serialize model\n"); else { printf("Made a %d byte string\n", (int)strlen((char*)string)); free(string); } librdf_free_uri(uri); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return(0); } redland-1.0.17/examples/example2.c0000644000175000017500000001131511455350447013642 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * example2.c - Redland example code parsing RDF/XML from a string in memory and adding/checking/removing a statement * * $Id$ * * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #include #include #include #include #include #include /* one prototype needed */ int main(int argc, char *argv[]); static unsigned const char *rdfxml_content=(unsigned const char *) "\ \ \ Dave Beckett's Home Page\ Dave Beckett\ The generic home page of Dave Beckett.\ \ \ "; int main(int argc, char *argv[]) { librdf_world* world; librdf_storage* storage; librdf_model* model; librdf_parser* parser; librdf_statement* statement; librdf_uri* uri; char *program=argv[0]; int rc=0; raptor_world *raptor_world_ptr; raptor_iostream* iostr; world=librdf_new_world(); librdf_world_open(world); raptor_world_ptr = librdf_world_get_raptor(world); uri=librdf_new_uri(world, (const unsigned char*)"http://example.librdf.org/"); if(!uri) { fprintf(stderr, "%s: Failed to create URI\n", program); return(1); } storage=librdf_new_storage(world, "memory", "test", NULL); if(!storage) { fprintf(stderr, "%s: Failed to create new storage\n", program); rc=1; goto tidyworld; } model=librdf_new_model(world, storage, NULL); if(!model) { fprintf(stderr, "%s: Failed to create model\n", program); rc=1; goto tidystorage; } parser=librdf_new_parser(world, "rdfxml", NULL, NULL); if(!parser) { fprintf(stderr, "%s: Failed to create new parser 'rdfxml'\n", program); rc=1; goto tidystorage; } if(librdf_parser_parse_string_into_model(parser, rdfxml_content, uri, model)) { fprintf(stderr, "%s: Failed to parse RDF into model\n", program); librdf_free_uri(uri); rc=1; goto tidymodel; } librdf_free_parser(parser); parser=NULL; librdf_free_uri(uri); uri=NULL; statement=librdf_new_statement(world); if(!statement) { fprintf(stderr, "%s: Failed to parse RDF into model\n", program); rc=1; goto tidymodel; } librdf_statement_set_subject(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/subject")); librdf_statement_set_predicate(statement, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/pred1")); librdf_statement_set_object(statement, librdf_new_node_from_literal(world, (const unsigned char*)"object", NULL, 0)); librdf_model_add_statement(model, statement); fprintf(stdout, "%s: Resulting model is:\n", program); iostr = raptor_new_iostream_to_file_handle(raptor_world_ptr, stdout); librdf_model_write(model, iostr); raptor_free_iostream(iostr); if(!librdf_model_contains_statement(model, statement)) { fprintf(stdout, "%s: Model does not contain statement\n", program); rc=1; goto tidystatement; } else fprintf(stdout, "%s: Model contains the statement\n", program); fprintf(stdout, "%s: Removing the statement\n", program); librdf_model_remove_statement(model, statement); fprintf(stdout, "%s: Resulting model is:\n", program); iostr = raptor_new_iostream_to_file_handle(raptor_world_ptr, stdout); librdf_model_write(model, iostr); raptor_free_iostream(iostr); tidystatement: librdf_free_statement(statement); tidymodel: librdf_free_model(model); tidystorage: librdf_free_storage(storage); tidyworld: librdf_free_world(world); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return(rc); } redland-1.0.17/ChangeLog.110000644000175000017500000012050311524303234012122 000000000000002010-12-29 Dave Beckett * src/rdf_serializer_raptor.c: Make raptor serializer work with raptor V2 1.9.2+ * src/rdf_parser_raptor.c: (librdf_parser_raptor_constructor): Update for Raptor V2 1.9.2 * configure.ac: Raptor V2 min version now 1.9.2 2010-12-05 Dave Beckett * NEWS.html, RELEASE.html, configure.ac, src/win32_rdf_config.h: Bump version to 1.0.13 2010-12-04 Dave Beckett * src/rdf_query_internal.h, src/rdf_query_rasqal.c, src/rdf_query_results.c: Remove use of deprecated rasqal functions conditioned on rasqal version 2010-10-13 Dave Beckett * Snapshotted redland_1_0_12 for 1.0.12 release (GIT d0e92f81be57acdeaa4b0c4d8e121e49fb4bfc57) * src/rdf_stream.c: Replace one more librdf_stream_get_context() * docs/redland-sections.txt: Add librdf_stream_get_context2 * utils/rdfproc.c, utils/redland-virtuoso-test.c: Update rdfproc and virtuoso test for librdf_stream_get_context2() * examples/.gitignore: ignore more * examples/example1.c, examples/example2.c, examples/example3.c, examples/example5.c, examples/example6.c: Update for raptor2 API and librdf_stream_get_context2 * src/rdf_query_rasqal.c, src/rdf_storage.c, src/rdf_storage_sqlite.c: Use librdf_stream_get_context2 replacing librdf_stream_get_context with a cast * src/rdf_stream.c, src/rdf_stream.h: (librdf_stream_get_context2): Added deprecating librdf_stream_get_context() (librdf_stream_get_context2): Returns a librdf_node* (librdf_stream_get_context): Deprecated for above. 2010-10-12 Dave Beckett * src/rdf_storage_hashes.c: (librdf_storage_hashes_context_serialise_get_statement): Return context node Fixes Issue#0000393 http://bugs.librdf.org/mantis/view.php?id=393 with fix based on patch in bug. Thanks to Michael Stahl * src/rdf_term.c: (librdf_free_node): Allow NULL free * src/rdf_raptor_statement.c: (librdf_free_statement): Allow NULL free 2010-10-10 Dave Beckett * utils/Makefile.am: Add @LIBRDF_DIRECT_LIBS@ to LDADD * utils/Makefile.am: Remove rdfproc_LDADD * Redland.i: Export librdf_statement_is_complete * configure.ac, src/Makefile.am, utils/Makefile.am: Add linking of -lraptor or -lraptor2 to handle newer GCC linkers Fixes Issue#0000348 http://bugs.librdf.org/mantis/view.php?id=348 as reported in Fedora with this change http://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking See also http://bugs.librdf.org/mantis/view.php?id=347 for the Rasqal equivalent. * src/librdf.h: Lets assume OSX GCC precompiled headers are working after many years * src/librdf.h: Include headers outside extern "C" block - included files do that too. * src/rdf_init.h: Include rasqal.h to get rasqal_world just in case * src/redland.h: Just include librdf.h * src/librdf.h: Add raptor and rasqal includes here * configure.ac: Use AC_LANG_SOURCE with AC_COMPILE_IFELSE for mysql header * NEWS.html, RELEASE.html, configure.ac, src/win32_rdf_config.h: Bump version to 1.0.12 2010-09-27 Dave Beckett * configure.ac: RASQAL_MIN_VERSION should have been 0.9.19 for some time 2010-09-25 Dave Beckett * Snapshotted redland_1_0_11 for 1.0.11 release (GIT 8cad0a6d84eed0d98e20a23883dcf6fdedc47587) * RELEASE.html: 1.0.11 * src/rdf_query_results.c: autodocs for query results functions explaining NULL args * src/rdf_query_results.c: (librdf_query_results_to_counted_string): Allow all NULL format args. * Redland.i: Remove unsigned char* for librdf_parser_guess_name2() since SWIG hates that. * Redland.i: Export librdf_model_add_typed_literal_statement and add arg defaults * Redland.i: Export librdf_node_get_li_ordinal * Export librdf_new_node_from_node and librdf_new_node_from_blank_identifier * src/rdf_query_results.c: autodocs for query results functions explaining NULL args * src/rdf_query_results.c: (librdf_query_results_to_counted_string): All all NULL format args. * Redland.i: Export librdf_world_set_logger * Redland.i: Remove unsigned char* for librdf_parser_guess_name2() since SWIG hates that. * Redland.i: Export librdf_model_add_typed_literal_statement() and add arg defaults * Redland.i: Export librdf_node_get_li_ordinal() * Redland.i: Export librdf_new_node_from_uri_local_name() and librdf_new_node_from_normalised_uri_string() 2010-09-24 Dave Beckett * Redland.i: Export more functions to SWIG Export: librdf_parser_check_name - for checking parser names librdf_query_results_is_syntax - to check if query result is a syntax librdf_serializer_check_name - for checking serializer names librdf_serializer_serialize_stream_to_file - pair of ...model_to_file * src/rdf_node.c: (librdf_new_node_from_uri_string): Cast for strlen arg * src/rdf_raptor.h: Export librdf_world_set_raptor and librdf_world_get_raptor for all raptors * src/rdf_raptor.c: librdf_world_set_raptor and librdf_world_get_raptor are public for all raptors (librdf_world_set_raptor): Export for V1 and V2. (librdf_world_get_raptor): Export for V1 and V2. (librdf_init_raptor): For V2 init, error and return but do not abort on raptor world failure. * src/rdf_init_internal.h: raptor_world_ptr and raptor_world_allocated_here are always in struct. * configure.ac: Use AC_LANG_SOURCE for gcc flag test * examples/example8.c: Long int for size_t print * examples/Makefile.am, examples/example8.c: Add example8 which formats sparql queries into triples or variable bindings * Redland.i: Export librdf_serializer_serialize_stream_to_string() 2010-09-10 Dave Beckett * src/rdf_query_rasqal.c: Fix runtime warning for models with no contexts (rasqal_redland_new_triples_source): use librdf_model_supports_contexts() to only add graph names to models that have contexts (graph names) to prevent a runtime warning. * docs/redland-sections.txt, src/rdf_model.c, src/rdf_model.h: Export librdf_model_supports_contexts to public API 2010-08-30 Dave Beckett * utils/rdfproc.c: Tidy help information - correct defaults * docs/tmpl/hash.sgml, docs/tmpl/iterator.sgml, docs/tmpl/list.sgml, docs/tmpl/parser.sgml, docs/tmpl/query.sgml, docs/tmpl/redland-unused.sgml, docs/tmpl/serializer.sgml, docs/tmpl/storage.sgml, docs/tmpl/stream.sgml, docs/tmpl/world.sgml: Updated generated SGML templates * src/rdf_raptor_statement.c: Refactor to remove warning of call to deprecated librdf_statement_encode_parts (librdf_statement_encode_parts_internal): Added (librdf_statement_encode_parts, librdf_statement_encode_parts2): Call librdf_statement_encode_parts_internal (librdf_statement_decode): Add fatal error if this function is called, librdf with Raptor V2 cannot implement it. 2010-08-30 Lauri Aalto * src/rdf_hash.c: (librdf_hash_to_string): Avoid using uninitialized pointers when jumping to tidy block prematurely. 2010-08-29 Dave Beckett * LICENSE.html: or any newer versions. Link to specific LGPL 2.1 version doc. Wording and formatting * FAQS.html: More FAQS * FAQS.html, INSTALL.html, LICENSE.html, NEWS.html, README.html, RELEASE.html, TODO.html, configure.ac, redland.rdf.in: Use 'Redland librdf RDF API Library' as the title * Redland.i: Expose new functions that make sense to bindings API Of the new functions in the 1.0.11 API, excluding all the ones that rely on counted strings that make little sense for a scripting API via SWIG, those that deal with raptor_iostream (*_write) that leaves: librdf_hash_from_string - OOPS, already was in API even though it was internal! librdf_hash_to_string - added librdf_new_query_results_formatter2 - not added, formatter is not in SWIG librdf_node_new_static_node_iterator - not added, C level librdf_query_languages_enumerate - not added, enumeration returns by sideffects librdf_query_results_to_file2 - added librdf_query_results_to_file_handle2 - not added passing FH hard in bindings. librdf_query_results_to_string2 - added librdf_statement_decode2 - not added, memory-focused librdf_statement_encode2 - not added, memory-focused librdf_statement_encode_parts2 - not added, memory-focused * src/rdf_statement_common.c: (librdf_statement_encode_parts2): autodocs * src/rdf_statement.c: (librdf_statement_decode_parts): Restored using librdf_statement_decode2 * src/rdf_statement.c: (main): Use non-deprecated librdf_statement_encode2() in test. * utils/rdfproc.1: Update for -q, -V, -o help, -r help and -s help * utils/rdfproc.c: Add -s help support * utils/rdfproc.c: Send non-result information messages to stderr and add quiet -q and verbose -V options to suppress/activate them. Added -q and -V options to rdfproc(1) based on patch in http://bugs.librdf.org/mantis/view.php?id=334 Added verbosity variable set initially to 1, -q makes it 0, -V increases it. Add support for '-o help' to print list of serializers. Print all serializers in help message below -o description. Note that the 'simple' serializer is now N-Triples. Set rc for parse command to 0 only if there are no errors. Some code style fixes. Fixes Issue#0000334 http://bugs.librdf.org/mantis/view.php?id=334 * src/rdf_hash.c: Added checks for memory allocation errors to (librdf_hash_print, librdf_hash_print_keys, librdf_hash_to_string) 2010-08-27 Dave Beckett * docs/redland-sections.txt, docs/tmpl/hash.sgml, docs/tmpl/iterator.sgml, docs/tmpl/list.sgml, docs/tmpl/parser.sgml, docs/tmpl/query.sgml, docs/tmpl/redland-unused.sgml, docs/tmpl/serializer.sgml, docs/tmpl/storage.sgml, docs/tmpl/stream.sgml: # Update tmpls * HACKING.md: No space before brace 2010-08-27 Nicholas J Humfrey * src/rdf_hash.c: Added new librdf_hash_to_string() function for converting a librdf_hash back to a string. 2010-08-26 Dave Beckett * src/rdf_storage_sql.c: (librdf_new_sql_config): Turn debug print into log action at level debug. * src/rdf_query_rasqal.c: Make rasqal query debugging display only if LIBRDF_DEBUG > 1 * src/rdf_storage_sqlite.c: Make even less sqlite request debug noise. * src/rdf_storage_sqlite.c: (librdf_storage_sqlite_exec): Make less debug noise. * utils/rdfproc.c: Fail with error when giving -n to a read only operation Adjust HELP_ARG macro to print alternatives when have long getopt support. (main): Generate error if not writable and is_new is set. Fixes Issue#0000383 http://bugs.librdf.org/mantis/view.php?id=383 * HACKING.md: # Add emacs mode at end * HACKING.md: #words 2010-08-25 Dave Beckett * Makefile.am: Add HACKING.md conversion dependent on script * docs/markdown-to-html.pl: Fix
 markdown indenting

	* docs/markdown-to-html.pl: Simplify converter - just add
	header/footer, do not run tidy

	* HACKING.md: Put headers down 1 level

	* Makefile.am: Use docs/markdown-to-html.pl to convert HACKING.md

	* docs/Makefile.am, docs/markdown-to-html.pl: Add
	markdown-to-html.pl

2010-08-24  Dave Beckett 

	* HACKING.md: #more words

	* HACKING.md: #more words

	* HACKING.md: words

	* .gitignore, HACKING.md, HACKING.txt, Makefile.am: Make
	HACKING.html from HACKING.md

	* HACKING.html, HACKING.txt: Markdown HACKING

	* HACKING.html: Now in better markdown format

	* HACKING.txt: typo

	* HACKING.txt: HACKING

	* src/rdf_storage_sqlite.c:
	(librdf_storage_sqlite_open): Fix unlink (is new) logic

	* docs/tmpl/iterator.sgml, docs/tmpl/list.sgml,
	docs/tmpl/parser.sgml, docs/tmpl/query.sgml,
	docs/tmpl/serializer.sgml, docs/tmpl/storage.sgml,
	docs/tmpl/stream.sgml: Update templates

2010-08-23  Dave Beckett 

	* src/rdf_raptor_statement.c:
	(librdf_statement_encode2): Use librdf_statement_encode_parts2
	instead of deprecated librdf_statement_encode_parts.

	* src/rdf_query_rasqal.c:
	(rasqal_redland_new_triples_source): Make graph iteration fix work
	with raptor v1 too

2010-08-23  Lauri Aalto 

	* src/rdf_hash_internal.h:
	removed duplicate declaration of
	librdf_hash_from_string()

2010-08-23  Nicholas J Humfrey 

	* src/rdf_hash.c: (librdf_hash_print, librdf_hash_print_keys,
	librdf_hash_print_values): Fixed wrong order of arguments used to
	fwrite()

2010-08-22  Dave Beckett 

	* docs/Makefile.am, docs/redland-sections.txt,
	docs/tmpl/hash.sgml, docs/tmpl/iterator.sgml, docs/tmpl/list.sgml,
	docs/tmpl/node.sgml, docs/tmpl/parser.sgml, docs/tmpl/query.sgml,
	docs/tmpl/query_results.sgml, docs/tmpl/redland-unused.sgml,
	docs/tmpl/serializer.sgml, docs/tmpl/statement.sgml,
	docs/tmpl/storage.sgml, docs/tmpl/stream.sgml,
	docs/tmpl/unused.sgml, docs/tmpl/uri.sgml, src/rdf_hash.h,
	src/rdf_init.c, src/rdf_model.c, src/rdf_node.c, src/rdf_query.h,
	src/rdf_query_results.c, src/rdf_statement.c, src/rdf_statement.h,
	src/rdf_storage_module.h: Updated code for gtk-doc autodocs

2010-08-20  Dave Beckett 

	* src/rdf_query_rasqal.c: Try to construct a set of data graphs
	that make rasqal queries with graphs work.

	(rasqal_redland_new_triples_source): After deleteing any existing
	graphs in the query string, add all the graph context uris as data
	graphs into the query model.  This allows rasqal to iterate over
	them and bind variables to graph names correctly.  This is a
	workaround, as really rasqal + redland should work together to
	allow abstracting this out of the triples-focused API.  Intended
	to address Issue#000382
	http://bugs.librdf.org/mantis/view.php?id=382

2010-08-09  Dave Beckett 

	* configure.ac:
	SUBST HAVE_RAPTOR2_API with define and conditional

	* redland.pc.in:
	Set have_raptor2_api var

	* configure.ac:
	AC_SUBST(HAVE_RAPTOR2_API)

	* configure.ac: Check if rasqal was built with raptor2 API and
	force raptor2 if it was.  This prevents trying to build librdf
	with raptor1 if rasqal was built with raptor2.

	* src/rdf_init.c: Keep the minimal rdf_init.c
	librdf_new_world()..librdf_free_world() test minimal by not using
	the librdf_world object for anything.  Create a separate rdf_world
	object for other tests.

2010-08-06  Nicholas J Humfrey 

	* src/rdf_node.c: Added test for librdf_new_node()

	* src/rdf_parser_raptor.c: Update
	librdf_parser_raptor_generate_id_handler() to handle new raptor
	generate nodeid API

2010-08-03  Dave Beckett 

	* src/rdf_node.c:
	(librdf_new_node_from_counted_uri_string): Define correctly

	* src/rdf_query.c:
	(main): use hash-type memory if BDB hash is not present.

	* src/rdf_model.c:
	(main): use hash-type memory if BDB hash is not present.

	* src/rdf_storage.c:
	(main): use hash-type memory if BDB hash is not present.

	* src/rdf_model.c:
	(main): Only try BDB hash if it's present.

	* configure.ac:
	move have_libdb=no earlier

2010-08-02  Dave Beckett 

	* src/rdf_node.c, src/rdf_node.h: Added
	librdf_new_node_from_counted_uri_string() to build URI node

	(librdf_new_node_from_counted_uri_string): Added

	(librdf_new_node_from_uri_string_or_uri): Adjust to add len
	parameter needed when passing in string.

	(librdf_new_node_from_uri_string): Pass in strlen(uri_string).

	* src/rdf_uri.c, src/rdf_uri.h: Added librdf_new_uri2() for
	building URIs from a counted string.

	(librdf_new_uri2): Added, using
	raptor_new_uri_from_counted_string() when built with raptor2.
	Clarify returns NULL if length is 0 too.

	(librdf_new_uri): Wrapper to above, calling strlen.

	* src/Makefile.am: adjust sqlite CPPFLAGS to ensure general
	includes are first.

2010-08-01  Dave Beckett 

	* src/rdf_term.c:
	(librdf_node_encode): For URI, ensure NUL is written at end

	* src/rdf_stream.c:
	(librdf_stream_write): Add space before context url

2010-06-04  Lauri Aalto 

	* src/Makefile.am, src/rdf_raptor_statement.c,
	src/rdf_statement.c, src/rdf_statement_common.c:
	
	(librdf_statement_encode_parts2, librdf_init_statement,
	librdf_finish_statement): Pulled some functionality common to both
	librdf and raptor2 statements to rdf_statement_common.c. Now links
	with LIBRDF_USE_RAPTOR_STATEMENT.

	* src/rdf_storage_hashes.c, src/rdf_storage_list.c:
	#ws

	* src/rdf_raptor_statement.c:
	file comment

2010-06-03  Dave Beckett 

	* src/rdf_statement.c:
	(main): fix call of librdf_statement_decode2 in test

	* src/rdf_statement.c:
	(main): use librdf_statement_decode2 in test

	* src/rdf_raptor_statement.c:
	(librdf_statement_decode2): Call librdf_node_decode with world

	* src/rdf_raptor_statement.c: Add librdf_statement_encode2 for
	raptor2

	* src/rdf_node.c:
	(librdf_node_get_counted_blank_identifier): No need for strlen

	* src/rdf_node.c:
	(librdf_node_get_counted_blank_identifier): Add for raptor v1 node

	* src/rdf_node.h, src/rdf_term.c:
	(librdf_node_get_counted_blank_identifier): Added

2010-06-02  Dave Beckett 

	* src/rdf_node.c:
	(librdf_new_node_from_blank_identifier): fix

	* src/rdf_node.h, src/rdf_term.c:
	(librdf_new_node_from_counted_blank_identifier): Implement for
	raptor 2 API

	* src/rdf_node.c, src/rdf_node.h:
	(librdf_new_node_from_counted_blank_identifier): Added

	* src/rdf_node.c, src/rdf_storage_hashes.c,
	src/rdf_storage_list.c, src/rdf_storage_trees.c: Use
	non-deprecated statement encode/decode functions for raptor V1

	* src/rdf_raptor_statement.c, src/rdf_statement.c,
	src/rdf_statement.h, src/rdf_storage_hashes.c: Added
	librdf_statement_encode2, librdf_statement_encode_parts2,
	librdf_statement_decode2 deprecating those without world
	arg.

	(librdf_statement_encode2, librdf_statement_encode_parts2,
	librdf_statement_decode2): Added deprecating those without world
	arg.

	(librdf_statement_encode, librdf_statement_encode_parts,
	librdf_statement_decode): Deprecated.

	* src/rdf_iterator.c, src/rdf_stream.c:
	Updated tests to use new
	librdf_node_new_static_node_iterator()

	* src/Makefile.am, src/rdf_node.c, src/rdf_node.h,
	src/rdf_node_common.c, src/rdf_term.c: Moved
	librdf_node_static_iterator code to new rdf_node_common.c module.

	(librdf_node_new_static_node_iterator): Added, deprecating
	librdf_node_static_iterator_create().

	(librdf_node_static_iterator_create): Always fails when built with
	raptor2 API.  Updated tests - all users of
	librdf_node_static_iterator_create() - to use new function.

	* src/librdf.h, src/rdf_node.h, src/rdf_raptor_statement.c,
	src/rdf_uri.c: Rename USE_RAPTOR_* macros to LIBRDF_USE_RAPTOR_*

	* src/librdf.h: tidy USE_RAPTOR_*

	* src/rdf_term.c:
	(librdf_new_node_from_typed_counted_literal): Use
	raptor_new_term_from_counted_literal

2010-05-26  Lauri Aalto 

	* src/rdf_storage_trees.c:
	(librdf_storage_trees_node_compare):
	librdf_node_get_literal_value_language()

2010-05-25  Dave Beckett 

	* src/rdf_term.c: Add checks for NULL world

	* src/rdf_term.c:
	(librdf_node_encode, librdf_node_decode, librdf_node_to_string,
	librdf_node_to_counted_string, librdf_node_print,
	librdf_node_equals): Implemented for librdf_node as raptor_term

	* src/rdf_query_rasqal.c, src/rdf_serializer_raptor.c,
	src/rdf_storage.c: Replace uses of statement->world for
	librdf_world with alternatives.  Comment out some logging deep in
	code refering to statement

	* src/Makefile.am, src/librdf.h, src/rdf_raptor_statement.c: Use
	rdf_raptor_statement.c for raptor2 with raptor_statement

	Added USE_RAPTOR_STATEMENT macro to use librdf_statement as
	typedef for raptor_statement.  Duplication of encode/decode
	statement should probably be moved to shared code in a separate
	module.  (node encode/decode too).

2010-05-24  Dave Beckett 

	* src/rdf_term.c: Remove strlen() and use raptor_term literal
	string_len

	* src/rdf_serializer.c:
	(librdf_serializer_serialize_stream_to_iostream,
	librdf_serializer_serialize_model_to_iostream): Document ownership
	transfer of raptor_iostreams.  Addresses issue #372
	http://bugs.librdf.org/mantis/view.php?id=372

2010-05-19  Lauri Aalto 

	* src/rdf_term.c:
	(librdf_node_write): Added USE_RAPTOR_TERM variant of the function
	to make binaries link.

	* src/rdf_term.c:
	(librdf_node_get_type): Fixed warnings about librdf_node_type <->
	raptor_term_type enums.

2010-05-18  Dave Beckett 

	* src/rdf_storage_sqlite.c: code style

	* src/rdf_storage_sqlite.c: code style

	* src/rdf_init.c: code style

	* src/rdf_init.c: 2010

	* src/rdf_storage_trees.c:
	(librdf_storage_trees_node_compare): Add raptor V2 API version.

	* src/rdf_storage_sqlite.c:
	(librdf_storage_sqlite_node_helper): Use storage->world

	* src/rdf_storage_mysql.c: Use raptor_data_free_handler for
	raptor_new_sequence calls (V2 API)

	* src/rdf_raptor_internal.h: define raptor_data_free_handler for
	raptor V2 API

	* src/rdf_storage_trees.c: Update
	librdf_storage_trees_node_compare for raptor 2 API.

	(librdf_storage_trees_node_compare): Use raptor_term_compare with
	raptor 2 API.  NOTE: This may be too weak to use in a sort
	ordering.

	* src/rdf_query_internal.h, src/rdf_query_rasqal.c,
	src/rdf_query_virtuoso.c: Make redland_node_to_rasqal_literal work
	with updated raptor2 raptor_term

	(redland_node_to_rasqal_literal): Add world arg so that it works
	when librdf_node does not have a librdf_world inside, when built
	with raptor 2.  Uodate callers

	* src/rdf_uri.c:
	(librdf_new_uri_normalised_to_base): Rewrite to not know about
	rdf_uri internals when using raptor_uri for raptor V2

	* src/rdf_query_rasqal.c: Update to latest raptor_term blank field
	structure.

	* src/rdf_parser_raptor.c: Update to latest raptor_term blank
	field structure.

	* src/rdf_uri.c:
	(librdf_new_uri_normalised_to_base): Support USE_RAPTOR_URI

	* src/rdf_storage_mysql.c, src/rdf_storage_sqlite.c:
	(librdf_storage_sqlite_node_helper,
	librdf_storage_mysql_node_hash_common): node->world not available
	with RAPTOR_USE_TERM, replace with storage->world

	* src/rdf_query_internal.h, src/rdf_query_rasqal.c,
	src/rdf_query_virtuoso.c:
	(redland_node_to_rasqal_literal): Internal function gains
	librdf_world* param. Required with USE_RAPTOR_TERM because
	raptor_terms doesn't contain it unlike librdf_node.

	* src/rdf_storage_trees.c:
	(librdf_storage_trees_node_compare): Support USE_RAPTOR_TERM. Use
	librdf_node_get_*() accessors instead of relying on librdf_node_s
	internals.

	* src/rdf_parser_raptor.c, src/rdf_query_rasqal.c: raptor2
	raptor_term_blank_value

2010-05-18  Lauri Aalto 

	* src/rdf_term.c: removed unnecessary #include with absolute path

2010-05-16  Dave Beckett 

	* src/rdf_term.c:
	(librdf_node_get_blank_identifier): Update to latest raptor_term
	fields.

2010-05-12  Dave Beckett 

	* src/rdf_term.c: Implement librdf_node_get_blank_identifier with
	term

2010-05-10  Dave Beckett 

	* src/rdf_term.c: implement more rdf_node with raptor_term

	* src/rdf_uri.c:
	(librdf_new_uri_normalised_to_base): Use old code to implement for
	raptor2 API.

2010-05-07  Dave Beckett 

	* src/rdf_term.c: open worlds

	* src/rdf_term.c: do not dup autodocs for now

	* src/Makefile.am, src/librdf.h, src/rdf_node.h, src/rdf_term.c:
	Add skeleton code for rdf_node as typedef for raptor_term

	* docs/tmpl/concepts.sgml, docs/tmpl/digest.sgml,
	docs/tmpl/files.sgml, docs/tmpl/hash.sgml,
	docs/tmpl/heuristics.sgml, docs/tmpl/iterator.sgml,
	docs/tmpl/list.sgml, docs/tmpl/log.sgml, docs/tmpl/model.sgml,
	docs/tmpl/node.sgml, docs/tmpl/parser.sgml, docs/tmpl/query.sgml,
	docs/tmpl/query_results.sgml, docs/tmpl/section-general.sgml,
	docs/tmpl/serializer.sgml, docs/tmpl/statement.sgml,
	docs/tmpl/storage.sgml, docs/tmpl/stream.sgml,
	docs/tmpl/unicode.sgml, docs/tmpl/unused.sgml, docs/tmpl/uri.sgml,
	docs/tmpl/world.sgml: Update tmpls

2010-05-03  Lauri Aalto 

	* src/rdf_model.c, src/rdf_parser.c, src/rdf_parser_raptor.c,
	src/rdf_serializer.c, src/rdf_storage.c: Ported to raptor2 head -
	funcptr typedef changes

2010-04-28  Nicholas J Humfrey 

	* src/rdf_query_rasqal.c: Empty graph result set is not an error.

2010-04-24  Dave Beckett 

	* src/rdf_storage_postgresql.c: Make
	librdf_storage_postgresql_contains_statement
	work.

	(librdf_storage_postgresql_contains_statement): snprintf to the
	query string.  Patch from Andrew Malton.

	* src/rdf_uri.c: librdf_free_uri fix condition for C99

	* docs/redland-sections.txt: more functions

	* src/rdf_storage.c: autodocs

	* docs/redland-sections.txt: add new functions

	* build/shave-libtool.in, build/shave.in, build/shave.m4: Remove
	rest of SHAVE

	* configure.ac: remove build/shave*

	* configure.ac: Switch to automake 1.11 silent rules

2010-04-21  Nicholas J Humfrey 

	* src/rdf_storage.c: Bug fix for
	librdf_storage_context_remove_statement() asseting that context
	should be non-NULL instead of statement.

2010-04-19  Nicholas J Humfrey 

	* docs/redland-chapter-storage-modules.xml: Fix for broken link in
	documentation to the storage API page.

2010-04-19  Lauri Aalto 

	* src/rdf_parser_raptor.c: Ported to raptor2 head. Syntax
	description need_base_uri -> RAPTOR_SYNTAX_NEED_BASE_URI bit flag.

2010-04-16  Dave Beckett 

	* src/rdf_query_results.c:
	(librdf_query_results_formatter_write): Autodocs notine using this
	drains results

2010-04-07  Lauri Aalto 

	* configure.ac, redland.pc.in: Export raptor2 pkg-config
	dependencies when building on raptor2.

2010-04-06  Lauri Aalto 

	* src/rdf_parser_raptor.c, src/rdf_serializer_raptor.c: Ported to
	raptor2 git head - use raptor_syntax_description for
	parser/serializer discovery and inspection.

	* configure.ac: Support building with libraptor2. Prefer
	libraptor2 over libraptor.

2010-04-01  Nicholas J Humfrey 

	* src/rdf_query.c, src/rdf_query.h: Added
	librdf_query_languages_enumerate() function.

2010-03-24  Dave Beckett 

	* configure.ac, src/rdf_raptor.h: Update minimum raptor to 1.4.19
	so that raptor_world typedef is always available

2010-03-23  Lauri Aalto 

	* src/rdf_raptor.h: Use RAPTOR_V2_AVAILABLE instead of
	RAPTOR_WORLD_DECLARED (no longer available) to decide whether to
	declare raptor_world type

	* src/rdf_heuristics.c: Fixed gcc4 warnings about using a char
	where an int is required

2010-03-18  Lauri Aalto 

	* src/rdf_parser_raptor.c, src/rdf_serializer_raptor.c: Ported to
	raptor2 git head - raptor_option related changes.

2010-03-10  Dave Robillard 

	* src/rdf_storage_trees.c:
	Fix ticket #350 - crash with trees storage.
	Fixes Issue#0000350 http://bugs.librdf.org/mantis/view.php?id=350

	(librdf_storage_trees_node_compare): Fix node comparison when one
	node has a language and the other doesn't, and other cases (make
	node comparison a proper order relation).

	* src/rdf_avltree.c:
	Use correct format string for size_t.

2010-03-10  Dave Beckett 

	* src/rdf_storage_virtuoso.c:
	(librdf_storage_virtuoso_get_contexts): Init iterator so it has a
	value even for error cases.

2010-03-03  Lauri Aalto 

	* src/rdf_serializer_raptor.c:
	(librdf_serializer_raptor_serialize_statement): Set
	raptor_statement graph term to NULL. Fixes access violations on
	raptor2 treating uninitialized pointer as a valid raptor_term*.

	* src/rdf_query_rasqal.c, src/rdf_raptor.c:
	Ported to raptor2 git head while retaining compatibility with
	raptor1.

	(librdf_query_rasqal_log_handler): Added for raptor2.
	
	(librdf_query_rasqal_error_handler, librdf_query_rasqal_warning_handler):
	Flagged out for raptor2.

	(librdf_query_rasqal_init): Set up raptor2 log handler, not
	error/warning handlers.

	(librdf_init_raptor, librdf_raptor_log_handler,
	librdf_raptor_fatal_error_handler, librdf_raptor_error_handler,
	librdf_raptor_warning_handler): Added log_handler for
	raptor2. Replaces old fatal/error/warning handlers.

2010-02-26  Dave Beckett 

	* docs/tmpl/log.sgml: Update tmpls

	* utils/redland-virtuoso-test.c: Get raptor world when
	initialising with raptor V2

2010-02-24  Lauri Aalto 

	* .gitignore: ignore *~

	* utils/redland-virtuoso-test.c: Made redland-virtuoso-test build
	on raptor2 (and raptor1)

2010-02-23  Lauri Aalto 

	* src/rdf_model.c, src/rdf_node.c, src/rdf_query_results.c,
	src/rdf_statement.c, src/rdf_stream.c: Allow flagging out
	deprecated implementations with LIBRDF_DISABLE_DEPRECATED

	* .gitignore: ignore *.stackdump

2010-02-22  Lauri Aalto 

	* src/rdf_log.c, src/rdf_raptor_internal.h, utils/rdfproc.c:
	raptor2 locator functions with preprocessor macros for raptor1
	compatibility

	* src/rdf_model.c, src/rdf_node.c, src/rdf_parser_raptor.c,
	src/rdf_query_results.c, src/rdf_raptor_internal.h,
	src/rdf_serializer_raptor.c, src/rdf_statement.c,
	src/rdf_stream.c, utils/rdfproc.c: raptor2 raptor_iostream calls
	with preprocessor macros for raptor1 compatibility

2010-02-18  Lauri Aalto 

	* src/rdf_node.c, src/rdf_parser_raptor.c,
	src/rdf_serializer_raptor.c, src/rdf_storage_sql.c: Ported to
	raptor2 git head

2010-02-16  Dave Beckett 

	* src/rdf_storage_sql.c: cast for strcmp

2010-02-16  Lauri Aalto 

	* src/rdf_log.h, src/rdf_raptor.c: Added raptor2 error/warning
	handlers

	Introduced LIBRDF_FROM_RAPTOR log facility.

2010-02-16  Lauri Aalto 

	* src/rdf_serializer_raptor.c:
	
	(librdf_serializer_raptor_serialize_stream_to_iostream,
	librdf_serializer_raptor_serialize_stream_to_counted_string): Call
	raptor_free_iostream() on raptor2 to get any output.

	* src/librdf.h, src/rdf_node.c, src/rdf_raptor.c, src/rdf_uri.c,
	src/rdf_uri_internal.h: Replaced librdf_uris with raptor_uris when
	using raptor2.

	(librdf_uri_get_digest): Internal function gains librdf_world*
	param.

	* utils/rdfproc.c: Changed deprecated librdf_model_print() call to
	librdf_model_write() with iostream.

	* src/rdf_model.c, src/rdf_statement.c: Fixed raptor2
	raptor_new_iostream calls in test code.

	* src/rdf_parser_raptor.c:
	(librdf_parser_raptor_new_statement_handler): Fixed raptor2
	raptor_new_iostream_to_file_handle() call with LIBRDF_DEBUG > 1.
	Removed unused debug variable.

	* src/rdf_avltree.c:
	(librdf_avltree_check_internal): Changed signature to take a
	size_t* instead of int*.

	(librdf_avltree_check): Pass size_t to
	librdf_avltree_check_internal to avoid warning about
	signed-unsigned comparison.

2010-02-15  Dave Beckett 

	* utils/redland-virtuoso-test.c: use librdf_model_write

	* utils/redland-virtuoso-test.c: librdf_free_uri

	* utils/redland-virtuoso-test.c: define base_uri

	* src/rdf_query_virtuoso.c: move results on

	* src/rdf_query_virtuoso.c: remove dup row_size

	* src/rdf_query_virtuoso.c:
	(librdf_query_virtuoso_new_results_formatter,
	librdf_query_virtuoso_free_results_formatter): Added copies from
	rdf_query_rasqal.c

	* src/rdf_query.c:
	(librdf_init_query): If not modular, register
	librdf_init_query_virtuoso() here

	* src/rdf_storage_virtuoso.c: If modular
	librdf_init_query_virtuoso() here

	* src/rdf_query.c:
	(librdf_init_query): Init virtuoso query.

	* src/rdf_query_virtuoso.c: fix row_size and numCols

	* src/rdf_storage_virtuoso.c: comments

	* src/rdf_storage_virtuoso_internal.h: Added
	SQL_DESC_COL_BOX_FLAGS

	* src/rdf_storage_virtuoso.c: Added conditional code (not used)
	for new lang/type descriptions.

	* src/rdf_storage_virtuoso_internal.h: Virtuoso docs and newer
	ODBC extensions Added SQL_DESC_COL_LITERAL_LANG and
	SQL_DESC_COL_LITERAL_TYPE from
	http://docs.openlinksw.com/virtuoso/odbcimplementation.html#virtodbcsparql

	* src/rdf_query_internal.h, src/rdf_query_rasqal.c: Export
	redland_node_to_rasqal_literal() internally

	* src/rdf_storage_virtuoso_internal.h: remove rasqal_query_results
	from librdf_query_virtuoso_context

	* src/rdf_query_virtuoso.c:
	(librdf_query_virtuoso_results_formatter_write): Format query
	results using rasqal.

	(librdf_query_virtuoso_results_formatter_write): Create rasqal
	variables table, query results and rows from librdf_query_results
	- that's about 3 copies: virtoso, librdf and rasqal - then use
	rasqal to serialize it.  Not optimal at all, but it should work.

	* src/rdf_storage_virtuoso.c: notes

	* src/rdf_storage_virtuoso.c: comments

	* src/rdf_storage_virtuoso.c: ws

	* src/rdf_storage_virtuoso.c: ws

	* src/rdf_storage_virtuoso.c: code style

	* src/rdf_storage_virtuoso.c: code style - removing assignments in
	if()

	* src/rdf_storage_virtuoso.c: doc comments and code style

	* src/rdf_storage_virtuoso.c: code style and some docs

	* src/rdf_storage_virtuoso.c: code style

	* src/rdf_storage_virtuoso.c: code style

	* src/Makefile.am: Added rasqal_query_virtuoso.c

	* src/rdf_storage_virtuoso_internal.h:
	librdf_query_virtuoso_context gains rasqal_query_results *results

	* src/rdf_storage_virtuoso.c: code style.

	* src/rdf_query_virtuoso.c: it compiles

	* src/rdf_query_virtuoso.c: code style

	* src/rdf_query_virtuoso.c: code style.

	* src/rdf_query_virtuoso.c: restore qrf functions from
	http://svn.librdf.org/view/*checkout*/librdf/trunk/src/rdf_query_virtuoso.c?revision=15455&content-type=text%2Fplain&pathrev=15458

	* src/rdf_query_virtuoso.c: code style

	* src/rdf_storage_virtuoso.c: code style

	* src/rdf_query_virtuoso.c: Check in for refactoring, getting it
	to compile.

	* src/rdf_storage.c, src/rdf_storage_module.h:
	librdf_storage_supports_query() and librdf_storage_query_execute()
	now call new storage factory methods.

	struct librdf_storage_factory_s gains supports_query and
	query_execute factory methods.

	* src/rdf_query_internal.h: move comment to match factory method

	* src/rdf_model.c, src/rdf_model.h: Added librdf_model_write()
	deprecating librdf_model_print() debug routine

	* src/rdf_stream.c, src/rdf_stream.h: Added librdf_stream_write()
	deprecating librdf_stream_print() debug routine

	* utils/redland-virtuoso-test.c: 'printf' format attribute in
	prototype for gcc

	* configure.ac, src/win32_rdf_config.h: 1.0.11

	* FAQS.html, INSTALL.html, LICENSE.html, NEWS.html, RELEASE.html,
	TODO.html: 1.0.11

	* README.html: GIT

	* src/rdf_query.c: autodocs

	* src/rdf_storage.c: autodocs

	* utils/redland-virtuoso-test.c: Use
	librdf_new_query_results_formatter2()

	* utils/rdfproc.c: Use librdf_new_query_results_formatter2()

	* src/rdf_statement.c:
	(librdf_statement_to_string): Use librdf_statement_write()

	* src/rdf_parser_raptor.c, src/rdf_statement.c,
	src/rdf_statement.h, src/rdf_stream.c: Add
	librdf_statement_write() to write to iostream

	(librdf_statement_write): Added using librdf_node_write().

	(librdf_statement_print): Use above.

	(main): Update test code to write to iostream to stdout and use
	librdf_statement_write()

	(librdf_parser_raptor_new_statement_handler): Update to use
	librdf_statement_write().

	(librdf_stream_print): Updated to use librdf_statement_write()

	* src/rdf_query.c:
	(main): Use librdf_query_results_to_counted_string2()

	* src/rdf_node.c:
	(librdf_node_to_string, librdf_node_to_counted_string): Alter
	these to construct an iostream to a string and use
	librdf_node_write() to create the strings.  These functions are
	still for debugging and deprecated.

2010-02-15  Lauri Aalto 

	* src/rdf_storage_sql.c: rdf_storage_sql: raptor2 git head support

	* src/rdf_node.c:
	(librdf_node_print): raptor2 raptor_new_iostream_to_file_handle()

2010-02-14  Dave Beckett 

	* src/rdf_query_results.c: autodocs

	* src/rdf_node.c, src/rdf_node.h: Deprecate librdf_node*_string()
	for librdf_node_write.

	(librdf_node_to_string, librdf_node_to_counted_string): Deprecated
	for librdf_node_write.  These were really only meant for internal
	use.  Discourage it more.

	* src/rdf_node.c:
	(librdf_node_write): Write NULL node as "(null)"

	* src/rdf_node.c, src/rdf_node.h: Added librdf_node_write() to
	write to iostream as ntriples and make librdf_node_print() use it

	(librdf_node_write); Added to write a redland node to an iostream,
	formatted as N-Triples.

	(librdf_node_print): Use above.  If anyone was relying on this debug
	format in scripts, this changes the result.  Intended to start to
	address Issue#0000124 http://bugs.librdf.org/mantis/view.php?id=124

	* src/rdf_query_results.c: Use
	librdf_new_query_results_formatter2() in reading/writing query
	results.
	
	(librdf_query_results_to_counted_string2,
	librdf_query_results_to_file_handle2): Use
	librdf_new_query_results_formatter2() for creating formatters
	rather than deprecated methods.

	* src/rdf_query.h, src/rdf_query_results.c: Added
	librdf_new_query_results_formatter2()

	(librdf_new_query_results_formatter2): Added, deprecating
	librdf_new_query_results_formatter and
	librdf_new_query_results_formatter_by_mime_type.

	* src/rdf_query_internal.h, src/rdf_query_rasqal.c,
	src/rdf_query_results.c: Switch to 1 query results formatter
	internal factory constructor method

	struct librdf_query_factory_s methods new_results_formatter and
	new_results_formatter_by_mime_type are replaced by one
	new_results_formatter method that takes name, mime type and format
	URI args.

	(librdf_query_rasqal_new_results_formatter): Renamed from
	librdf_query_rasqal_new_results_formatter2

	(librdf_query_rasqal_new_results_formatter,
	librdf_query_rasqal_new_results_formatter_by_mime_type):
	deleted

	(librdf_query_rasqal_register_factory): Register just one method
	above.

	(librdf_new_query_results_formatter,
	librdf_new_query_results_formatter_by_mime_type): Call just one
	factory method.

	* src/rdf_query_rasqal.c: Use
	librdf_query_rasqal_new_results_formatter2() to implement older
	methods.

	(librdf_query_rasqal_new_results_formatter2): Added and
	handle rasqal >= 0.9.18 and
	older.

	(librdf_query_rasqal_new_results_formatter,
	librdf_query_rasqal_new_results_formatter_by_mime_type): Call
	above function.

	(librdf_query_rasqal_register_factory): Register factory method
	new_results_Formatter2 is supported.

	* src/rdf_query_internal.h: struct librdf_query_factory_s gains
	new_results_formatter2 for query results formatting.

	* src/rdf_query_rasqal.c: Add conditional support for rasqal
	0.9.18+ query result formatter
	class.

	(librdf_query_rasqal_new_results_formatter,
	librdf_query_rasqal_new_results_formatter_by_mime_type): Call
	rasqal_new_query_results_formatter2 with unified args when rasqal
	is new enough.

2010-02-12  Lauri Aalto 

	* src/rdf_log.c, src/rdf_model.c, src/rdf_parser.c,
	src/rdf_parser_raptor.c, src/rdf_query_rasqal.c,
	src/rdf_query_results.c, src/rdf_raptor.c, src/rdf_serializer.c,
	src/rdf_serializer_raptor.c, src/rdf_storage.c:
	Work-in-progress to get librdf to build on raptor2 git HEAD.

	raptor_statement now implemented using raptor_terms.

	raptor_statement_handler loses constness of raptor_statement

	Dropped custom error/warning handlers in parsing.

	FIXME: raptor_uri <-> librdf_uri mapping is currently broken

	Changed function calls:
	- raptor_format_locator() -> raptor_locator_format()
	- raptor_new_sequence(): raptor_sequence_{free,print}_handler ->
	  raptor_data_..._handler
	- raptor_world_enumerate_parsers(), raptor_new_parser(),
	  raptor_world_guess_parser_name(), raptor_parser_parse_start(),
	  raptor_parser_parse_chunk(), raptor_parser_get_need_base_uri()
	- raptor_parser_set_{statement,namespace,generage_id}_handler
	- raptor_www_new()
	- raptor_feature -> raptor_option
	- raptor_world_enumerate_serializers(), raptor_new_serializer(),
	  raptor_serialize_start_to_iostream()
	- raptor_new_iostream_to_string(), raptor_new_iostream_to_file_handle()

2010-02-08  Dave Beckett 

	* src/rdf_query.h, src/rdf_query_results.c: Alter query result
	formatters to all take format name, mime_type and uri args

	(librdf_query_results_to_counted_string2,
	librdf_query_results_to_string2,
	librdf_query_results_to_file_handle2,
	librdf_query_results_to_file2): Added, deprecating version without
	the 2 suffix.

2010-01-24  Dave Beckett 

	* redland.pc.in: Use pkg-config (undocumented) Requires.private
	for raptor and rasqal

2010-01-20  Lauri Aalto 

	* utils/rdfproc.c:
	Use librdf_query_results_formats_* functions
	instead of corresponding rasqal_query_results_formats_* functions.
	Fixes Issue#0000322 http://bugs.librdf.org/mantis/view.php?id=322

2010-01-18  Lauri Aalto 

	* utils/rdfproc.c:
	(main): Fixed double deletion in CMD_CONTEXTS.
	Fixes Issue#0000321 http://bugs.librdf.org/mantis/view.php?id=321

2010-01-06  Dave Beckett 

	* README.html: 2010

2010-01-02  Dave Beckett 

	* src/.gitignore, utils/.gitignore: Ignore .o files

	* .gitignore, build/.gitignore, demos/.gitignore, docs/.gitignore,
	docs/tmpl/.gitignore, examples/.gitignore, src/.gitignore,
	utils/.gitignore: Add .gitignore to replace SVN prop svn:ignore

redland-1.0.17/NOTICE0000644000175000017500000000026410375024366011046 00000000000000This product includes Redland software (http://librdf.org/)
developed at the Institute for Learning and Research Technology,
University of Bristol, UK (http://www.bristol.ac.uk/).
redland-1.0.17/INSTALL0000644000175000017500000003660012155164577011205 00000000000000Installation Instructions
*************************

Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
Inc.

   Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.  This file is offered as-is,
without warranty of any kind.

Basic Installation
==================

   Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package.  The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.  Some packages provide this
`INSTALL' file but do not implement all of the features documented
below.  The lack of an optional feature in a given package is not
necessarily a bug.  More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation.  It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions.  Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').

   It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring.  Caching is
disabled by default to prevent problems with accidental use of stale
cache files.

   If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release.  If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.

   The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'.  You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.

   The simplest way to compile this package is:

  1. `cd' to the directory containing the package's source code and type
     `./configure' to configure the package for your system.

     Running `configure' might take a while.  While running, it prints
     some messages telling which features it is checking for.

  2. Type `make' to compile the package.

  3. Optionally, type `make check' to run any self-tests that come with
     the package, generally using the just-built uninstalled binaries.

  4. Type `make install' to install the programs and any data files and
     documentation.  When installing into a prefix owned by root, it is
     recommended that the package be configured and built as a regular
     user, and only the `make install' phase executed with root
     privileges.

  5. Optionally, type `make installcheck' to repeat any self-tests, but
     this time using the binaries in their final installed location.
     This target does not install anything.  Running this target as a
     regular user, particularly if the prior `make install' required
     root privileges, verifies that the installation completed
     correctly.

  6. You can remove the program binaries and object files from the
     source code directory by typing `make clean'.  To also remove the
     files that `configure' created (so you can compile the package for
     a different kind of computer), type `make distclean'.  There is
     also a `make maintainer-clean' target, but that is intended mainly
     for the package's developers.  If you use it, you may have to get
     all sorts of other programs in order to regenerate files that came
     with the distribution.

  7. Often, you can also type `make uninstall' to remove the installed
     files again.  In practice, not all packages have tested that
     uninstallation works correctly, even though it is required by the
     GNU Coding Standards.

  8. Some packages, particularly those that use Automake, provide `make
     distcheck', which can by used by developers to test that all other
     targets like `make install' and `make uninstall' work correctly.
     This target is generally not run by end users.

Compilers and Options
=====================

   Some systems require unusual options for compilation or linking that
the `configure' script does not know about.  Run `./configure --help'
for details on some of the pertinent environment variables.

   You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment.  Here
is an example:

     ./configure CC=c99 CFLAGS=-g LIBS=-lposix

   *Note Defining Variables::, for more details.

Compiling For Multiple Architectures
====================================

   You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory.  To do this, you can use GNU `make'.  `cd' to the
directory where you want the object files and executables to go and run
the `configure' script.  `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.  This
is known as a "VPATH" build.

   With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory.  After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.

   On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor.  Like
this:

     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
                 CPP="gcc -E" CXXCPP="g++ -E"

   This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.

Installation Names
==================

   By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc.  You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.

   You can specify separate installation prefixes for
architecture-specific files and architecture-independent files.  If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.

   In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files.  Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.  In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.

   The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.

   The first method involves providing an override variable for each
affected directory.  For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'.  Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated.  The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.

   The second method involves providing the `DESTDIR' variable.  For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names.  The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters.  On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.

Optional Features
=================

   If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.

   Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System).  The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.

   For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.

   Some packages offer the ability to configure how verbose the
execution of `make' will be.  For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.

Particular systems
==================

   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:

     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"

and if that doesn't work, install pre-built binaries of GCC for HP-UX.

   HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved.  Use GNU `make'
instead.

   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `' header file.  The option `-nodtk' can be used as
a workaround.  If GNU CC is not installed, it is therefore recommended
to try

     ./configure CC="cc"

and if that doesn't work, try

     ./configure CC="cc -nodtk"

   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.

   On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'.  It is recommended to use the following options:

     ./configure --prefix=/boot/common

Specifying the System Type
==========================

   There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on.  Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option.  TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:

     CPU-COMPANY-SYSTEM

where SYSTEM can have one of these forms:

     OS
     KERNEL-OS

   See the file `config.sub' for the possible values of each field.  If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.

   If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.

   If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.

Sharing Defaults
================

   If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists.  Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.

Defining Variables
==================

   Variables not defined in a site shell script can be set in the
environment passed to `configure'.  However, some packages may run
configure again during the build, and the customized values of these
variables may be lost.  In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'.  For example:

     ./configure CC=/usr/local2/bin/gcc

causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).

Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug.  Until the bug is fixed you can use this workaround:

     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash

`configure' Invocation
======================

   `configure' recognizes the following options to control how it
operates.

`--help'
`-h'
     Print a summary of all of the options to `configure', and exit.

`--help=short'
`--help=recursive'
     Print a summary of the options unique to this package's
     `configure', and exit.  The `short' variant lists options used
     only in the top level, while the `recursive' variant lists options
     also present in any nested packages.

`--version'
`-V'
     Print the version of Autoconf used to generate the `configure'
     script, and exit.

`--cache-file=FILE'
     Enable the cache: use and save the results of the tests in FILE,
     traditionally `config.cache'.  FILE defaults to `/dev/null' to
     disable caching.

`--config-cache'
`-C'
     Alias for `--cache-file=config.cache'.

`--quiet'
`--silent'
`-q'
     Do not print messages saying which checks are being made.  To
     suppress all normal output, redirect it to `/dev/null' (any error
     messages will still be shown).

`--srcdir=DIR'
     Look for the package's source code in directory DIR.  Usually
     `configure' can determine that directory automatically.

`--prefix=DIR'
     Use DIR as the installation prefix.  *note Installation Names::
     for more details, including other options available for fine-tuning
     the installation locations.

`--no-create'
`-n'
     Run the configure checks, but stop before creating any output
     files.

`configure' also accepts some other, not widely useful, options.  Run
`configure --help' for more details.

redland-1.0.17/NEWS.html0000644000175000017500000010022712257575706011616 00000000000000



  Redland librdf RDF API Library - News



Redland librdf RDF API Library - News

2013-12-28 Redland Version 1.0.17 Released

Configuration and build improvements
Fixed Issues: 0000529, 0000540, 0000541, 0000542 and 0000543

See the 1.0.17 Release Notes for the full details of the changes.

2012-12-29 Redland Version 1.0.16 Released

librdf_model_contains_statement() and librdf_storage_contains_statement() now return 0 for invalid statements
Postgres, MySQL and Hashes storage bug fixes.
Multiple other API bug fixes
Multiple build fixes to help building on Windows. (Daniel Richard G.)
Requires Raptor 2.0.7 or newer
Fixed Issues: 0000443, 0000460, 0000497, 0000518 and 0000519

See the 1.0.16 Release Notes for the full details of the changes.

2011-12-03 Redland Version 1.0.15 Released

Revert librdf_new_statement_from_statement() to original copy semantics
Add functions for cross-library (DLL) memory management
Added a few new small APIs.
Fixed Issues: 0000461, 0000468, 0000475, 0000478, 0000483 and 0000485

See the 1.0.15 Release Notes for the full details of the changes.

2011-07-23 Redland Version 1.0.14 Released

Rasqal minimum version is now 0.9.25.
Fixed a few URI and node reference leaks after changes for Raptor V2
Added parser class methods to parse from I/O stream sources
Added query class static method to get query language descriptions
Removed unused and Raptor-duplicate internal code
Code cleanup fixing unused variables and values via GCC 4.6, LLVM clang and valgrind.
Other minor fixes and improvements
Fixed Issues: #0000375, #0000418, #0000432 and #0000447

See the 1.0.14 Release Notes for the full details of the changes.

2011-02-01 Redland Version 1.0.13 Released

Raptor V1 support was removed; Raptor minimum version is now 2.0.0
Rasqal minimum version is now 0.9.22.
Added description-style APIs for parser, serializer and query results formats
Serializing to quad formats now works
Replaced remaining few abort()s in code paths with error log and failure
Several other minor API changes
Fixed Issues: #0000325, #0000404 and #0000419

See the 1.0.13 Release Notes for the full details of the changes.

2010-10-13 Redland Version 1.0.12 Released

Enable librdf.h to be used as the top-level header in addition to redland.h
Fix linking issues when building with GNU ld with DT_NEEDED disabled
Fixed Issues: #0000329, #0000348 #0000391, #0000392 and #0000393.

See the 1.0.12 Release Notes for the full details of the changes.

2010-09-25 Redland Version 1.0.11 Released

Virtuoso storage backend querying now fully works.
Several new convenience APIs were added and others deprecated.
Support building with Raptor V2 API if configured with --with-raptor2.
Exports more functions to SWIG language bindings.
Switched to GIT version control hosted by GitHub.
Many other bug fixes and improvements were made.
Fixed Issues: #0000124, #0000284, #0000321, #0000322, #0000334, #0000338, #0000341, #0000344, #0000350, #0000363, #0000366, #0000371, #0000380, #0000382 and #0000383

See the 1.0.11 Release Notes for the full details of the changes.

2009-12-16 Redland Version 1.0.10 Released

Added a Virtuoso storage by Patrick van Kleef
Support Rasqal 0.9.17 API
Fix compiling against sqlite 3.6.17 or newer
Fix modular storage dynamic loading linking problems. Several other bug fixes including addressing issues: Issue #0000302, Issue #0000304, Issue #0000311, Issue #0000315 and Issue #0000317.

See the 1.0.10 Release Notes for the full details of the changes.

2009-04-12 Redland Version 1.0.9 Released

Made the storages (triple stores) API public and the implementations modular - can be compiled externally and dynamically loaded on demand.
Removed Raptor and Rasqal from sources - now external build dependencies.
Many other bug fixes including addressing issues: #0000272, #0000282 #0000283, #0000285 and #0000286.

See the 1.0.9 Release Notes for the full details of the changes.

2008-07-05 Redland Version 1.0.8 Released

Updated to use Rasqal 0.9.16 (from 0.9.15)
Updated to use Raptor 1.4.18 (from 1.4.16)
Added a 'trees' indexed in-memory storage
Improvements to low-memory and other failures of resource allocation
API additions and changes to concepts, parser and serializer classes.
Fixed Issue 0000256

NOTE: The next release of redland will NOT include raptor and rasqal in the tarball, they will be separate download dependencies.

See the 1.0.8 Release Notes for the full details of the changes.

2007-12-24 Redland Version 1.0.7 Released

Updated to use Rasqal 0.9.15 (from 0.9.14)
Updated to use Raptor 1.4.16 (from 1.4.15)
Added a optional modular storage
Improvements to low-memory and other failures of resource allocation
Added URI filtering to the parser class
SQLite storage gains transactions and other fixes
Many other bug fixes addressing Issues 0000187, 0000189, 0000203, 0000205, 0000209, 0000213, 0000215, 0000218, 0000229, 0000230, 0000234, 0000235 and 0000236

See the 1.0.7 Release Notes for the full details of the changes.

2007-05-05 Redland Version 1.0.6 Released

Updated to use Rasqal 0.9.14 (from 0.9.13)
Updated to use Raptor 1.4.15 (from 1.4.13)
Added a new transactions API for graph changes, implemented for MySQL
Added a new query results formatter class
Many other bug fixes addressing Issues #0000175, #0000173, #0000159, #0000153, #0000150 and #0000038

See the 1.0.6 Release Notes for the full details of the changes.

2006-11-19 Redland Version 1.0.5 Released

Updated to use Rasqal 0.9.13 (from 0.9.12)
Updated to use Raptor 1.4.13 (from 1.4.9)
Several API additions
Parsing methods can take a NULL base URI when it is not needed
Added serializer methods to serialize from a stream
Many fixes and improvements to the SQLite storage
Export some more functions to the SWIG binding
Many minor improvements
Many other bug fixes addressing Issues #0000092, #0000103, #0000105, #0000107, #0000114, #0000116, #0000125, #0000130, #0000132, #0000136 and #0000139.

See the 1.0.5 Release Notes for the full details of the changes.

2006-05-05 Redland Version 1.0.4 Released

Updated to use Rasqal 0.9.12 to update to SPARQL 2006-04-06 and JSON results
Updated to use Raptor 1.4.9 with many improvements
Fixes for several crashes in parsing and serializing.

See the 1.0.4 Release Notes for the full details of the changes.

2006-02-15 Redland Version 1.0.3 Released

Updated to use Rasqal 0.9.11 to update to SPARQL 2005-11-23
Updated to use Raptor 1.4.8 with many improvements
Added a new PostgreSQL storage contributed by Shi Wenzhong
Created an enhanced API reference manual with gtk-doc
Some other minor fixes and changes

NOTE: Redland will be switching to use Subversion for version control after the 1.0.3 release. See the Redland Subversion site or the online Redland installation notes for the latest information.

See the 1.0.3 Release Notes for the full details of the changes.

2005-06-10 Redland Version 1.0.2 Released

Fixed a crash when querying or searching with the API and getting no results
Updated to use Rasqal 0.9.10 to provide query results sorting such as SPARQL ORDER BY and some SPARQL syntax updates. (release notes)
Updated to use Raptor 1.4.7 to to fix some crashes in the RSS tag soup parser and serializer. (release notes)

See the 1.0.2 Release Notes for the full details of the changes.

2005-05-29 Redland Version 1.0.1 Released

Updated to use Rasqal 0.9.9 to provide improved SPARQL query support for the revised syntax (release notes)
Updated to use Raptor 1.4.6 to provide a new GRDDL parser as well as updated RSS enclosures support (relase notes)
MySQL store has changed key algorithm: NOTE: may require a store save and reload
SQLite store now returns correct query results
Digest and Hash classes are now public and available to bindings
Empty iterators and streams now always return an object
Win32 portability fixes and build configuration (John Barstow)
Several other API additions were made.

See the 1.0.1 Release Notes for the full details of the changes.

2005-02-06 Redland Version 1.0.0 Released

This is a mature library so it is time for 1.0.0
Updated to use Rasqal 0.9.6 for better query and SPARQL support
Updated to use Raptor 1.4.5 for new RDF/XML abbreviated serializer, improved RSS tag soup parser and RSS 1.0 serializer
New experimental SQLite storage

See the 1.0.0 Release Notes for the full details of the changes.

2004-11-01 Redland Version 0.9.19 Released

License changed from LGPL 2.1/MPL 1.1 to LGPL 2.1/Apache 2
Updated to use Rasqal 0.9.4 to provide SPARQL support
Updated to use Raptor 1.4.2 to provide serializing of models to strings in RDF/XML or N-Triples
Some small API additions and bug fixes.

See the 0.9.19 Release Notes for the full details of the changes.

2004-08-03 Redland Version 0.9.18 Released

(Revert statement usage counting from 0.9.17)

This is Redland 1.0 release candidate 1
New Query and Query Results classes to support RDF querying with RDQL using Rasqal
Moved the language APIS into the new Redland Bindings package
Added a new message logging API giving structured messages
Updated MySQL storage (Morten Frederiksen)
Check that duplicate statements are not added to models
Portability fixes for building natively on Win32 (Jose Kahan)
Updated to Rasqal 0.9.2 and Raptor 1.3.2
Several other minor bugs and fixes.

See the 0.9.17 Release Notes for the full details of the changes.

2004-02-24 Redland Version 0.9.16 Released

A small but important bug fix to make the installed C headers work correctly again.

See the 0.9.16 Release Notes for the full details of the changes.

2004-01-31 Redland Version 0.9.15 Released

API CHANGE Several classes were modified to use unsigned char* for UTF-8 encoded URIs and Literals
Update to synchronise with Raptor version 1.2.0 (RDF/XML and N-Triples parser) - see Raptor NEWS gaining the Turtle Terse RDF Triple Language
Added storage with MySQL written by Morten Frederiksen
Added storage with AKT Triplestore
Added file and URI-backed in-memory storage
Added fixes to make Redland compile cleanly under C++ (tested with g++)
Added assertion checks and reporting for function arguments
Added method for finding statements in a context
Added a method for listing the contexts in a graph
Storage, model and serializer get/set feature methods now take and return nodes
Improved rdfproc utility to handle multiple storage types, storage options, contexts and environment variables for configuration.
Fix crash on reporting parser errors with % in the message
Improved RDF/XML serializer to chose better output names
Many other minor changes and fixes.

See the 0.9.15 Release Notes for the full list of the changes.

2003-09-08 Redland Version 0.9.14 Released

Update to synchronise with Raptor version 1.0.0 (RDF/XML and N-Triples parser) - see Raptor NEWS for the changes since 0.9.12.
Added a new utility program rdfproc - a general RDF processor for Redland that allows command line use of the library.
Made the Node class intern every node.
Fixed the broken use of Perl UNIVERSAL::isa
Other minor API changes

See the 0.9.14 Release Notes for the full list of the changes.

2003-08-28 Redland Version 0.9.13 Released

API CHANGE Node The class was modifed to make objects immutable, removing the set methods and to add new node type convienence methods.
API addition Model Added a method to sync the model to the backing store.
API addition Parser Added methods to allow parsing from strings.
API addition Statement Added method to check for partial statements.
API addition Storage Added a method to sync the backing store.
Better error recovery - most errors return if possible.
Added initial simple threading support (patches by Seth Ladd)
Greatly improved Python API using 2.2 features (Edd Dumbill and Matt Biddulph)
Updated Perl, Python and Java APIs to always return new nodes and statements, removing the need to consider shared object issues.
Updated serializing to RDF/XML to handle datatype literals
Update to Raptor version 0.9.12 (RDF/XML and N-Triples parser) - see Raptor NEWS for changes since 0.9.8.
Extensive portability and other bug fixes.

See the 0.9.13 Release Notes for the full list of the changes.

2003-02-13 Redland Version 0.9.12 Released

FORMAT CHANGE The persistent storage format was changed to support RDF typed literals and this will require an upgrade of any existing Berkeley/Sleepycat DB stores created by Redland 0.9.11 or earlier. A utility redland-db-upgrade is provided that creates an updated store from an existing one.
API CHANGE Iterator and Stream classes. The next/get_next method is split into get_object always returning a shared object and next methods. get_context method added. (get_object is called current in higher level language APIs)
API CHANGE Model class. Method add_statement no longer takes ownership of the passed in statement. The caller now retains ownership.
API CHANGE Model class. Method add_statements no longer frees the passed in librdf_stream; the caller must free it now.
API CHANGE Node and Model classes. Added RDF Datatyped Literals. Other literal is_wf_xml constructors and methods deprecated.
API CHANGE All literals methods and constructors have no mention of the never-used or supported XML Space argument which is not part of an RDF literal.
Added a script utils/update-api-0912.pl to help automate the API changes as far as possible or warn about those that cannot be automatically updated.
Added contexts - Statements added to Model (when using a Storage that supports contexts) can take an optional Node, returned by the new get_context method on Iterator and Stream classes.
Many portability and compiling fixes (OSX, gcc 3.x, FreeBSD, non-gcc compiler)
Java API classes. Add finished() method replacing useless finalize().
Use Raptor message callbacks to get parser warnings and errors
Build Java API working around the stupid things recent SWIG versions do.
Make Redland work with BDB/Sleepycat DB v4 (as well as v2 and v3)
Python API gains pydoc comments and HTML derived version
Perl and Python APIs now receive Redland message callbacks
Redland URI class now registers with Raptor rather than specially compile Raptor
Added RDF/XML Serializer class and made higher level language APIs to it
Update to Raptor version 0.9.8 (RDF/XML and N-Triples parser) - see Raptor NEWS for detailed changes since 0.9.5
Added skeleton Ruby and PHP APIs
Major source reorganisation.

See also the 0.9.12 Release Notes

2002-06-08 Redland Version 0.9.11 Released

Update to Raptor version 0.9.5 (RDF/XML and N-Triples parser)
Added serialization to a syntax API; with N-Triples as the first syntax
Added start of query language API
Updated Python interface to be more Pythonic, now requires python 2.1+
Added Ruby API
Redland will now work as a perl CPAN module
Updated Perl interface - modules have been renamed. Fix programs with update-perl-api.pl
Updated Java API
Now uses libtool to build dynamic and static libraries
Multiple startup/shutdowns of entire library now works.

2001-08-28 Redland Version 0.9.10 Released

More work on debian packaging
Added Raptor N-Triples parser
Changes needed for _:name identifiers from N-Triples
Added Java API

2001-06-07 Redland Version 0.9.9 Released

Added librdf_world class to manage Redland environment startup/shutdown - pervasive change throughout all other classes
configure improvements to try to get expat variants detected and working more automatically
Added Debian (.deb) package support
SiRPAC parser wrapper now handles multi-line literals
Changed stream and iterator interfaces and classes to be compatible, in preparation for unifying in one new filter class. NOTE: This requires changes to user-code - librdf_iterator_have_elements is now !librdf_iterator_is_end and librdf_iterator_set_map is now librdf_iterator_add_map
Added perl and python interface warnings for above changes
Preparation work for querying for arcs to/from a resource node, filtering
Additional examples and explanations added to perl interface documentation
Updated to Raptor RDF/XML parser 0.9.1 - many bug fixes

2001-02-05 Redland Version 0.9.8 Released

Added Tcl interface
Added Raptor RDF parser, written by me (alpha quality) and made some changes to support it.
More fixes to Perl interface to fix crashes
Added Perl RDF::RSS method as_xhtml for simple RSS 1.0 to (X)HTML formatting.

2001-01-05 Redland Version 0.9.7 Released

Changed Perl Model API - renamed get_* method names, added deprecated warnings for old names.
Updated Repat to 2000-12-24 version (plus some patches).
Added Perl Plain Old Documentation (POD).
Fixed subtle Perl interface object reference bugs.
Changed Model API - add_statement now does not own the added statement
Added to Model API - get_source, get_arc, get_target return one matching librdf_node, not a list of them like get_sources etc. do via librdf_iterator.
Added UTF-8 support for converting between UTF-8 and ISO Latin-1.

2000-11-06 Redland Version 0.9.6 Released

Added python interface (2.0 and 1.5)
More perl interface fixes
Parser APIs updated to handle syntax specified by MIME type and/or URI and now have features allowing the setting/querying of parser options.

2000-10-20 Redland Version 0.9.5 Released

Added Repat RDF parser by Jason Diamond - jason at njektilo dot org
More perl API fixes and improvements
Internal changes preparing for proper reification support and use of rdf:, rdfs: concepts

2000-09-29 Redland Version 0.9.4 Released

Implemented perl interface
Created RPM construction support
Started work on internal RDF parser

2000-08-30 Redland Version 0.9.3 Released

Implemented fast get sources, targets, arcs for storage models using multiple hashes (Berkeley DB)
Made Berkeley DB support work for V3, two variants of V2
Implemented removing statements for stored models
Changed internal hash API arguments, which was nice.
Added general RDF utility example code example4.c that parses RDF/XML syntax, stores it and provides multiple query methods.
Added simple 10-line RDF example code example3.c
SiRPAC Java parser call changed to not discard error output
Use streaming part of SiRPAC Java parser
Didn't do anything on list :( but fixed several parts of code marked FIXME :-).

2000-08-21 Redland Version 0.9.2 Released

API HTML documentation added to release.
configure now splits and generates sub-version numbers.

2000-08-18 Redland Version 0.9.1 Released

configure warns user if no persistant storage (BDB) found
configure warns user if no RDF parser configured
Made BDB V1 fail if found by configure - does not work with Redland.
Some improvements to installation document.

2000-08-17 Redland named

Redland renamed from librdf, license changed to LGPL/MPL from LGPL/BSD.

2000-06-21 Redland first CVS commit

Redland 'born' with first CVS commit: It compiles and builds as a GNU automake/conf suite with 'make distcheck' and 'make check'


Copyright (C) 2000-2013 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

redland-1.0.17/redland.pc.in0000644000175000017500000000100511516326266012500 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ plugindir=${libdir}/redland swig=${prefix}/share/redland/Redland.i have_raptor2_api=@HAVE_RAPTOR2_API@ Name: Redland RDF API Library Description: Redland RDF API and triple store library Requires.private: raptor2 >= @RAPTOR_MIN_VERSION@, rasqal >= @RASQAL_MIN_VERSION@, rasqal <= @RASQAL_MAX_VERSION@ Version: @VERSION@ Libs: -L${libdir} -lrdf Libs.private: @LIBRDF_LDFLAGS@ @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ Cflags: -I${includedir} redland-1.0.17/configure0000755000175000017500000217443212257575715012076 00000000000000#! /bin/sh # From configure.ac Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for Redland librdf RDF API Library 1.0.17. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: http://bugs.librdf.org/ about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script $0: under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" lt_ltdl_dir='libltdl' SHELL=${CONFIG_SHELL-/bin/sh} lt_dlopen_dir="$lt_ltdl_dir" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Redland librdf RDF API Library' PACKAGE_TARNAME='redland' PACKAGE_VERSION='1.0.17' PACKAGE_STRING='Redland librdf RDF API Library 1.0.17' PACKAGE_BUGREPORT='http://bugs.librdf.org/' PACKAGE_URL='' ac_unique_file="src/rdf_node.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" enable_option_checking=no ac_subst_vars='ltdl_LTLIBOBJS ltdl_LIBOBJS am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE GTK_DOC_BUILD_PDF_TRUE GTK_DOC_BUILD_HTML_FALSE GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE GTKDOC_DEPS_LIBS GTKDOC_DEPS_CFLAGS HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V abs_top_builddir abs_top_srcdir RECHO_C RECHO_N MEM_LIBS MEM LIBRDF_PKGCONFIG_PRIVATE_LIBS LIBRDF_LIBTOOLLIBS LIBRDF_LDFLAGS LIBRDF_CPPFLAGS LIBRDF_INTERNAL_DEPS LIBRDF_INTERNAL_LIBS LIBRDF_INTERNAL_CPPFLAGS LIBRDF_DIRECT_LIBS LIBRDF_EXTERNAL_LIBS LIBRDF_EXTERNAL_CPPFLAGS DIGEST_SRCS DIGEST_OBJS MODULAR_LIBRDF_FALSE MODULAR_LIBRDF_TRUE VIRTUOSO_LIBS VIRTUOSO_CPPFLAGS POSTGRESQL_LIBS POSTGRESQL_CPPFLAGS TSTORE_LIBS TSTORE_CPPFLAGS MYSQL_LIBS MYSQL_CPPFLAGS STORAGE_VIRTUOSO_FALSE STORAGE_VIRTUOSO_TRUE STORAGE_POSTGRESQL_FALSE STORAGE_POSTGRESQL_TRUE STORAGE_TSTORE_FALSE STORAGE_TSTORE_TRUE STORAGE_SQLITE_FALSE STORAGE_SQLITE_TRUE STORAGE_MYSQL_FALSE STORAGE_MYSQL_TRUE STORAGE_MEMORY_FALSE STORAGE_MEMORY_TRUE STORAGE_TREES_FALSE STORAGE_TREES_TRUE STORAGE_HASHES_FALSE STORAGE_HASHES_TRUE STORAGE_FILE_FALSE STORAGE_FILE_TRUE ODBC_LIBS ODBC_CFLAGS IODBC_CONFIG PG_CONFIG SQLITE_LIBS SQLITE_CFLAGS MYSQL_CONFIG TSTORE_CONFIG REDLAND_MODULE_PATH HASH_SRCS HASH_OBJS HAVE_RAPTOR2_API RAPTOR_MIN_VERSION RAPTOR2_LIBS RAPTOR2_CFLAGS RASQAL_LIBS RASQAL_CFLAGS RASQAL_MAX_VERSION RASQAL_MIN_VERSION GETOPT_FALSE GETOPT_TRUE MEMCMP_FALSE MEMCMP_TRUE RECHO PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG PERL TAR LTDLOPEN LT_CONFIG_H subdirs CONVENIENCE_LTDL_FALSE CONVENIENCE_LTDL_TRUE INSTALL_LTDL_FALSE INSTALL_LTDL_TRUE ARGZ_H sys_symbol_underscore LIBADD_DL LT_DLPREOPEN LIBADD_DLD_LINK LIBADD_SHL_LOAD LIBADD_DLOPEN LT_DLLOADERS INCLTDL LTDLINCL LTDLDEPS LIBLTDL CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB DLLTOOL OBJDUMP NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED LIBTOOL LN_S am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC ac_ct_AR AR LIBRDF_LIBTOOL_VERSION LIBRDF_VERSION_DECIMAL LIBRDF_VERSION_RELEASE LIBRDF_VERSION_MINOR LIBRDF_VERSION_MAJOR host_os host_vendor host_cpu host build_os build_vendor build_cpu build MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_included_ltdl with_ltdl_include with_ltdl_lib enable_ltdl_install enable_release enable_modular with_bdb with_bdb_lib with_bdb_include with_bdb_dbname enable_digests with_module_path with_threestore with_mysql with_sqlite with_postgresql with_virtuoso with_iodbc with_unixodbc with_datadirect with_odbc_include with_odbc_lib enable_storages with_threads enable_assertions enable_assert_messages enable_debug enable_silent_rules with_html_dir enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR RASQAL_CFLAGS RASQAL_LIBS RAPTOR2_CFLAGS RAPTOR2_LIBS SQLITE_CFLAGS SQLITE_LIBS GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS' ac_subdirs_all='libltdl' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Redland librdf RDF API Library 1.0.17 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/redland] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Redland librdf RDF API Library 1.0.17:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl --enable-release Turn on optimizations (for maintainer). --disable-modular Build storage backends into librdf library. --enable-digests=LIST Use digests (default=md5 sha1 ripemd160) --enable-storages=LIST Use storages (default=all) --enable-assertions Perform run time assertion checks (default yes). --enable-assert-messages Print run time assertion check failure messages (default yes). --enable-debug Enable debug messages (default no). --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0') --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-included-ltdl use the GNU ltdl sources included here --with-ltdl-include=DIR use the ltdl headers installed in DIR --with-ltdl-lib=DIR use the libltdl.la installed in DIR --with-bdb=DIR Oracle Berkeley DB install area (default=/usr) --with-bdb-lib=DIR Oracle Berkeley DB lib directory (default=/usr/lib) --with-bdb-include=DIR Oracle Berkeley DB include directory (default=/usr/include) --with-bdb-dbname=NAME Oracle Berkeley DB library name (auto) --with-module-path=PATH Default search path for modules (default=/usr/local/lib/redland:${libdir}/redland --with-threestore(=CONFIG|yes|no) Location of 3store-config (default=auto) --with-mysql(=CONFIG|yes|no) Location of MySQL 3/4 mysql_config (default=auto) --with-sqlite(=yes|no) Enable SQLite store (default=auto) --with-postgresql(=CONFIG|yes|no) Location of pg_config (default=auto) --with-virtuoso(=yes|no) Enable Virtuoso RDF store (default=auto) --with-iodbc(=DIR) Select iODBC support DIR is the iODBC base install directory (default=/usr/local) --with-unixodbc(=DIR) Select UnixODBC support DIR is the UnixODBC base install directory (default=/usr/local) --with-datadirect(=DIR) Select DataDirect support DIR is the DataDirect base install directory (default=/usr/local) --with-odbc-inc=DIR Specify custom ODBC include directory (default=/usr/local/include) --with-odbc-lib=DIR Specify custom ODBC lib directory (default=/usr/local/lib) --with-threads With POSIX thread support (default=no) --with-html-dir=PATH path to installed docs Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path RASQAL_CFLAGS C compiler flags for RASQAL, overriding pkg-config RASQAL_LIBS linker flags for RASQAL, overriding pkg-config RAPTOR2_CFLAGS C compiler flags for RAPTOR2, overriding pkg-config RAPTOR2_LIBS linker flags for RAPTOR2, overriding pkg-config SQLITE_CFLAGS C compiler flags for SQLITE, overriding pkg-config SQLITE_LIBS linker flags for SQLITE, overriding pkg-config GTKDOC_DEPS_CFLAGS C compiler flags for GTKDOC_DEPS, overriding pkg-config GTKDOC_DEPS_LIBS linker flags for GTKDOC_DEPS, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Redland librdf RDF API Library configure 1.0.17 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------------- ## ## Report this to http://bugs.librdf.org/ ## ## -------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Redland librdf RDF API Library $as_me 1.0.17, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/rdf_config.h" ac_aux_dir= for ac_dir in build "$srcdir"/build; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build \"$srcdir\"/build" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='redland' VERSION='1.0.17' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac version_major=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\1/'` version_minor=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\2/'` version_release=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\3/'` version_decimal=`expr $version_major \* 10000 + $version_minor \* 100 + $version_release` cat >>confdefs.h <<_ACEOF #define LIBRDF_VERSION_MAJOR $version_major _ACEOF cat >>confdefs.h <<_ACEOF #define LIBRDF_VERSION_MINOR $version_minor _ACEOF cat >>confdefs.h <<_ACEOF #define LIBRDF_VERSION_RELEASE $version_release _ACEOF cat >>confdefs.h <<_ACEOF #define LIBRDF_VERSION_DECIMAL $version_decimal _ACEOF # for redland-config.in LIBRDF_VERSION_MAJOR=$version_major LIBRDF_VERSION_MINOR=$version_minor LIBRDF_VERSION_RELEASE=$version_release LIBRDF_VERSION_DECIMAL=$version_decimal # Libtool versioning # # CURRENT # The most recent interface number that this library implements. # # REVISION # The implementation number of the CURRENT interface. # # AGE # The difference between the newest and oldest interfaces that this # library implements. In other words, the library implements all the # interface numbers in the range from number `CURRENT - AGE' to # `CURRENT'. # # Rules: # 1. Start with version information of `0:0:0' for each libtool library. # # 2. Update the version information only immediately before a public # release of your software. More frequent updates are unnecessary, # and only guarantee that the current interface number gets larger # faster. # # 3. If the library source code has changed at all since the last # update, then increment REVISION (`C:R:A' becomes `C:r+1:A'). # # 4. If any interfaces have been added, removed, or changed since the # last update, increment CURRENT, and set REVISION to 0. # # 5. If any interfaces have been added since the last public release, # then increment AGE. # # 6. If any interfaces have been removed since the last public release, # then set AGE to 0. # # syntax: CURRENT[:REVISION[:AGE]] LIBRDF_LIBTOOL_VERSION=0:0:0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 $as_echo "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is clang" >&5 $as_echo_n "checking whether $CC is clang... " >&6; } CC_IS_CLANG=no if $CC 2>&1 | grep clang >/dev/null 2>&1; then CC_IS_CLANG=yes else : fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_IS_CLANG" >&5 $as_echo "$CC_IS_CLANG" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # Libtool and LTDL initialising case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=yes enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 $as_echo_n "checking which extension is used for runtime loadable modules... " >&6; } if ${libltdl_cv_shlibext+:} false; then : $as_echo_n "(cached) " >&6 else module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 $as_echo "$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_EXT "$libltdl_cv_shlibext" _ACEOF fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_EXT "$libltdl_cv_shrext" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variable specifies run-time module search path" >&5 $as_echo_n "checking which variable specifies run-time module search path... " >&6; } if ${lt_cv_module_path_var+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_module_path_var="$shlibpath_var" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 $as_echo "$lt_cv_module_path_var" >&6; } if test -n "$lt_cv_module_path_var"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 $as_echo_n "checking for the default library search path... " >&6; } if ${lt_cv_sys_dlsearch_path+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 $as_echo "$lt_cv_sys_dlsearch_path" >&6; } if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done cat >>confdefs.h <<_ACEOF #define LT_DLSEARCH_PATH "$sys_dlsearch_path" _ACEOF fi LT_DLLOADERS= ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBADD_DLOPEN= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBDL 1" >>confdefs.h if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" for ac_func in dlerror do : ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" if test "x$ac_cv_func_dlerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLERROR 1 _ACEOF fi done LIBS="$lt_save_LIBS" fi LIBADD_SHL_LOAD= ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld" fi fi case $host_os in darwin[1567].*) # We only want this for pre-Mac OS X 10.4. ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : $as_echo "#define HAVE_DYLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include " if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl _ACEOF LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : $as_echo "#define HAVE_DLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done $as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; } if ${lt_cv_sys_symbol_underscore+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 $as_echo "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 $as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } if ${libltdl_cv_need_uscore+:} false; then : $as_echo_n "(cached) " >&6 else libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" if test "$cross_compiling" = yes; then : libltdl_cv_need_uscore=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; x$lt_dlunknown|x*) ;; esac else : # compilation failed fi fi rm -fr conftest* LIBS="$save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 $as_echo "$libltdl_cv_need_uscore" >&6; } fi fi if test x"$libltdl_cv_need_uscore" = xyes; then $as_echo "#define NEED_USCORE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 $as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } if ${lt_cv_sys_dlopen_deplibs+:} false; then : $as_echo_n "(cached) " >&6 else # PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[4-9]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[12345]*|irix6.[01]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd* | netbsdelf*-gnu) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[1234]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } if test "$lt_cv_sys_dlopen_deplibs" != yes; then $as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h fi : for ac_header in argz.h do : ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default " if test "x$ac_cv_header_argz_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARGZ_H 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) # include #endif " if test "x$ac_cv_type_error_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF else $as_echo "#define error_t int" >>confdefs.h $as_echo "#define __error_t_defined 1" >>confdefs.h fi ARGZ_H= for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ARGZ_H=argz.h; _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" fi done if test -z "$ARGZ_H"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 $as_echo_n "checking if argz actually works... " >&6; } if ${lt_cv_sys_argz_works+:} false; then : $as_echo_n "(cached) " >&6 else case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 $as_echo "$lt_cv_sys_argz_works" >&6; } if test "$lt_cv_sys_argz_works" = yes; then : $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h else ARGZ_H=argz.h _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 $as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } if ${libltdl_cv_preloaded_symbols+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 $as_echo "$libltdl_cv_preloaded_symbols" >&6; } if test x"$libltdl_cv_preloaded_symbols" = xyes; then $as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h fi # Set options # Check whether --with-included_ltdl was given. if test "${with_included_ltdl+set}" = set; then : withval=$with_included_ltdl; fi if test "x$with_included_ltdl" != xyes; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. ac_fn_c_check_header_compile "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default " if test "x$ac_cv_header_ltdl_h" = xyes; then : ac_fn_c_check_decl "$LINENO" "lt_dlinterface_register" "ac_cv_have_decl_lt_dlinterface_register" "$ac_includes_default #include " if test "x$ac_cv_have_decl_lt_dlinterface_register" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dladvise_preload in -lltdl" >&5 $as_echo_n "checking for lt_dladvise_preload in -lltdl... " >&6; } if ${ac_cv_lib_ltdl_lt_dladvise_preload+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lltdl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lt_dladvise_preload (); int main () { return lt_dladvise_preload (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ltdl_lt_dladvise_preload=yes else ac_cv_lib_ltdl_lt_dladvise_preload=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dladvise_preload" >&5 $as_echo "$ac_cv_lib_ltdl_lt_dladvise_preload" >&6; } if test "x$ac_cv_lib_ltdl_lt_dladvise_preload" = xyes; then : with_included_ltdl=no else with_included_ltdl=yes fi else with_included_ltdl=yes fi else with_included_ltdl=yes fi fi # Check whether --with-ltdl_include was given. if test "${with_ltdl_include+set}" = set; then : withval=$with_ltdl_include; fi if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else as_fn_error $? "invalid ltdl include directory: \`$with_ltdl_include'" "$LINENO" 5 fi else with_ltdl_include=no fi # Check whether --with-ltdl_lib was given. if test "${with_ltdl_lib+set}" = set; then : withval=$with_ltdl_lib; fi if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else as_fn_error $? "invalid ltdl library directory: \`$with_ltdl_lib'" "$LINENO" 5 fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) case $enable_ltdl_convenience in no) as_fn_error $? "this package needs a convenience libltdl" "$LINENO" 5 ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_build_prefix}'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. $as_echo "#define HAVE_LTDL 1" >>confdefs.h LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) as_fn_error $? "\`--with-ltdl-include' and \`--with-ltdl-lib' options must be used together" "$LINENO" 5 ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL="-I$with_ltdl_include" ;; esac INCLTDL="$LTDLINCL" # Report our decision... { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl headers" >&5 $as_echo_n "checking where to find libltdl headers... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTDLINCL" >&5 $as_echo "$LTDLINCL" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl library" >&5 $as_echo_n "checking where to find libltdl library... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBLTDL" >&5 $as_echo "$LIBLTDL" >&6; } # Check whether --enable-ltdl-install was given. if test "${enable_ltdl_install+set}" = set; then : enableval=$enable_ltdl_install; fi case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac if test x"${enable_ltdl_install-no}" != xno; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else INSTALL_LTDL_TRUE='#' INSTALL_LTDL_FALSE= fi if test x"${enable_ltdl_convenience-no}" != xno; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else CONVENIENCE_LTDL_TRUE='#' CONVENIENCE_LTDL_FALSE= fi subdirs="$subdirs libltdl" # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in closedir opendir readdir do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else _LT_LIBOBJS="$_LT_LIBOBJS lt__dirent.$ac_objext" fi done for ac_func in strlcat strlcpy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else _LT_LIBOBJS="$_LT_LIBOBJS lt__strl.$ac_objext" fi done cat >>confdefs.h <<_ACEOF #define LT_LIBEXT "$libext" _ACEOF name= eval "lt_libprefix=\"$libname_spec\"" cat >>confdefs.h <<_ACEOF #define LT_LIBPREFIX "$lt_libprefix" _ACEOF name=ltdl eval "LTDLOPEN=\"$libname_spec\"" # Only expand once: # Find a tar command for 'make dist' for ac_prog in gnutar gtar tar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_TAR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$TAR"; then ac_cv_prog_TAR="$TAR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_TAR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi TAR=$ac_cv_prog_TAR if test -n "$TAR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 $as_echo "$TAR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$TAR" && break done for ac_prog in perl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PERL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PERL="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PERL" && break done # Gnome if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} for ac_prog in echo do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RECHO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RECHO"; then ac_cv_prog_RECHO="$RECHO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RECHO="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RECHO=$ac_cv_prog_RECHO if test -n "$RECHO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RECHO" >&5 $as_echo "$RECHO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$RECHO" && break done RECHO_C= RECHO_N= case `$RECHO -n x` in -n*) case `$RECHO 'xy\c'` in *c*) ;; xy) RECHO_C='\c' ;; esac;; *) RECHO_N='-n' ;; esac release_version=no # Check whether --enable-release was given. if test "${enable_release+set}" = set; then : enableval=$enable_release; \ if test "$enableval" = "yes"; then \ release_version=yes fi; fi modular=yes # Check whether --enable-modular was given. if test "${enable_modular+set}" = set; then : enableval=$enable_modular; \ if test "$enableval" = "no"; then \ modular=no fi; fi # GCC warning options # http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html # # Too noisy: # -Wconversion: # -Wformat-nonliteral : variables for format strings # -Wno-system-headers : not debugging system # -Wunused-parameter : variables can be marked __attribute__('unused') # # Apple gcc specific (probably): -Wshorten-64-to-32 possible_warnings="\ -Wall \ -Wc++-compat \ -Wextra \ -Wunused \ \ -Waggregate-return \ -Wbad-function-cast \ -Wcast-align \ -Wdeclaration-after-statement \ -Wdisabled-optimization \ -Wdiv-by-zero \ -Wendif-labels \ -Werror-implicit-function-declaration \ -Wfloat-equal \ -Wformat-security \ -Wframe-larger-than=4096 \ -Winit-self \ -Winline \ -Wmissing-declarations \ -Wmissing-field-initializers \ -Wmissing-format-attribute \ -Wmissing-noreturn \ -Wmissing-prototypes \ -Wnested-externs \ -Wold-style-definition \ -Wpacked \ -Wpointer-arith \ -Wredundant-decls \ -Wshadow \ -Wsign-compare \ -Wsign-conversion \ -Wstrict-prototypes \ -Wswitch-enum \ -Wundef \ -Wunsafe-loop-optimizations \ -Wwrite-strings \ \ -Wshorten-64-to-32 \ -Wno-conversion \ -Wno-format-nonliteral \ -Wno-system-headers \ -Wno-unused-parameter \ " warning_cflags= if test "$USE_MAINTAINER_MODE" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for supported $CC warning flags" >&5 $as_echo_n "checking for supported $CC warning flags... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $warning_cflags" >&5 $as_echo "$warning_cflags" >&6; } for warning in $possible_warnings; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $warning" >&5 $as_echo_n "checking whether $CC supports $warning... " >&6; } redland_save_CFLAGS="$CFLAGS" if test $CC_IS_CLANG = yes; then # Make unknown warnings into errors for clang so the test below works CFLAGS="-Werror $CFLAGS" fi CFLAGS="$CFLAGS $warning" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : redland_cc_flag=yes else redland_cc_flag=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$redland_save_CFLAGS" if test "X$redland_cc_flag" = "Xyes"; then warning_cflags="$warning_cflags $warning" else : fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $redland_cc_flag" >&5 $as_echo "$redland_cc_flag" >&6; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking $CC supports warning flags" >&5 $as_echo_n "checking $CC supports warning flags... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $warning_cflags" >&5 $as_echo "$warning_cflags" >&6; } fi MAINTAINER_CPPFLAGS="$warning_cflags" # Externally linked libraries - appear in redland-config # -Dfoo -Idir LIBRDF_CPPFLAGS=$CPPFLAGS # -Ldir LIBRDF_LDFLAGS=$LDFLAGS # -llib LIBRDF_LIBS=$LIBS # Internally linked libraries - never given to users # -Dfoo -Idir LIBRDF_INTERNAL_CPPFLAGS= # -Ldir -llib LIBRDF_INTERNAL_LIBS= # Internal dependencies like libltdl when built locally LIBRDF_INTERNAL_DEPS= # Libraries linked externally also may be internal - presently just # raptor and rasqal but in future may include others # Currently only substituted into redland-src-config. # -Dfoo -Idir LIBRDF_EXTERNAL_CPPFLAGS= # -Ldir -llib LIBRDF_EXTERNAL_LIBS= # do these first because somehow they get messed up by bdb checks ac_fn_c_check_type "$LINENO" "byte" "ac_cv_type_byte" "$ac_includes_default" if test "x$ac_cv_type_byte" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BYTE 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "u32" "ac_cv_type_u32" "$ac_includes_default" if test "x$ac_cv_type_u32" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_U32 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "u64" "ac_cv_type_u64" "$ac_includes_default" if test "x$ac_cv_type_u64" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_U64 1 _ACEOF fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned char" >&5 $as_echo_n "checking size of unsigned char... " >&6; } if ${ac_cv_sizeof_unsigned_char+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned char))" "ac_cv_sizeof_unsigned_char" "$ac_includes_default"; then : else if test "$ac_cv_type_unsigned_char" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (unsigned char) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_char=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_char" >&5 $as_echo "$ac_cv_sizeof_unsigned_char" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_CHAR $ac_cv_sizeof_unsigned_char _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned int" >&5 $as_echo_n "checking size of unsigned int... " >&6; } if ${ac_cv_sizeof_unsigned_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned int))" "ac_cv_sizeof_unsigned_int" "$ac_includes_default"; then : else if test "$ac_cv_type_unsigned_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (unsigned int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_int" >&5 $as_echo "$ac_cv_sizeof_unsigned_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5 $as_echo_n "checking size of unsigned long... " >&6; } if ${ac_cv_sizeof_unsigned_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then : else if test "$ac_cv_type_unsigned_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (unsigned long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5 $as_echo "$ac_cv_sizeof_unsigned_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5 $as_echo_n "checking size of unsigned long long... " >&6; } if ${ac_cv_sizeof_unsigned_long_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default"; then : else if test "$ac_cv_type_unsigned_long_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (unsigned long long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_long_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5 $as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long _ACEOF # Check whether --with-bdb was given. if test "${with_bdb+set}" = set; then : withval=$with_bdb; bdb_prefix="$withval" else bdb_prefix="none" fi # Check whether --with-bdb_lib was given. if test "${with_bdb_lib+set}" = set; then : withval=$with_bdb_lib; bdb_lib_dir="$withval" else bdb_lib_dir="none" fi # Check whether --with-bdb_include was given. if test "${with_bdb_include+set}" = set; then : withval=$with_bdb_include; bdb_include_dir="$withval" else bdb_include_dir="none" fi # Check whether --with-bdb_dbname was given. if test "${with_bdb_dbname+set}" = set; then : withval=$with_bdb_dbname; bdb_dbname="$withval" else bdb_dbname="none" fi bdb_version=unknown bdb_available=Missing # debian multiarch multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null` if test "x$bdb_prefix" != "xno" ; then if test "x$bdb_prefix" = "xyes" ; then bdb_prefix="none" fi # Only prefix given - set lib and include if test "X$bdb_prefix" != "Xnone" -a "X$bdb_lib_dir" = "Xnone" -a "X$bdb_include_dir" = "Xnone" ; then bdb_lib_dir="$bdb_prefix/lib" bdb_include_dir="$bdb_prefix/include" fi # Nothing given - search if test "X$bdb_prefix" = "Xnone" -a "X$bdb_lib_dir" = "Xnone" -a "X$bdb_include_dir" = "Xnone" -a "X$bdb_dbname" = "Xnone" ; then bdb_prefix="/usr" bdb_lib_dir="/usr/lib" bdb_include_dir="/usr/include" extraprefix= # OSX fink area added if found and /sw/bin is in the PATH if test -d /sw/include -a -d /sw/lib ; then if echo $PATH |grep /sw/bin >/dev/null; then extraprefix=/sw fi fi # Sigh! And this still might not be good enough. for bdbc_version in 5.3 5.2 5.1 5.0 4.9 4.8 4.7 4.6 4.5 4.4 4.3 4.2 4.1 4.0 4 3.3 3.2 3.1 3 2; do bdbc_major=`echo $bdbc_version | sed -e 's/^\(.\).*$/\1/'`; bdbc_version2=`echo $bdbc_version | sed -e 's/^\(.\).\(.\)$/\1\2/'` for bdbc_prefix in $extraprefix /usr/local/BerkeleyDB.$bdbc_version /usr/local /opt/local /usr; do bdbc_libdir=$bdbc_prefix/lib for bdbc_incdir in $bdbc_prefix/include/db$bdbc_version $bdbc_prefix/include/db$bdbc_version2 $bdbc_prefix/include/db$bdbc_major $bdbc_prefix/include ; do if test -r $bdbc_incdir/db.h ; then header_bdbc_version=`sed -ne 's/^.*DB_VERSION_STRING.*Berkeley DB \(...\).*/\1/p' $bdbc_incdir/db.h` if test "X$header_bdbc_version" = "X$bdbc_version" ; then for bdbc_name in db-$bdbc_version db$bdbc_version db-$bdbc_version2 db$bdbc_version2; do bdbc_libdir_multiarch= if test "X$multiarch" != X; then bdbc_libdir_multiarch=$bdbc_libdir/$multiarch fi for bdbc_libdir2 in $bdbc_libdir_multiarch $bdbc_libdir $bdbc_libdir/db$bdbc_version $bdbc_libdir/db$bdbc_version2; do if test -r $bdbc_libdir2/lib$bdbc_name.a -o -r $bdbc_libdir2/lib$bdbc_name.so -o -r $bdbc_libdir2/lib$bdbc_name.dylib; then bdb_version=$bdbc_version bdb_prefix=$bdbc_prefix bdb_include_dir=$bdbc_incdir bdb_lib_dir=$bdbc_libdir2 bdb_dbname=$bdbc_name break 5 fi done done fi fi done done done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Oracle Berkeley DB (BDB) version" >&5 $as_echo_n "checking Oracle Berkeley DB (BDB) version... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bdb_version" >&5 $as_echo "$bdb_version" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of BDB libs" >&5 $as_echo_n "checking location of BDB libs... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bdb_lib_dir" >&5 $as_echo "$bdb_lib_dir" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of BDB includes" >&5 $as_echo_n "checking location of BDB includes... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bdb_include_dir" >&5 $as_echo "$bdb_include_dir" >&6; } if test "$bdb_prefix" != no; then nLDFLAGS=$LDFLAGS nCPPFLAGS= if test "$bdb_lib_dir" != /usr/lib; then nLDFLAGS="-L$bdb_lib_dir"; fi if test "$bdb_dbname" = none; then # Yuck, yuck, yuck - can't they create a bdb-config program like GNOME? bdb_dbname=`cd $bdb_lib_dir; ls -1 libdb[-0-9.]*.a libdb[-0-9.]*.{so,dylib}* 2>/dev/null | sed -e 's/^lib//' -e 's/\.a$//' -e 's/\.so.*$//' -e 's/\.dylib.*$//' | head -1` if test "X$bdb_dbname" = X; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find the BDB library name from the files in $bdb_lib_dir" >&5 $as_echo "$as_me: WARNING: Cannot find the BDB library name from the files in $bdb_lib_dir" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Assuming it is 'db' and will link like -ldb" >&5 $as_echo "$as_me: WARNING: Assuming it is 'db' and will link like -ldb" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Use --with-bdb-dbname=NAME if this is wrong" >&5 $as_echo "$as_me: WARNING: Use --with-bdb-dbname=NAME if this is wrong" >&2;} bdb_dbname=db fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking name of BDB library" >&5 $as_echo_n "checking name of BDB library... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bdb_dbname" >&5 $as_echo "$bdb_dbname" >&6; } if test "$bdb_include_dir" != /usr/include; then nCPPFLAGS="-I$bdb_include_dir"; fi LDFLAGS="$nLDFLAGS $LDFLAGS" CPPFLAGS="$nCPPFLAGS $CPPFLAGS" LIBS="-l$bdb_dbname $LIBS" for ac_header in db.h do : ac_fn_c_check_header_mongrel "$LINENO" "db.h" "ac_cv_header_db_h" "$ac_includes_default" if test "x$ac_cv_header_db_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DB_H 1 _ACEOF fi done have_libdb=no if test "$ac_cv_header_db_h" = yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BDB V1 dbopen" >&5 $as_echo_n "checking for BDB V1 dbopen... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { dbopen(NULL, 0, 0, DB_BTREE, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_DBOPEN 1" >>confdefs.h if test $have_libdb = no; then bdb_available="Version 1.x - not supported" have_libdb=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BDB V2 db_open" >&5 $as_echo_n "checking for BDB V2 db_open... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { db_open(NULL, DB_BTREE, 0, 0, NULL, NULL, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_DB_OPEN 1" >>confdefs.h have_libdb=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BDB V3/V4.x db_create" >&5 $as_echo_n "checking for BDB V3/V4.x db_create... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { db_create(NULL, NULL, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_DB_CREATE 1" >>confdefs.h have_libdb=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext have_bdb_open_7_args=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BDB V4.1+ DB->open with 7 arguments" >&5 $as_echo_n "checking for BDB V4.1+ DB->open with 7 arguments... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { DB *bdb; bdb->open(bdb, NULL, NULL, NULL, DB_BTREE, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_BDB_OPEN_7_ARGS 1" >>confdefs.h have_libdb=yes have_bdb_open_7_args=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "X$have_bdb_open_7_args" = Xno; then # Cannot have 6 args if 7 args worked { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BDB V4.0 DB->open with 6 arguments" >&5 $as_echo_n "checking for BDB V4.0 DB->open with 6 arguments... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { DB *bdb; bdb->open(bdb, NULL, NULL, DB_BTREE, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_BDB_OPEN_6_ARGS 1" >>confdefs.h have_libdb=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BDB DB->close with 2 arguments" >&5 $as_echo_n "checking for BDB DB->close with 2 arguments... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { DB *bdb; bdb->close(bdb, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_BDB_CLOSE_2_ARGS 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BDB DB->fd with 2 arguments" >&5 $as_echo_n "checking for BDB DB->fd with 2 arguments... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { DB *bdb; bdb->fd(bdb, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_BDB_FD_2_ARGS 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BDB DB->set_flags" >&5 $as_echo_n "checking for BDB DB->set_flags... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { DB *bdb; bdb->set_flags(bdb, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_BDB_SET_FLAGS 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether DB_TXN defined in db.h" >&5 $as_echo_n "checking whether DB_TXN defined in db.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { DB_TXN* ptr=(DB_TXN*)NULL ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_BDB_DB_TXN 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether DBC defined in db.h" >&5 $as_echo_n "checking whether DBC defined in db.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { size_t len=sizeof(DBC) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_BDB_CURSOR 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to db_cursor" >&5 $as_echo_n "checking number of arguments to db_cursor... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { DB* db; db->cursor(db, NULL, NULL, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_BDB_CURSOR_4_ARGS 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: 4" >&5 $as_echo "4" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: 3" >&5 $as_echo "3" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "X$have_libdb" = Xyes; then bdb_available="Version $bdb_version (library $bdb_dbname in $bdb_lib_dir)" LIBRDF_LIBS="$LIBRDF_LIBS $nLDFLAGS -l$bdb_dbname" LIBRDF_CPPFLAGS="$LIBRDF_CPPFLAGS $nCPPFLAGS" fi fi fi CPPFLAGS="$LIBRDF_CPPFLAGS" LDFLAGS="$LIBRDF_LDFLAGS" LIBS="$LIBRDF_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in errno.h stdlib.h unistd.h string.h fcntl.h time.h sys/time.h sys/stat.h getopt.h stddef.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac for ac_func in getopt getopt_long memcmp mkstemp mktemp tmpnam gettimeofday getenv do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_func_memcmp = no; then MEMCMP_TRUE= MEMCMP_FALSE='#' else MEMCMP_TRUE='#' MEMCMP_FALSE= fi if test $ac_cv_func_getopt = no -a $ac_cv_func_getopt_long = no; then GETOPT_TRUE= GETOPT_FALSE='#' else GETOPT_TRUE='#' GETOPT_FALSE= fi CPPFLAGS="$LIBRDF_CPPFLAGS" LDFLAGS="$LIBRDF_LDFLAGS" LIBS="$LIBRDF_LIBS" parser_modules=raptor rdf_parsers_available= # Check for rasqal before raptor so that we can see if rasqal was already # built with raptor2 and can then enforce raptor2 is required RASQAL_MIN_VERSION=0.9.25 RASQAL_MAX_VERSION=0.9.99 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RASQAL" >&5 $as_echo_n "checking for RASQAL... " >&6; } if test -n "$RASQAL_CFLAGS"; then pkg_cv_RASQAL_CFLAGS="$RASQAL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rasqal >= \$RASQAL_MIN_VERSION rasqal <= \$RASQAL_MAX_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_RASQAL_CFLAGS=`$PKG_CONFIG --cflags "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$RASQAL_LIBS"; then pkg_cv_RASQAL_LIBS="$RASQAL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rasqal >= \$RASQAL_MIN_VERSION rasqal <= \$RASQAL_MAX_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_RASQAL_LIBS=`$PKG_CONFIG --libs "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then RASQAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION" 2>&1` else RASQAL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$RASQAL_PKG_ERRORS" >&5 as_fn_error $? "Rasqal is not installed or too old - see http://librdf.org/rasqal/ to get a version in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION" "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Rasqal is not installed or too old - see http://librdf.org/rasqal/ to get a version in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION" "$LINENO" 5 else RASQAL_CFLAGS=$pkg_cv_RASQAL_CFLAGS RASQAL_LIBS=$pkg_cv_RASQAL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } RASQAL_VERSION=`$PKG_CONFIG rasqal --modversion 2>/dev/null` fi LIBRDF_EXTERNAL_CPPFLAGS="$RASQAL_CFLAGS $LIBRDF_EXTERNAL_CPPFLAGS" LIBRDF_EXTERNAL_LIBS="$RASQAL_LIBS $LIBRDF_EXTERNAL_LIBS" rdf_query="rasqal(system $RASQAL_VERSION)" # Check for raptor RAPTOR_MIN_VERSION=2.0.7 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAPTOR2" >&5 $as_echo_n "checking for RAPTOR2... " >&6; } if test -n "$RAPTOR2_CFLAGS"; then pkg_cv_RAPTOR2_CFLAGS="$RAPTOR2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"raptor2 >= \$RAPTOR_MIN_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "raptor2 >= $RAPTOR_MIN_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_RAPTOR2_CFLAGS=`$PKG_CONFIG --cflags "raptor2 >= $RAPTOR_MIN_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$RAPTOR2_LIBS"; then pkg_cv_RAPTOR2_LIBS="$RAPTOR2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"raptor2 >= \$RAPTOR_MIN_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "raptor2 >= $RAPTOR_MIN_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_RAPTOR2_LIBS=`$PKG_CONFIG --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then RAPTOR2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>&1` else RAPTOR2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$RAPTOR2_PKG_ERRORS" >&5 as_fn_error $? "Raptor2 is not installed or too old - see http://librdf.org/raptor/ to get version $RAPTOR_MIN_VERSION or newer" "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Raptor2 is not installed or too old - see http://librdf.org/raptor/ to get version $RAPTOR_MIN_VERSION or newer" "$LINENO" 5 else RAPTOR2_CFLAGS=$pkg_cv_RAPTOR2_CFLAGS RAPTOR2_LIBS=$pkg_cv_RAPTOR2_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null` fi LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS $RAPTOR2_LIBS" LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS $RASQAL_LIBS" LIBRDF_EXTERNAL_CPPFLAGS="$RAPTOR2_CFLAGS $LIBRDF_EXTERNAL_CPPFLAGS" LIBRDF_EXTERNAL_LIBS="$LIBRDF_DIRECT_LIBS $LIBRDF_EXTERNAL_LIBS" rdf_parsers_available="$parser_available raptor(system $RAPTOR_VERSION)" HAVE_RAPTOR2_API=1 digest_modules="md5 sha1 ripemd160" { $as_echo "$as_me:${as_lineno-$LINENO}: checking digests wanted" >&5 $as_echo_n "checking digests wanted... " >&6; } # Check whether --enable-digests was given. if test "${enable_digests+set}" = set; then : enableval=$enable_digests; digest_modules="$enableval" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $digest_modules" >&5 $as_echo "$digest_modules" >&6; } DIGEST_OBJS= DIGEST_SRCS= digest_modules_available= HASH_OBJS= HASH_SRCS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bdb hash support" >&5 $as_echo_n "checking for bdb hash support... " >&6; } if test "$have_libdb" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_BDB_HASH 1" >>confdefs.h HASH_OBJS="$HASH_OBJS rdf_hash_bdb.lo" HASH_SRCS="$HASH_SRCS rdf_hash_bdb.c" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi persistent_storages="/file/tstore/mysql/sqlite/" persistent_store=no all_storages="memory file hashes trees mysql sqlite tstore postgresql virtuoso" always_available_storages="memory file hashes trees" for storage in $all_storages; do eval $storage'_storage_available=no' eval $storage'_storage=no' done for storage in $always_available_storages; do eval $storage'_storage_available=yes' eval $storage'_storage=yes' done REDLAND_MODULE_PATH="" # Check whether --with-module-path was given. if test "${with_module_path+set}" = set; then : withval=$with_module_path; REDLAND_MODULE_PATH="$witheval" fi if test "x$REDLAND_MODULE_PATH" = "x"; then REDLAND_MODULE_PATH=$libdir"/redland" if test "x$prefix" != "xNONE"; then REDLAND_MODULE_PATH="/usr/local/lib/redland:"$REDLAND_MODULE_PATH fi fi storages_available="memory file hashes(memory) trees" if test "x$have_libdb" = xyes; then storages_available="$storages_available hashes(bdb $bdb_version)" fi # Check whether --with-threestore was given. if test "${with_threestore+set}" = set; then : withval=$with_threestore; tstore_config="$withval" else tstore_config="" fi if test "X$tstore_config" != "Xno"; then if test "X$tstore_config" != "Xyes" ; then TSTORE_CONFIG=$tstore_config fi tstore_config=yes fi if test $tstore_config = yes -a "X$TSTORE_CONFIG" = "X" ; then for ac_prog in 3store-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_TSTORE_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$TSTORE_CONFIG"; then ac_cv_prog_TSTORE_CONFIG="$TSTORE_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_TSTORE_CONFIG="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi TSTORE_CONFIG=$ac_cv_prog_TSTORE_CONFIG if test -n "$TSTORE_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TSTORE_CONFIG" >&5 $as_echo "$TSTORE_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$TSTORE_CONFIG" && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 3store library" >&5 $as_echo_n "checking for 3store library... " >&6; } if test "X$TSTORE_CONFIG" != X -a "X$PKG_CONFIG" != X ; then tstore_version=`$TSTORE_CONFIG --version` storages_available="$storages_available 3store($tstore_version)" tstore_storage_available=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - version $tstore_version" >&5 $as_echo "yes - version $tstore_version" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-mysql was given. if test "${with_mysql+set}" = set; then : withval=$with_mysql; mysql_config="$withval" else mysql_config="" fi if test "X$mysql_config" != "Xno"; then if test "X$mysql_config" != "Xyes" ; then MYSQL_CONFIG=$mysql_config fi mysql_config=yes fi if test $mysql_config = yes -a "X$MYSQL_CONFIG" = "X" ; then for ac_prog in mysql_config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MYSQL_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MYSQL_CONFIG"; then ac_cv_prog_MYSQL_CONFIG="$MYSQL_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MYSQL_CONFIG="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MYSQL_CONFIG=$ac_cv_prog_MYSQL_CONFIG if test -n "$MYSQL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_CONFIG" >&5 $as_echo "$MYSQL_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MYSQL_CONFIG" && break done fi libmysql_min_version=3.23.56 # Also tested on 4.0.14 mysql_cflags= mysql_libs= if test "X$MYSQL_CONFIG" != X; then mysql_libs=`$MYSQL_CONFIG --libs | sed -e "s/'//g"` # Stop the MySQL config program adding -Os or -O options to CFLAGS mysql_cflags=`$MYSQL_CONFIG --cflags | sed -e "s/'//g" -e "s/[ \t]-O[A-Za-z0-9]*/ /" ` LIBS="$LIBRDF_LIBS $mysql_libs" CPPFLAGS="$LIBRDF_CPPFLAGS $mysql_cflags" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql library" >&5 $as_echo_n "checking for mysql library... " >&6; } LIBMYSQL_VERSION=`$MYSQL_CONFIG --version` libmysql_version_dec=`echo $LIBMYSQL_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` libmysql_min_version_dec=`echo $libmysql_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - version $LIBMYSQL_VERSION" >&5 $as_echo "yes - version $LIBMYSQL_VERSION" >&6; } if test $libmysql_version_dec -lt $libmysql_min_version_dec; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Using libmysql $LIBMYSQL_VERSION is unsupported - $libmysql_min_version or newer recommended." >&5 $as_echo "$as_me: WARNING: Using libmysql $LIBMYSQL_VERSION is unsupported - $libmysql_min_version or newer recommended." >&2;} else storages_available="$storages_available mysql($LIBMYSQL_VERSION)" mysql_storage_available=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether MYSQL_OPT_RECONNECT is declared" >&5 $as_echo_n "checking whether MYSQL_OPT_RECONNECT is declared... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int x=MYSQL_OPT_RECONNECT; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_MYSQL_OPT_RECONNECT 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext LIBS="$LIBRDF_LIBS" CPPFLAGS="$LIBRDF_CPPFLAGS" fi # Check whether --with-sqlite was given. if test "${with_sqlite+set}" = set; then : withval=$with_sqlite; with_sqlite="$withval" else with_sqlite="auto" fi if test "X$with_sqlite" != Xno; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLITE" >&5 $as_echo_n "checking for SQLITE... " >&6; } if test -n "$SQLITE_CFLAGS"; then pkg_cv_SQLITE_CFLAGS="$SQLITE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3\""; } >&5 ($PKG_CONFIG --exists --print-errors "sqlite3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SQLITE_CFLAGS=`$PKG_CONFIG --cflags "sqlite3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SQLITE_LIBS"; then pkg_cv_SQLITE_LIBS="$SQLITE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3\""; } >&5 ($PKG_CONFIG --exists --print-errors "sqlite3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SQLITE_LIBS=`$PKG_CONFIG --libs "sqlite3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SQLITE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sqlite3" 2>&1` else SQLITE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sqlite3" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SQLITE_PKG_ERRORS" >&5 with_sqlite=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } with_sqlite=no else SQLITE_CFLAGS=$pkg_cv_SQLITE_CFLAGS SQLITE_LIBS=$pkg_cv_SQLITE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SQLITE_VERSION=`$PKG_CONFIG sqlite3 --modversion` with_sqlite=yes fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking using sqlite library" >&5 $as_echo_n "checking using sqlite library... " >&6; } if test "X$with_sqlite" != Xno ; then storages_available="$storages_available sqlite($SQLITE_VERSION)" sqlite_storage_available=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - version $SQLITE_VERSION" >&5 $as_echo "yes - version $SQLITE_VERSION" >&6; } CPPFLAGS="$LIBRDF_CPPFLAGS $SQLITE_CFLAGS" for ac_header in sqlite3.h sqlite.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS="$LIBRDF_CPPFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-postgresql was given. if test "${with_postgresql+set}" = set; then : withval=$with_postgresql; pg_config="$withval" else postgresql_config="" fi if test "X$pg_config" != "Xno"; then if test "X$pg_config" != "Xyes" ; then PG_CONFIG=$pg_config fi pg_config=yes fi if test $pg_config = yes -a "X$PG_CONFIG" = "X" ; then for ac_prog in pg_config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PG_CONFIG"; then ac_cv_prog_PG_CONFIG="$PG_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PG_CONFIG="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PG_CONFIG=$ac_cv_prog_PG_CONFIG if test -n "$PG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 $as_echo "$PG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PG_CONFIG" && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for postgresql library" >&5 $as_echo_n "checking for postgresql library... " >&6; } if test "X$PG_CONFIG" != X ; then postgresql_version=`$PG_CONFIG --version | sed -e 's/^.* //'` storages_available="$storages_available postgresql($postgresql_version)" postgresql_storage_available=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - version $postgresql_version" >&5 $as_echo "yes - version $postgresql_version" >&6; } CPPFLAGS="$LIBRDF_CPPFLAGS -I`$PG_CONFIG --includedir`" for ac_header in libpq-fe.h do : ac_fn_c_check_header_mongrel "$LINENO" "libpq-fe.h" "ac_cv_header_libpq_fe_h" "$ac_includes_default" if test "x$ac_cv_header_libpq_fe_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPQ_FE_H 1 _ACEOF fi done CPPFLAGS="$LIBRDF_CPPFLAGS" LIBS="$LIBRDF_LIBS -L`$PG_CONFIG --libdir` -lpq" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ########################################################################## # # # OpenLink Virtuoso storage support # # # ########################################################################## # Check whether --with-virtuoso was given. if test "${with_virtuoso+set}" = set; then : withval=$with_virtuoso; with_virtuoso="$withval" else with_virtuoso="auto" fi ## ## Checkout ODBC situation ## # # Initialize variables # found_odbc=no ODBC_CFLAGS= ODBC_LIBS= # # Check for iODBC support # if test "$found_odbc" = "no" then # Check whether --with-iodbc was given. if test "${with_iodbc+set}" = set; then : withval=$with_iodbc; if test "$withval" = "yes" then withval=/usr/local fi PATH_IODBC="$withval/bin:$PATH" # Extract the first word of "iodbc-config", so it can be a program name with args. set dummy iodbc-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_IODBC_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $IODBC_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_IODBC_CONFIG="$IODBC_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH_IODBC do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_IODBC_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_IODBC_CONFIG" && ac_cv_path_IODBC_CONFIG="no" ;; esac fi IODBC_CONFIG=$ac_cv_path_IODBC_CONFIG if test -n "$IODBC_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IODBC_CONFIG" >&5 $as_echo "$IODBC_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iODBC support" >&5 $as_echo_n "checking for iODBC support... " >&6; } if test -f "$withval/lib/libiodbc.dylib" then found_odbc=iODBC # Mac OS X ODBC_CFLAGS="-I$withval/include" ODBC_LIBS="-L$withval/lib -liodbc" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } elif test -x "$IODBC_CONFIG" then found_odbc=iODBC ODBC_CFLAGS=`$IODBC_CONFIG --cflags` ODBC_LIBS=`$IODBC_CONFIG --libs` { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } elif test -f "$withval/lib/libiodbc.a" then found_odbc=iODBC ODBC_CFLAGS="-I$withval/include" ODBC_LIBS="-L$withval/lib -liodbc" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi # # Check for UnixODBC support # if test "$found_odbc" = "no" then # Check whether --with-unixodbc was given. if test "${with_unixodbc+set}" = set; then : withval=$with_unixodbc; if test "$withval" = "yes" then withval=/usr/local fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UnixODBC support" >&5 $as_echo_n "checking for UnixODBC support... " >&6; } if test -f "$withval/lib/libodbc.a" then found_odbc=unixODBC ODBC_CFLAGS="-I$withval/include" ODBC_LIBS="-L$withval/lib -lodbc" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi # # Check for DataDirect support # if test "$found_odbc" = "no" then # Check whether --with-datadirect was given. if test "${with_datadirect+set}" = set; then : withval=$with_datadirect; if test "$withval" = "yes" then withval=/usr/local fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DataDirect support" >&5 $as_echo_n "checking for DataDirect support... " >&6; } if test -f "$withval/lib/libodbc.a" then found_odbc=DataDirect ODBC_CFLAGS="-I$withval/include" ODBC_LIBS="-L$withval/lib -lodbc" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi # # Check for custom ODBC support # if test "$found_odbc" = "no" then # Check whether --with-odbc-include was given. if test "${with_odbc_include+set}" = set; then : withval=$with_odbc_include; if test "$withval" = "yes" then withval=/usr/local/include fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sql.h" >&5 $as_echo_n "checking for sql.h... " >&6; } if test -f "$withval/sql.h" then ODBC_CFLAGS="-I$withval" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # Check whether --with-odbc-lib was given. if test "${with_odbc_lib+set}" = set; then : withval=$with_odbc_lib; if test "$withval" = "yes" then withval=/usr/local/lib fi ac_save_LDFLAGS=$LDFLAGS test -n "$withval" && LDFLAGS="$LDFLAGS -L$withval" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -liodbc" >&5 $as_echo_n "checking for SQLConnect in -liodbc... " >&6; } if ${ac_cv_lib_iodbc_SQLConnect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liodbc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SQLConnect (); int main () { return SQLConnect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iodbc_SQLConnect=yes else ac_cv_lib_iodbc_SQLConnect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLConnect" >&5 $as_echo "$ac_cv_lib_iodbc_SQLConnect" >&6; } if test "x$ac_cv_lib_iodbc_SQLConnect" = xyes; then : ODBC_LIBS="-L$withval -liodbc"; found_odbc=iODBC else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -lodbc" >&5 $as_echo_n "checking for SQLConnect in -lodbc... " >&6; } if ${ac_cv_lib_odbc_SQLConnect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodbc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SQLConnect (); int main () { return SQLConnect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odbc_SQLConnect=yes else ac_cv_lib_odbc_SQLConnect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odbc_SQLConnect" >&5 $as_echo "$ac_cv_lib_odbc_SQLConnect" >&6; } if test "x$ac_cv_lib_odbc_SQLConnect" = xyes; then : ODBC_LIBS="-L$withval -lodbc"; found_odbc=ODBC fi fi LDFLAGS=$ac_save_LDFLAGS fi fi # # Maybe the libraries are in some default directory # if test "$found_odbc" = "no" then # Extract the first word of "iodbc-config", so it can be a program name with args. set dummy iodbc-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_IODBC_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $IODBC_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_IODBC_CONFIG="$IODBC_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_IODBC_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_IODBC_CONFIG" && ac_cv_path_IODBC_CONFIG="no" ;; esac fi IODBC_CONFIG=$ac_cv_path_IODBC_CONFIG if test -n "$IODBC_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IODBC_CONFIG" >&5 $as_echo "$IODBC_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iODBC support" >&5 $as_echo_n "checking for iODBC support... " >&6; } if test -x "$IODBC_CONFIG" then found_odbc=iODBC ODBC_CFLAGS=`$IODBC_CONFIG --cflags` ODBC_LIBS=`$IODBC_CONFIG --libs` { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # # Maybe the libraries are in some default directory # if test "$found_odbc" = "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -liodbc" >&5 $as_echo_n "checking for SQLConnect in -liodbc... " >&6; } if ${ac_cv_lib_iodbc_SQLConnect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liodbc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SQLConnect (); int main () { return SQLConnect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iodbc_SQLConnect=yes else ac_cv_lib_iodbc_SQLConnect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLConnect" >&5 $as_echo "$ac_cv_lib_iodbc_SQLConnect" >&6; } if test "x$ac_cv_lib_iodbc_SQLConnect" = xyes; then : ODBC_LIBS="-liodbc"; found_odbc=iODBC else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -lodbc" >&5 $as_echo_n "checking for SQLConnect in -lodbc... " >&6; } if ${ac_cv_lib_odbc_SQLConnect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodbc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SQLConnect (); int main () { return SQLConnect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odbc_SQLConnect=yes else ac_cv_lib_odbc_SQLConnect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odbc_SQLConnect" >&5 $as_echo "$ac_cv_lib_odbc_SQLConnect" >&6; } if test "x$ac_cv_lib_odbc_SQLConnect" = xyes; then : ODBC_LIBS="-lodbc"; found_odbc=ODBC fi fi fi # # Expand our compile flags # # # Check if SQLLEN, SQLULEN, SQLBIGINT, SQLUBIGINT are defined # save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS" ac_fn_c_check_type "$LINENO" "SQLLEN" "ac_cv_type_SQLLEN" " #include #include #include " if test "x$ac_cv_type_SQLLEN" = xyes; then : else $as_echo "#define SQLLEN SQLINTEGER" >>confdefs.h $as_echo "#define SQLULEN SQLUINTEGER" >>confdefs.h fi if test "x$with_virtuoso" != "xno" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking virtuoso storage dependencies" >&5 $as_echo_n "checking virtuoso storage dependencies... " >&6; } if test "$found_odbc" = "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabled virtuoso storage:" >&5 $as_echo "$as_me: WARNING: Disabled virtuoso storage:" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find ODBC header files and/or libraries" >&5 $as_echo "$as_me: WARNING: could not find ODBC header files and/or libraries" >&2;} virtuoso_storage_available=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } storages_available="$storages_available virtuoso" virtuoso_storage_available=yes fi fi CPPFLAGS="$save_CPPFLAGS" ########################################################################## # # # OpenLink Virtuoso storage support ***END*** # # # ########################################################################## # This is needed because autoheader can't work out which computed # symbols must be pulled from acconfig.h into config.h.in if test "x" = "y"; then $as_echo "#define STORAGE_FILE 1" >>confdefs.h $as_echo "#define STORAGE_HASHES 1" >>confdefs.h $as_echo "#define STORAGE_TREES 1" >>confdefs.h $as_echo "#define STORAGE_MEMORY 1" >>confdefs.h $as_echo "#define STORAGE_MYSQL 1" >>confdefs.h $as_echo "#define STORAGE_SQLITE 1" >>confdefs.h $as_echo "#define STORAGE_TSTORE 1" >>confdefs.h $as_echo "#define STORAGE_POSTGRESQL 1" >>confdefs.h $as_echo "#define STORAGE_VIRTUOSO 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking storages required" >&5 $as_echo_n "checking storages required... " >&6; } # Check whether --enable-storages was given. if test "${enable_storages+set}" = set; then : enableval=$enable_storages; storages="$enableval" fi if test "X$storages" = Xall -o "X$storages" = X; then storages="$all_storages" { $as_echo "$as_me:${as_lineno-$LINENO}: result: all" >&5 $as_echo "all" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $storages" >&5 $as_echo "$storages" >&6; } fi if echo $storages | grep memory >/dev/null; then : else storages="memory $storages" fi for storage in $storages; do if eval test \$$storage'_storage_available' = yes; then eval $storage'_storage=yes' NAME=`echo $storage | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` n=STORAGE_${NAME} cat >>confdefs.h <<_ACEOF #define $n 1 _ACEOF storages_enabled="$storages_enabled $storage" if echo $persistent_storages | grep "/$storage/" >/dev/null; then persistent_store=yes fi fi done if test $file_storage = yes; then STORAGE_FILE_TRUE= STORAGE_FILE_FALSE='#' else STORAGE_FILE_TRUE='#' STORAGE_FILE_FALSE= fi if test $hashes_storage = yes; then STORAGE_HASHES_TRUE= STORAGE_HASHES_FALSE='#' else STORAGE_HASHES_TRUE='#' STORAGE_HASHES_FALSE= fi if test $trees_storage = yes; then STORAGE_TREES_TRUE= STORAGE_TREES_FALSE='#' else STORAGE_TREES_TRUE='#' STORAGE_TREES_FALSE= fi if test $memory_storage = yes; then STORAGE_MEMORY_TRUE= STORAGE_MEMORY_FALSE='#' else STORAGE_MEMORY_TRUE='#' STORAGE_MEMORY_FALSE= fi if test $mysql_storage = yes; then STORAGE_MYSQL_TRUE= STORAGE_MYSQL_FALSE='#' else STORAGE_MYSQL_TRUE='#' STORAGE_MYSQL_FALSE= fi if test $sqlite_storage = yes; then STORAGE_SQLITE_TRUE= STORAGE_SQLITE_FALSE='#' else STORAGE_SQLITE_TRUE='#' STORAGE_SQLITE_FALSE= fi if test $tstore_storage = yes; then STORAGE_TSTORE_TRUE= STORAGE_TSTORE_FALSE='#' else STORAGE_TSTORE_TRUE='#' STORAGE_TSTORE_FALSE= fi if test $postgresql_storage = yes; then STORAGE_POSTGRESQL_TRUE= STORAGE_POSTGRESQL_FALSE='#' else STORAGE_POSTGRESQL_TRUE='#' STORAGE_POSTGRESQL_FALSE= fi if test $virtuoso_storage = yes; then STORAGE_VIRTUOSO_TRUE= STORAGE_VIRTUOSO_FALSE='#' else STORAGE_VIRTUOSO_TRUE='#' STORAGE_VIRTUOSO_FALSE= fi if test $mysql_storage = yes; then MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags | sed -e "s/'//g" -e "s/-OA-Za-z0-9*//" ` MYSQL_LIBS="$LIBRDF_LIBS $mysql_libs" fi if test $tstore_storage = yes; then TSTORE_CPPFLAGS="`$TSTORE_CONFIG --cflags` `$PKG_CONFIG glib --cflags`" TSTORE_LIBS="`$TSTORE_CONFIG --libs` `$PKG_CONFIG glib --libs`" fi if test $postgresql_storage = yes; then POSTGRESQL_CPPFLAGS="-I`$PG_CONFIG --includedir`" POSTGRESQL_LIBS="-L`$PG_CONFIG --libdir` -lpq" fi if test $virtuoso_storage = yes; then VIRTUOSO_CPPFLAGS="$ODBC_CFLAGS" VIRTUOSO_LIBS="$ODBC_LIBS" fi if test "$persistent_store" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No persistant storage is available or enabled" >&5 $as_echo "$as_me: WARNING: No persistant storage is available or enabled" >&2;} fi if test "$modular" = yes; then LIBRDF_INTERNAL_CPPFLAGS="$LIBRDF_INTERNAL_CPPFLAGS $INCLTDL" LIBRDF_INTERNAL_LIBS="$LIBRDF_INTERNAL_LIBS $LIBLTDL" LIBRDF_INTERNAL_DEPS="$LIBRDF_INTERNAL_DEPS $LTDLDEPS" $as_echo "#define MODULAR_LIBRDF 1" >>confdefs.h else LIBRDF_CPPFLAGS="$LIBRDF_CPPFLAGS $MYSQL_CPPFLAGS $SQLITE_CFLAGS $TSTORE_CPPFLAGS $POSTGRESQL_CPPFLAGS $VIRTUOSO_CPPFLAGS" LIBRDF_LIBS="$LIBRDF_LIBS $MYSQL_LIBS $SQLITE_LIBS $TSTORE_LIBS $POSTGRESQL_LIBS $VIRTUOSO_LIBS" fi if test $modular = yes; then MODULAR_LIBRDF_TRUE= MODULAR_LIBRDF_FALSE='#' else MODULAR_LIBRDF_TRUE='#' MODULAR_LIBRDF_FALSE= fi CPPFLAGS="$LIBRDF_CPPFLAGS" LDFLAGS="$LIBRDF_LDFLAGS" LIBS="$LIBRDF_LIBS" # Check whether --with-threads was given. if test "${with_threads+set}" = set; then : withval=$with_threads; with_threads="$withval" else with_threads="no" fi for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking if POSIX threads should be used" >&5 $as_echo_n "checking if POSIX threads should be used... " >&6; } if test $with_threads = "yes" ; then if test "$ac_cv_header_pthread_h" = yes ; then $as_echo "#define WITH_THREADS 1" >>confdefs.h LIBRDF_LIBS="$LIBRDF_LIBS -lpthread" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi LIBS=$LIBRDF_LIBS # Maybe add some local digest modules for module in $digest_modules; do module_u=`echo $module | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local $module digest module" >&5 $as_echo_n "checking for local $module digest module... " >&6; } base=rdf_digest_$module if test -r $srcdir/src/$base.c; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } n=HAVE_LOCAL_${module_u}_DIGEST cat >>confdefs.h <<_ACEOF #define $n 1 _ACEOF DIGEST_OBJS="$DIGEST_OBJS $base.lo" DIGEST_SRCS="$DIGEST_SRCS $base.c" digest_modules_available="$digest_modules_available $module" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi done # This is needed because autoheader can't work out which computed # symbols must be pulled from acconfig.h into config.h.in if test "x" = "y"; then $as_echo "#define HAVE_LOCAL_MD5_DIGEST 1" >>confdefs.h $as_echo "#define HAVE_LOCAL_SHA1_DIGEST 1" >>confdefs.h $as_echo "#define HAVE_LOCAL_RIPEMD160_DIGEST 1" >>confdefs.h fi #LIBRDF_EXTERNAL_CPPFLAGS="$LIBRDF_EXTERNAL_CPPFLAGS $LIBRDF_CPPFLAGS" LIBRDF_EXTERNAL_LIBS="$LIBRDF_EXTERNAL_LIBS $LIBRDF_LIBS" # Everything except things with .pc files (raptor and rasqal) # 3store uses it but is optional and thus tricky to specify this way LIBRDF_PKGCONFIG_PRIVATE_LIBS=`echo $LIBRDF_LIBS | sed -e 's, ..top_build_prefix.libltdl/libltdlc.la, ,'` # Make final changes to cflags CFLAGS="-DLIBRDF_INTERNAL=1 $CFLAGS" assert=yes # Check whether --enable-assertions was given. if test "${enable_assertions+set}" = set; then : enableval=$enable_assertions; assert=$enableval fi if test "$assert" = "yes"; then $as_echo "#define LIBRDF_ASSERT 1" >>confdefs.h fi assert_messages=yes # Check whether --enable-assert-messages was given. if test "${enable_assert_messages+set}" = set; then : enableval=$enable_assert_messages; assert_messages=$enableval fi if test "$assert_messages" = "yes"; then $as_echo "#define LIBRDF_ASSERT_MESSAGES 1" >>confdefs.h fi debug_messages=no # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; debug_messages=$enableval fi if test "$debug_messages" = "yes"; then LIBRDF_CPPFLAGS="-g -DLIBRDF_DEBUG=1 $LIBRDF_CPPFLAGS" fi if test "$USE_MAINTAINER_MODE" = yes; then CPPFLAGS="$MAINTAINER_CPPFLAGS $CPPFLAGS" fi if test "$USE_MAINTAINER_MODE" = yes -a $release_version = no; then CFLAGS=`echo $CFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` CXXFLAGS=`echo $CXXFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` LIBRDF_CPPFLAGS=`echo $LIBRDF_CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` LIBRDF_EXTERNAL_CPPFLAGS=`echo $LIBRDF_EXTERNAL_CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` LIBRDF_INTERNAL_CPPFLAGS=`echo $LIBRDF_INTERNAL_CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` fi LIBS="$LIBS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" LIBRDF_LIBTOOLLIBS=librdf.la abs_top_srcdir=`cd $srcdir; pwd` abs_top_builddir=`pwd` # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ac_config_files="$ac_config_files Makefile redland.rdf docs/Makefile docs/version.xml examples/Makefile scripts/Makefile src/Makefile src/librdf.h src/redland.spec src/win32_rdf_config.h src/win32/Makefile utils/Makefile demos/Makefile data/Makefile redland.pc" ac_config_files="$ac_config_files redland-config" ac_config_files="$ac_config_files redland-src-config" # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 $as_echo "$GTKDOC_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gtkdoc-rebase do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_REBASE+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_REBASE in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE if test -n "$GTKDOC_REBASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 $as_echo "$GTKDOC_REBASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GTKDOC_REBASE" && break done test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. set dummy gtkdoc-mkpdf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_MKPDF in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF if test -n "$GTKDOC_MKPDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 $as_echo "$GTKDOC_MKPDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else with_html_dir='${datadir}/gtk-doc/html' fi HTML_DIR="$with_html_dir" # Check whether --enable-gtk-doc was given. if test "${enable_gtk_doc+set}" = set; then : enableval=$enable_gtk_doc; else enable_gtk_doc=no fi if test x$enable_gtk_doc = xyes; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.3\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : else as_fn_error $? "You need to have gtk-doc >= 1.3 installed to build $PACKAGE_NAME" "$LINENO" 5 fi if test "x$PACKAGE_NAME" != "xglib"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 $as_echo_n "checking for GTKDOC_DEPS... " >&6; } if test -n "$GTKDOC_DEPS_CFLAGS"; then pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTKDOC_DEPS_LIBS"; then pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` else GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0) were not met: $GTKDOC_DEPS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 $as_echo_n "checking whether to build gtk-doc documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 $as_echo "$enable_gtk_doc" >&6; } # Check whether --enable-gtk-doc-html was given. if test "${enable_gtk_doc_html+set}" = set; then : enableval=$enable_gtk_doc_html; else enable_gtk_doc_html=yes fi # Check whether --enable-gtk-doc-pdf was given. if test "${enable_gtk_doc_pdf+set}" = set; then : enableval=$enable_gtk_doc_pdf; else enable_gtk_doc_pdf=no fi if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc_html = xyes; then GTK_DOC_BUILD_HTML_TRUE= GTK_DOC_BUILD_HTML_FALSE='#' else GTK_DOC_BUILD_HTML_TRUE='#' GTK_DOC_BUILD_HTML_FALSE= fi if test x$enable_gtk_doc_pdf = xyes; then GTK_DOC_BUILD_PDF_TRUE= GTK_DOC_BUILD_PDF_FALSE='#' else GTK_DOC_BUILD_PDF_TRUE='#' GTK_DOC_BUILD_PDF_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi if test -n "$GTKDOC_REBASE"; then GTK_DOC_USE_REBASE_TRUE= GTK_DOC_USE_REBASE_FALSE='#' else GTK_DOC_USE_REBASE_TRUE='#' GTK_DOC_USE_REBASE_FALSE= fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi LT_CONFIG_H=src/rdf_config.h _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi ltdl_LIBOBJS=$_ltdl_libobjs ltdl_LTLIBOBJS=$_ltdl_ltlibobjs if test -z "${MEMCMP_TRUE}" && test -z "${MEMCMP_FALSE}"; then as_fn_error $? "conditional \"MEMCMP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GETOPT_TRUE}" && test -z "${GETOPT_FALSE}"; then as_fn_error $? "conditional \"GETOPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STORAGE_FILE_TRUE}" && test -z "${STORAGE_FILE_FALSE}"; then as_fn_error $? "conditional \"STORAGE_FILE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STORAGE_HASHES_TRUE}" && test -z "${STORAGE_HASHES_FALSE}"; then as_fn_error $? "conditional \"STORAGE_HASHES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STORAGE_TREES_TRUE}" && test -z "${STORAGE_TREES_FALSE}"; then as_fn_error $? "conditional \"STORAGE_TREES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STORAGE_MEMORY_TRUE}" && test -z "${STORAGE_MEMORY_FALSE}"; then as_fn_error $? "conditional \"STORAGE_MEMORY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STORAGE_MYSQL_TRUE}" && test -z "${STORAGE_MYSQL_FALSE}"; then as_fn_error $? "conditional \"STORAGE_MYSQL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STORAGE_SQLITE_TRUE}" && test -z "${STORAGE_SQLITE_FALSE}"; then as_fn_error $? "conditional \"STORAGE_SQLITE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STORAGE_TSTORE_TRUE}" && test -z "${STORAGE_TSTORE_FALSE}"; then as_fn_error $? "conditional \"STORAGE_TSTORE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STORAGE_POSTGRESQL_TRUE}" && test -z "${STORAGE_POSTGRESQL_FALSE}"; then as_fn_error $? "conditional \"STORAGE_POSTGRESQL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STORAGE_VIRTUOSO_TRUE}" && test -z "${STORAGE_VIRTUOSO_FALSE}"; then as_fn_error $? "conditional \"STORAGE_VIRTUOSO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MODULAR_LIBRDF_TRUE}" && test -z "${MODULAR_LIBRDF_FALSE}"; then as_fn_error $? "conditional \"MODULAR_LIBRDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Redland librdf RDF API Library $as_me 1.0.17, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ Redland librdf RDF API Library config.status 1.0.17 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/rdf_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/rdf_config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "redland.rdf") CONFIG_FILES="$CONFIG_FILES redland.rdf" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/version.xml") CONFIG_FILES="$CONFIG_FILES docs/version.xml" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/librdf.h") CONFIG_FILES="$CONFIG_FILES src/librdf.h" ;; "src/redland.spec") CONFIG_FILES="$CONFIG_FILES src/redland.spec" ;; "src/win32_rdf_config.h") CONFIG_FILES="$CONFIG_FILES src/win32_rdf_config.h" ;; "src/win32/Makefile") CONFIG_FILES="$CONFIG_FILES src/win32/Makefile" ;; "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "demos/Makefile") CONFIG_FILES="$CONFIG_FILES demos/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "redland.pc") CONFIG_FILES="$CONFIG_FILES redland.pc" ;; "redland-config") CONFIG_FILES="$CONFIG_FILES redland-config" ;; "redland-src-config") CONFIG_FILES="$CONFIG_FILES redland-src-config" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; "redland-config":F) chmod +x redland-config ;; "redland-src-config":F) chmod +x redland-src-config ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ | --c=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; --disable-option-checking) ;; *) case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 $as_echo "$ac_msg" >&6 as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 fi cd "$ac_popdir" done fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: Redland build summary: " >&5 $as_echo " Redland build summary: " >&6; } if test "$modular" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using modular storage backends in $REDLAND_MODULE_PATH" >&5 $as_echo " Using modular storage backends in $REDLAND_MODULE_PATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using monolithic storage backends" >&5 $as_echo " Using monolithic storage backends" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: Oracle Berkeley DB (BDB) : $bdb_available Triple stores available : $storages_available Triple stores enabled :$storages_enabled RDF parsers :$rdf_parsers_available RDF query : $rdf_query Content digests :$digest_modules_available " >&5 $as_echo " Oracle Berkeley DB (BDB) : $bdb_available Triple stores available : $storages_available Triple stores enabled :$storages_enabled RDF parsers :$rdf_parsers_available RDF query : $rdf_query Content digests :$digest_modules_available " >&6; } redland-1.0.17/mkinstalldirs0000755000175000017500000000672211311353466012752 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: redland-1.0.17/INSTALL.html0000644000175000017500000003720712071146235012140 00000000000000 Redland librdf RDF API Library - Building and Installing from Source

Redland librdf RDF API Library - Building and Installing from Source

1. Getting the sources

There are several ways to get the sources. The most stable and tested versions are the sources shipped with each release and these are recommended as the first place to start. For the latest developent sources, anonymous GIT access is available but this may require some configuring of developer tools that are not needed for the releases.

The source bundle and package files contain all the HTML files and documentation provided on the web site.

Redland (librdf) requires the Raptor and Rasqal to be already built and installed (libraries, headers and pkg-config .pc files). See the Raptor install document and Rasqal install document for the details of installing them.

1.1. Getting released sources

Every release comes with full sources and these are available from http://download.librdf.org/source/ master site as well as the SourceForge site.

1.2. Getting the sources from GIT

  git clone git://github.com/dajobe/librdf.git
  cd librdf

At this stage, or after a git pull you will need to create the automake and autoconf derived files, as described below in Create the configure program by using the autogen.sh script.

Building Redland in this way requires some particular development tools not needed when building from snapshot releases - automake, autoconf, libtool and dependencies. The autogen.sh script looks for the newest versions of the auto* tools and checks that they meet the minimum versions.

2. Configuring and building

Redland uses the GNU automake and autoconf to handle system dependency checking. It is developed and built on x86 Linux and x86 OSX but is also tested on other systems occasionally.

configure tries very hard to find several programs and libraries that Redland might need. These include the storage modules (Berkeley/Sleepycat DB, MySQL, PostgreSQL 3store) and various others. A summary of the modular parts found is given at the end of the configure run. Several options to configure given below can be used to point to locations or names of dependencies that cannot be automatically determined.

2.1. Create configure program

If there is no configure program, you can create it by running the autogen.sh script, as long as you have the automake and autoconf tools. This is done by:

  ./autogen.sh

and you can also pass along arguments intended for configure (see below for what these are):

  ./autogen.sh --prefix=/usr/local/somewhere

On OSX you may have to explicitly set the LIBTOOLIZE variable for the libtoolize utility since on OSX libtoolize is a different program. The full path to the utility should be given:

  LIBTOOLIZE=/opt/local/bin/glibtoolize ./autogen.sh

Alternatively you can run the automake and autoconf programs by hand with:

  aclocal; autoheader; automake --add-missing; autoconf

The automake and autoconf tools have many different versions and autogen.sh enforces the minimums. At present development is being done with automake 1.10.2 (minimum version 1.7), autoconf 2.63 (minimum version 2.54) and libtool 2.2.6 (minimum version 2.2.0). These are only needed when compiling from GIT sources. autogen.sh enforces the requirements.

2.2. Options for configure

See also the generic GNU installation instructions in INSTALL for information about general options such as --prefix etc.

--disable-assert

Disable compiling run-time assertions. In maintainer mode, assertion failures are fatal.

--disable-assert-messages

Disable compiling run-time assertion failure messages. In maintainer mode, assertion failures are fatal after the assertion failure is reported.

--enable-debug

Enable debug messages (default not enabled). Maintainer mode automatically enables this.

--enable-digests=LIST

Does nothing - only builtin content digests are available now: MD5 and SHA1.

--enable-parsers=LIST

Select the list of RDF parsers to be included if the are availble. The valid list of RDF parsers is currently only raptor (the default) since the older repat parser has been removed. Raptor uses either of libxml2 (prefered) or expat. Redland requires the Raptor parser for other functionality, so it cannot be disabled.

--with-bdb= ROOT or no

Enable use of the Berkeley DB library installed at ROOT. That means ROOT/include must contain the BDB header db.h and ROOT/lib must contain the library libdb.a (or whatever shared library version/name your system uses).

If the value is no, the BDB backend store is disabled.

Berkeley DB was also known as Sleepycat DB (after version 2 before being bought by Oracle) and is distributed and supported by Oracle Versions 4.1.25, 4.1.24, 4.0.14, 3.3.11, 3.2.9, 3.1.17, 3.1.14, 2.7.7 and 2.4.14 have been tested and work. Some systems do not come installed with a working Berkeley DB so on those systems, Redland will have no persistent storage unless BDB is built separately and enabled via this option.

Note: If you change installed versions of BDB then you will need to re-configure Redland carefully to let it discover the features of the newer BDB as follows:

  rm -f config.cache
  make clean
  ./configure ... # any configure arguments here

(plus you might need to use the dbX_upgrade utility to update the BDB database files to the formats supported by the newer version X - see the BDB documentation to find out if this is required.)

If the BerkeleyDB is installed in different places from ROOT/lib (library) and ROOT/include (header) or the library name is something that can't be worked out automatically, then you can use the next set of options to specify them.

If all of the BDB options are omitted, Redland will do a best efforts guess to find the newest BDB installation but this may not work for all configurations.

--with-bdb-lib=LIBDIR
--with-bdb-include=INCDIR
--with-bdb-name=NAME

Use Berkeley DB with the installed library in LIBDIR and the db.h header in INCDIR and the installed library called NAME like -lNAME. This is relative to LIBDIR. All of these options can be omitted and configure will try to find or guess the values from the system.

For example, to compile redland on OSX with fink might require a configure line something like this:

  ./configure --with-bdb-lib=/sw/lib \
              --with-bdb-include=/sw/include/db3

The name of the BDB library was correctly discovered for this configuration, as db-3.3.

If all of the BDB options are omitted, Redland will do a best efforts guess to find the newest BDB installation but this may not work for all configurations.

(At present, Redland knows of the default /sw Fink installation directory and will look there for BDB installs)

--with-mysql(=CONFIG|yes|no)

Enable use of the Redland MySQL 3.x, 4.x triple store backend using CONFIG for the mysql_config program. The default when either no argument is given, or --with-mysql alone, is to search for mysql_config on the search PATH. With --with-mysql=no, this store is disabled.

Versions 3.23.58 and 4.0.4 have been tested and work.

--with-openssl-digests

Enable the content digests provided by the OpenSSL libcrypto library (MD5, SHA1 and RIPEMD160) if the library is available. configure will automatically enable this unless disabled by setting this option to no.

--with-postgresql(=CONFIG|yes|no)

Enable use of the Redland PostgreSQL triple store backend using CONFIG for the pg_config program. The default when either no argument is given, or --with-postgresql alone, is to search for pg_config on the search PATH. With --with-postgresql=no, this store is disabled.

--with-sqlite=(yes|no|2|3)

Enable use of SQLite triple store backend with a particular version V2 or V3, an automatically chosen one with yes or disable it (with no).

--with-threestore(=CONFIG|yes|no)

Enable use of the AKT project 3store triple store backend using CONFIG for the 3store-config program. The default when either no argument is given, or --with-threestore alone, is to search for the 3store-config on the search PATH. With --with-threestore=no, this store is disabled.

--with-xml-parser=NAME

Pick an XML parser to use for Raptor - either libxml (default) or expat. If this option is not given, either will be used, with libxml preferred if both are present. One of these much be available for Raptor to parse XML syntaxes.

Raptor has been tested with various combinations of these libraries that are described further in the Raptor install documentation.

WARNING If the Sleepycat/Berkeley DB library is installed in a non-default directory, when the final linking occurs, the libraries may not be found at run time. To fix this you will need to use a system-specific method of passing this information to the run-time loader. On most systems you can set the LD_LIBRARY_PATH environment variable to include the directory where the libdb* libraries are found. (On OSX this is DYLD_LIBRARY_PATH) You can also configure it via a system wide file - see the ld, ld.so orld.so.1 manual pages for details.

2.3 Configuring

The default configuration will install into /usr/local:

   ./configure

To install into the standard Unix / Linux (and also Cygwin) system directory, use:

   ./configure --prefix=/usr

Append to the line any additional options you need like this:

   ./configure --prefix=/usr --with-bdb=/usr/local/berkeleydb

If you are having problems with configuring several times when adding or removing options, you may have to tidy up first with either of these:

   make clean
   rm -f config.cache

2.4 Compiling

Compile the library and the rdfproc utility with:

   make

Note: GNU make is probably required which may be called gmake or gnumake if your system has a different make available too.

2.5. Testing

You can build and run the built-in tests for Redland with:

    make check

which should emit lots of exciting test messages to the screen but conclude with something like:
All n tests passed
if everything works correctly.

(If you have got all the required subsidiary development tools, you can also do make distcheck which does a longer check that the distribution installation, configuring and building works. This does not perform any additional core testing).

2.6 Installing the library

To install the C library (static and shared typically) plus the interface header (.h) files do:

   make install

3. Using the library

Once the library has been configured and built, there are several C example programs that can be used. They are in the examples sub-directory and can be built with:

   cd examples

   make EXAMPLE
   # or on cygwin
   make EXAMPLE.exe

or to build all of them

   make examples

If no Berkeley DB was found by configure, some of the examples will fail since there is no on-disk storage system available. To change them to use the in-memory hashes, edit the lines reading something like

  storage=librdf_new_storage("hashes",
                             "test", 
                             "hash_type='bdb',dir='.'");

to read

  storage=librdf_new_storage("hashes", 
                             "test",
                             "hash_type='memory',dir='.'");

3.1 rdfproc

The rdfproc utility in the utils directory exercises the majority of the useful parts of the Redland API and can demonstrate many ways to store, search and manipulate the graph from C.

3.2. example1.c

example1 uses a RDF parser, if you have one available, to parse a URI of RDF/XML content, store it in multple Berkeley DB hashes on the disk and run queries against them. It takes two arguments, the first the URI of the RDF/XML content (or file:filename) and the second, optional one, is the name of the RDF parser to use.

3.3. example2.c

example2 does not use a RDF parser, but reads from a simple triple dump format and again stores the data on disk in multiple Berkeley DB hashes.

3.4. example3.c

example3 contains a 10 line main program that creates an RDF model, a statement, adds it to the model and stores it on disk.

3.5. example4.c

example4 contains an example of how to serialize an RDF model to a syntax.


Copyright (C) 2000-2013 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

redland-1.0.17/ChangeLog.120000644000175000017500000007170111702657222012137 000000000000002011-12-03 Dave Beckett * Snapshotted redland_1_0_15 for 1.0.15 release (GIT b086a6be81252d6beed8051c788518fd1ef07ddf) * configure.ac: BDB 5.2 * scripts/fix-gtkdoc-header.pl: Add fix-gtkdoc-header.pl * docs/Makefile.am, scripts/Makefile.am: Update gtkdoc config to work in make distcheck * docs/Makefile.am: Build filtered_rdf_log.h in builddir * docs/.gitignore: filtered_rdf_log.h * docs/redland-changes.tsv: Add librdf_new_hash * src/rdf_parser.c: Fix parser test to test 3 parsers This can never have worked - it overwrote the 'i' variable. Code style fixes. If a parser constructor fails, just warn and skip in case raptor does not have it installed. * src/rdf_init.c: (librdf_new_world): Handle else only if debugging 2011-12-02 Dave Beckett * configure.ac, src/Makefile.am: Add LIBRDF_INTERNAL_DEPS for libltd dependencies not libs Intended to fix Issue #0000485 http://bugs.librdf.org/mantis/view.php?id=485 but can't reproduce 2011-11-23 Dave Beckett * configure.ac: Use AWK 2011-11-21 Lauri Aalto * src/rdf_parser.c: (librdf_parser_get_namespaces_seen_count): Fix return value autodocs. Fixes issue #0000483 http://bugs.librdf.org/mantis/view.php?id=483 * src/rdf_hash_bdb.c: eliminate empty if body warnings when debug messages are disabled 2011-11-18 Dave Beckett * docs/redland-changes.tsv, docs/redland-docs.xml, docs/redland-sections.txt, docs/tmpl/general.sgml, docs/tmpl/hash.sgml, docs/tmpl/log.sgml, docs/tmpl/section-general.sgml, docs/tmpl/statement.sgml, docs/tmpl/storage.sgml, docs/tmpl/unused.sgml, src/librdf.h.in, src/rdf_init.c, src/rdf_init.h, src/rdf_log.c: autodocs and add section general to the manual * src/rdf_log.c: (librdf_log): Use raptor_vasprintf for raptor >= 2.0.5 * configure.ac: Do not enable debug messages by default for --enable-maintainer-mode This now requires the extra --enable-debug option to configure or autogen.sh * ChangeLog, docs/redland-sections.txt, src/rdf_hash.h, src/rdf_hash_internal.h: Make librdf_new_hash public * docs/redland-sections.txt: Add librdf_new_hash librdf_new_hash_from_factory 2011-11-17 Dave Beckett * NEWS.html, RELEASE.html: 1.0.15 * autogen.sh: Update autogen.sh 2011-11-04 Lauri Aalto * src/rdf_statement.c, src/rdf_statement.h: (librdf_new_statement_from_statement2): Renamed API function from librdf_new_statement_from_statement(). Shallow copy. (librdf_new_statement_from_statement): Reverted to pre-raptor_term deep copy contract for the function. Fixes Issue #0000478 http://bugs.librdf.org/mantis/view.php?id=478 * src/rdf_stream.c: (librdf_stream_get_object): Improved docs * utils/rdfproc.c: (main): Use raptor_free_memory() for raptor-allocated memory * src/rdf_statement.c: (librdf_statement_to_string): Use raptor for freeing raptor-allocated memory * src/rdf_parser_raptor.c: (librdf_parser_raptor_get_accept_header): Use librdf_alloc_memory() for memory to be freed externally. Code style. * src/rdf_query.c, src/rdf_query_results.c: (librdf_parser_get_accept_header): Document librdf_free_memory() (librdf_parser_raptor_parse_as_stream_common): Changed const-removing cast. * src/rdf_parser.c: (main): Use appropriate free in tests * src/rdf_parser.c, src/rdf_parser_raptor.c: (librdf_parser_get_accept_header): Document librdf_free_memory() * src/rdf_node.c: (librdf_node_to_string, librdf_node_to_counted_string): Use raptor_free_memory() for raptor-allocated memory, not free() * src/rdf_model.c, src/rdf_serializer.c: (librdf_model_to_counted_string, librdf_serializer_serialize_model_to_counted_string, librdf_serializer_serialize_model_to_string): Document librdf_free_memory(). (main): Practise as preached in tests. * src/rdf_hash.c: (librdf_hash_to_string): Use librdf_alloc_memory(), librdf_free_memory() * src/rdf_digest.c: (librdf_digest_to_string): Memory alloc/free in same shared object. * src/rdf_init.c, src/rdf_init.h: (librdf_alloc_memory, librdf_calloc_memory): Added new API functions. * src/rdf_serializer.c, src/rdf_serializer_raptor.c: (librdf_serializer_serialize_stream_to_counted_string): Document requirement for librdf_free_memory(). (librdf_serializer_raptor_serialize_stream_to_counted_string): Use raptor_free_memory() not free() in error cases. * src/rdf_init.c, src/rdf_init.h: (librdf_free_memory): Added new API function. Fixes Issue #0000475 http://bugs.librdf.org/mantis/view.php?id=475 2011-08-27 Dave Beckett * HACKING.md: Code style for macros 2011-08-25 Dave Beckett * configure.ac: Make configure never set BDB 7 arg and 6 arg open defines Based on idea in Issue#0000468 http://bugs.librdf.org/mantis/view.php?id=468 * src/rdf_hash_bdb.c: (librdf_hash_bdb_open): Use 7 args open in preference to 6 Thanks to Peter O'Gorman (pogma) for the patch Fixes Issue#0000468 http://bugs.librdf.org/mantis/view.php?id=468 * src/rdf_storage_virtuoso.c: Prevent virtuoso query being registered twice in non-modular build (librdf_storage_module_register_factory) (librdf_init_storage_virtuoso): Remove librdf_init_query_virtuoso() calls. Fixes Issue#0000461 http://bugs.librdf.org/mantis/view.php?id=461 2011-08-24 Dave Beckett * src/rdf_storage_virtuoso.c: Add switch for VIRTUOSO_DV_TIMESTAMP_OBJ but not sure what it does 2011-08-23 Dave Beckett * HACKING.md: hacking 2011-08-21 Dave Beckett * src/.gitignore: Ignore win32_rdf_config.h * utils/rdfproc.c: windows fixes * src/rdf_serializer.c: (log_handler): Add REDLAND_CALLBACK_STDCALL for windows * src/rdf_model.c: (main): move declarations to top of block 2011-08-01 Dave Beckett * src/rdf_storage_tstore.c: alloc changes but this storage seems like it won't compile 2011-07-31 Dave Beckett * src/rdf_storage_mysql.c, src/rdf_storage_postgresql.c: Fix typos in alloc changes for mysql and postgresql storages * src/rdf_concepts.c, src/rdf_digest.c, src/rdf_files.c, src/rdf_hash.c, src/rdf_hash_bdb.c, src/rdf_hash_cursor.c, src/rdf_hash_memory.c, src/rdf_heuristics.c, src/rdf_init.c, src/rdf_internal.h, src/rdf_iterator.c, src/rdf_list.c, src/rdf_log.c, src/rdf_model.c, src/rdf_node.c, src/rdf_node_common.c, src/rdf_parser.c, src/rdf_parser_raptor.c, src/rdf_query.c, src/rdf_query_rasqal.c, src/rdf_query_virtuoso.c, src/rdf_raptor.c, src/rdf_serializer.c, src/rdf_statement.c, src/rdf_storage.c, src/rdf_storage_file.c, src/rdf_storage_hashes.c, src/rdf_storage_list.c, src/rdf_storage_mysql.c, src/rdf_storage_postgresql.c, src/rdf_storage_sql.c, src/rdf_storage_sqlite.c, src/rdf_storage_trees.c, src/rdf_storage_tstore.c, src/rdf_storage_virtuoso.c, src/rdf_stream.c, src/rdf_uri.c, src/rdf_utf8.c: Code style change and cleanup for alloc/free macros Code style: 1. var = LIBRDF_CALLOC(type, count, size) Prefering: var = LIBRDF_CALLOC(type, 1, sizeof(*var)) when count = 1 2. var = LIBRDF_MALLOC(type, size) 3. LIBRDF_FREE(type, var) The consequence here is allocs that mostly fit into 1 line without so much boilerplate and duplication of types. The LIBRDF_MALLOC and LIBRDF_CALLOC now do the cast to the return type. LIBRDF_FREE takes the object type too but always casts arg to void This certainly contains many wrong types to the arg but might be used later in some kind of smart type-aware debugging allocator. 2011-07-31 Dave Beckett * src/rdf_query_virtuoso.c, src/rdf_storage_hashes.c, src/rdf_storage_postgresql.c: code style: replace if((var=value)) ... format with two statements * src/rdf_storage_mysql.c: code style: replace if((var=value)) ... format with two statements * HACKING.md: Memory allocation 2011-07-23 Dave Beckett * NEWS.html, RELEASE.html, configure.ac: Bumped version to 1.0.15 * docs/Makefile.am: Update docs * Snapshotted redland_1_0_14 for 1.0.14 release (GIT bb131974b8e13a29641eec183ded5a574e3866e5) 2011-07-23 Dave Beckett * RELEASE.html: 1.0.14 * src/rdf_model.c: (test_model_cloning): Free new storages from cloned models. * src/rdf_storage_hashes.c: (librdf_storage_hashes_clone): Copy storage fields in cloning. 2011-07-22 Dave Beckett * src/rdf_storage_hashes.c: (librdf_storage_hashes_clone): Do not lose new_context memory * src/rdf_storage_sqlite.c: Fixed librdf_storage_sqlite_context_serialise_finished leak of a node reference (librdf_storage_sqlite_context_serialise_finished): Free the context node in the context-serializing argument list. Too many use of 'context' error! * docs/Makefile.am, docs/redland-sections.txt, docs/tmpl/redland-unused.sgml, docs/tmpl/unused.sgml: Remove internal funcs from docs Ignore rdf_raptor_internal.h for autodocs * src/rdf_statement_internal.h: Remove unused struct librdf_statement_s * src/rdf_statement.c: Restore librdf_statement_decode_parts to ABI (librdf_statement_decode_parts): Add back. Although this has been deprecated for librdf_statement_decode2() should not have been removed. Always fails. * docs/tmpl/parser.sgml, docs/tmpl/query.sgml, docs/tmpl/redland-unused.sgml, docs/tmpl/unused.sgml: Update tmpls 2011-07-21 Lauri Aalto * src/rdf_types.h: Fixed printf format warnings on systems where u64 is not unsigned long long. 2011-07-20 Dave Beckett * src/rdf_model.c: Tidy up better during optional test failures (such as no mysql db running) * docs/redland-sections.txt: Remove internal cache unused docs * src/Makefile.am, src/rdf_cache.c, src/rdf_cache.h, src/rdf_internal.h: Remove rdf_cache internal module - not used * src/rdf_parser.c: (main): Free another iostream * src/rdf_storage_postgresql.c: (librdf_storage_postgresql_init): Free options on failures * src/rdf_storage_mysql.c: (librdf_storage_mysql_init): Free options on failures * src/rdf_parser.c: (main): Free iostream * src/rdf_statement.c: (main): Free iostream * src/rdf_node.c: Fix URI reference leak in two librdf_node constructors. (librdf_new_node_from_uri_local_name) (librdf_new_node_from_normalised_uri_string): Fix URI reference leak due to raptor term constructor semantics. 2011-07-18 Dave Beckett * docs/redland-changes.tsv, docs/redland-sections.txt: 1.0.14 * src/rdf_raptor.c: autodocs * configure.ac: Look for debian multiarch dir for libs first * src/Makefile.am: Remove rdf_avltree_internal.h from dist * utils/redland-virtuoso-test.c: Remove variables only set once to NULL * src/Makefile.am, src/rdf_avltree.c, src/rdf_avltree_internal.h, src/rdf_storage_trees.c: Remove avltree module and use raptor_avltree Type changes: - Use raptor_avltree not librdf_avltree - Use raptor_avltree_iterator not librdf_iterator Call changes: - raptor_avltree_size replaces librdf_avltree_size - raptor_avltree_add replaces librdf_avltree_add and return value is tri-value not an enum - raptor_avltree_delete replaces librdf_avltree_delete - raptor_avltree_search replaces librdf_avltree_search - raptor_new_avltree_iterator replaces librdf_avltree_get_iterator_start, loses a world arg and gains a direction argument which is always 'forward' (1) in this module. - raptor_avltree_iterator_is_end replaces librdf_iterator_end - raptor_avltree_iterator_next replaces librdf_iterator_next - raptor_avltree_iterator_get replaces librdf_iterator_get_object - raptor_free_avltree_iterator replaces librdf_free_iterator - raptor_new_avltree replaces librdf_new_tree and gains a flags argument. - raptor_free_avltree replaces librdf_free_avltree * utils/.gitignore: Ignore *.plist * src/.gitignore: Ignore *.plist * src/rdf_stream.c: (librdf_stream_from_node_iterator_finished): Init 'world' carefully [clang] * src/rdf_storage_virtuoso.c: (librdf_storage_virtuoso_size): init 'count' [clang] * src/rdf_storage_sqlite.c: Remove a couple of useless assignment to 'status' [clang] Really should have a proper retry a few times then fail mechanism. Storage option for sqlite store? * src/rdf_statement_common.c: (librdf_statement_encode_parts2): Remove useless assignment to 'p' and 'length' [clang] * src/rdf_statement.c: (librdf_statement_encode_parts_internal): Remove useless assignment to 'p' and 'length' [clang] * src/rdf_query_virtuoso.c: (librdf_query_virtuoso_results_formatter_write): init 'rc' [clang] * src/rdf_query.c: (librdf_query_remove_query_result): Protect lookup of NULL 'cur' [clang] * src/rdf_parser_raptor.c: Take not of failure statuses [clang] (librdf_parser_raptor_parse_as_stream_common): Error out when status non-0 (librdf_parser_raptor_serialise_finished): Set world carefully to avoid NULL pointer lookup. * src/rdf_node.c: (librdf_node_decode): Remove useless assignment to total_length [clang] * src/rdf_hash_bdb.c: (librdf_hash_bdb_sync): Set and use ret var [clang] * src/rdf_digest_sha1.c: SHA1 fixes [clang] * src/rdf_cache.c: (librdf_cache_set_common): Set node to NULL and code style [clang] * src/rdf_cache.c: (librdf_cache_set_common): move new_object assignment to in debug ifdef [clang] * utils/rdfproc.c: Remove assignment of rc never read [clang] * utils/rdf-tree.c: Initialize buffer to NULL. [clang] * src/rdf_hash.c: (librdf_hash_from_string): Do not set values that are never read [clang] * src/rdf_hash.c: (librdf_hash_get_all_iterator_get_method) (librdf_hash_keys_iterator_get_method): Return context, not address of local context var. [clang] * src/rdf_digest.c: (librdf_digest_to_string): Return on malloc failure [CLANG] * src/rdf_init.c: (librdf_world_set_feature): Actually set the value for genid_base and counter [clang]' * src/rdf_query_virtuoso.c: (librdf_query_virtuoso_results_formatter_write): Remove set but unused context variable * src/rdf_storage_mysql.c: (librdf_storage_mysql_context_add_statement_helper): Use calculated rc value in return * src/rdf_hash_bdb.c: (librdf_hash_bdb_get_fd): Use ret value to return failure * configure.ac, src/Makefile.am, utils/Makefile.am: Add clang support for maintainer with 'analyze' target. configure.ac: Add RECHO substvar * configure.ac: Guesing BDB libname looks for dynamic libs too and tries to be specific 2011-07-17 Dave Beckett * src/librdf.h.in, src/rdf_node.c, src/rdf_utf8.c, src/rdf_utf8.h: Move UTF8 utility functions into public API Make the rdf_utf8.h header (which was already shipped and installed) usable: do not depend on rdf_types.h, use raptor typedefs and replace byte with it's definition of unsigned char. (librdf_unicode_char_to_utf8): Replaced and deprecated with raptor_unicode_utf8_string_put_char. (librdf_utf8_to_unicode_char): Replaced and deprecated with raptor_unicode_utf8_string_get_char Add stdlib.h for malloc definition. Remove utf8 spec comment (librdf_latin1_to_utf8): Free allocation on failure (librdf_utf8_to_latin1): Free allocation on failure Fixes Issue#0000447 http://bugs.librdf.org/mantis/view.php?id=447 2011-07-17 Dave Beckett * src/librdf.h.in, src/rdf_log.h, src/rdf_serializer.h, src/rdf_serializer_internal.h: Use raptor2.h not raptor.h 2011-07-16 Dave Beckett * src/rdf_node.c: (librdf_node_write): Always write N-Triples 2011-04-05 Dave Beckett * src/rdf_hash.c: (librdf_hash_get_as_boolean): 'false' string fixed to be a False value. 2011-03-20 Dave Beckett * docs/tmpl/iterator.sgml, docs/tmpl/list.sgml, docs/tmpl/parser.sgml, docs/tmpl/query.sgml, docs/tmpl/serializer.sgml, docs/tmpl/storage.sgml, docs/tmpl/stream.sgml, docs/tmpl/unused.sgml: Update tmpls * src/rdf_init.c, src/rdf_init_internal.h, src/rdf_node.c, src/rdf_parser_raptor.c, src/rdf_raptor.c, src/rdf_raptor_internal.h: Move raptor blank node ID generation to hang off world object librdf_world gains bnode_hash field moved from raptor parser context. (librdf_raptor_generate_id_handler): Added based on librdf_parser_raptor_generate_id_handler(). (librdf_init_raptor, librdf_finish_raptor): Initialise and free bnode hash once per redland world and use librdf_raptor_generate_id_handler() to generate IDs. (librdf_raptor_reset_bnode_hash): Added to remove and reset current bnode ID hash map. (librdf_raptor_free_bnode_hash): Added to empty current bnode ID hash map. (librdf_world_open, librdf_free_world): Move raptor init to after hash module, free to before it, to allow bnode_hash to work. (librdf_parser_raptor_init): Deleted bnode_hash code and use librdf_raptor_reset_bnode_hash() to reset current world-wide hash. (librdf_parser_raptor_terminate): Deleted bnode_hash code and use librdf_raptor_free_bnode_hash() to empty current world-wide hash. (librdf_parser_raptor_generate_id_handler): Deleted. (librdf_parser_raptor_parse_file_handle_as_stream) (librdf_parser_raptor_parse_as_stream_common): remove setting bnode ID handler per-parser. (librdf_parser_raptor_serialise_finished): empty bnode hash map at end of parsing. Fixes Issue #0000432 http://bugs.librdf.org/mantis/view.php?id=432 * src/rdf_node.c: Generating a blank node ID now directly uses redland call. (librdf_new_node_from_blank_identifier): Generate an identifier using internal librdf_world_get_genid rather than let it fall to a raptor genid handler. Addresses part of Issue #0000432 http://bugs.librdf.org/mantis/view.php?id=432 * docs/tmpl/iterator.sgml, docs/tmpl/list.sgml, docs/tmpl/parser.sgml, docs/tmpl/query.sgml, docs/tmpl/serializer.sgml, docs/tmpl/storage.sgml, docs/tmpl/stream.sgml: Update tmpls to remove varargs autodocs stupidity * configure.ac: Add checks for Oracle Berkeley DB 5.1, 5.0 and 4.9 and updated messages with new name. The 'bdb' storage seems to work with same API, but new on-disk format that will require a use of utils/db-upgrade. * src/Makefile.am: Add -lraptor2 to rdf_parser_test link line since it uses raptor2 symbols 2011-03-11 Lauri Aalto * src/rdf_parser.c, src/rdf_parser.h, src/rdf_parser_internal.h, src/rdf_parser_raptor.c: #trim trailing ws * src/rdf_parser.c: cast away compiler warnings * src/rdf_parser_raptor.c: (librdf_parser_raptor_parse_into_model_common): Reorder args so that string and its length are next to each other. * src/rdf_parser_raptor.c: (librdf_parser_raptor_parse_iostream_as_stream): Autodocs * src/rdf_parser_raptor.c: (librdf_parser_raptor_parse_as_stream_common) (librdf_parser_raptor_parse_into_model_common): Do not use librdf_log() for programmer errors, just runtime errors. * src/rdf_parser.c: bail out on encountering test failure * src/rdf_parser.c: code style * src/rdf_parser.c: #ws * src/rdf_parser_raptor.c: fixed file name in boilerplate and updated year * src/rdf_parser.h, src/rdf_parser.c, src/rdf_parser_raptor.c: (librdf_parser_parse_iostream_as_stream) (librdf_parser_parse_iostream_into_model): Added two new API functions contributed by nxg.Merged pull request https://github.com/dajobe/librdf/pull/1 with the following changes: - Removed const qualifier from raptor_iostreams passed around. - Fixed librdf_parser_raptor_parse_into_model_common() return type. - Removed raptor1 support code as librdf no longer supports raptor1. Fixes issue #0000375 http://bugs.librdf.org/mantis/view.php?id=375 2011-03-10 Lauri Aalto * src/rdf_storage_sqlite.c: #ws tabs to spaces * src/rdf_storage_sqlite.c: sqlite storage: Do not add duplicate statements if a context is given. Fixes Issue #0000418 http://bugs.librdf.org/mantis/view.php?id=418 2011-02-27 Dave Beckett * scripts/process-changes.pl: Update to latest process-changes.pl 2011-02-16 Dave Beckett * INSTALL.html: BDB is now owned by and distributed by Oracle 2011-02-15 Dave Beckett * src/rdf_parser_raptor.c, src/rdf_serializer_raptor.c: Add sanity check for raptor initialising that there are parsers and serializers (librdf_parser_raptor_constructor) (librdf_serializer_raptor_constructor): If there is no default parser/serializer (at index 0) then Raptor is probably broken so return an error and stop initialising. 2011-02-07 Dave Beckett * ChangeLog, ChangeLog.11, Makefile.am: Add ChangeLog.11 for 2010 2011-02-06 Dave Beckett * LICENSE.html: Make GPL V2 or newer explicit. 2011-02-04 Nicholas J Humfrey * configure.ac: librdf now depends upon rasqal version 0.9.25 for the new rasqal_world_get_query_language_description() function. 2011-02-03 Nicholas J Humfrey * src/rdf_query.c, src/rdf_query.h: (librdf_query_language_get_description): Added to return full description of of the query language. Deprecated the librdf_query_languages_enumerate() function. (librdf_query_languages_enumerate): Deprecated for above. 2011-02-02 Dave Beckett * redland.pc.in: Revert 1e317023157f670816fe53d00c725fd407cf3451 2011-02-01 Dave Beckett * src/redland.spec.in: Update spec for test RPM builds - Require Raptor 2 - Do not use removed configure options --with-raptor and --with-rasqal * redland.pc.in: Redland librdf requries raptor2 and rasqal * NEWS.html, RELEASE.html, configure.ac: Bumped version to 1.0.14 2011-02-01 Dave Beckett * Snapshotted redland_1_0_13 for 1.0.13 release (GIT commit 90ed9fc810fa1c2fb73ebe999204e46e29d116d0) 2011-01-30 Dave Beckett * scripts/process-changes.pl: Import latest process-changes.pl from rasqal 2011-01-28 Lauri Aalto * src/rdf_list.c: (librdf_list_iterators_replace_node): Fixed debug print with LIBRDF_DEBUG > 2. Fixes Issue #0000419 http://bugs.librdf.org/mantis/view.php?id=419 2011-01-25 Nicholas J Humfrey * src/rdf_serializer_raptor.c: Corrected bad copy/paste of librdf_node_is_resource() check in the raptor serializer code. * src/rdf_serializer_raptor.c: Pass the graph context through to the raptor serialiser, so that the graph is included in quad serialisation formats. 2011-01-24 Dave Beckett * RELEASE.html: 1.0.13, no SWIG interface changes * Redland.i: remove syntax description methods for now 2011-01-22 Dave Beckett * src/rdf_init.c, src/rdf_query.c, src/rdf_query_internal.h, src/rdf_query_rasqal.c: Pass on failure to initialise rasqal and query system (librdf_query_rasqal_constructor): Return error failure to construct. (librdf_init_query): Return error failure to init including from librdf_query_rasqal_constructor() * src/Makefile.am, src/rdf_query.c, src/rdf_query_internal.h, src/rdf_query_triples.c: Remove triples query language * src/rdf_log.c: (librdf_fatal): Code tidy to call abort() just once and always print the error. * src/rdf_query_rasqal.c: (librdf_query_rasqal_constructor): Call fatal error when query lang reg fails. * src/rdf_cache.c, src/rdf_concepts.c, src/rdf_digest.c, src/rdf_hash_memory.c, src/rdf_init.c, src/rdf_log.c, src/rdf_node.c, src/rdf_node_common.c, src/rdf_parser.c, src/rdf_parser_raptor.c, src/rdf_query.c, src/rdf_query_rasqal.c, src/rdf_query_results.c, src/rdf_query_virtuoso.c, src/rdf_raptor.c, src/rdf_serializer.c, src/rdf_statement_common.c, src/rdf_storage.c, src/rdf_storage_file.c, src/rdf_storage_hashes.c, src/rdf_storage_list.c, src/rdf_storage_mysql.c, src/rdf_storage_postgresql.c, src/rdf_storage_sqlite.c, src/rdf_storage_trees.c, src/rdf_storage_tstore.c, src/rdf_storage_virtuoso.c, src/rdf_stream.c, src/rdf_uri.c: code style * src/rdf_hash.c, src/rdf_init.c: Casts for C++ * .gitignore, ChangeLog, ChangeLog.10, Makefile.am: Added ChangeLog.10 for 2009 * docs/tmpl/iterator.sgml, docs/tmpl/list.sgml, docs/tmpl/parser.sgml, docs/tmpl/query.sgml, docs/tmpl/query_results.sgml, docs/tmpl/redland-unused.sgml, docs/tmpl/section-general.sgml, docs/tmpl/serializer.sgml, docs/tmpl/storage.sgml, docs/tmpl/stream.sgml, docs/tmpl/unused.sgml: Update doc tmpls * docs/redland-sections.txt: Add parser, serializer and query result format get_description methods * Redland.i: Export syntax description functions for parser, serializer and query results. Export librdf_parser_get_description(), librdf_query_results_formats_get_description() and librdf_serializer_get_description() with const and unsigned attributes removed since SWIG has tended to hate them. * docs/redland-changes.tsv, src/rdf_parser.c, src/rdf_parser.h, src/rdf_query.h, src/rdf_query_results.c, src/rdf_serializer.c, src/rdf_serializer.h, utils/rdfproc.c: Add syntax descriptions for parser, serializer and query result format. Use raptor_syntax_description typdef from raptor2 to return a new style way of listing syntax formats using a get_description method on the static class. Deprecates the old enumerate methods. (librdf_parser_get_description): Added, deprecating librdf_parser_enumerate(). (librdf_query_results_formats_get_description): Added, deprecating librdf_query_results_formats_enumerate(). (librdf_serializer_get_description): Added, deprecating librdf_serializer_enumerate(). Updated rdfproc to use new functions above. Add function changes to redland-changes.tsv Fixes Issue#0000325 http://bugs.librdf.org/mantis/view.php?id=325 * src/rdf_query_results.c: Remove Rasqal < 0.9.22 conditionals (librdf_query_results_formats_check, librdf_query_results_formats_enumerate): Remove #if conditions on rasqal version. Tidy code. * src/rdf_query_rasqal.c, src/rdf_query_virtuoso.c: Remove Rasqal < 0.9.22 conditionals * redland.rdf.in: GIT * configure.ac: Do not substitute LIBRDF_VERSION since VERSION is already there * redland-config.in: fix --version to work without pkg-config. Use raptor2 package. make --help and --version work before installation to help make distcheck. * Makefile.am: Add scripts to SUBDIRS * docs/Makefile.am: redland-changes.tsv * scripts/process-changes.pl: add linkend for uppercase macros/enums * Makefile.am: touch-mtime.pl moved 2011-01-21 Dave Beckett * configure.ac: Welcome back src/rdf_node.c * Makefile.am: markdown-to-html.pl moved * HACKING.md: more code style updates * docs/Makefile.am: Remove redland-changes.tsv * src/Makefile.am, src/rdf_node.c, src/rdf_raptor_statement.c, src/rdf_statement.c, src/rdf_term.c: Rename rdf_term/raptor_statement to rdf_node/statement to match class names * docs/redland-sections.txt: remove temporary raptor1 funcs from unused. Add version macros * scripts/Makefile.am: scripts automakefile * docs/redland-changes.tsv, docs/redland-docs.xml, scripts/process-changes.pl: Add redland changes since 1.0.12 Run process changes. Add new types and typedefs. Add changes section to docs and update for 2011. * docs/Makefile.am: fix package name * configure.ac, docs/Makefile.am, docs/markdown-to-html.pl, docs/redland-changes.tsv, scripts/markdown-to-html.pl, scripts/touch-mtime.pl, utils/Makefile.am, utils/touch-mtime.pl: Add scripts dir and generated redland changes Add scripts dir and move scripts there. Import process-changes.pl from rasqal. Generate redland-changes.xml from redland-changes.tsv skeleton. 2011-01-19 Dave Beckett * ChangeLog, FAQS.html, INSTALL.html, LICENSE.html, NEWS.html, README.html, RELEASE.html, TODO.html, src/librdf.h.in: 1.0.13 and 2011 * src/Makefile.am: remove librdf.h from librdf_la_SOURCES * configure.ac, redland-config.in, src/.gitignore, src/librdf.h, src/librdf.h.in: Subsititute version macros into librdf.h, now created by configure 2011-01-18 Dave Beckett * src/rdf_node.h: Mark librdf_node_to_string and librdf_node_to_counted_string as deprecated not removed 2011-01-17 Lauri Aalto * src/rdf_node.h: (librdf_node_to_string, librdf_node_to_counted_string): Removed prototypes for functions no longer available. 2011-01-15 Dave Beckett * configure.ac, redland.pc.in, src/Makefile.am, src/librdf.h, src/rdf_log.h, src/rdf_model.c, src/rdf_node.c, src/rdf_node.h, src/rdf_node_internal.h, src/rdf_parser.c, src/rdf_parser_raptor.c, src/rdf_query_rasqal.c, src/rdf_raptor.c, src/rdf_raptor_internal.h, src/rdf_raptor_statement.c, src/rdf_serializer.c, src/rdf_serializer_raptor.c, src/rdf_statement.c, src/rdf_storage.c, src/rdf_storage_sql.c, src/rdf_storage_trees.c, src/rdf_term.c, src/rdf_uri.c: Remove Raptor 1 support, require Raptor 2.0.0 and Rasqal 0.9.22+ 2011-01-14 Dave Beckett * src/rdf_init.c: 2011 * src/rdf_serializer.c: (librdf_new_serializer): Log failure to find a serializer for name/type/uri * src/rdf_parser.c: (librdf_new_parser): Log failure to find a parser for name/type/uri * src/rdf_storage.c: (librdf_new_storage, librdf_new_storage_with_options): Report storage name not found errors 2011-01-12 Dave Beckett * src/rdf_query_virtuoso.c: Fix for rasqal 0.9.22 2011-01-11 Lauri Aalto * src/rdf_query_rasqal.c, src/rdf_query_results.c: make librdf build with rasqal master head redland-1.0.17/data/0000755000175000017500000000000012257576340011136 500000000000000redland-1.0.17/data/Makefile.am0000644000175000017500000000161511032320042013065 00000000000000# -*- Mode: Makefile -*- # # Makefile.am - data automake file for Redland # # Copyright (C) 2004-2006, David Beckett http://purl.org/net/dajobe/ # Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # EXTRA_DIST=dc.nt dc.rdf dc.ttl redland-1.0.17/data/Makefile.in0000644000175000017500000003310112257575714013125 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = data DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/rdf_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIGEST_OBJS = @DIGEST_OBJS@ DIGEST_SRCS = @DIGEST_SRCS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HASH_OBJS = @HASH_OBJS@ HASH_SRCS = @HASH_SRCS@ HAVE_RAPTOR2_API = @HAVE_RAPTOR2_API@ HTML_DIR = @HTML_DIR@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IODBC_CONFIG = @IODBC_CONFIG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBRDF_CPPFLAGS = @LIBRDF_CPPFLAGS@ LIBRDF_DIRECT_LIBS = @LIBRDF_DIRECT_LIBS@ LIBRDF_EXTERNAL_CPPFLAGS = @LIBRDF_EXTERNAL_CPPFLAGS@ LIBRDF_EXTERNAL_LIBS = @LIBRDF_EXTERNAL_LIBS@ LIBRDF_INTERNAL_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ LIBRDF_INTERNAL_DEPS = @LIBRDF_INTERNAL_DEPS@ LIBRDF_INTERNAL_LIBS = @LIBRDF_INTERNAL_LIBS@ LIBRDF_LDFLAGS = @LIBRDF_LDFLAGS@ LIBRDF_LIBTOOLLIBS = @LIBRDF_LIBTOOLLIBS@ LIBRDF_LIBTOOL_VERSION = @LIBRDF_LIBTOOL_VERSION@ LIBRDF_PKGCONFIG_PRIVATE_LIBS = @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ LIBRDF_VERSION_DECIMAL = @LIBRDF_VERSION_DECIMAL@ LIBRDF_VERSION_MAJOR = @LIBRDF_VERSION_MAJOR@ LIBRDF_VERSION_MINOR = @LIBRDF_VERSION_MINOR@ LIBRDF_VERSION_RELEASE = @LIBRDF_VERSION_RELEASE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEM = @MEM@ MEM_LIBS = @MEM_LIBS@ MKDIR_P = @MKDIR_P@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ODBC_CFLAGS = @ODBC_CFLAGS@ ODBC_LIBS = @ODBC_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSTGRESQL_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ POSTGRESQL_LIBS = @POSTGRESQL_LIBS@ RANLIB = @RANLIB@ RAPTOR2_CFLAGS = @RAPTOR2_CFLAGS@ RAPTOR2_LIBS = @RAPTOR2_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ RASQAL_CFLAGS = @RASQAL_CFLAGS@ RASQAL_LIBS = @RASQAL_LIBS@ RASQAL_MAX_VERSION = @RASQAL_MAX_VERSION@ RASQAL_MIN_VERSION = @RASQAL_MIN_VERSION@ RECHO = @RECHO@ RECHO_C = @RECHO_C@ RECHO_N = @RECHO_N@ REDLAND_MODULE_PATH = @REDLAND_MODULE_PATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TAR = @TAR@ TSTORE_CONFIG = @TSTORE_CONFIG@ TSTORE_CPPFLAGS = @TSTORE_CPPFLAGS@ TSTORE_LIBS = @TSTORE_LIBS@ VERSION = @VERSION@ VIRTUOSO_CPPFLAGS = @VIRTUOSO_CPPFLAGS@ VIRTUOSO_LIBS = @VIRTUOSO_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # -*- Mode: Makefile -*- # # Makefile.am - data automake file for Redland # # Copyright (C) 2004-2006, David Beckett http://purl.org/net/dajobe/ # Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # EXTRA_DIST = dc.nt dc.rdf dc.ttl all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: redland-1.0.17/data/dc.rdf0000644000175000017500000000061610375024363012134 00000000000000 Dave Beckett's Home Page Dave Beckett The generic home page of Dave Beckett. redland-1.0.17/data/dc.ttl0000644000175000017500000000034310375024363012161 00000000000000@prefix dc: . dc:creator "Dave Beckett" ; dc:description "The generic home page of Dave Beckett." ; dc:title "Dave Beckett's Home Page" . redland-1.0.17/data/dc.nt0000644000175000017500000000046310375024363012002 00000000000000 "Dave Beckett" . "The generic home page of Dave Beckett." . "Dave Beckett's Home Page" . redland-1.0.17/utils/0000755000175000017500000000000012257576340011365 500000000000000redland-1.0.17/utils/db_upgrade.c0000644000175000017500000000700511032320041013516 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * db_upgrade.c - Upgrade a redland on-disk BDB store * * Copyright (C) 2003-2006, David Beckett http://purl.org/net/dajobe/ * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #include #include #include #include #include /* one prototype needed */ int main(int argc, char *argv[]); int main(int argc, char *argv[]) { librdf_world* world; librdf_storage *storage, *new_storage; librdf_model *model, *new_model; librdf_stream *stream; char *program=argv[0]; char *name; char *new_name; int count; if(argc < 2 || argc >3) { fprintf(stderr, "USAGE: %s: [new DB name]\n", program); return(1); } name=argv[1]; if(argc < 3) { new_name=librdf_heuristic_gen_name(name); if(!new_name) { fprintf(stderr, "%s: Failed to create new name from '%s'\n", program, name); return(1); } } else { new_name=argv[2]; } fprintf(stderr, "%s: Upgrading DB '%s' to '%s'\n", program, name, new_name); world=librdf_new_world(); librdf_world_open(world); storage=librdf_new_storage(world, "hashes", name, "hash-type='bdb',dir='.',write='no',new='no'"); if(!storage) { fprintf(stderr, "%s: Failed to open old storage '%s'\n", program, name); return(1); } new_storage=librdf_new_storage(world, "hashes", new_name, "hash-type='bdb',dir='.',write='yes',new='yes'"); if(!storage) { fprintf(stderr, "%s: Failed to create new storage '%s'\n", program, new_name); return(1); } model=librdf_new_model(world, storage, NULL); if(!model) { fprintf(stderr, "%s: Failed to create model for '%s'\n", program, name); return(1); } new_model=librdf_new_model(world, new_storage, NULL); if(!new_model) { fprintf(stderr, "%s: Failed to create new model for '%s'\n", program, new_name); return(1); } stream=librdf_model_as_stream(model); if(!stream) { fprintf(stderr, "%s: librdf_model_as_stream returned NULL stream\n", program); return(1); } else { count=0; while(!librdf_stream_end(stream)) { librdf_statement *statement=librdf_stream_get_object(stream); if(!statement) { fprintf(stderr, "%s: librdf_stream_next returned NULL\n", program); break; } librdf_model_add_statement(new_model, statement); librdf_stream_next(stream); count++; } librdf_free_stream(stream); } librdf_free_model(model); librdf_free_model(new_model); librdf_free_storage(storage); librdf_free_storage(new_storage); librdf_free_world(world); if(argc < 3) free(new_name); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return(0); } redland-1.0.17/utils/Makefile.am0000644000175000017500000000335211772662730013344 00000000000000MYSQL_UTILS=rdf-tree bin_PROGRAMS=redland-db-upgrade rdfproc if STORAGE_VIRTUOSO noinst_PROGRAMS=redland-virtuoso-test endif AM_INSTALLCHECK_STD_OPTIONS_EXEMPT=redland-db-upgrade EXTRA_PROGRAMS=$(MYSQL_UTILS) man_MANS = redland-db-upgrade.1 rdfproc.1 EXTRA_DIST= rdfproc.html \ $(man_MANS) \ fix-groff-xhtml CLEANFILES=*.db $(EXTRA_PROGRAMS) *.plist AM_CPPFLAGS=@LIBRDF_INTERNAL_CPPFLAGS@ @LIBRDF_CPPFLAGS@ -I$(top_srcdir)/src @LIBRDF_EXTERNAL_CPPFLAGS@ LDADD=@LIBRDF_DIRECT_LIBS@ $(top_builddir)/src/librdf.la AM_LDFLAGS=@LIBRDF_LDFLAGS@ redland_db_upgrade_SOURCES = db_upgrade.c redland_virtuoso_test_SOURCES = redland-virtuoso-test.c redland_virtuoso_test_LDADD= @LIBRDF_DIRECT_LIBS@ @LIBRDF_LDFLAGS@ $(top_builddir)/src/librdf.la rdfproc_SOURCES = rdfproc.c if GETOPT rdfproc_SOURCES += getopt.c rdfproc_getopt.h endif ANALYZE = clang ANALYZE_FLAGS = "--analyze" # Based on COMPILE target ANALYZE_COMMAND = $(ANALYZE) \ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ $(ANALYZE_FLAGS) mysql-utils: $(MYSQL_UTILS) @MAINT@rdfproc.html: $(srcdir)/rdfproc.1 $(srcdir)/fix-groff-xhtml @MAINT@ -groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(srcdir)/fix-groff-xhtml $@ $(top_builddir)/src/librdf.la: cd $(top_builddir)/src && $(MAKE) librdf.la if MAINTAINER_MODE # Run Clang static analyzer over sources. analyze: $(SOURCES) @list='$(SOURCES)'; \ result=0; \ for file in $$list; do \ if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ $(RECHO) "Analyzing $$file"; \ $(ANALYZE_COMMAND) $(srcdir)/$$file; \ status=$$?; \ if test $$status != 0; then \ result=1; \ fi; \ fi; \ done; \ set -e; exit $$result endif redland-1.0.17/utils/Makefile.in0000644000175000017500000007016112257575714013363 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = redland-db-upgrade$(EXEEXT) rdfproc$(EXEEXT) @STORAGE_VIRTUOSO_TRUE@noinst_PROGRAMS = \ @STORAGE_VIRTUOSO_TRUE@ redland-virtuoso-test$(EXEEXT) EXTRA_PROGRAMS = $(am__EXEEXT_1) @GETOPT_TRUE@am__append_1 = getopt.c rdfproc_getopt.h subdir = utils DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/rdf_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = rdf-tree$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) rdf_tree_SOURCES = rdf-tree.c rdf_tree_OBJECTS = rdf-tree.$(OBJEXT) rdf_tree_LDADD = $(LDADD) rdf_tree_DEPENDENCIES = $(top_builddir)/src/librdf.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__rdfproc_SOURCES_DIST = rdfproc.c getopt.c rdfproc_getopt.h @GETOPT_TRUE@am__objects_1 = getopt.$(OBJEXT) am_rdfproc_OBJECTS = rdfproc.$(OBJEXT) $(am__objects_1) rdfproc_OBJECTS = $(am_rdfproc_OBJECTS) rdfproc_LDADD = $(LDADD) rdfproc_DEPENDENCIES = $(top_builddir)/src/librdf.la am_redland_db_upgrade_OBJECTS = db_upgrade.$(OBJEXT) redland_db_upgrade_OBJECTS = $(am_redland_db_upgrade_OBJECTS) redland_db_upgrade_LDADD = $(LDADD) redland_db_upgrade_DEPENDENCIES = $(top_builddir)/src/librdf.la am_redland_virtuoso_test_OBJECTS = redland-virtuoso-test.$(OBJEXT) redland_virtuoso_test_OBJECTS = $(am_redland_virtuoso_test_OBJECTS) redland_virtuoso_test_DEPENDENCIES = $(top_builddir)/src/librdf.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = rdf-tree.c $(rdfproc_SOURCES) $(redland_db_upgrade_SOURCES) \ $(redland_virtuoso_test_SOURCES) DIST_SOURCES = rdf-tree.c $(am__rdfproc_SOURCES_DIST) \ $(redland_db_upgrade_SOURCES) $(redland_virtuoso_test_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIGEST_OBJS = @DIGEST_OBJS@ DIGEST_SRCS = @DIGEST_SRCS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HASH_OBJS = @HASH_OBJS@ HASH_SRCS = @HASH_SRCS@ HAVE_RAPTOR2_API = @HAVE_RAPTOR2_API@ HTML_DIR = @HTML_DIR@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IODBC_CONFIG = @IODBC_CONFIG@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBRDF_CPPFLAGS = @LIBRDF_CPPFLAGS@ LIBRDF_DIRECT_LIBS = @LIBRDF_DIRECT_LIBS@ LIBRDF_EXTERNAL_CPPFLAGS = @LIBRDF_EXTERNAL_CPPFLAGS@ LIBRDF_EXTERNAL_LIBS = @LIBRDF_EXTERNAL_LIBS@ LIBRDF_INTERNAL_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ LIBRDF_INTERNAL_DEPS = @LIBRDF_INTERNAL_DEPS@ LIBRDF_INTERNAL_LIBS = @LIBRDF_INTERNAL_LIBS@ LIBRDF_LDFLAGS = @LIBRDF_LDFLAGS@ LIBRDF_LIBTOOLLIBS = @LIBRDF_LIBTOOLLIBS@ LIBRDF_LIBTOOL_VERSION = @LIBRDF_LIBTOOL_VERSION@ LIBRDF_PKGCONFIG_PRIVATE_LIBS = @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ LIBRDF_VERSION_DECIMAL = @LIBRDF_VERSION_DECIMAL@ LIBRDF_VERSION_MAJOR = @LIBRDF_VERSION_MAJOR@ LIBRDF_VERSION_MINOR = @LIBRDF_VERSION_MINOR@ LIBRDF_VERSION_RELEASE = @LIBRDF_VERSION_RELEASE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MEM = @MEM@ MEM_LIBS = @MEM_LIBS@ MKDIR_P = @MKDIR_P@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ODBC_CFLAGS = @ODBC_CFLAGS@ ODBC_LIBS = @ODBC_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSTGRESQL_CPPFLAGS = @POSTGRESQL_CPPFLAGS@ POSTGRESQL_LIBS = @POSTGRESQL_LIBS@ RANLIB = @RANLIB@ RAPTOR2_CFLAGS = @RAPTOR2_CFLAGS@ RAPTOR2_LIBS = @RAPTOR2_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ RASQAL_CFLAGS = @RASQAL_CFLAGS@ RASQAL_LIBS = @RASQAL_LIBS@ RASQAL_MAX_VERSION = @RASQAL_MAX_VERSION@ RASQAL_MIN_VERSION = @RASQAL_MIN_VERSION@ RECHO = @RECHO@ RECHO_C = @RECHO_C@ RECHO_N = @RECHO_N@ REDLAND_MODULE_PATH = @REDLAND_MODULE_PATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ TAR = @TAR@ TSTORE_CONFIG = @TSTORE_CONFIG@ TSTORE_CPPFLAGS = @TSTORE_CPPFLAGS@ TSTORE_LIBS = @TSTORE_LIBS@ VERSION = @VERSION@ VIRTUOSO_CPPFLAGS = @VIRTUOSO_CPPFLAGS@ VIRTUOSO_LIBS = @VIRTUOSO_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MYSQL_UTILS = rdf-tree AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = redland-db-upgrade man_MANS = redland-db-upgrade.1 rdfproc.1 EXTRA_DIST = rdfproc.html \ $(man_MANS) \ fix-groff-xhtml CLEANFILES = *.db $(EXTRA_PROGRAMS) *.plist AM_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ @LIBRDF_CPPFLAGS@ -I$(top_srcdir)/src @LIBRDF_EXTERNAL_CPPFLAGS@ LDADD = @LIBRDF_DIRECT_LIBS@ $(top_builddir)/src/librdf.la AM_LDFLAGS = @LIBRDF_LDFLAGS@ redland_db_upgrade_SOURCES = db_upgrade.c redland_virtuoso_test_SOURCES = redland-virtuoso-test.c redland_virtuoso_test_LDADD = @LIBRDF_DIRECT_LIBS@ @LIBRDF_LDFLAGS@ $(top_builddir)/src/librdf.la rdfproc_SOURCES = rdfproc.c $(am__append_1) ANALYZE = clang ANALYZE_FLAGS = "--analyze" # Based on COMPILE target ANALYZE_COMMAND = $(ANALYZE) \ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ $(ANALYZE_FLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu utils/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list installcheck-binPROGRAMS: $(bin_PROGRAMS) bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list rdf-tree$(EXEEXT): $(rdf_tree_OBJECTS) $(rdf_tree_DEPENDENCIES) $(EXTRA_rdf_tree_DEPENDENCIES) @rm -f rdf-tree$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rdf_tree_OBJECTS) $(rdf_tree_LDADD) $(LIBS) rdfproc$(EXEEXT): $(rdfproc_OBJECTS) $(rdfproc_DEPENDENCIES) $(EXTRA_rdfproc_DEPENDENCIES) @rm -f rdfproc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rdfproc_OBJECTS) $(rdfproc_LDADD) $(LIBS) redland-db-upgrade$(EXEEXT): $(redland_db_upgrade_OBJECTS) $(redland_db_upgrade_DEPENDENCIES) $(EXTRA_redland_db_upgrade_DEPENDENCIES) @rm -f redland-db-upgrade$(EXEEXT) $(AM_V_CCLD)$(LINK) $(redland_db_upgrade_OBJECTS) $(redland_db_upgrade_LDADD) $(LIBS) redland-virtuoso-test$(EXEEXT): $(redland_virtuoso_test_OBJECTS) $(redland_virtuoso_test_DEPENDENCIES) $(EXTRA_redland_virtuoso_test_DEPENDENCIES) @rm -f redland-virtuoso-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(redland_virtuoso_test_OBJECTS) $(redland_virtuoso_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_upgrade.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf-tree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfproc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redland-virtuoso-test.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: installcheck-binPROGRAMS maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am \ installcheck-binPROGRAMS installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 mysql-utils: $(MYSQL_UTILS) @MAINT@rdfproc.html: $(srcdir)/rdfproc.1 $(srcdir)/fix-groff-xhtml @MAINT@ -groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(srcdir)/fix-groff-xhtml $@ $(top_builddir)/src/librdf.la: cd $(top_builddir)/src && $(MAKE) librdf.la # Run Clang static analyzer over sources. @MAINTAINER_MODE_TRUE@analyze: $(SOURCES) @MAINTAINER_MODE_TRUE@ @list='$(SOURCES)'; \ @MAINTAINER_MODE_TRUE@ result=0; \ @MAINTAINER_MODE_TRUE@ for file in $$list; do \ @MAINTAINER_MODE_TRUE@ if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ @MAINTAINER_MODE_TRUE@ $(RECHO) "Analyzing $$file"; \ @MAINTAINER_MODE_TRUE@ $(ANALYZE_COMMAND) $(srcdir)/$$file; \ @MAINTAINER_MODE_TRUE@ status=$$?; \ @MAINTAINER_MODE_TRUE@ if test $$status != 0; then \ @MAINTAINER_MODE_TRUE@ result=1; \ @MAINTAINER_MODE_TRUE@ fi; \ @MAINTAINER_MODE_TRUE@ fi; \ @MAINTAINER_MODE_TRUE@ done; \ @MAINTAINER_MODE_TRUE@ set -e; exit $$result # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: redland-1.0.17/utils/rdf-tree.c0000644000175000017500000003552411611163532013156 00000000000000/* * rdf-tree.c - Retrieve statements from persistent Redland storage. * * Copyright (C) 2003-2004 Morten Frederiksen - http://purl.org/net/morten/ * * and * * Copyright (C) 2000-2006, David Beckett http://purl.org/net/dajobe/ * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * */ #include #include #include #include #include #include const char *VERSION = "0.4"; struct options { librdf_node *context; char *database; char *directory; char *host; char *model; int level; int port; char *output; char *password; int quiet; char *user; } opts; int main(int argc, char *argv[]); int tree(librdf_world * world, librdf_node * node, librdf_model * model, librdf_model * outputmodel, LHASH * table, int level); void hash_free(void *data); int getoptions(int argc, char *argv[], librdf_world * world); int usage(char *argv0, int version); int main(int argc, char *argv[]) { /* Redland objects. */ librdf_world *world; librdf_storage *storage; librdf_model *model; librdf_uri *uri = 0; librdf_storage *outputstorage; librdf_model *outputmodel; librdf_storage *contextstorage; librdf_model *contextmodel; librdf_stream *stream; librdf_serializer *serializer; int argnum; char *storage_type; char *storage_options; /* Create rdflib world. */ world = librdf_new_world(); if(!world) { fprintf(stderr, "%s: Failed to create Redland world\n", argv[0]); return (1); }; librdf_world_open(world); /* Parse command line options (if possible). */ argnum = getoptions(argc, argv, world); /* Check for URI argument. */ if(argnum < argc) { uri = librdf_new_uri(world, argv[argnum]); if(!uri) { fprintf(stderr, "%s: Failed to create input uri\n", argv[0]); exit(1); }; }; /* Set storage options. */ if(opts.database) { storage_type = strdup("mysql"); storage_options = malloc(strlen(opts.host) + strlen(opts.database) + strlen(opts.user) + strlen(opts.password) + 120); if(!storage_type || !storage_options) { fprintf(stderr, "%s: Failed to create 'mysql' storage options\n", argv[0]); return (1); }; sprintf(storage_options, "host='%s',database='%s',port='%i',user='%s',password='%s',contexts='yes',write='no'", opts.host, opts.database, opts.port, opts.user, opts.password); } else { storage_type = strdup("hashes"); storage_options = malloc(strlen(opts.directory) + 120); if(!storage_type || !storage_options) { fprintf(stderr, "%s: Failed to create 'hashes' storage options\n", argv[0]); return (1); }; sprintf(storage_options, "hash-type='bdb',dir='%s',contexts='yes',write='no'", opts.directory); }; /* Create storage. */ storage = librdf_new_storage(world, storage_type, opts.model, storage_options); if(!storage) { fprintf(stderr, "%s: Failed to create storage (%s/%s/%s)\n", argv[0], storage_type, opts.model, storage_options); return (1); } /* Create model. */ model = librdf_new_model(world, storage, NULL); if(!model) { fprintf(stderr, "%s: Failed to create model\n", argv[0]); return (1); } /* Create output storage. */ outputstorage = librdf_new_storage(world, "memory", "output", ""); if(!outputstorage) { fprintf(stderr, "%s: Failed to create output storage\n", argv[0]); return (1); } /* Create output model. */ outputmodel = librdf_new_model(world, outputstorage, NULL); if(!outputmodel) { fprintf(stderr, "%s: Failed to create output model\n", argv[0]); return (1); } /* Create serializer. */ serializer = librdf_new_serializer(world, opts.output, NULL, NULL); if(!serializer) { fprintf(stderr, "%s: Failed to create serializer\n", argv[0]); return (1); } if(librdf_model_size(model) != -1 && !opts.quiet) fprintf(stderr, "%s: Model '%s' contains %d statements.\n", argv[0], opts.model, librdf_storage_size(storage)); /* stream=librdf_model_as_stream(model); while (!librdf_stream_end(stream)) { librdf_statement *s; librdf_node *n; s=librdf_stream_get_object(stream); fprintf(stderr,"%s\n",librdf_statement_to_string(s)); n=librdf_stream_get_context(stream); fprintf(stderr,"- context: %s\n",n?librdf_node_to_string(n):"-"); librdf_stream_next(stream); }; librdf_free_stream(stream); */ /* Only statements with given context? */ if(opts.context) { if(!opts.quiet) fprintf(stderr, "%s: Creating context storage...\n", argv[0]); /* Create context storage. */ contextstorage = librdf_new_storage(world, "memory", "context", ""); if(!contextstorage) { fprintf(stderr, "%s: Failed to create context storage\n", argv[0]); return (1); }; /* Create context model. */ contextmodel = librdf_new_model(world, contextstorage, NULL); if(!contextmodel) { fprintf(stderr, "%s: Failed to create context model\n", argv[0]); return (1); }; /* Extract statements with given context. */ if(!(stream = librdf_model_context_as_stream(model, opts.context))) { fprintf(stderr, "%s: Failed to serialize context model\n", argv[0]); return (1); }; if(librdf_model_add_statements(contextmodel, stream)) { fprintf(stderr, "%s: Failed to add statements to context model\n", argv[0]); return (1); }; librdf_free_model(model); librdf_free_storage(storage); storage = contextstorage; model = contextmodel; }; /* Populate output model... */ if(uri) { int rc = 0; LHASH *table = lh_new((LHASH_HASH_FN_TYPE) lh_strhash, (LHASH_COMP_FN_TYPE) strcmp); if(!table) { fprintf(stderr, "%s: Failed to create hash table\n", argv[0]); return (1); }; if(!opts.quiet) fprintf(stderr, "%s: Populating output model from uri...\n", argv[0]); /* Recursively extract statements about subject... */ rc = tree(world, librdf_new_node_from_uri(world, uri), model, outputmodel, table, opts.level); lh_doall(table, (LHASH_DOALL_FN_TYPE) hash_free); lh_free(table); if(rc) { fprintf(stderr, "%s: Failed to extract statements from model (%d)\n", argv[0], rc); return (1); }; librdf_free_model(model); librdf_free_storage(storage); } else { if(!opts.quiet) fprintf(stderr, "%s: Outputting entire model...\n", argv[0]); /* No restraints, use entire model as output. */ librdf_free_model(outputmodel); librdf_free_storage(outputstorage); outputstorage = storage; outputmodel = model; }; /* Serialize output... */ if(!opts.quiet) fprintf(stderr, "%s: Serializing...\n", argv[0]); if(librdf_serializer_serialize_model(serializer, stdout, NULL, outputmodel)) { fprintf(stderr, "%s: Failed to serialize output model\n", argv[0]); return (1); }; /* Clean up. */ librdf_free_serializer(serializer); librdf_free_model(outputmodel); librdf_free_storage(outputstorage); librdf_free_world(world); /* keep gcc -Wall happy */ return (0); } int tree(librdf_world * world, librdf_node * node, librdf_model * model, librdf_model * outputmodel, LHASH * table, int level) { librdf_stream *instream; librdf_node *object; librdf_statement *statement; int rc; librdf_node_type ont; librdf_node *rdftype = librdf_new_node_from_uri_string(world, "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); /* Add node to hash, to prevent cycles. */ lh_insert(table, strdup(librdf_node_to_string(node))); if(lh_error(table)) { return 1; } /* Find all statements about node. */ if(! (statement = librdf_new_statement_from_nodes(world, librdf_new_node_from_node(node), NULL, NULL))) { return 2; } if(!(instream = librdf_model_find_statements(model, statement))) { return 0; } while(!librdf_stream_end(instream)) { /* Add statement to output model. */ statement = librdf_stream_get_object(instream); if(librdf_model_add_statement(outputmodel, librdf_new_statement_from_statement (statement))) return 4; /* Recurse? */ if(level && !librdf_node_equals(rdftype, librdf_statement_get_predicate (statement))) { object = librdf_statement_get_object(statement); ont = librdf_node_get_type(object); if(ont == LIBRDF_NODE_TYPE_RESOURCE || ont == LIBRDF_NODE_TYPE_BLANK) { /* librdf_statement_print(statement,stderr); fprintf(stderr,"%s","\n"); */ /* Don't recurse if object is known... */ if(!lh_retrieve(table, librdf_node_to_string(object))) { rc = tree(world, object, model, outputmodel, table, level - 1); if(rc) return rc; } }; }; librdf_stream_next(instream); }; librdf_free_stream(instream); return 0; }; void hash_free(void *data) { free(data); }; int getoptions(int argc, char *argv[], librdf_world * world) { /* Define command line options. */ struct option opts_long[] = { {"help", no_argument, NULL, '?'}, {"context", required_argument, NULL, 'c'}, {"database", required_argument, NULL, 's'}, {"directory", required_argument, NULL, 'd'}, {"host", required_argument, NULL, 'h'}, {"level", required_argument, NULL, 'l'}, {"model", required_argument, NULL, 'm'}, {"output", required_argument, NULL, 'o'}, {"port", required_argument, NULL, 'P'}, {"password", optional_argument, NULL, 'p'}, {"quiet", no_argument, NULL, 'q'}, {"user", required_argument, NULL, 'u'}, {"version", no_argument, NULL, 'v'}, {0, 0, 0, 0} }; const char *opts_short = "?c:D:d:h:l:m:o:P:p:qu:v"; int i = 1; char c; char *buffer; int ttypasswd = 1; /* Set defaults. */ opts.context = 0; opts.level = 1; opts.password = 0; opts.port = 3306; opts.quiet = 0; opts.user = 0; if(!(opts.directory = strdup("./")) || !(opts.host = strdup("mysql")) || !(opts.model = strdup("redland")) || !(opts.output = strdup("rdfxml")) || !(opts.database = strdup("redland"))) { fprintf(stderr, "%s: Failed to allocate default options\n", argv[0]); exit(1); }; while((c = getopt_long(argc, argv, opts_short, opts_long, &i)) != -1) { buffer = NULL; if(optarg) { buffer = malloc(strlen(optarg) + 1); if(!buffer) { fprintf(stderr, "%s: Failed to allocate buffer for command line argument (%s)\n", argv[0], optarg); exit(1); }; strncpy(buffer, optarg, strlen(optarg) + 1); }; switch (c) { case '?': usage(argv[0], 0); case 'c': free(buffer); opts.context = librdf_new_node_from_uri_string(world, optarg); if(!opts.context) { fprintf(stderr, "%s: Failed to create context node (%s)\n", argv[0], optarg); exit(1); }; break; case 'D': free(opts.directory); opts.directory = 0; opts.database = buffer; break; case 'd': free(opts.database); opts.database = 0; opts.directory = buffer; break; case 'h': opts.host = buffer; break; case 'l': free(buffer); opts.level = atoi(optarg); break; case 'm': opts.model = buffer; break; case 'o': free(opts.output); opts.output = buffer; break; case 'P': free(buffer); opts.port = atoi(optarg); break; case 'p': opts.password = buffer; ttypasswd = 0; break; case 'q': opts.quiet = 1; break; case 'u': opts.user = buffer; break; case 'v': usage(argv[0], 1); default: fprintf(stderr, "%s: Invalid option (%c)\n", argv[0], c); usage(argv[0], 0); } } /* Flag missing user name. */ if(opts.database && !opts.user) { fprintf(stderr, "%s: Missing user name for mysql storage\n", argv[0]); usage(argv[0], 0); exit(1); }; /* Read password from tty if not specified. */ if(opts.database && ttypasswd) { char c2; int i2 = 0; opts.password = malloc(128); if(!opts.password) { fprintf(stderr, "%s: Failed to allocate buffer for password\n", argv[0]); exit(1); }; fprintf(stderr, "%s: Enter password for %s@%s/%s: ", argv[0], opts.user, opts.host, opts.database); while((c2 = getchar()) != '\n') { opts.password[i2++] = c2; if(i2 == 127) break; }; opts.password[i2] = 0; }; return optind; } int usage(char *argv0, int version) { printf("\n\ %s Version %s\n\ Retrieve statements from persistent Redland storage.\n\ * Copyright (C) 2003 Morten Frederiksen - http://purl.org/net/morten/\n\ * Copyright (C) 2000-2003 David Beckett - http://purl.org/net/dajobe/\n\ ", argv0, VERSION); if(version) exit(0); printf("\n\ usage: %s [options] [ ]\n\ \n\ -?, --help Display this help message and exit.\n\ -c, --context=\n\ Extract only statements with given context URI.\n\ -D, --database=\n\ Name of MySQL database to use, default is 'redland'.\n\ -d, --directory=\n\ Directory to use for BDB files. When provided implies use\n\ of 'hashes' storage type instead of 'mysql'.\n\ -h, --host=\n\ Host to contact for MySQL connections, default is 'mysql'.\n\ -l, --level=\n\ The number of levels of statements to extract. Default is\n\ 1, also returning statements about objects.\n\ -m, --model=\n\ Identifier for (name of) storage (model name for storage\n\ type 'mysql', base file name for storage type 'hashes'),\n\ default is 'redland'.\n\ -o, --output=\n\ Syntax identifier for serialization, 'ntriples' or\n\ 'rdfxml' (default).\n\ -p, --password=\n\ Password to use when connecting to MySQL server.\n\ If password is not given it's asked from the tty.\n\ -P, --port=\n\ The port number to use when connecting to MySQL server.\n\ Default port number is 3306.\n\ -q, --quiet\n\ No informational messages, only errors.\n\ -u, --user=\n\ User name for MySQL server.\n\ -v, --version Output version information and exit.\n\ \n\ ", argv0); exit(1); } redland-1.0.17/utils/getopt.c0000644000175000017500000000712411032320041012726 00000000000000/* * Public Domain getopt - history below * */ /* * From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.sources * Subject: getopt library routine Date: 30 Mar 85 04:45:33 GMT */ /* * getopt -- public domain version of standard System V routine * * Strictly enforces the System V Command Syntax Standard; provided by D A * Gwyn of BRL for generic ANSI C implementations * * #define STRICT to prevent acceptance of clustered options with arguments * and ommision of whitespace between option and arg. */ /* * Modified by Manuel Novoa III on 1/5/01 to use weak symbols. * Programs needing long options will link gnu_getopt instead. */ /* * Last public domain version 1.5 downloaded from uclibc CVS: * http://www.uclibc.org/cgi-bin/cvsweb/uClibc/libc/unistd/getopt.c * on 2003-02-18 by Dave Beckett and tidied: * Ran through "indent getopt.c -gnu" then fixed up the mess * Removed register - compilers are smart these days * ANSI-fied the declarations * Prefixed with rdfproc_ so that it doesn't clash with any getopt * linked in later. */ #include #include #include int opterr; /* error => print message */ int optind; /* next argv[] index */ int optopt; /* Set for unknown arguments */ char *optarg; /* option parameter if any */ /* * Err: * program name argv[0] * specific message * defective option letter */ static int Err (char *name, char *mess, int c) /* returns '?' */ { optopt = c; if (opterr) { (void) fprintf (stderr, "%s: %s -- %c\n", name, mess, c); } return '?'; /* erroneous-option marker */ } int getopt (int argc, char * const argv[], const char *optstring) { static int sp = 1; /* position within argument */ int osp; /* saved `sp' for param test */ #ifndef STRICT int oind; /* saved `optind' for param test */ #endif int c; /* option letter */ char *cp; /* -> option in `optstring' */ optarg = NULL; /* initialise getopt vars */ if (optind == 0) { optind = 1; opterr = 1; optopt = 1; optarg = NULL; } if (sp == 1) { /* fresh argument */ if (optind >= argc /* no more arguments */ || argv[optind][0] != '-' /* no more options */ || argv[optind][1] == '\0' /* not option; stdin */ ) return EOF; else if (strcmp (argv[optind], "--") == 0) { ++optind; /* skip over "--" */ return EOF; /* "--" marks end of options */ } } c = argv[optind][sp]; /* option letter */ osp = sp++; /* get ready for next letter */ #ifndef STRICT oind = optind; /* save optind for param test */ #endif if (argv[optind][sp] == '\0') { /* end of argument */ ++optind; /* get ready for next try */ sp = 1; /* beginning of next argument */ } if (c == ':' || c == '?' /* optstring syntax conflict */ || (cp = strchr (optstring, c)) == NULL) /* not found */ { return Err (argv[0], "illegal option", c); } if (cp[1] == ':') { /* option takes parameter */ #ifdef STRICT if (osp != 1) { return Err (argv[0], "option must not be clustered", c); } /* reset by end of argument */ if (sp != 1) { return Err (argv[0], "option must be followed by white space", c); } #else if (oind == optind) { /* argument w/o whitespace */ optarg = &argv[optind][sp]; sp = 1; /* beginning of next argument */ } else #endif if (optind >= argc) { return Err (argv[0], "option requires an argument", c); } else /* argument w/ whitespace */ optarg = argv[optind]; ++optind; /* skip over parameter */ } return c; } redland-1.0.17/utils/rdfproc.10000644000175000017500000001767011757416522013040 00000000000000.\" Hey, EMACS: -*- nroff -*- .\" .\" rdfproc.1 - Redland RDF processor utility manual page .\" .\" Copyright (C) 2003-2010 David Beckett - http://www.dajobe.org/ .\" Copyright (C) 2003-2005 University of Bristol - http://www.bristol.ac.uk/ .\" .TH rdfproc 1 "2010-08-29" .\" Please adjust this date whenever revising the manpage. .SH NAME rdfproc \- Redland RDF processor utility .SH SYNOPSIS .B rdfproc .RB [ options ] .IR "store-name" .IR "command" .IR "arg..." .SH EXAMPLE .nf .B rdfproc test parse http://planetrdf.com/guide/rss.rdf .br .B rdfproc test print .br .B rdfproc test serialize ntriples .br .SH DESCRIPTION The .B rdfproc utility allows parsing, querying, manipulating and serializing of RDF content using the .B Redland RDF library. The \fIstore-name\fR is a Redland store name, typically a short identifier. The arguments to \fIcommand\fR vary and are explained in section COMMANDS below. .SH OPTIONS rdfproc uses the usual GNU command line syntax, with long options starting with two dashes (`-') if supported by the getopt_long function. Otherwise the short options are only available. .TP .B \-h, \-\-help Show a summary of the options. .TP .B \-c, \-\-contexts Use a store with Redland contexts. .TP .B \-n, \-\-new Make a new store, overwriting any existing one. .TP .B \-o, \-\-output \fIFORMAT\fR Set the output FORMAT for sequences of triples, such as from a search (find command) to a Redland serializer. Use \-h or \-o help to see the full list of supported formats. .TP .B \-p, \-\-password Read the storage option 'password' from standard input. Terminated by end of line ('\\n') or end of file. This is equivalent to setting it using \-t or \-\-storage-options but does not require exposing the password in the argument list. .TP .B \-q, \-\-quiet Suppress informational messages (that go to stderr) .TP .B \-r, \-\-results \fIFORMAT\fR Set the query results syntax format. Use \-h or \-r help to see the full list of query result formats. .IP The exact list of formats depends on what libraptor(3) was built with but is given correct in the usage message with \-h. .TP .B \-s, \-\-storage \fITYPE\fR Set the Redland storage type (default 'hashes'). If environment variable RDFPROC_STORAGE_TYPE is set, the storage type given here will override it. Use \-h or \-s help to see the full list of query result formats. .TP .B \-t, \-\-storage-options \fIOPTIONS\fR Set options for the the Redland storage, default is "hash-type='bdb',dir='.'" to match the default storage "hashes". For storages types such as 'mysql' that need extra options this would typically be something like "host='hostname',database='dbname',user='abc',password='pass'". If environment variable RDFPROC_STORAGE_OPTIONS is set, the storage options given here will be applied afterwards. .TP .B \-v, \-\-version Print the Redland version and exit. .TP .B \-V, \-\-verbose Show informational messages on stderr. .SH COMMANDS Where a node is allowed, such as \fINODE\fP, \fISUBJECT\fP, \fIPREDICATE\fP or \fIOBJECT\fP below, simple heuristics are used to guess which are blank node identifiers, URIs or literals (to add a statement with a literal, use add-typed). If the item starts with _: then it is assumed to be a blank node identifier, otherwise if it matches something:// it is assumed to be a URI, otherwise it is a literal. Literals are only allowed as objects of statements and blank nodes are not allowed as predicates. .IP "\fBadd \fISUBJECT\fP \fIPREDICATE\fP \fIOBJECT\fP \fI[CONTEXT]\fP\fR" Add the given triple to graph, in the optional Redland context if the \fICONTEXT\fR node is given. .IP "\fBadd-typed \fISUBJECT\fP \fIPREDICATE\fP \fIOBJECT\fP \fIOBJECT-LANG\fP \fIOBJECT-URI\fP \fI[CONTEXT]\fP\fR" Add the triple with the datatyped literal object to the graph, in the optional Redland context if \fICONTEXT\fR is given. .IP "\fBarc \fISUBJECT\fP \fIOBJECT\fP\fR" .IP "\fBarcs \fISUBJECT\fP \fIOBJECT\fP\fR" Show one node/all nodes that match triples (\fISUBJECT\fP, ?, \fIOBJECT\fP) .IP "\fBarcs-in \fINODE\fP\fR" Show all properties of triples with \fINODE\fP as a subject. .IP "\fBarcs-out \fINODE\fP\fR" Show all properties of triples with \fINODE\fP as an object. .IP "\fBcontains \fISUBJECT\fP \fIPREDICATE\fP \fIOBJECT\fP\fR" Check if the given triple is in the graph. .IP "\fBcontexts\fR" List all the contexts in the graph (if contexts are enabled). .IP "\fBfind \fISUBJECT\fP|- \fIPREDICATE\fP|- \fIOBJECT\fP|- [\fICONTEXT\fP]\fR" Find matching triples to the given statement where - stands for a blank that matches any node. If \fICONTEXT\fP is given, only search for triples in that context node. .IP "\fBhas-arc-in \fINODE\fP \fIARC\fP\fR" Check that there is a triple with \fINODE\fP as a subject and \fIARC\fP as a predicate. .IP "\fBhas-arc-out \fPNODE\fP \fIARC\fP\fR" Check that there is a triple with \fINODE\fP as a object and \fIARC\fP as a predicate. .IP "\fBparse \fIURI|FILENAME\fP [\fISYNTAX|\fP [\fIBASE URI\fP]]\fR" Parse syntax at \fIURI\fP into the graph using \fISYNTAX\fP which can be one of \fIrdfxml\fP (RDF/XML, default), \fIntriples\fP, \fIturtle\fP, \fIrss-tag-soup\fP (for all RSS and Atoms), \fIgrddl\fP and \fIguess\fP to use content hints and protocol information to work it out. (This list changes faster than this manual page) If \fIFILENAME\fP is a existing file, the appropriate URI will be generated for it. If parsing returns errors, the return code will be non-0. .IP "\fBparse-stream \fIURI|FILENAME\fP [\fISYNTAX\fP [\fIBASE URI\fP [\fICONTEXT\fP]]\fR" Streaming parse syntax at URI into the graph using \fISYNTAX\fP which can be one of \fIrdfxml\fP (RDF/XML, default) or \fIntriples\fP. If \fIFILENAME\fP is an existing file, the appropriate URI will be generated for it. If the optional \fICONTEXT\fI URI is given, the triples are added to that context. If parsing returns errors, the return code will be non-0. .IP "\fBprint\fR" Print the graph triples in a simple format showing context nodes if present. .IP "\fBquery \fINAME\fP|- \fIURI\fP|- \fIQUERY-STRING\fP\fR" Run \fIQUERY-STRING\fI query in language \fINAME\fR returning variable bindings, a boolean or RDF graph depending on the query. Query language can be 'sparql' or 'rdql'. .IP "\fBremove \fISUBJECT\fP \fIPREDICATE\fP \fIOBJECT\fP \fI[CONTEXT]\fP\fR" Remove the given triple graph, in the optional Redland context if \fICONTEXT\fR is given. .IP "\fBremove-context \fICONTEXT\fP\fR" Remove all triples in the graph with the Redland context \fICONTEXT\fR. .IP "\fBserialize [\fISYNTAX\fP [\fIURI\fP [\fIMIME-TYPE\fP]]]\fR" Serializes the graph to a syntax with a particular \ISYNTAX\fR \fIURI\fR or Internet Media Type/MIME Type. The default is RDF/XML (\fINAME\fR "rdfxml", MIME Type "application/rdf/xml") if none of the above are given. Other alternatives are "ntriples" (no MIME Type). .IP "\fBsource \fIPREDICATE\fP \fIOBJECT\fP\fR" .IP "\fBsources \fIPREDICATE\fP \fIOBJECT\fP\fR" Show one node/all nodes that match triples (?, \fIPREDICATE\fP, \fIOBJECT\fP) .IP "\fBtarget \fISUBJECT\fP \fIPREDICATE\fP\fR" .IP "\fBtargets \fISUBJECT\fP \fIPREDICATE\fP\fR" Show one node/all nodes that match triples (\fISUBJECT\fP, \fIPREDICATE\fP, ?) .SH "ENVIRONMENT" RDFPROC_STORAGE_OPTIONS can be set to provide storage options instead of using the option \-t, \-\-storage-options \fIOPTIONS\fR. When both are given, command options are applied last. .LP RDFPROC_STORAGE_TYPE can be set to provide a storage type instead of using the option \-s, \-\-storage \fITYPE\fR. When both are given, the storage type from the command is used. .SH "CONFORMING TO" \fIRDF/XML Syntax (Revised)\fR, W3C Recommendation, .UR http://www.w3.org/TR/rdf-syntax-grammar/ http://www.w3.org/TR/rdf-syntax-grammar/ .UE \fIN-Triples\fR, in \fIRDF Test Cases\fR, Jan Grant and Dave Beckett (eds.) W3C Recommendation, .UR http://www.w3.org/TR/rdf-testcases/#ntriples http://www.w3.org/TR/rdf-testcases/#ntriples .UE .SH SEE ALSO redland(3), libraptor(3), rapper(1) .SH AUTHOR Dave Beckett - .UR http://www.dajobe.org/ http://www.dajobe.org/ .UE redland-1.0.17/utils/rdfproc.html0000644000175000017500000002755311772663003013640 00000000000000 Redland RDF Application Framework - Redland RDF processor utility

Redland RDF Application Framework - Redland RDF processor utility


NAME

rdfproc − Redland RDF processor utility

SYNOPSIS

rdfproc [options] store-name command arg...

EXAMPLE

rdfproc test parse http://planetrdf.com/guide/rss.rdf
rdfproc test print
rdfproc test serialize ntriples

DESCRIPTION

The rdfproc utility allows parsing, querying, manipulating and serializing of RDF content using the Redland RDF library. The store-name is a Redland store name, typically a short identifier. The arguments to command vary and are explained in section COMMANDS below.

OPTIONS

rdfproc uses the usual GNU command line syntax, with long options starting with two dashes (’-’) if supported by the getopt_long function. Otherwise the short options are only available.
−h, −−help

Show a summary of the options.

−c, −−contexts

Use a store with Redland contexts.

−n, −−new

Make a new store, overwriting any existing one.

−o, −−output FORMAT

Set the output FORMAT for sequences of triples, such as from a search (find command) to a Redland serializer. Use −h or −o help to see the full list of supported formats.

−p, −−password

Read the storage option ’password’ from standard input. Terminated by end of line (’\n’) or end of file. This is equivalent to setting it using −t or −−storage-options but does not require exposing the password in the argument list.

−q, −−quiet

Suppress informational messages (that go to stderr)

−r, −−results FORMAT

Set the query results syntax format. Use −h or −r help to see the full list of query result formats.

The exact list of formats depends on what libraptor(3) was built with but is given correct in the usage message with −h.

−s, −−storage TYPE

Set the Redland storage type (default ’hashes’). If environment variable RDFPROC_STORAGE_TYPE is set, the storage type given here will override it. Use −h or −s help to see the full list of query result formats.

−t, −−storage-options OPTIONS

Set options for the the Redland storage, default is "hash-type=’bdb’,dir=’.’" to match the default storage "hashes". For storages types such as ’mysql’ that need extra options this would typically be something like "host=’hostname’,database=’dbname’,user=’abc’,password=’pass’". If environment variable RDFPROC_STORAGE_OPTIONS is set, the storage options given here will be applied afterwards.

−v, −−version

Print the Redland version and exit.

−V, −−verbose

Show informational messages on stderr.

COMMANDS

Where a node is allowed, such as NODE, SUBJECT, PREDICATE or OBJECT below, simple heuristics are used to guess which are blank node identifiers, URIs or literals (to add a statement with a literal, use add-typed). If the item starts with _: then it is assumed to be a blank node identifier, otherwise if it matches something:// it is assumed to be a URI, otherwise it is a literal. Literals are only allowed as objects of statements and blank nodes are not allowed as predicates.
add
SUBJECT PREDICATE OBJECT [CONTEXT]

Add the given triple to graph, in the optional Redland context if the CONTEXT node is given.

add-typed SUBJECT PREDICATE OBJECT OBJECT-LANG OBJECT-URI [CONTEXT]

Add the triple with the datatyped literal object to the graph, in the optional Redland context if CONTEXT is given.

arc SUBJECT OBJECT
arcs
SUBJECT OBJECT

Show one node/all nodes that match triples (SUBJECT, ?, OBJECT)

arcs-in NODE

Show all properties of triples with NODE as a subject.

arcs-out NODE

Show all properties of triples with NODE as an object.

contains SUBJECT PREDICATE OBJECT

Check if the given triple is in the graph.

contexts

List all the contexts in the graph (if contexts are enabled).

find SUBJECT|- PREDICATE|- OBJECT|- [CONTEXT]

Find matching triples to the given statement where - stands for a blank that matches any node. If CONTEXT is given, only search for triples in that context node.

has-arc-in NODE ARC

Check that there is a triple with NODE as a subject and ARC as a predicate.

has-arc-out NODE ARC

Check that there is a triple with NODE as a object and ARC as a predicate.

parse URI|FILENAME [SYNTAX| [BASE URI]]

Parse syntax at URI into the graph using SYNTAX which can be one of rdfxml (RDF/XML, default), ntriples, turtle, rss-tag-soup (for all RSS and Atoms), grddl and guess to use content hints and protocol information to work it out. (This list changes faster than this manual page) If FILENAME is a existing file, the appropriate URI will be generated for it. If parsing returns errors, the return code will be non-0.

parse-stream URI|FILENAME [SYNTAX [BASE URI [CONTEXT]]

Streaming parse syntax at URI into the graph using SYNTAX which can be one of rdfxml (RDF/XML, default) or ntriples. If FILENAME is an existing file, the appropriate URI will be generated for it. If the optional CONTEXT URI is given, the triples are added to that context. If parsing returns errors, the return code will be non-0.

print

Print the graph triples in a simple format showing context nodes if present.

query NAME|- URI|- QUERY-STRING

Run QUERY-STRING query in language NAME returning variable bindings, a boolean or RDF graph depending on the query. Query language can be ’sparql’ or ’rdql’.

remove SUBJECT PREDICATE OBJECT [CONTEXT]

Remove the given triple graph, in the optional Redland context if CONTEXT is given.

remove-context CONTEXT

Remove all triples in the graph with the Redland context CONTEXT.

serialize [SYNTAX [URI [MIME-TYPE]]]

Serializes the graph to a syntax with a particular ISYNTAX URI or Internet Media Type/MIME Type. The default is RDF/XML (NAME "rdfxml", MIME Type "application/rdf/xml") if none of the above are given. Other alternatives are "ntriples" (no MIME Type).

source PREDICATE OBJECT
sources
PREDICATE OBJECT

Show one node/all nodes that match triples (?, PREDICATE, OBJECT)

target SUBJECT PREDICATE
targets
SUBJECT PREDICATE

Show one node/all nodes that match triples (SUBJECT, PREDICATE, ?)

ENVIRONMENT

RDFPROC_STORAGE_OPTIONS can be set to provide storage options instead of using the option −t, −−storage-options OPTIONS. When both are given, command options are applied last.

RDFPROC_STORAGE_TYPE can be set to provide a storage type instead of using the option −s, −−storage TYPE. When both are given, the storage type from the command is used.

CONFORMING TO

RDF/XML Syntax (Revised), W3C Recommendation, http://www.w3.org/TR/rdf-syntax-grammar/

N-Triples, in RDF Test Cases, Jan Grant and Dave Beckett (eds.) W3C Recommendation, http://www.w3.org/TR/rdf-testcases/#ntriples

SEE ALSO

redland(3), libraptor(3), rapper(1)

AUTHOR

Dave Beckett - http://www.dajobe.org/


Copyright 2002-2012 Dave Beckett
2002-2012 University of Bristol

redland-1.0.17/utils/redland-db-upgrade.10000644000175000017500000000177311032320041014767 00000000000000.\" Hey, EMACS: -*- nroff -*- .\" .\" redland-db-upgrade.1 - Redland database upgrade utility manual page .\" .\" Copyright (C) 2003-2006 David Beckett - http://purl.org/net/dajobe/ .\" Copyright (C) 2003 University of Bristol - http://www.bristol.ac.uk/ .\" .TH redland-db-upgrade 1 "2003-08-19" .\" Please adjust this date whenever revising the manpage. .SH NAME redland-db-upgrade \- upgrade older Redland databases to 0.9.12 format .SH SYNOPSIS .B redland-db-upgrade \fIold BDB Name\fP \fInew BDB name\fP .SH DESCRIPTION \fIredland-db-upgrade\fP converts Redland databases from the format in 0.9.11 and earlier into the new format. It must be run on each Redland database. For example if database \fIa\fP created files \fIa-sp2o.db\fP, \fIa-so2p.db\fP and \fIa-po2s.db\fP it could be converted to a new database \fIb\fP with: .IP redland-db-upgrade a b .SH SEE ALSO .BR redland (3), .SH AUTHOR Dave Beckett - .UR http://purl.org/net/dajobe/ http://purl.org/net/dajobe/ .UE redland-1.0.17/utils/rdfproc.c0000644000175000017500000014534011774157457013126 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * rdfproc.c - Redland RDF command processor * * Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * * */ #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include #ifdef HAVE_GETOPT_H #include #else #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #ifdef NEED_OPTIND_DECLARATION extern int optind; extern char *optarg; #endif /* one prototype needed */ int main(int argc, char *argv[]); static char *program=NULL; enum command_type { CMD_NONE, CMD_PRINT, CMD_CONTAINS, CMD_FIND, CMD_SOURCES, CMD_ARCS, CMD_TARGETS, CMD_SOURCE, CMD_ARC, CMD_TARGET, CMD_ADD, CMD_REMOVE, CMD_ADD_TYPED, CMD_PARSE_MODEL, CMD_PARSE_STREAM, CMD_ARCS_IN, CMD_ARCS_OUT, CMD_HAS_ARC_IN, CMD_HAS_ARC_OUT, CMD_QUERY_AS_BINDINGS, CMD_QUERY, CMD_SERIALIZE, CMD_REMOVE_CONTEXT, CMD_CONTEXTS, CMD_MATCH, CMD_SIZE }; typedef struct { enum command_type type; const char *name; int min_args; /* min args needed? */ int max_args; /* max args needed? */ int write; /* write to db? */ } command; static command commands[]={ {CMD_NONE, "(none)", 0, 0, 0,}, {CMD_PRINT, "print", 0, 0, 0,}, {CMD_CONTAINS, "contains", 3, 3, 0}, {CMD_FIND, "find", 3, 4, 0}, {CMD_SOURCES, "sources", 2, 2, 0}, {CMD_ARCS, "arcs", 2, 2, 0}, {CMD_TARGETS, "targets", 2, 2, 0}, {CMD_SOURCE, "source", 2, 2, 0}, {CMD_ARC, "arc", 2, 2, 0}, {CMD_TARGET, "target", 2, 2, 0}, {CMD_ADD, "add", 3, 4, 1}, {CMD_REMOVE, "remove", 3, 4, 1}, {CMD_ADD_TYPED, "add-typed", 5, 6, 1}, {CMD_PARSE_MODEL, "parse", 1, 4, 1}, {CMD_PARSE_STREAM, "parse-stream", 1, 4, 1}, {CMD_ARCS_IN, "arcs-in", 1, 1, 0}, {CMD_ARCS_OUT, "arcs-out", 1, 1, 0}, {CMD_HAS_ARC_IN, "has-arc-in", 2, 2, 0}, {CMD_HAS_ARC_OUT, "has-arc-out", 2, 2, 0}, /* FIXME triples-match-query is deliberately not documented */ {CMD_QUERY, "triples-match-query", 3, 3, 0}, {CMD_QUERY_AS_BINDINGS, "query", 3, 3, 0}, {CMD_SERIALIZE, "serialize", 0, 4, 0}, {CMD_REMOVE_CONTEXT, "remove-context", 1, 1, 0}, {CMD_CONTEXTS, "contexts", 0, 0, 0}, {CMD_MATCH, "match", 3, 4, 0}, {CMD_SIZE, "size", 0, 0, 0}, {(enum command_type)-1, NULL, 0, 0, 0} }; #ifdef HAVE_GETOPT_LONG #define HELP_TEXT(short, long, description) " -" #short ", --" long " " description #define HELP_ARG(short, long) "-" #short " / --" #long #else #define HELP_TEXT(short, long, description) " -" #short " " description #define HELP_ARG(short, long) "-" #short #endif #define GETOPT_STRING "chno:pqr:s:t:TvV" #ifdef HAVE_GETOPT_LONG static struct option long_options[] = { /* name, has_arg, flag, val */ {"contexts", 0, 0, 'c'}, {"help", 0, 0, 'h'}, {"new", 0, 0, 'n'}, {"output", 1, 0, 'o'}, {"password", 0, 0, 'p'}, {"quiet", 0, 0, 'q'}, {"results", 1, 0, 'r'}, {"storage", 1, 0, 's'}, {"storage-options", 1, 0, 't'}, {"transactions", 0, 0, 'T'}, {"version", 0, 0, 'v'}, {"verbose", 0, 0, 'V'}, {NULL, 0, 0, 0} }; #endif static const char *title_format_string="Redland RDF processor utility %s\n"; static const char *default_storage_name="hashes"; static const char *default_storage_options="hash-type='bdb',dir='.'"; static int REDLAND_CALLBACK_STDCALL log_handler(void *user_data, librdf_log_message *message) { /* int code=message->code; */ /* The error code */ raptor_locator *locator=(raptor_locator*)(message->locator); /* Do not handle messages below warning*/ if(message->level < LIBRDF_LOG_WARN) return 0; if(message->level == LIBRDF_LOG_WARN) fprintf(stderr, "%s: Warning - ", program); else fprintf(stderr, "%s: Error - ", program); if(locator) { /* && message->facility == LIBRDF_FROM_PARSER) */ raptor_locator_print(locator, stderr); fputc(':', stderr); fputc(' ', stderr); } fputs(message->message, stderr); fputc('\n', stderr); if(message->level >= LIBRDF_LOG_FATAL) exit(1); /* Handled */ return 1; } static void print_nodes(FILE* fh, librdf_iterator* iterator) { int count; librdf_node* context_node; librdf_node* node; /* (Common code) Print out nodes */ count=0; while(!librdf_iterator_end(iterator)) { context_node=(librdf_node*)librdf_iterator_get_context(iterator); node=(librdf_node*)librdf_iterator_get_object(iterator); if(!node) { fprintf(stderr, "%s: librdf_iterator_get_object returned NULL\n", program); break; } fputs("Matched node: ", fh); librdf_node_print(node, fh); if(context_node) { fputs(" with context ", fh); librdf_node_print(context_node, fh); } fputc('\n', fh); count++; librdf_iterator_next(iterator); } librdf_free_iterator(iterator); fprintf(stderr, "%s: matching nodes: %d\n", program, count); } static void print_node(FILE* fh, librdf_node* node) { if(node) { fputs("Matched node: ", fh); librdf_node_print(node, fh); fputc('\n', fh); librdf_free_node(node); } } int main(int argc, char *argv[]) { librdf_world* world; librdf_parser* parser; librdf_serializer* serializer; librdf_storage *storage; librdf_model* model; librdf_node *source, *arc, *target, *node; librdf_node* context_node=NULL; librdf_stream* stream; librdf_iterator* iterator; librdf_uri *uri; librdf_uri *base_uri=NULL; librdf_query *query; librdf_query_results *results; librdf_hash *options; int usage=0; int help=0; int is_new=0; int verbosity = 1; char *identifier=NULL; char *cmd=NULL; char *name; char *mime_type; unsigned cmd_index = 0; int count; int type; int result; char *p; unsigned int i; int rc; int transactions=0; char *storage_name=(char*)default_storage_name; char *storage_options=(char*)default_storage_options; char *storage_password=NULL; librdf_statement* partial_statement=NULL; unsigned char *uri_string=NULL; int free_uri_string=0; librdf_model* output_model=NULL; librdf_storage* output_storage=NULL; librdf_serializer* output_serializer=NULL; size_t capacity; size_t size; const char *query_graph_serializer_syntax_name="rdfxml"; char* results_format=NULL; program=argv[0]; if((p=strrchr(program, '/'))) program=p+1; else if((p=strrchr(program, '\\'))) program=p+1; argv[0]=program; world=librdf_new_world(); librdf_world_set_logger(world, world, log_handler); librdf_world_open(world); options=librdf_new_hash(world, NULL); librdf_hash_open(options, NULL, 0, 1, 1, NULL); #ifdef HAVE_GETENV if((name=getenv("RDFPROC_STORAGE_OPTIONS"))) storage_options=name; if((name=getenv("RDFPROC_STORAGE_TYPE"))) storage_name=name; #endif while (!usage && !help) { int c; #ifdef HAVE_GETOPT_LONG int option_index = 0; c = getopt_long (argc, argv, GETOPT_STRING, long_options, &option_index); #else c = getopt (argc, argv, GETOPT_STRING); #endif if(c == -1) break; switch(c) { case 0: case '?': /* getopt() - unknown option */ usage=1; break; case 'c': librdf_hash_put_strings(options, "contexts", "yes"); break; case 'h': help=1; break; case 'n': is_new=1; break; case 'o': if(optarg) { if(!strcmp(optarg, "help")) { fprintf(stderr, "%s: Valid serializers are:\n", program); for(i = 0; 1; i++) { const raptor_syntax_description* desc; desc = librdf_serializer_get_description(world, i); if(!desc) break; printf(" %-20s %s\n", desc->names[0], desc->label); } exit(0); } else if(!strcmp(optarg, "simple")) { fprintf(stderr, "%s: WARNING: The deprecated 'simple' output type has been replaced with N-Triples\n", program); output_serializer=NULL; } else { output_serializer=librdf_new_serializer(world, optarg, NULL, NULL); if(!output_serializer) { fprintf(stderr, "%s: invalid argument `%s' for `" HELP_ARG(o, output) "'\nTry '%s " HELP_ARG(o, output) " help' for a list of valid serializers\n", program, optarg, program); usage=1; } else { output_storage = librdf_new_storage(world, NULL, NULL, NULL); if(!output_storage) { fprintf(stderr, "%s: Failed to create output storage\n", program); librdf_free_serializer(output_serializer); output_serializer=NULL; } else { output_model = librdf_new_model(world, output_storage, NULL); if(!output_model) { fprintf(stderr, "%s: Failed to create output storage model\n", program); librdf_free_storage(output_storage); output_storage=NULL; librdf_free_serializer(output_serializer); output_serializer=NULL; } } } } } break; case 'p': /* gets() the password from stdin, checking for input overflow */ capacity=0; size=0; while(!feof(stdin)) { if((capacity-size) < 10) { capacity += 10; p=(char*)malloc(capacity); if(storage_password) { strncpy(p, storage_password, size); free(storage_password); } storage_password=p; } rc=fgetc(stdin); /* short enough that I don't care to use fread */ if(rc == '\n' || rc == EOF) { storage_password[size]='\0'; break; } storage_password[size++]=(char)rc; } if(!size) { fprintf(stderr, "%s: WARNING: No storage password found on input\n", program); if(storage_password) { free(storage_password); storage_password=NULL; } } if(storage_password) { librdf_hash_put_strings(options, "password", storage_password); free(storage_password); } break; case 'q': verbosity=0; break; case 'r': if(optarg) { if(!strcmp(optarg, "help")) { fprintf(stderr, "%s: Valid query result formats are:\n", program); for(i = 0; 1; i++) { const raptor_syntax_description* desc; desc = librdf_query_results_formats_get_description(world, i); if(!desc) break; printf(" %-20s %s\n", desc->names[0], desc->label); } exit(0); } else { if(librdf_query_results_formats_check(world, optarg, NULL, NULL)) results_format=optarg; else { fprintf(stderr, "%s: invalid argument `%s' for `" HELP_ARG(r, results) "'\nTry '%s " HELP_ARG(r, results) " help' for a list of valid query result formats\n", program, optarg, program); usage=1; } } } break; case 's': if(optarg) { if(!strcmp(optarg, "help")) { fprintf(stderr, "%s: Valid storage names are:\n", program); for(i = 0; 1; i++) { const char *format_name; const char *format_label; if(librdf_storage_enumerate(world, i, &format_name, &format_label)) break; printf(" %-10s %s\n", format_name, format_label); } exit(0); } if(!librdf_get_storage_factory(world, optarg)) { fprintf(stderr, "%s: invalid argument `%s' for `" HELP_ARG(s, storage) "'\nTry '%s " HELP_ARG(s, storage) " help' for a list of valid storages\n", program, optarg, program); usage=1; } else storage_name=optarg; } break; case 't': storage_options=optarg; break; case 'T': transactions=1; break; case 'v': fputs(librdf_version_string, stdout); fputc('\n', stdout); exit(0); case 'V': verbosity++; break; } } if(usage || help) goto usage; if(optind == argc) { usage=2; /* Title and usage */ goto usage; } argv+=optind; argc-=optind; identifier=argv[0]; argv++; argc--; if(!argc) { fprintf(stderr, "%s: No command given\n", program); usage=1; goto usage; } cmd=argv[0]; for(i = 1; commands[i].name; i++) if(!strcmp(cmd, commands[i].name)) { cmd_index = i; break; } if(!cmd_index) { fprintf(stderr, "%s: No such command `%s'\n", program, argv[0]); usage=1; goto usage; } argv++; argc--; if(argc < commands[cmd_index].min_args) { fprintf(stderr, "%s: Command %s needs %d arguments\n", program, cmd, commands[cmd_index].min_args); usage=1; } else if(argc > commands[cmd_index].max_args) { fprintf(stderr, "%s: Command %s given more than %d arguments\n", program, cmd, commands[cmd_index].max_args); usage=1; } /* otherwise is just fine and argv points to remaining args */ usage: if(usage) { if(usage>1) { fprintf(stderr, title_format_string, librdf_version_string); fputs("Redland librdf home page: ", stderr); fputs(librdf_home_url_string, stderr); fputc('\n', stderr); fputs(librdf_copyright_string, stderr); fputs("\nLicense: ", stderr); fputs(librdf_license_string, stderr); fputs("\n\n", stderr); } fprintf(stderr, "Try `%s " HELP_ARG(h, help) "' for more information.\n", program); exit(1); } if(help) { printf("Usage: %s [options] store-name command arg...\n", program); printf(title_format_string, librdf_version_string); puts(librdf_short_copyright_string); puts("Utility for processing RDF using the Redland library."); puts("\nOptions:"); puts(HELP_TEXT(c, "contexts ", "Use Redland contexts")); puts(HELP_TEXT(h, "help ", "Print this help, then exit")); puts(HELP_TEXT(n, "new ", "Create a new store (default no)")); puts(HELP_TEXT(o, "output FORMAT ", "Set the triple output format")); for(i = 0; 1; i++) { const raptor_syntax_description* desc; desc = librdf_serializer_get_description(world, i); if(!desc) break; printf(" %-15s %s", desc->names[0], desc->label); if(!strcmp(desc->names[0], query_graph_serializer_syntax_name)) puts(" (default)"); else putchar('\n'); } puts(HELP_TEXT(p, "password ", "Read storage option 'password' from standard input")); puts(HELP_TEXT(q, "quiet ", "Do not print information messages")); puts(HELP_TEXT(r, "results FORMAT ", "Set the query results format (no default)")); for(i = 0; 1; i++) { const raptor_syntax_description* desc; desc = librdf_query_results_formats_get_description(world, i); if(!desc) break; printf(" %-10s %s\n", desc->names[0], desc->label); } puts(HELP_TEXT(s, "storage TYPE ", "Set the graph storage type")); for(i = 0; 1; i++) { const char *help_name; const char *help_label; if(librdf_storage_enumerate(world, i, &help_name, &help_label)) break; printf(" %-10s %s", help_name, help_label); if(!strcmp(help_name, default_storage_name)) puts(" (default)"); else putchar('\n'); } printf(HELP_TEXT(t, "storage-options OPTIONS\n ", "Storage options (default \"%s\")\n"), default_storage_options); puts(HELP_TEXT(v, "version ", "Print the Redland version")); puts(HELP_TEXT(V, "verbose ", "Increase message verbosity")); puts("\nCommands:"); puts(" parse FILE|URI [SYNTAX [BASEURI [CONTEXT]]]"); puts(" parse-stream FILE|URI [SYNTAX [BASEURI [CONTEXT]]]"); puts(" Parse RDF syntax (default RDF/XML) in FILE or URI into the graph"); puts(" with optional BASEURI, into the optional CONTEXT."); puts(" print Print the graph triples."); puts(" serialize [SYNTAX [URI [MIME-TYPE]]] Serializes to a syntax (RDF/XML)."); puts(" query NAME|- URI|- QUERY-STRING Run QUERY-STRING query in language NAME for bindings"); #if 0 puts(" triples-match-query NAME URI|- QUERY-STRING Query for matching triples"); #endif puts(" find SUBJECT|- PREDICATE|- OBJECT|- [CONTEXT] Find matching triples"); puts(" contains SUBJECT PREDICATE OBJECT Check if triple is in the graph."); puts(" contexts List the contexts in the graph."); puts(" add SUBJECT PREDICATE OBJECT [CONTEXT] Add triple to graph."); puts(" add-typed SUBJECT PREDICATE OBJECT OBJECT-LANG OBJECT-URI [CONTEXT]"); puts(" Add datatyped triple to graph."); puts(" remove SUBJECT PREDICATE OBJECT [CONTEXT] Remove triple from graph."); puts(" remove-context CONTEXT Remove all triples with CONTEXT."); puts(" sources | targets | arcs NODE1 NODE2 Show matching nodes."); puts(" source | target | arc NODE1 NODE2 Show 1 matching node."); puts(" arcs-in | arcs-out NODE Show properties in/out of NODE"); puts(" has-arc-in | has-arc-out NODE ARC Check for property in/out of NODE."); puts(" size Print the number of triples in the graph."); puts("\nNotation:"); puts(" nodes are either blank node identifiers like _:ABC,"); puts(" URIs like http://example.org otherwise are literal strings."); puts(" - matches any node when allowed."); puts(" triples are three nodes (subject, predicate, object)"); puts(" predicates can only be uris, only objects can be literals"); puts(" source means subject of triples matching (?, NODE1, NODE2)"); puts(" target means object of triples matching (NODE1, NODE2, ?)"); puts(" arc means predicate of triples matching (NODE1, ?, NODE2)"); puts("\nReport bugs to http://bugs.librdf.org/"); puts("Redland home page: http://librdf.org/"); exit(0); } type = commands[cmd_index].type; if(commands[cmd_index].write) { librdf_hash_put_strings(options, "write", "yes"); if(is_new) librdf_hash_put_strings(options, "new", "yes"); } else { if(is_new) { fprintf(stderr, "%s: Cannot empty a new store during read-only command '%s'\n" "%s: Retry without the " HELP_ARG(n, new) " option\n", program, cmd, program); return(1); } } librdf_hash_from_string(options, storage_options); storage=librdf_new_storage_with_options(world, storage_name, identifier, options); if(!storage) { fprintf(stderr, "%s: Failed to open %s storage '%s'\n", program, storage_name, identifier); return(1); } model=librdf_new_model(world, storage, NULL); if(!model) { fprintf(stderr, "%s: Failed to create model\n", program); return(1); } if(transactions) librdf_model_transaction_start(model); /* Do this or gcc moans */ stream=NULL; iterator=NULL; parser=NULL; serializer=NULL; source=NULL; arc=NULL; target=NULL; uri=NULL; node=NULL; query=NULL; results=NULL; rc=0; switch(type) { case CMD_PRINT: { raptor_iostream *iostr; iostr = raptor_new_iostream_to_file_handle(world->raptor_world_ptr, stdout); librdf_model_write(model, iostr); raptor_free_iostream(iostr); } break; case CMD_PARSE_MODEL: case CMD_PARSE_STREAM: uri_string=(unsigned char *)argv[0]; if(!access((const char*)uri_string, R_OK)) { uri_string=raptor_uri_filename_to_uri_string((char*)uri_string); free_uri_string=1; } uri=librdf_new_uri(world, uri_string); if(!uri) { fprintf(stderr, "%s: Failed to create URI from %s\n", program, argv[0]); break; } parser=librdf_new_parser(world, ((argc > 1) ? argv[1] : NULL), NULL, NULL); if(!parser) { fprintf(stderr, "%s: Failed to create new parser %s\n", program, argv[1]); librdf_free_uri(uri); break; } if(verbosity) fprintf(stderr, "%s: Parsing URI %s with %s parser\n", program, librdf_uri_as_string(uri), (argc > 1) ? argv[1] : "default"); if(argc >= 3 && argv[2]) { base_uri=NULL; if(strcmp(argv[2], "-")) { base_uri=librdf_new_uri(world, (const unsigned char *)argv[2]); if(!base_uri) { fprintf(stderr, "%s: Failed to create base URI from %s\n", program, argv[2]); break; } } if(verbosity) fprintf(stderr, "%s: Using base URI %s\n", program, (base_uri ? (const char*)librdf_uri_as_string(base_uri) : "NULL")); target=NULL; /* context node */ if(argc >= 4 && argv[3]) { if(librdf_heuristic_is_blank_node(argv[3])) target=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[3])); else target=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[3]); } if(verbosity) fprintf(stderr, "%s: Using context node %s\n", program, (argv[3] ? argv[3] : "NULL")); } else base_uri=librdf_new_uri_from_uri(uri); rc=0; if(type == CMD_PARSE_MODEL && !target) { if(librdf_parser_parse_into_model(parser, uri, base_uri, model)) { fprintf(stderr, "%s: Failed to parse into the graph\n", program); rc=1; } } else { /* either CMD_PARSE_STREAM or it's a parse into context */ count=0; if(!(stream=librdf_parser_parse_as_stream(parser, uri, base_uri))) { fprintf(stderr, "%s: Failed to parse RDF as stream\n", program); } else { while(!librdf_stream_end(stream)) { librdf_statement *statement=librdf_stream_get_object(stream); if(!statement) { fprintf(stderr, "%s: librdf_stream_next returned NULL\n", program); break; } if(target) /* context node */ librdf_model_context_add_statement(model, target, statement); else librdf_model_add_statement(model, statement); count++; librdf_stream_next(stream); } librdf_free_stream(stream); } if(target) { librdf_free_node(target); target=NULL; } if(verbosity) fprintf(stderr, "%s: Added %d triples\n", program, count); rc=1; } if(rc) { librdf_uri* error_count_uri=librdf_new_uri(world, (const unsigned char*)LIBRDF_PARSER_FEATURE_ERROR_COUNT); librdf_uri* warning_count_uri=librdf_new_uri(world, (const unsigned char*)LIBRDF_PARSER_FEATURE_WARNING_COUNT); librdf_node* error_count_node; librdf_node* warning_count_node; int error_count, warning_count; error_count_node=librdf_parser_get_feature(parser, error_count_uri); if(error_count_node) { error_count=atoi((const char*)librdf_node_get_literal_value(error_count_node)); librdf_free_node(error_count_node); } else { fprintf(stderr, "%s: Could not get parsing error count\n", program); error_count= (-1); } warning_count_node=librdf_parser_get_feature(parser, warning_count_uri); if(warning_count_node) { warning_count=atoi((const char*)librdf_node_get_literal_value(warning_count_node)); librdf_free_node(warning_count_node); } else { fprintf(stderr, "%s: Could not get parsing warning count\n", program); warning_count= (-1); } if((error_count >=0) && (warning_count >=0) && error_count+warning_count > 0) { fprintf(stdout, "%s: The parsing returned %d errors and %d warnings\n", program, error_count, warning_count); } librdf_free_uri(error_count_uri); librdf_free_uri(warning_count_uri); rc = (error_count == 0) ? 0 : 1; } librdf_free_parser(parser); librdf_free_uri(uri); if(base_uri) librdf_free_uri(base_uri); break; case CMD_SERIALIZE: /* args are name (optional), uri (may be NULL), mime_type * (optional), base URI (optional) */ uri=NULL; name=NULL; mime_type=NULL; base_uri=NULL; if(!argc) goto serialize; if(strcmp(argv[0], "-")) name=argv[0]; if(argc < 2) goto serialize; if(strcmp(argv[1], "-")) { uri=librdf_new_uri(world, (const unsigned char *)argv[1]); if(!uri) { fprintf(stderr, "%s: Failed to create URI from %s\n", program, argv[1]); break; } } if(argc == 3) { if(strcmp(argv[2], "-")) mime_type=argv[2]; } if(argc == 4) { if(strcmp(argv[3], "-")) { base_uri=librdf_new_uri(world, (const unsigned char *)argv[3]); if(!base_uri) { fprintf(stderr, "%s: Failed to create base URI from %s\n", program, argv[3]); break; } } } serialize: serializer=librdf_new_serializer(world, name, mime_type, uri); if(!serializer) { fprintf(stderr, "%s: Failed to create new serializer name %s, uri %s, mime type %s\n", program, argv[0], argv[1], argv[2]); if(uri) librdf_free_uri(uri); break; } librdf_serializer_serialize_model_to_file_handle(serializer, stdout, NULL, model); librdf_free_serializer(serializer); if(uri) librdf_free_uri(uri); break; case CMD_QUERY: /* args are name, uri (may be NULL), query_string/mime_type */ name=argv[0]; if(!strcmp(name, "-")) name=NULL; if(!strcmp(argv[1], "-")) uri=NULL; else { uri=librdf_new_uri(world, (const unsigned char *)argv[1]); if(!uri) { fprintf(stderr, "%s: Failed to create URI from %s\n", program, argv[1]); break; } } query=librdf_new_query(world, name, uri, (const unsigned char *)argv[2], NULL); goto printmatching; break; case CMD_QUERY_AS_BINDINGS: /* args are name (optional), uri (may be NULL), query_string */ uri=NULL; name=NULL; if(strcmp(argv[0], "-")) name=argv[0]; if(!strcmp(argv[1], "-")) uri=NULL; else { uri=librdf_new_uri(world, (const unsigned char *)argv[1]); if(!uri) { fprintf(stderr, "%s: Failed to create URI from %s\n", program, argv[1]); break; } } query=librdf_new_query(world, name, uri, (const unsigned char *)argv[2], NULL); if(!query) { fprintf(stderr, "%s: Failed to create new query %s\n", program, argv[2]); if(uri) librdf_free_uri(uri); break; } if(!(results=librdf_model_query_execute(model, query))) { fprintf(stderr, "%s: Query of model with '%s' failed\n", program, argv[2]); if(uri) librdf_free_uri(uri); librdf_free_query(query); query=NULL; break; } if(results_format) { raptor_iostream *iostr; librdf_query_results_formatter *formatter; if(verbosity) fprintf(stderr, "%s: Formatting query result as '%s':\n", program, results_format); iostr = raptor_new_iostream_to_file_handle(world->raptor_world_ptr, stdout); formatter = librdf_new_query_results_formatter2(results, results_format, NULL /* mime type */, NULL /* format_uri */); librdf_query_results_formatter_write(iostr, formatter, results, base_uri); librdf_free_query_results_formatter(formatter); raptor_free_iostream(iostr); } else if(librdf_query_results_is_bindings(results)) { if(verbosity) fprintf(stderr, "%s: Query returned bindings results:\n", program); while(!librdf_query_results_finished(results)) { int v_idx; if(verbosity) fputs("result: ", stdout); fputs("[", stdout); for(v_idx = 0; 1 ; v_idx++) { librdf_node *value; value = librdf_query_results_get_binding_value(results, v_idx); if(!value) break; name = (char*)librdf_query_results_get_binding_name(results, v_idx); if(i > 0) fputs(", ", stdout); fprintf(stdout, "%s=", name); if(value) { librdf_node_print(value, stdout); librdf_free_node(value); } else fputs("NULL", stdout); } fputs("]\n", stdout); librdf_query_results_next(results); } if(verbosity) fprintf(stderr, "%s: Query returned %d results\n", program, librdf_query_results_get_count(results)); } else if(librdf_query_results_is_boolean(results)) { if(verbosity) fprintf(stderr, "%s: Query returned boolean result: %s\n", program, librdf_query_results_get_boolean(results) ? "true" : "false"); rc = !librdf_query_results_get_boolean(results); } else if(librdf_query_results_is_graph(results)) { librdf_storage* tmp_storage; librdf_model* tmp_model; tmp_storage=librdf_new_storage(world, NULL, NULL, NULL); tmp_model=librdf_new_model(world, tmp_storage, NULL); if(verbosity) fprintf(stderr, "%s: Query returned graph result:\n", program); stream=librdf_query_results_as_stream(results); if(!stream) { fprintf(stderr, "%s: Failed to get query results graph\n", program); return(1); } librdf_model_add_statements(tmp_model, stream); librdf_free_stream(stream); if(verbosity) fprintf(stderr, "%s: Total %d triples\n", program, librdf_model_size(model)); serializer=librdf_new_serializer(world, query_graph_serializer_syntax_name, NULL, NULL); if(!serializer) { fprintf(stderr, "%s: Failed to create serializer type %s\n", program, query_graph_serializer_syntax_name); return(1); } librdf_serializer_serialize_model_to_file_handle(serializer, stdout, NULL, tmp_model); librdf_free_serializer(serializer); librdf_free_model(tmp_model); librdf_free_storage(tmp_storage); } else { if(verbosity) fprintf(stderr, "%s: Query returned unknown result format\n", program); rc=1; } if(uri) librdf_free_uri(uri); librdf_free_query_results(results); break; case CMD_CONTAINS: case CMD_FIND: case CMD_MATCH: case CMD_ADD: case CMD_REMOVE: case CMD_ADD_TYPED: if(!strcmp(argv[0], "-")) source=NULL; else if(librdf_heuristic_is_blank_node(argv[0])) source=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[0])); else source=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[0]); if(!strcmp(argv[1], "-")) arc=NULL; else arc=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[1]); if(type == CMD_ADD_TYPED) { char *lang=(strcmp(argv[3], "-")) ? argv[3] : NULL; librdf_uri* dt_uri=librdf_new_uri(world, (const unsigned char *)argv[4]); target=librdf_new_node_from_typed_literal(world, (const unsigned char *)argv[2], lang, dt_uri); librdf_free_uri(dt_uri); } else { if(!strcmp(argv[2], "-")) target=NULL; else { if(!strncmp(argv[2], "_:", 2)) target=librdf_new_node_from_blank_identifier(world, (const unsigned char *)argv[2]+2); else if(librdf_heuristic_object_is_literal(argv[2])) target=librdf_new_node_from_literal(world, (const unsigned char *)argv[2], NULL, 0); else target=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[2]); } } partial_statement=librdf_new_statement(world); librdf_statement_set_subject(partial_statement, source); librdf_statement_set_predicate(partial_statement, arc); librdf_statement_set_object(partial_statement, target); if((type != CMD_FIND) && (type != CMD_MATCH)) { if(!source || !arc || !target) { fprintf(stderr, "%s: cannot have missing triple parts for %s\n", program, cmd); librdf_free_statement(partial_statement); break; } } printmatching: switch(type) { case CMD_CONTAINS: if(librdf_model_contains_statement(model, partial_statement)) { if(verbosity) fprintf(stderr, "%s: the graph contains the triple\n", program); rc=0; } else { if(verbosity) fprintf(stderr, "%s: the graph does not contain the triple\n", program); rc=1; } break; case CMD_FIND: case CMD_MATCH: case CMD_QUERY: /* Print out matching statements */ if(type==CMD_FIND || type==CMD_MATCH) { if(argc == 4 || type==CMD_MATCH) { if(argc == 4) { if(librdf_heuristic_is_blank_node(argv[3])) context_node=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[3])); else context_node=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[3]); } if(type == CMD_MATCH) { librdf_hash* match_options=librdf_new_hash(world, NULL); librdf_hash_open(match_options, NULL, 0, 1, 1, NULL); librdf_hash_put_strings(match_options, "match-substring", "yes"); stream=librdf_model_find_statements_with_options(model, partial_statement, context_node, match_options); librdf_free_hash(match_options); } else { stream=librdf_model_find_statements_in_context(model, partial_statement, context_node); } if(context_node) librdf_free_node(context_node); } else stream=librdf_model_find_statements(model, partial_statement); } else { if(!(results=librdf_model_query_execute(model, query))) { fprintf(stderr, "%s: Query of model with '%s' failed\n", program, argv[2]); librdf_free_query(query); query=NULL; break; } stream=librdf_query_results_as_stream(results); } if(!stream) { fprintf(stderr, "%s: %s returned no results (NULL stream)\n", program, commands[type].name); } else { count=0; while(!librdf_stream_end(stream)) { librdf_statement *statement=librdf_stream_get_object(stream); context_node = librdf_stream_get_context2(stream); if(!statement) { fprintf(stderr, "%s: librdf_stream_next returned NULL\n", program); break; } if(output_model) { librdf_model_add_statement(output_model, librdf_new_statement_from_statement(statement)); } else { fputs("Matched triple: ", stdout); librdf_statement_print(statement, stdout); if(context_node) { fputs(" with context ", stdout); librdf_node_print(context_node, stdout); } fputc('\n', stdout); } count++; librdf_stream_next(stream); } librdf_free_stream(stream); if(!output_model) fprintf(stderr, "%s: matching triples: %d\n", program, count); if(results) librdf_free_query_results(results); } break; case CMD_ADD: case CMD_ADD_TYPED: if(argv[3]) { if(librdf_heuristic_is_blank_node(argv[3])) context_node=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[3])); else context_node=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[3]); rc=librdf_model_context_add_statement(model, context_node, partial_statement); librdf_free_node(context_node); } else { if(argv[3]) fprintf(stderr, "%s: ERROR: Cannot add in context - model does not support contexts\n", program); rc=librdf_model_add_statement(model, partial_statement); } if(verbosity) { if(rc) fprintf(stderr, "%s: Failed to add triple to the graph\n", program); else { if(verbosity) fprintf(stderr, "%s: Added triple to the graph\n", program); } } break; case CMD_REMOVE: if(argv[3]) { if(librdf_heuristic_is_blank_node(argv[3])) context_node=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[3])); else context_node=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[3]); rc=librdf_model_context_remove_statement(model, context_node, partial_statement); librdf_free_node(context_node); } else rc=librdf_model_remove_statement(model, partial_statement); if(verbosity) { if(rc) fprintf(stderr, "%s: failed to remove triple from the graph\n", program); else { if(verbosity) fprintf(stderr, "%s: removed triple from the graph\n", program); } } break; default: fprintf(stderr, "Unexpected command %d\n", type); } /* end inner switch */ /* also frees the nodes */ librdf_free_statement(partial_statement); break; case CMD_SOURCES: arc=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[0]); if(librdf_heuristic_is_blank_node(argv[1])) target=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[1])); else if(librdf_heuristic_object_is_literal(argv[1])) target=librdf_new_node_from_literal(world, (const unsigned char *)argv[1], NULL, 0); else target=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[1]); iterator=librdf_model_get_sources(model, arc, target); if(!iterator) { fprintf(stderr, "%s: Failed to get sources\n", program); break; } print_nodes(stdout, iterator); librdf_free_node(arc); librdf_free_node(target); break; case CMD_ARCS: if(!iterator) { if(librdf_heuristic_is_blank_node(argv[0])) source=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[0])); else source=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[0]); if(librdf_heuristic_is_blank_node(argv[1])) target=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[1])); else if(librdf_heuristic_object_is_literal(argv[1])) target=librdf_new_node_from_literal(world, (const unsigned char *)argv[1], NULL, 0); else target=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[1]); iterator=librdf_model_get_arcs(model, source, target); if(!iterator) { fprintf(stderr, "Failed to get arcs\n"); break; } } print_nodes(stdout, iterator); librdf_free_node(source); librdf_free_node(target); break; case CMD_TARGETS: if(!iterator) { if(librdf_heuristic_is_blank_node(argv[0])) source=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[0])); else source=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[0]); arc=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[1]); iterator=librdf_model_get_targets(model, source, arc); if(!iterator) { fprintf(stderr, "%s: Failed to get targets\n", program); break; } } print_nodes(stdout, iterator); librdf_free_node(source); librdf_free_node(arc); break; case CMD_SOURCE: arc=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[0]); if(librdf_heuristic_is_blank_node(argv[1])) target=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[1])); else if(librdf_heuristic_object_is_literal(argv[1])) target=librdf_new_node_from_literal(world, (const unsigned char *)argv[1], NULL, 0); else target=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[1]); node=librdf_model_get_source(model, arc, target); if(!node) { fprintf(stderr, "%s: Failed to get source\n", program); librdf_free_node(arc); librdf_free_node(target); break; } print_node(stdout, node); librdf_free_node(arc); librdf_free_node(target); break; case CMD_ARC: if(!node) { if(librdf_heuristic_is_blank_node(argv[0])) source=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[0])); else source=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[0]); if(librdf_heuristic_is_blank_node(argv[1])) target=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[1])); else if(librdf_heuristic_object_is_literal(argv[1])) target=librdf_new_node_from_literal(world, (const unsigned char *)argv[1], NULL, 0); else target=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[1]); node=librdf_model_get_arc(model, source, target); if(!node) { fprintf(stderr, "Failed to get arc\n"); librdf_free_node(source); librdf_free_node(target); break; } } print_node(stdout, node); librdf_free_node(source); librdf_free_node(target); break; case CMD_TARGET: if(!node) { if(librdf_heuristic_is_blank_node(argv[0])) source=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[0])); else source=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[0]); arc=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[1]); node=librdf_model_get_target(model, source, arc); if(!node) { fprintf(stderr, "%s: Failed to get target\n", program); librdf_free_node(source); librdf_free_node(arc); break; } } print_node(stdout, node); librdf_free_node(source); librdf_free_node(arc); break; case CMD_ARCS_IN: case CMD_ARCS_OUT: if(librdf_heuristic_is_blank_node(argv[0])) source=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[0])); else source=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[0]); iterator=(type == CMD_ARCS_IN) ? librdf_model_get_arcs_in(model, source) : librdf_model_get_arcs_out(model, source); if(!iterator) { fprintf(stderr, "%s: Failed to get arcs in/out\n", program); librdf_free_node(source); break; } count=0; while(!librdf_iterator_end(iterator)) { context_node=(librdf_node*)librdf_iterator_get_context(iterator); node=(librdf_node*)librdf_iterator_get_object(iterator); if(!node) { fprintf(stderr, "%s: librdf_iterator_get_next returned NULL\n", program); break; } fputs("Matched arc: ", stdout); librdf_node_print(node, stdout); if(context_node) { fputs(" with context ", stdout); librdf_node_print(context_node, stdout); } fputc('\n', stdout); librdf_free_node(node); count++; librdf_iterator_next(iterator); } librdf_free_iterator(iterator); if(verbosity) fprintf(stderr, "%s: matching arcs: %d\n", program, count); librdf_free_node(source); break; case CMD_HAS_ARC_IN: case CMD_HAS_ARC_OUT: if(librdf_heuristic_is_blank_node(argv[0])) source=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[0])); else source=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[0]); arc=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[1]); result=(type == CMD_HAS_ARC_IN) ? librdf_model_has_arc_in(model, arc, source) : librdf_model_has_arc_out(model, source, arc); if(verbosity) { if(result) fprintf(stderr, "%s: the graph contains the arc\n", program); else fprintf(stderr, "%s: the graph does not contain the arc\n", program); } rc = !result; librdf_free_node(source); librdf_free_node(arc); break; case CMD_REMOVE_CONTEXT: if(librdf_heuristic_is_blank_node(argv[0])) context_node=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(argv[0])); else context_node=librdf_new_node_from_uri_string(world, (const unsigned char *)argv[0]); rc=librdf_model_context_remove_statements(model, context_node); librdf_free_node(context_node); if(verbosity) { if(rc) fprintf(stderr, "%s: failed to remove context triples from the graph\n", program); else fprintf(stderr, "%s: removed context triples from the graph\n", program); } break; case CMD_CONTEXTS: iterator=librdf_model_get_contexts(model); if(!iterator) { fprintf(stderr, "%s: Failed to get contexts\n", program); break; } count=0; while(!librdf_iterator_end(iterator)) { node=(librdf_node*)librdf_iterator_get_object(iterator); if(!node) { fprintf(stderr, "%s: librdf_iterator_get_next returned NULL\n", program); break; } fputs("Context: ", stdout); librdf_node_print(node, stdout); fputc('\n', stdout); count++; librdf_iterator_next(iterator); } librdf_free_iterator(iterator); if(verbosity) fprintf(stderr, "%s: contexts: %d\n", program, count); break; case CMD_SIZE: count=librdf_model_size(model); if(count >= 0) fprintf(stdout, "%s: graph has %d triples\n", program, count); else fprintf(stdout, "%s: graph has unknown number of triples\n", program); break; default: fprintf(stderr, "%s: Unknown command %d\n", program, type); return(1); } if(query) librdf_free_query(query); if(free_uri_string) raptor_free_memory(uri_string); if(output_model) { if(librdf_serializer_serialize_model_to_file_handle(output_serializer, stdout, NULL, output_model)) { fprintf(stderr, "%s: Failed to serialize output model\n", program); }; librdf_free_serializer(output_serializer); librdf_free_model(output_model); librdf_free_storage(output_storage); } librdf_free_hash(options); if(transactions) librdf_model_transaction_commit(model); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return(rc); } redland-1.0.17/utils/fix-groff-xhtml0000755000175000017500000000402011164034065014235 00000000000000#!/usr/bin/perl # # Format XHTML generated by groff -Thtml (via tidy) for websites # # Usage: groff -Thtml -P-l something.man | tidy -asxml ... | fix-groff-xhtml OUTPUT-FILE # # (C) Copyright 2003-2006 Dave Beckett # use strict; use File::Basename; my $progname=basename $0; my $raptor_title="Raptor RDF Parser Toolkit"; my $redland_title="Redland RDF Application Framework"; my $rasqal_title="Rasqal RDF Query Library"; die "USAGE: $progname OUTPUT-FILE\n" if @ARGV < 1; my $doc_title; my($file)=@ARGV; open(OUT, ">$file") or die "$progname: Cannot create $file - $!\n"; open(IN, "-"); while() { s%libraptor%$raptor_title - Raptor API%; s%

libraptor

%

$raptor_title - Raptor API

%; s%rapper%$raptor_title - Raptor RDF parser utility%; s%

rapper

%

$raptor_title - Raptor RDF parser utility

%; s%rdfproc%$redland_title - Redland RDF processor utility%; s%

rdfproc

%

$redland_title - Redland RDF processor utility

%; s%librasqal%$rasqal_title - Rasqal API%; s%

librasqal

%

$rasqal_title - Rasqal API

%; s%roqet%$rasqal_title - Rasqal RDF parser utility%; s%

roqet

%

$rasqal_title - Rasqal RDF parser utility

%; next if /^%%; # This is not xhtml s% cols="\d+" % %; s%(name|id)="([^"]+)"%my($at,$val)=($1,$2); $val =~ s/ /_/g; qq{$at="$val"};%eg; s%(Dave Beckett|Institute for Learning and Research Technology .ILRT.|University of Bristol) (?:- |)(http://[^<]+)%$1%; my $year=1900+(localtime)[5]; print OUT <<"EOT" if m%^%;

Copyright 2002-$year Dave Beckett
2002-$year University of Bristol

EOT print OUT; } close(IN); close(OUT); redland-1.0.17/utils/redland-virtuoso-test.c0000644000175000017500000006376111611164221015724 00000000000000/* -*- Mode: c; c-basic-offset: 2 -*- * * redland-virtuoso-test.c - Test program to showcase the virtuoso storage * * Copyright (C) 2008, Openlink Software, http://www.openlinksw.com/ * * This package is Free Software and part of Redland http://librdf.org/ * * It is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version * 2. GNU General Public License (GPL) V2 or any newer version * 3. Apache License, V2.0 or any newer version * * You may not use this file except in compliance with at least one of * the above three licenses. * * See LICENSE.html or LICENSE.txt at the top of this package for the * complete terms and further detail along with the license texts for * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. * */ /* * This program is an example of how to use the 'virtuoso' engine in Redland * to connect to the Virtuoso QUAD store. * * To run this program you need to have installed Virtuoso (5.0.8 or later) * on your system and configured an ODBC DSN to connect to your Virtuoso * database. * * There are several ways to pass connection information to this program: * * a) Default ODBC connection to DSN=Local Virtuoso * * ./redland-virtuoso-test * * b) Using command line parameters: * * ./redland-virtuoso-test "dsn='MyVirt',user='demo',password='demo'" * * c) Using environment variable: * * VIRTUOSO_STORAGE_OPTIONS="dsn='Another DSN',user='myuid',password='mypwd'" * * ./redland-virtuoso-test * * * You can learn more about Virtuoso from: * * http://virtuoso.openlinksw.com/ * * and you can download the open source release of Virtuoso from: * * http://sourceforge.net/projects/virtuoso * */ #define DEFAULT_STORAGE_OPTIONS "dsn='Local Virtuoso',user='dba',password='dba'" #define DEFAULT_CONTEXT "http://red" #define DEFAULT_IDENTIFIER "http://red" #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 #include #endif #include #include #include #include #include #include #include #include int add_triple(librdf_world *world, librdf_node *context, librdf_model* model, const char *s, const char *p, const char *o); int add_triple_typed(librdf_world *world, librdf_node *context, librdf_model* model, const char *s, const char *p, const char *o); int print_query_results(librdf_world* world, librdf_model* model, librdf_query_results *results); int PASSED=0; int FAILED=0; #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #define FORMAT_ATTR(string_index, first_to_check_index) \ __attribute__((__format__(__printf__, string_index, first_to_check_index))) #else #define FORMAT_ATTR(string_index, first_to_check_index) #endif /* make GCC happier by having 'printf' format attribute in prototype */ static void endTest(int OK, const char *message, ...) FORMAT_ATTR(2, 3); static void startTest(int testID, const char *message, ...) FORMAT_ATTR(2, 3); static void endTest(int OK, const char *message, ...) { va_list arguments; va_start(arguments, message); if(OK) { fprintf(stderr, "**PASSED**:"); PASSED++; } else { fprintf(stderr, "**FAILED**:"); FAILED++; } vfprintf(stderr, message, arguments); va_end(arguments); } static void startTest(int testID, const char *message, ...) { va_list arguments; va_start(arguments, message); fprintf(stderr, "%3d:", testID); vfprintf(stderr, message, arguments); va_end(arguments); } static void getTotal(void) { fprintf(stderr, "=============================================\n"); fprintf(stderr, "PASSED:%3d FAILED:%3d\n\n", PASSED, FAILED); } static int log_handler(void *user_data, librdf_log_message *message) { /* int code=message->code; */ /* The error code */ raptor_locator *locator=(raptor_locator*)(message->locator); /* Do not handle messages below warning*/ if(message->level < LIBRDF_LOG_WARN) return 0; if(message->level == LIBRDF_LOG_WARN) fprintf(stderr, ": Warning - "); else fprintf(stderr, ": Error - "); if(locator) { /* && message->facility == LIBRDF_FROM_PARSER) */ raptor_locator_print(locator, stderr); fputc(':', stderr); fputc(' ', stderr); } fputs(message->message, stderr); fputc('\n', stderr); if(message->level >= LIBRDF_LOG_FATAL) exit(1); /* Handled */ return 1; } static void print_nodes(FILE* fh, librdf_iterator* iterator) { int count; librdf_node* context_node; librdf_node* node; /* (Common code) Print out nodes */ count=0; while(!librdf_iterator_end(iterator)) { context_node=(librdf_node*)librdf_iterator_get_context(iterator); node=(librdf_node*)librdf_iterator_get_object(iterator); if(!node) { fprintf(stderr, ": librdf_iterator_get_object returned NULL\n"); break; } fputs("Matched node: ", fh); librdf_node_print(node, fh); if(context_node) { fputs(" with context ", fh); librdf_node_print(context_node, fh); } fputc('\n', fh); count++; librdf_iterator_next(iterator); } librdf_free_iterator(iterator); fprintf(stderr, ": matching nodes: %d\n", count); } static void print_node(FILE* fh, librdf_node* node) { if(node) { fputs("Matched node: ", fh); librdf_node_print(node, fh); fputc('\n', fh); } } int add_triple(librdf_world *world, librdf_node *context, librdf_model* model, const char *s, const char *p, const char *o) { librdf_node *subject, *predicate, *object; librdf_statement* statement=NULL; int rc; if(librdf_heuristic_is_blank_node(s)) subject=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(s)); else subject=librdf_new_node_from_uri_string(world, (const unsigned char *)s); predicate=librdf_new_node_from_uri_string(world, (const unsigned char *)p); if(librdf_heuristic_is_blank_node(o)) object=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(o)); else object=librdf_new_node_from_uri_string(world, (const unsigned char *)o); statement=librdf_new_statement(world); librdf_statement_set_subject(statement, subject); librdf_statement_set_predicate(statement, predicate); librdf_statement_set_object(statement, object); rc=librdf_model_context_add_statement(model, context, statement); librdf_free_statement(statement); return rc; } int add_triple_typed(librdf_world *world, librdf_node *context, librdf_model* model, const char *s, const char *p, const char *o) { librdf_node *subject, *predicate, *object; librdf_statement* statement=NULL; int rc; if(librdf_heuristic_is_blank_node(s)) subject=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(s)); else subject=librdf_new_node_from_uri_string(world, (const unsigned char *)s); predicate=librdf_new_node_from_uri_string(world, (const unsigned char *)p); if(librdf_heuristic_is_blank_node(o)) object=librdf_new_node_from_blank_identifier(world, (const unsigned char *)librdf_heuristic_get_blank_node(o)); else object=librdf_new_node_from_literal(world, (const unsigned char *)o, NULL, 0); statement=librdf_new_statement(world); librdf_statement_set_subject(statement, subject); librdf_statement_set_predicate(statement, predicate); librdf_statement_set_object(statement, object); rc=librdf_model_context_add_statement(model, context, statement); librdf_free_statement(statement); return rc; } int print_query_results(librdf_world* world, librdf_model* model, librdf_query_results *results) { int i; char *name; librdf_stream* stream; librdf_serializer* serializer; const char *query_graph_serializer_syntax_name="rdfxml"; if(librdf_query_results_is_bindings(results)) { fprintf(stdout, ": Query returned bindings results:\n"); while(!librdf_query_results_finished(results)) { fputs("result: [", stdout); for(i=0; i0) fputs(", ", stdout); fprintf(stdout, "%s=", name); if(value) { librdf_node_print(value, stdout); librdf_free_node(value); } else fputs("NULL", stdout); } fputs("]\n", stdout); librdf_query_results_next(results); } fprintf(stdout, ": Query returned %d results\n", librdf_query_results_get_count(results)); } else if(librdf_query_results_is_boolean(results)) { fprintf(stdout, ": Query returned boolean result: %s\n", librdf_query_results_get_boolean(results) ? "true" : "false"); } else if(librdf_query_results_is_graph(results)) { librdf_storage* tmp_storage; librdf_model* tmp_model; tmp_storage=librdf_new_storage(world, NULL, NULL, NULL); tmp_model=librdf_new_model(world, tmp_storage, NULL); fprintf(stdout, ": Query returned graph result:\n"); stream=librdf_query_results_as_stream(results); if(!stream) { fprintf(stderr, ": Failed to get query results graph\n"); return -1; } librdf_model_add_statements(tmp_model, stream); librdf_free_stream(stream); fprintf(stdout, ": Total %d triples\n", librdf_model_size(model)); serializer=librdf_new_serializer(world, query_graph_serializer_syntax_name, NULL, NULL); if(!serializer) { fprintf(stderr, ": Failed to create serializer type %s\n", query_graph_serializer_syntax_name); return -1; } librdf_serializer_serialize_model_to_file_handle(serializer, stdout, NULL, tmp_model); librdf_free_serializer(serializer); librdf_free_model(tmp_model); librdf_free_storage(tmp_storage); } else { fprintf(stdout, ": Query returned unknown result format\n"); return -1; } return 0; } int main(int argc, char *argv[]) { librdf_world* world; librdf_storage *storage; librdf_model* model; librdf_node *node; librdf_node *subject, *predicate, *object; librdf_node* context_node=NULL; librdf_stream* stream; librdf_iterator* iterator; librdf_uri *base_uri=NULL; librdf_query *query; librdf_query_results *results; librdf_hash *options; int count; int rc; int transactions=0; const char* storage_name; const char* storage_options; const char* context; const char* identifier; const char* results_format; librdf_statement* statement=NULL; char* query_cmd=NULL; char* s; /* * Initialize */ storage_name="virtuoso"; results_format="xml"; context=DEFAULT_CONTEXT; identifier=DEFAULT_IDENTIFIER; /* * Get connection options */ if(argc == 2 && argv[1][0] != '\0') storage_options=argv[1]; else if((s=getenv ("VIRTUOSO_STORAGE_OPTIONS")) != NULL) storage_options=s; else storage_options=DEFAULT_STORAGE_OPTIONS; world=librdf_new_world(); librdf_world_set_logger(world, world, log_handler); librdf_world_open(world); options=librdf_new_hash(world, NULL); librdf_hash_open(options, NULL, 0, 1, 1, NULL); librdf_hash_put_strings(options, "contexts", "yes"); transactions=1; librdf_hash_from_string(options, storage_options); storage=librdf_new_storage_with_options(world, storage_name, identifier, options); if(!storage) { fprintf(stderr, ": Failed to open %s storage '%s'\n", storage_name, identifier); return(1); } model=librdf_new_model(world, storage, NULL); if(!model) { fprintf(stderr, ": Failed to create model\n"); return(1); } if(transactions) librdf_model_transaction_start(model); /* Do this or gcc moans */ stream=NULL; iterator=NULL; subject=NULL; predicate=NULL; object=NULL; node=NULL; query=NULL; results=NULL; context_node=librdf_new_node_from_uri_string(world, (const unsigned char *)context); /**** Test 1 *******/ startTest(1, " Remove all triples in <%s> context\n", context); { rc=librdf_model_context_remove_statements(model, context_node); if(rc) endTest(0, " failed to remove context triples from the graph\n"); else endTest(1, " removed context triples from the graph\n"); } /**** Test 2 *******/ startTest(2, " Add triples to <%s> context\n", context); { rc=0; rc |= add_triple(world, context_node, model, "aa", "bb", "cc"); rc |= add_triple(world, context_node, model, "aa", "bb1", "cc"); rc |= add_triple(world, context_node, model, "aa", "a2", "_:cc"); rc |= add_triple_typed(world, context_node, model, "aa", "a2", "cc"); rc |= add_triple_typed(world, context_node, model, "mm", "nn", "Some long literal with language@en"); rc |= add_triple_typed(world, context_node, model, "oo", "pp", "12345^^"); if(rc) endTest(0, " failed add triple\n"); else endTest(1, " add triple to context\n"); } /**** Test 3 *******/ startTest(3, " Print all triples in <%s> context\n", context); { raptor_iostream* iostr = raptor_new_iostream_to_file_handle(librdf_world_get_raptor(world), stdout); librdf_model_write(model, iostr); raptor_free_iostream(iostr); endTest(1, "\n"); } /***** Test 4 *****/ startTest(4, " Count of triples in <%s> context\n", context); { count=librdf_model_size(model); if(count >= 0) endTest(1, " graph has %d triples\n", count); else endTest(0, " graph has unknown number of triples\n"); } /***** Test 5 *****/ startTest(5, " Exec: ARC aa bb \n"); { subject=librdf_new_node_from_uri_string(world, (const unsigned char*)"aa"); predicate=librdf_new_node_from_uri_string(world, (const unsigned char*)"bb"); node=librdf_model_get_target(model, subject, predicate); librdf_free_node(subject); librdf_free_node(predicate); if(!node) { endTest(0, " Failed to get arc\n"); } else { print_node(stdout, node); librdf_free_node(node); endTest(1, "\n"); } } /***** Test 6 *****/ startTest(6, " Exec: ARCS aa cc \n"); { subject=librdf_new_node_from_uri_string(world, (const unsigned char*)"aa"); object=librdf_new_node_from_uri_string(world, (const unsigned char*)"cc"); iterator=librdf_model_get_arcs(model, subject, object); librdf_free_node(subject); librdf_free_node(object); if(!iterator) { endTest(0, " Failed to get arcs\n"); } else { print_nodes(stdout, iterator); endTest(1, "\n"); } } /***** Test 7 *****/ startTest(7, " Exec: ARCS-IN cc \n"); { object=librdf_new_node_from_uri_string(world, (const unsigned char*)"cc"); iterator=librdf_model_get_arcs_in(model, object); librdf_free_node(object); if(!iterator) { endTest(0, " Failed to get arcs in\n"); } else { int ok=1; count=0; while(!librdf_iterator_end(iterator)) { context_node=(librdf_node*)librdf_iterator_get_context(iterator); node=(librdf_node*)librdf_iterator_get_object(iterator); /*returns SHARED pointer */ if(!node) { ok=0; endTest(ok, " librdf_iterator_get_next returned NULL\n"); break; } fputs("Matched arc: ", stdout); librdf_node_print(node, stdout); if(context_node) { fputs(" with context ", stdout); librdf_node_print(context_node, stdout); } fputc('\n', stdout); count++; librdf_iterator_next(iterator); } librdf_free_iterator(iterator); endTest(ok, " matching arcs: %d\n", count); } } /***** Test 8 *****/ startTest(8, " Exec: ARCS-OUT aa \n"); { subject=librdf_new_node_from_uri_string(world, (const unsigned char*)"aa"); iterator=librdf_model_get_arcs_out(model, subject); librdf_free_node(subject); if(!iterator) endTest(0, " Failed to get arcs out\n"); else { int ok=1; count=0; while(!librdf_iterator_end(iterator)) { context_node=(librdf_node*)librdf_iterator_get_context(iterator); node=(librdf_node*)librdf_iterator_get_object(iterator); if(!node) { ok=0; endTest(ok, " librdf_iterator_get_next returned NULL\n"); break; } fputs("Matched arc: ", stdout); librdf_node_print(node, stdout); if(context_node) { fputs(" with context ", stdout); librdf_node_print(context_node, stdout); } fputc('\n', stdout); count++; librdf_iterator_next(iterator); } librdf_free_iterator(iterator); endTest(ok, " matching arcs: %d\n", count); } } /***** Test 9 *****/ startTest(9, " Exec: CONTAINS aa bb1 cc \n"); { subject=librdf_new_node_from_uri_string(world, (const unsigned char*)"aa"); predicate=librdf_new_node_from_uri_string(world, (const unsigned char*)"bb1"); object=librdf_new_node_from_uri_string(world, (const unsigned char*)"cc"); statement=librdf_new_statement(world); librdf_statement_set_subject(statement, subject); librdf_statement_set_predicate(statement, predicate); librdf_statement_set_object(statement, object); if(librdf_model_contains_statement(model, statement)) endTest(1, " the graph contains the triple\n"); else endTest(0, " the graph does not contain the triple\n"); librdf_free_statement(statement); } /***** Test 10 *****/ startTest(10, " Exec: FIND aa - - \n"); { subject=librdf_new_node_from_uri_string(world, (const unsigned char*)"aa"); statement=librdf_new_statement(world); librdf_statement_set_subject(statement, subject); stream=librdf_model_find_statements_in_context(model, statement, context_node); if(!stream) { endTest(0, " FIND returned no results (NULL stream)\n"); } else { librdf_node* ctxt_node=NULL; int ok=1; count=0; while(!librdf_stream_end(stream)) { librdf_statement *stmt=librdf_stream_get_object(stream); ctxt_node = librdf_stream_get_context2(stream); if(!stmt) { ok=0; endTest(ok, " librdf_stream_next returned NULL\n"); break; } fputs("Matched triple: ", stdout); librdf_statement_print(stmt, stdout); if(context) { fputs(" with context ", stdout); librdf_node_print(ctxt_node, stdout); } fputc('\n', stdout); count++; librdf_stream_next(stream); } librdf_free_stream(stream); endTest(ok, " matching triples: %d\n", count); } librdf_free_statement(statement); } /***** Test 11 *****/ startTest(11, " Exec: HAS-ARC-IN cc bb \n"); { predicate=librdf_new_node_from_uri_string(world, (const unsigned char*)"bb"); object=librdf_new_node_from_uri_string(world, (const unsigned char*)"cc"); if(librdf_model_has_arc_in(model, object, predicate)) endTest(1, " the graph contains the arc\n"); else endTest(0, " the graph does not contain the arc\n"); librdf_free_node(predicate); librdf_free_node(object); } /***** Test 12 *****/ startTest(12, " Exec: HAS-ARC-OUT aa bb \n"); { subject=librdf_new_node_from_uri_string(world, (const unsigned char*)"aa"); predicate=librdf_new_node_from_uri_string(world, (const unsigned char*)"bb"); if(librdf_model_has_arc_out(model, subject, predicate)) endTest(1, " the graph contains the arc\n"); else endTest(0, " the graph does not contain the arc\n"); librdf_free_node(predicate); librdf_free_node(subject); } /***** Test 13 *****/ startTest(13, " Exec: SOURCE aa cc \n"); { predicate=librdf_new_node_from_uri_string(world, (const unsigned char*)"bb"); object=librdf_new_node_from_uri_string(world, (const unsigned char*)"cc"); node=librdf_model_get_source(model, predicate, object); librdf_free_node(predicate); librdf_free_node(object); if(!node) { endTest(0, " Failed to get source\n"); } else { print_node(stdout, node); librdf_free_node(node); endTest(1, "\n"); } } /***** Test 14 *****/ startTest(14, " Exec: SOURCES bb cc \n"); { predicate=librdf_new_node_from_uri_string(world, (const unsigned char*)"bb"); object=librdf_new_node_from_uri_string(world, (const unsigned char*)"cc"); iterator=librdf_model_get_sources(model, predicate, object); librdf_free_node(predicate); librdf_free_node(object); if(!iterator) { endTest(0, " Failed to get sources\n"); } else { print_nodes(stdout, iterator); endTest(1, "\n"); } } /***** Test 15 *****/ startTest(15, " Exec: TARGET aa bb \n"); { subject=librdf_new_node_from_uri_string(world, (const unsigned char*)"aa"); predicate=librdf_new_node_from_uri_string(world, (const unsigned char*)"bb"); node=librdf_model_get_target(model, subject, predicate); librdf_free_node(subject); librdf_free_node(predicate); if(!node) { endTest(0, " Failed to get target\n"); } else { print_node(stdout, node); librdf_free_node(node); endTest(1, "\n"); } } /***** Test 16 *****/ startTest(16, " Exec: TARGETS aa bb \n"); { subject=librdf_new_node_from_uri_string(world, (const unsigned char*)"aa"); predicate=librdf_new_node_from_uri_string(world, (const unsigned char*)"bb"); iterator=librdf_model_get_targets(model, subject, predicate); librdf_free_node(subject); librdf_free_node(predicate); if(!iterator) { endTest(0, " Failed to get targets\n"); } else { print_nodes(stdout, iterator); endTest(1, "\n"); } } /***** Test 17 *****/ startTest(17, " Exec: REMOVE aa bb1 cc \n"); { subject=librdf_new_node_from_uri_string(world, (const unsigned char*)"aa"); predicate=librdf_new_node_from_uri_string(world, (const unsigned char*)"bb1"); object=librdf_new_node_from_uri_string(world, (const unsigned char*)"cc"); statement=librdf_new_statement(world); librdf_statement_set_subject(statement, subject); librdf_statement_set_predicate(statement, predicate); librdf_statement_set_object(statement, object); if(librdf_model_context_remove_statement(model, context_node, statement)) endTest(0, " failed to remove triple from the graph\n"); else endTest(1, " removed triple from the graph\n"); librdf_free_statement(statement); } /***** Test 18 *****/ query_cmd=(char *)"CONSTRUCT {?s ?p ?o} FROM WHERE {?s ?p ?o}"; startTest(18, " Exec: QUERY \"%s\" \n", query_cmd); { query=librdf_new_query(world, (char *)"vsparql", NULL, (const unsigned char *)query_cmd, NULL); if(!(results=librdf_model_query_execute(model, query))) { endTest(0, " Query of model with '%s' failed\n", query_cmd); librdf_free_query(query); query=NULL; } else { stream=librdf_query_results_as_stream(results); if(!stream) { endTest(0, " QUERY returned no results (NULL stream)\n"); } else { librdf_node* ctxt=NULL; count=0; while(!librdf_stream_end(stream)) { librdf_statement *stmt=librdf_stream_get_object(stream); /*returns SHARED pointer */ ctxt = librdf_stream_get_context2(stream); if(!stmt) { endTest(0, " librdf_stream_next returned NULL\n"); break; } fputs("Matched triple: ", stdout); librdf_statement_print(stmt, stdout); if(ctxt) { fputs(" with context ", stdout); librdf_node_print(ctxt, stdout); } fputc('\n', stdout); count++; librdf_stream_next(stream); } librdf_free_stream(stream); endTest(1, " matching triples: %d\n", count); librdf_free_query_results(results); } } librdf_free_query(query); } /***** Test 19 *****/ query_cmd=(char *)"SELECT * WHERE {graph { ?s ?p ?o }}"; startTest(19, " Exec1: QUERY_AS_BINDINGS \"%s\" \n", query_cmd); { query=librdf_new_query(world, (char *)"vsparql", NULL, (const unsigned char *)query_cmd, NULL); if(!(results=librdf_model_query_execute(model, query))) { endTest(0, " Query of model with '%s' failed\n", query_cmd); librdf_free_query(query); query=NULL; } else { raptor_iostream *iostr; librdf_query_results_formatter *formatter; fprintf(stderr, "**: Formatting query result as '%s':\n", results_format); iostr = raptor_new_iostream_to_file_handle(librdf_world_get_raptor(world), stdout); formatter = librdf_new_query_results_formatter2(results, results_format, NULL /* mime type */, NULL /* format_uri */); base_uri = librdf_new_uri(world, (const unsigned char*)"http://example.org/"); librdf_query_results_formatter_write(iostr, formatter, results, base_uri); librdf_free_query_results_formatter(formatter); raptor_free_iostream(iostr); librdf_free_uri(base_uri); endTest(1, "\n"); librdf_free_query_results(results); } librdf_free_query(query); } /***** Test 20 *****/ query_cmd=(char *)"SELECT * WHERE {graph { ?s ?p ?o }}"; startTest(20, " Exec2: QUERY_AS_BINDINGS \"%s\" \n", query_cmd); { query=librdf_new_query(world, (char *)"vsparql", NULL, (const unsigned char *)query_cmd, NULL); if(!(results=librdf_model_query_execute(model, query))) { endTest(0, " Query of model with '%s' failed\n", query_cmd); librdf_free_query(query); query=NULL; } else { if(print_query_results(world, model, results)) endTest(0, "\n"); else endTest(1, "\n"); librdf_free_query_results(results); } librdf_free_query(query); } getTotal(); if(transactions) librdf_model_transaction_commit(model); librdf_free_node(context_node); librdf_free_node(context_node); librdf_free_hash(options); librdf_free_model(model); librdf_free_storage(storage); librdf_free_world(world); #ifdef LIBRDF_MEMORY_DEBUG librdf_memory_report(stderr); #endif /* keep gcc -Wall happy */ return(0); } redland-1.0.17/utils/rdfproc_getopt.h0000644000175000017500000000034011032320041014443 00000000000000/* * Public Domain getopt header * */ #ifndef RDFPROC_GETOPT_H #define RDFPROC_GETOPT_H int getopt(int argc, char * const argv[], const char *optstring); extern char *optarg; extern int optind, opterr, optopt; #endif redland-1.0.17/aclocal.m40000644000175000017500000136644012257575713012026 00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Portability macros for glibc argz. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # Written by Gary V. Vaughan # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 argz.m4 AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for `error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test "$lt_cv_sys_argz_works" = yes], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [ARGZ_H=argz.h AC_LIBOBJ([argz])])]) AC_SUBST([ARGZ_H]) ]) # Prerequisites of lib/argz.c. AC_DEFUN([gl_PREREQ_ARGZ], [:]) dnl -*- mode: autoconf -*- # serial 1 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first dnl check for tools we added during development AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([gtk-doc], AS_HELP_STRING([--enable-gtk-doc], [use gtk-doc to build documentation [[default=no]]]),, [enable_gtk_doc=no]) if test x$enable_gtk_doc = xyes; then ifelse([$1],[], [PKG_CHECK_EXISTS([gtk-doc],, AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], [PKG_CHECK_EXISTS([gtk-doc >= $1],, AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) dnl don't check for glib if we build glib if test "x$PACKAGE_NAME" != "xglib"; then dnl don't fail if someone does not have glib PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,) fi fi AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) dnl enable/disable output formats AC_ARG_ENABLE([gtk-doc-html], AS_HELP_STRING([--enable-gtk-doc-html], [build documentation in html format [[default=yes]]]),, [enable_gtk_doc_html=yes]) AC_ARG_ENABLE([gtk-doc-pdf], AS_HELP_STRING([--enable-gtk-doc-pdf], [build documentation in pdf format [[default=no]]]),, [enable_gtk_doc_pdf=no]) if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) ]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- # # Copyright (C) 1999-2006, 2007, 2008, 2011 Free Software Foundation, Inc. # Written by Thomas Tanner, 1999 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 18 LTDL_INIT # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) # ------------------------------------------ # DIRECTORY contains the libltdl sources. It is okay to call this # function multiple times, as long as the same DIRECTORY is always given. AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) _$0($*) ])# LT_CONFIG_LTDL_DIR # We break this out into a separate macro, so that we can call it safely # internally without being caught accidentally by the sed scan in libtoolize. m4_defun([_LT_CONFIG_LTDL_DIR], [dnl remove trailing slashes m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) m4_case(_LTDL_DIR, [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.' m4_if(_ARG_DIR, [.], [], [m4_define([_LTDL_DIR], _ARG_DIR) _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], [m4_if(_ARG_DIR, _LTDL_DIR, [], [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])]) m4_popdef([_ARG_DIR]) ])# _LT_CONFIG_LTDL_DIR # Initialise: m4_define([_LTDL_DIR], []) # _LT_BUILD_PREFIX # ---------------- # If Autoconf is new enough, expand to `${top_build_prefix}', otherwise # to `${top_builddir}/'. m4_define([_LT_BUILD_PREFIX], [m4_ifdef([AC_AUTOCONF_VERSION], [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], [${top_build_prefix}], [${top_builddir}/])], [${top_build_prefix}])], [${top_builddir}/])[]dnl ]) # LTDL_CONVENIENCE # ---------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with # '${top_build_prefix}' if available, otherwise with '${top_builddir}/', # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_build_prefix, top_builddir, and top_srcdir appropriately # in your Makefiles. AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_CONVENIENCE # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) # _LTDL_CONVENIENCE # ----------------- # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). m4_defun([_LTDL_CONVENIENCE], [case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" AC_SUBST([INCLTDL]) ])# _LTDL_CONVENIENCE # LTDL_INSTALLABLE # ---------------- # sets LIBLTDL to the link flags for the libltdl installable library # and LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl # is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if # available, otherwise with '${top_builddir}/', and LTDLINCL will be # prefixed with '${top_srcdir}/' (note the single quotes!). If your # package is not flat and you're not using automake, define top_build_prefix, # top_builddir, and top_srcdir appropriately in your Makefiles. # In the future, this macro may have to be called after LT_INIT. AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_INSTALLABLE # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) # _LTDL_INSTALLABLE # ----------------- # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). m4_defun([_LTDL_INSTALLABLE], [if test -f $prefix/lib/libltdl.la; then lt_save_LDFLAGS="$LDFLAGS" LDFLAGS="-L$prefix/lib $LDFLAGS" AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) LDFLAGS="$lt_save_LDFLAGS" if test x"${lt_lib_ltdl-no}" = xyes; then if test x"$enable_ltdl_install" != xyes; then # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install']) enable_ltdl_install=no fi elif test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) fi fi # If configure.ac declared an installable ltdl, and the user didn't override # with --disable-ltdl-install, we will install the shipped libltdl. case $enable_ltdl_install in no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLDEPS= LTDLINCL= ;; *) enable_ltdl_install=yes ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" ;; esac AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" AC_SUBST([INCLTDL]) ])# LTDL_INSTALLABLE # _LTDL_MODE_DISPATCH # ------------------- m4_define([_LTDL_MODE_DISPATCH], [dnl If _LTDL_DIR is `.', then we are configuring libltdl itself: m4_if(_LTDL_DIR, [], [], dnl if _LTDL_MODE was not set already, the default value is `subproject': [m4_case(m4_default(_LTDL_MODE, [subproject]), [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])], [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])], [recursive], [], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl dnl Be careful not to expand twice: m4_define([$0], []) ])# _LTDL_MODE_DISPATCH # _LT_LIBOBJ(MODULE_NAME) # ----------------------- # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead # of into LIBOBJS. AC_DEFUN([_LT_LIBOBJ], [ m4_pattern_allow([^_LT_LIBOBJS$]) _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" ])# _LT_LIBOBJS # LTDL_INIT([OPTIONS]) # -------------------- # Clients of libltdl can use this macro to allow the installer to # choose between a shipped copy of the ltdl sources or a preinstalled # version of the library. If the shipped ltdl sources are not in a # subdirectory named libltdl, the directory name must be given by # LT_CONFIG_LTDL_DIR. AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) dnl We need to keep our own list of libobjs separate from our parent project, dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while dnl we look for our own LIBOBJs. m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) m4_pushdef([AC_LIBSOURCES]) dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: m4_if(_LTDL_MODE, [], [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) AC_ARG_WITH([included_ltdl], [AS_HELP_STRING([--with-included-ltdl], [use the GNU ltdl sources included here])]) if test "x$with_included_ltdl" != xyes; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_DECL([lt_dlinterface_register], [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], [with_included_ltdl=no], [with_included_ltdl=yes])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT #include ])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT] ) fi dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE dnl was called yet, then for old times' sake, we assume libltdl is in an dnl eponymous directory: AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) AC_ARG_WITH([ltdl_include], [AS_HELP_STRING([--with-ltdl-include=DIR], [use the ltdl headers installed in DIR])]) if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include']) fi else with_ltdl_include=no fi AC_ARG_WITH([ltdl_lib], [AS_HELP_STRING([--with-ltdl-lib=DIR], [use the libltdl.la installed in DIR])]) if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib']) fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) m4_case(m4_default(_LTDL_TYPE, [convenience]), [convenience], [_LTDL_CONVENIENCE], [installable], [_LTDL_INSTALLABLE], [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together]) ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL="-I$with_ltdl_include" ;; esac INCLTDL="$LTDLINCL" # Report our decision... AC_MSG_CHECKING([where to find libltdl headers]) AC_MSG_RESULT([$LTDLINCL]) AC_MSG_CHECKING([where to find libltdl library]) AC_MSG_RESULT([$LIBLTDL]) _LTDL_SETUP dnl restore autoconf definition. m4_popdef([AC_LIBOBJ]) m4_popdef([AC_LIBSOURCES]) AC_CONFIG_COMMANDS_PRE([ _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) ]) # Only expand once: m4_define([LTDL_INIT]) ])# LTDL_INIT # Old names: AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIB_LTDL], []) dnl AC_DEFUN([AC_WITH_LTDL], []) dnl AC_DEFUN([LT_WITH_LTDL], []) # _LTDL_SETUP # ----------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. This is a public # interface mainly for the benefit of libltdl's own configure.ac, most # other users should call LTDL_INIT instead. AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_SYS_MODULE_EXT])dnl AC_REQUIRE([LT_SYS_MODULE_PATH])dnl AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl AC_REQUIRE([LT_LIB_DLLOAD])dnl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl AC_REQUIRE([gl_FUNC_ARGZ])dnl m4_require([_LT_CHECK_OBJDIR])dnl m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL dnl _LTDL_MODE specific code must be called at least once: _LTDL_MODE_DISPATCH # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). AC_CONFIG_COMMANDS_PRE([dnl m4_pattern_allow([^LT_CONFIG_H$])dnl m4_ifset([AH_HEADER], [LT_CONFIG_H=AH_HEADER], [m4_ifset([AC_LIST_HEADERS], [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`], [])])]) AC_SUBST([LT_CONFIG_H]) AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) name= eval "lt_libprefix=\"$libname_spec\"" m4_pattern_allow([LT_LIBPREFIX])dnl AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) name=ltdl eval "LTDLOPEN=\"$libname_spec\"" AC_SUBST([LTDLOPEN]) ])# _LTDL_SETUP # _LT_ENABLE_INSTALL # ------------------ m4_define([_LT_ENABLE_INSTALL], [AC_ARG_ENABLE([ltdl-install], [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac m4_ifdef([AM_CONDITIONAL], [AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)]) ])# _LT_ENABLE_INSTALL # LT_SYS_DLOPEN_DEPLIBS # --------------------- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd* | netbsdelf*-gnu) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test "$lt_cv_sys_dlopen_deplibs" != yes; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ])# LT_SYS_DLOPEN_DEPLIBS # Old name: AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) # LT_SYS_MODULE_EXT # ----------------- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_MODULE_EXT])dnl AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for runtime loadable modules, say, ".so".]) fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_SHARED_EXT])dnl AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], [Define to the shared library suffix, say, ".dylib".]) fi ])# LT_SYS_MODULE_EXT # Old name: AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) # LT_SYS_MODULE_PATH # ------------------ AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) if test -n "$lt_cv_module_path_var"; then m4_pattern_allow([LT_MODULE_PATH_VAR])dnl AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], [Define to the name of the environment variable that determines the run-time module search path.]) fi ])# LT_SYS_MODULE_PATH # Old name: AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) # LT_SYS_DLSEARCH_PATH # -------------------- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done m4_pattern_allow([LT_DLSEARCH_PATH])dnl AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], [Define to the system default library search path.]) fi ])# LT_SYS_DLSEARCH_PATH # Old name: AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) # _LT_CHECK_DLPREOPEN # ------------------- m4_defun([_LT_CHECK_DLPREOPEN], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], [libltdl_cv_preloaded_symbols], [if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi ]) if test x"$libltdl_cv_preloaded_symbols" = xyes; then AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], [Define if libtool can extract symbol lists from object files.]) fi ])# _LT_CHECK_DLPREOPEN # LT_LIB_DLLOAD # ------------- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include #endif ]], [[dlopen(0, 0);]])], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" AC_CHECK_FUNCS([dlerror]) LIBS="$lt_save_LIBS" fi AC_SUBST([LIBADD_DLOPEN]) LIBADD_SHL_LOAD= AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld"])]) AC_SUBST([LIBADD_SHL_LOAD]) case $host_os in darwin[[1567]].*) # We only want this for pre-Mac OS X 10.4. AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform]) fi AC_SUBST([LT_DLPREOPEN]) dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) AC_LANG_POP ])# LT_LIB_DLLOAD # Old name: AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLLIB], []) # LT_SYS_SYMBOL_USCORE # -------------------- # does the compiler prefix global symbols with an underscore? AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.c >&AS_MESSAGE_LOG_FD fi rm -rf conftest* ]) sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ])# LT_SYS_SYMBOL_USCORE # Old name: AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) # LT_FUNC_DLSYM_USCORE # -------------------- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" _LT_TRY_DLOPEN_SELF( [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], [], [libltdl_cv_need_uscore=cross]) LIBS="$save_LIBS" ]) fi fi if test x"$libltdl_cv_need_uscore" = xyes; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ])# LT_FUNC_DLSYM_USCORE # Old name: AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) ]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2009, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # (`yes' being less verbose, `no' or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [ --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0')]) case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few `make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using `$V' instead of `$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) redland-1.0.17/redland-src-config.in0000644000175000017500000000622011516537653014137 00000000000000#!/bin/sh # # Copyright (C) 2002-2008 David Beckett http://www.dajobe.org/ # Copyright (C) 2002-2004 University of Bristol, UK http://www.bristol.ac.uk/ # # This package is Free Software and part of Redland http://librdf.org/ # # It is licensed under the following three licenses as alternatives: # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version # 2. GNU General Public License (GPL) V2 or any newer version # 3. Apache License, V2.0 or any newer version # # You may not use this file except in compliance with at least one of # the above three licenses. # # See LICENSE.html or LICENSE.txt at the top of this package for the # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. # # # usage() { cat<&2 fi while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --version) echo @VERSION@ exit 0 ;; --cflags) echo_cflags=yes ;; --libs) echo_libs=yes ;; --libtool-libs) echo_libtool_libs=yes ;; --help|--usage) usage 0 ;; --run) lpath=@abs_top_builddir@/src/.libs if test -d .libs; then lpath=".libs:$lpath" fi ldir=`pkg-config raptor --variable=libdir` lpath="$lpath:$ldir" ldir=`pkg-config rasqal --variable=libdir` lpath="$lpath:$ldir" if test `uname` = Darwin; then DYLD_LIBRARY_PATH=$lpath:$DYLD_LIBRARY_PATH export DYLD_LIBRARY_PATH else LD_LIBRARY_PATH=$lpath:$LD_LIBRARY_PATH export LD_LIBRARY_PATH fi shift exec ${1+"$@"} ;; --swig) echo_swig=yes ;; --version) echo @VERSION@ exit 0 ;; --version-decimal) echo @LIBRDF_VERSION_DECIMAL@ exit 0 ;; *) usage 1 1>&2 ;; esac shift done raptor_config="pkg-config raptor2" rasqal_config="pkg-config rasqal" if test "$echo_cflags" = "yes"; then echo -I@abs_top_srcdir@/src `$rasqal_config --cflags` `$raptor_config --cflags` fi if test "$echo_libtool_libs" = "yes"; then echo @abs_top_builddir@/src/librdf.la fi if test "$echo_libs" = "yes"; then echo -L@abs_top_builddir@/src/.libs -lrdf @LIBRDF_LDFLAGS@ @LIBRDF_EXTERNAL_LIBS@ `$rasqal_config --libs` `$raptor_config --libs` fi if test "$echo_swig" = "yes"; then echo @abs_top_builddir@/Redland.i fi redland-1.0.17/gtk-doc.make0000644000175000017500000002061312155164573012334 00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt EXTRA_DIST = \ $(HTML_IMAGES) \ $(SETUP_FILES) DOC_STAMPS=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ tmpl.stamp sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) if ENABLE_GTK_DOC if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) else all-local: endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### setup-build.stamp: -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ echo ' DOC Preparing build'; \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ done; \ fi; \ test -d $(abs_srcdir)/tmpl && \ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ chmod -R u+w $(abs_builddir)/tmpl; } \ fi @touch setup-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo ' DOC Scanning header files' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ echo " DOC Introspecting gobjects"; \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo ' DOC Rebuilding template files' @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ if test -w $(abs_srcdir) ; then \ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ fi \ fi @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo ' DOC Building XML' @-chmod -R u+w $(srcdir) @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building HTML' @rm -rf html @mkdir html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; @echo ' DOC Fixing cross-references' @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building PDF' @rm -f $(DOC_MODULE).pdf @mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ rm -rf tmpl; \ fi maintainer-clean-local: clean @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if ENABLE_GTK_DOC dist-check-gtkdoc: else dist-check-gtkdoc: @echo "*** gtk-doc must be installed and enabled in order to make dist" @false endif dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/tmpl @mkdir $(distdir)/html @-cp ./tmpl/*.sgml $(distdir)/tmpl @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs