1 Let the pkg-config stuff be overridden by variables
3 --- a/configure.ac 2013-03-29 23:57:59.782772145 +0100
4 +++ b/configure.ac 2013-03-30 00:09:41.823766113 +0100
6 RAPTOR_MIN_VERSION=2.0.7
9 -AC_CHECK_PROGS(PKG_CONFIG, pkg-config)
10 -if test "X$PKG_CONFIG" = X; then
11 - AC_MSG_ERROR(pkg-config not found. configuring raptor V2 requires it. Get it from http://pkg-config.freedesktop.org/)
15 -AC_MSG_CHECKING(for raptor)
16 -if $PKG_CONFIG raptor2 --exists; then
17 +PKG_CHECK_MODULES([RAPTOR2],[raptor2 >= $RAPTOR_MIN_VERSION],[
18 RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
19 - AC_MSG_RESULT(system $RAPTOR_VERSION)
21 - if $PKG_CONFIG raptor2 --atleast-version=$RAPTOR_MIN_VERSION; then
24 - AC_MSG_ERROR(Installed raptor $RAPTOR_VERSION is too old - need $RAPTOR_MIN_VERSION)
27 - AC_MSG_RESULT(not found)
29 AC_MSG_ERROR(Raptor is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION)
32 +AC_SUBST(RAPTOR2_CFLAGS)
33 +AC_SUBST(RAPTOR2_LIBS)
35 RAPTOR_VERSION_DEC=`echo $RAPTOR_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
36 AC_SUBST(RAPTOR_VERSION_DEC)
41 -RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS `$PKG_CONFIG raptor2 --cflags`"
42 -RASQAL_EXTERNAL_LIBS="$RASQAL_EXTERNAL_LIBS `$PKG_CONFIG raptor2 --libs`"
43 +RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS $RAPTOR2_CFLAGS"
44 +RASQAL_EXTERNAL_LIBS="$RASQAL_EXTERNAL_LIBS $RAPTOR2_LIBS"
47 if test $need_regex_pcre = 1; then
48 --- a/configure 2013-03-31 00:36:31.396795267 +0100
49 +++ b/configure 2013-03-31 00:36:42.820795169 +0100
79 @@ -1554,6 +1558,10 @@
80 directories to add to pkg-config's search path
82 path overriding pkg-config's built-in search path
84 + C compiler flags for RAPTOR2, overriding pkg-config
86 + linker flags for RAPTOR2, overriding pkg-config
88 C compiler flags for GTKDOC_DEPS, overriding pkg-config
90 @@ -13818,26 +13826,35 @@
91 RAPTOR_MIN_VERSION=2.0.7
94 -for ac_prog in pkg-config
96 - # Extract the first word of "$ac_prog", so it can be a program name with args.
97 -set dummy $ac_prog; ac_word=$2
105 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
106 + if test -n "$ac_tool_prefix"; then
107 + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
108 +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
109 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
110 $as_echo_n "checking for $ac_word... " >&6; }
111 -if ${ac_cv_prog_PKG_CONFIG+:} false; then :
112 +if ${ac_cv_path_PKG_CONFIG+:} false; then :
113 $as_echo_n "(cached) " >&6
115 - if test -n "$PKG_CONFIG"; then
116 - ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
118 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
119 + case $PKG_CONFIG in
121 + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
124 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
128 test -z "$as_dir" && as_dir=.
129 for ac_exec_ext in '' $ac_executable_extensions; do
130 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
131 - ac_cv_prog_PKG_CONFIG="$ac_prog"
132 + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
133 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
136 @@ -13845,9 +13862,10 @@
144 -PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
145 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
146 if test -n "$PKG_CONFIG"; then
147 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
148 $as_echo "$PKG_CONFIG" >&6; }
149 @@ -13857,31 +13875,158 @@
153 - test -n "$PKG_CONFIG" && break
155 +if test -z "$ac_cv_path_PKG_CONFIG"; then
156 + ac_pt_PKG_CONFIG=$PKG_CONFIG
157 + # Extract the first word of "pkg-config", so it can be a program name with args.
158 +set dummy pkg-config; ac_word=$2
159 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
160 +$as_echo_n "checking for $ac_word... " >&6; }
161 +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
162 + $as_echo_n "(cached) " >&6
164 + case $ac_pt_PKG_CONFIG in
166 + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
169 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
173 + test -z "$as_dir" && as_dir=.
174 + for ac_exec_ext in '' $ac_executable_extensions; do
175 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
176 + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
177 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
184 -if test "X$PKG_CONFIG" = X; then
185 - as_fn_error $? "pkg-config not found. configuring raptor V2 requires it. Get it from http://pkg-config.freedesktop.org/" "$LINENO" 5
189 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
190 +if test -n "$ac_pt_PKG_CONFIG"; then
191 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
192 +$as_echo "$ac_pt_PKG_CONFIG" >&6; }
194 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
195 +$as_echo "no" >&6; }
198 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for raptor" >&5
199 -$as_echo_n "checking for raptor... " >&6; }
200 -if $PKG_CONFIG raptor2 --exists; then
201 - RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
202 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system $RAPTOR_VERSION" >&5
203 -$as_echo "system $RAPTOR_VERSION" >&6; }
205 - if $PKG_CONFIG raptor2 --atleast-version=$RAPTOR_MIN_VERSION; then
207 + if test "x$ac_pt_PKG_CONFIG" = x; then
210 - as_fn_error $? "Installed raptor $RAPTOR_VERSION is too old - need $RAPTOR_MIN_VERSION" "$LINENO" 5
211 + case $cross_compiling:$ac_tool_warned in
213 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
214 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
215 +ac_tool_warned=yes ;;
217 + PKG_CONFIG=$ac_pt_PKG_CONFIG
220 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
221 -$as_echo "not found" >&6; }
222 + PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
226 +if test -n "$PKG_CONFIG"; then
227 + _pkg_min_version=0.9.0
228 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
229 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
230 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
231 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
232 +$as_echo "yes" >&6; }
234 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
235 +$as_echo "no" >&6; }
242 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAPTOR2" >&5
243 +$as_echo_n "checking for RAPTOR2... " >&6; }
245 +if test -n "$RAPTOR2_CFLAGS"; then
246 + pkg_cv_RAPTOR2_CFLAGS="$RAPTOR2_CFLAGS"
247 + elif test -n "$PKG_CONFIG"; then
248 + if test -n "$PKG_CONFIG" && \
249 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"raptor2 >= \$RAPTOR_MIN_VERSION\""; } >&5
250 + ($PKG_CONFIG --exists --print-errors "raptor2 >= $RAPTOR_MIN_VERSION") 2>&5
252 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
253 + test $ac_status = 0; }; then
254 + pkg_cv_RAPTOR2_CFLAGS=`$PKG_CONFIG --cflags "raptor2 >= $RAPTOR_MIN_VERSION" 2>/dev/null`
255 + test "x$?" != "x0" && pkg_failed=yes
262 +if test -n "$RAPTOR2_LIBS"; then
263 + pkg_cv_RAPTOR2_LIBS="$RAPTOR2_LIBS"
264 + elif test -n "$PKG_CONFIG"; then
265 + if test -n "$PKG_CONFIG" && \
266 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"raptor2 >= \$RAPTOR_MIN_VERSION\""; } >&5
267 + ($PKG_CONFIG --exists --print-errors "raptor2 >= $RAPTOR_MIN_VERSION") 2>&5
269 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
270 + test $ac_status = 0; }; then
271 + pkg_cv_RAPTOR2_LIBS=`$PKG_CONFIG --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>/dev/null`
272 + test "x$?" != "x0" && pkg_failed=yes
282 +if test $pkg_failed = yes; then
283 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
284 +$as_echo "no" >&6; }
286 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
287 + _pkg_short_errors_supported=yes
289 + _pkg_short_errors_supported=no
291 + if test $_pkg_short_errors_supported = yes; then
292 + RAPTOR2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>&1`
294 + RAPTOR2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>&1`
296 + # Put the nasty error message in config.log where it belongs
297 + echo "$RAPTOR2_PKG_ERRORS" >&5
300 + as_fn_error $? "Raptor is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION" "$LINENO" 5
302 +elif test $pkg_failed = untried; then
303 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
304 +$as_echo "no" >&6; }
306 as_fn_error $? "Raptor is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION" "$LINENO" 5
309 + RAPTOR2_CFLAGS=$pkg_cv_RAPTOR2_CFLAGS
310 + RAPTOR2_LIBS=$pkg_cv_RAPTOR2_LIBS
311 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
312 +$as_echo "yes" >&6; }
314 + RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
320 RAPTOR_VERSION_DEC=`echo $RAPTOR_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
323 @@ -14883,8 +15028,8 @@
327 -RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS `$PKG_CONFIG raptor2 --cflags`"
328 -RASQAL_EXTERNAL_LIBS="$RASQAL_EXTERNAL_LIBS `$PKG_CONFIG raptor2 --libs`"
329 +RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS $RAPTOR2_CFLAGS"
330 +RASQAL_EXTERNAL_LIBS="$RASQAL_EXTERNAL_LIBS $RAPTOR2_LIBS"
333 if test $need_regex_pcre = 1; then
334 @@ -15579,126 +15724,6 @@
342 -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
343 - if test -n "$ac_tool_prefix"; then
344 - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
345 -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
346 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
347 -$as_echo_n "checking for $ac_word... " >&6; }
348 -if ${ac_cv_path_PKG_CONFIG+:} false; then :
349 - $as_echo_n "(cached) " >&6
351 - case $PKG_CONFIG in
353 - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
356 - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
360 - test -z "$as_dir" && as_dir=.
361 - for ac_exec_ext in '' $ac_executable_extensions; do
362 - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
363 - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
364 - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
374 -PKG_CONFIG=$ac_cv_path_PKG_CONFIG
375 -if test -n "$PKG_CONFIG"; then
376 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
377 -$as_echo "$PKG_CONFIG" >&6; }
379 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
380 -$as_echo "no" >&6; }
385 -if test -z "$ac_cv_path_PKG_CONFIG"; then
386 - ac_pt_PKG_CONFIG=$PKG_CONFIG
387 - # Extract the first word of "pkg-config", so it can be a program name with args.
388 -set dummy pkg-config; ac_word=$2
389 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
390 -$as_echo_n "checking for $ac_word... " >&6; }
391 -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
392 - $as_echo_n "(cached) " >&6
394 - case $ac_pt_PKG_CONFIG in
396 - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
399 - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
403 - test -z "$as_dir" && as_dir=.
404 - for ac_exec_ext in '' $ac_executable_extensions; do
405 - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
406 - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
407 - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
417 -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
418 -if test -n "$ac_pt_PKG_CONFIG"; then
419 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
420 -$as_echo "$ac_pt_PKG_CONFIG" >&6; }
422 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
423 -$as_echo "no" >&6; }
426 - if test "x$ac_pt_PKG_CONFIG" = x; then
429 - case $cross_compiling:$ac_tool_warned in
431 -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
432 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
433 -ac_tool_warned=yes ;;
435 - PKG_CONFIG=$ac_pt_PKG_CONFIG
438 - PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
442 -if test -n "$PKG_CONFIG"; then
443 - _pkg_min_version=0.9.0
444 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
445 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
446 - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
447 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
448 -$as_echo "yes" >&6; }
450 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
451 -$as_echo "no" >&6; }
458 # Extract the first word of "gtkdoc-check", so it can be a program name with args.
459 set dummy gtkdoc-check; ac_word=$2
460 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
461 --- a/utils/Makefile.am 2013-03-31 00:39:54.396793523 +0100
462 +++ b/utils/Makefile.am 2013-03-31 00:34:47.293796162 +0100
464 roqet_SOURCES += getopt.c rasqal_getopt.h
466 roqet_LDADD = $(top_builddir)/src/librasqal.la
467 -roqet_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
468 +roqet_LDFLAGS = @RAPTOR2_LIBS@
470 check_query_SOURCES = check_query.c
472 check_query_SOURCES += getopt.c rasqal_getopt.h
474 check_query_LDADD = $(top_builddir)/src/librasqal.la
475 -check_query_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
476 +check_query_LDFLAGS = @RAPTOR2_LIBS@
478 srxread_SOURCES = srxread.c
479 srxread_LDADD = $(top_builddir)/src/librasqal.la
480 -srxread_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
481 +srxread_LDFLAGS = @RAPTOR2_LIBS@
483 srxwrite_SOURCES = srxwrite.c
484 srxwrite_LDADD = $(top_builddir)/src/librasqal.la
485 -srxwrite_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
486 +srxwrite_LDFLAGS = @RAPTOR2_LIBS@
490 --- a/utils/Makefile.in 2013-03-31 00:40:02.603793453 +0100
491 +++ b/utils/Makefile.in 2013-03-31 00:35:44.498795670 +0100
492 @@ -359,16 +359,16 @@
494 roqet_SOURCES = roqet.c $(am__append_1)
495 roqet_LDADD = $(top_builddir)/src/librasqal.la
496 -roqet_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
497 +roqet_LDFLAGS = @RAPTOR2_LIBS@
498 check_query_SOURCES = check_query.c $(am__append_2)
499 check_query_LDADD = $(top_builddir)/src/librasqal.la
500 -check_query_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
501 +check_query_LDFLAGS = @RAPTOR2_LIBS@
502 srxread_SOURCES = srxread.c
503 srxread_LDADD = $(top_builddir)/src/librasqal.la
504 -srxread_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
505 +srxread_LDFLAGS = @RAPTOR2_LIBS@
506 srxwrite_SOURCES = srxwrite.c
507 srxwrite_LDADD = $(top_builddir)/src/librasqal.la
508 -srxwrite_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
509 +srxwrite_LDFLAGS = @RAPTOR2_LIBS@