Fixed Container.Background support. We can have that support or not.
[idesk.git] / aclocal.m4
blobeb35bc9c82a6e7457ded970e0310273071ec8d54
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl @synopsis AC_PATH_GENERIC(LIBRARY [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
14 dnl
15 dnl Runs a LIBRARY-config script and defines LIBRARY_CFLAGS and LIBRARY_LIBS
16 dnl
17 dnl The script must support `--cflags' and `--libs' args.
18 dnl If MINIMUM-VERSION is specified, the script must also support the
19 dnl `--version' arg.
20 dnl If the `--with-library-[exec-]prefix' arguments to ./configure are given,
21 dnl it must also support `--prefix' and `--exec-prefix'.
22 dnl (In other words, it must be like gtk-config.)
23 dnl
24 dnl For example:
25 dnl
26 dnl    AC_PATH_GENERIC(Foo, 1.0.0)
27 dnl
28 dnl would run `foo-config --version' and check that it is at least 1.0.0
29 dnl
30 dnl If so, the following would then be defined:
31 dnl
32 dnl    FOO_CFLAGS to `foo-config --cflags`
33 dnl    FOO_LIBS   to `foo-config --libs`
34 dnl
35 dnl At present there is no support for additional "MODULES" (see AM_PATH_GTK)
36 dnl (shamelessly stolen from gtk.m4 and then hacked around a fair amount)
37 dnl
38 dnl @author Angus Lees <gusl@cse.unsw.edu.au>
39 dnl @version $Id: ac_path_generic.m4,v 1.1.1.1 2001/07/26 00:46:28 guidod Exp $
41 AC_DEFUN([AC_PATH_GENERIC],
42 [dnl
43 dnl we're going to need uppercase, lowercase and user-friendly versions of the
44 dnl string `LIBRARY'
45 pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
46 pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
48 dnl
49 dnl Get the cflags and libraries from the LIBRARY-config script
50 dnl
51 AC_ARG_WITH(DOWN-prefix,[  --with-]DOWN[-prefix=PFX       Prefix where $1 is installed (optional)],
52         DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="")
53 AC_ARG_WITH(DOWN-exec-prefix,[  --with-]DOWN[-exec-prefix=PFX Exec prefix where $1 is installed (optional)],
54         DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="")
56   if test x$DOWN[]_config_exec_prefix != x ; then
57      DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix"
58      if test x${UP[]_CONFIG+set} != xset ; then
59        UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config
60      fi
61   fi
62   if test x$DOWN[]_config_prefix != x ; then
63      DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix"
64      if test x${UP[]_CONFIG+set} != xset ; then
65        UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config
66      fi
67   fi
69   AC_PATH_PROG(UP[]_CONFIG, DOWN-config, no)
70   ifelse([$2], ,
71      AC_MSG_CHECKING(for $1),
72      AC_MSG_CHECKING(for $1 - version >= $2)
73   )
74   no_[]DOWN=""
75   if test "$UP[]_CONFIG" = "no" ; then
76      no_[]DOWN=yes
77   else
78      UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`"
79      UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`"
80      ifelse([$2], , ,[
81         DOWN[]_config_major_version=`$UP[]_CONFIG $DOWN[]_config_args \
82          --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
83         DOWN[]_config_minor_version=`$UP[]_CONFIG $DOWN[]_config_args \
84          --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
85         DOWN[]_config_micro_version=`$UP[]_CONFIG $DOWN[]_config_args \
86          --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
87         DOWN[]_wanted_major_version="regexp($2, [\<\([0-9]*\)], [\1])"
88         DOWN[]_wanted_minor_version="regexp($2, [\<\([0-9]*\)\.\([0-9]*\)], [\2])"
89         DOWN[]_wanted_micro_version="regexp($2, [\<\([0-9]*\).\([0-9]*\).\([0-9]*\)], [\3])"
91         # Compare wanted version to what config script returned.
92         # If I knew what library was being run, i'd probably also compile
93         # a test program at this point (which also extracted and tested
94         # the version in some library-specific way)
95         if test "$DOWN[]_config_major_version" -lt \
96                         "$DOWN[]_wanted_major_version" \
97           -o \( "$DOWN[]_config_major_version" -eq \
98                         "$DOWN[]_wanted_major_version" \
99             -a "$DOWN[]_config_minor_version" -lt \
100                         "$DOWN[]_wanted_minor_version" \) \
101           -o \( "$DOWN[]_config_major_version" -eq \
102                         "$DOWN[]_wanted_major_version" \
103             -a "$DOWN[]_config_minor_version" -eq \
104                         "$DOWN[]_wanted_minor_version" \
105             -a "$DOWN[]_config_micro_version" -lt \
106                         "$DOWN[]_wanted_micro_version" \) ; then
107           # older version found
108           no_[]DOWN=yes
109           echo -n "*** An old version of $1 "
110           echo -n "($DOWN[]_config_major_version"
111           echo -n ".$DOWN[]_config_minor_version"
112           echo    ".$DOWN[]_config_micro_version) was found."
113           echo -n "*** You need a version of $1 newer than "
114           echo -n "$DOWN[]_wanted_major_version"
115           echo -n ".$DOWN[]_wanted_minor_version"
116           echo    ".$DOWN[]_wanted_micro_version."
117           echo "***"
118           echo "*** If you have already installed a sufficiently new version, this error"
119           echo "*** probably means that the wrong copy of the DOWN-config shell script is"
120           echo "*** being found. The easiest way to fix this is to remove the old version"
121           echo "*** of $1, but you can also set the UP[]_CONFIG environment to point to the"
122           echo "*** correct copy of DOWN-config. (In this case, you will have to"
123           echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf"
124           echo "*** so that the correct libraries are found at run-time)"
125         fi
126      ])
127   fi
128   if test "x$no_[]DOWN" = x ; then
129      AC_MSG_RESULT(yes)
130      ifelse([$3], , :, [$3])
131   else
132      AC_MSG_RESULT(no)
133      if test "$UP[]_CONFIG" = "no" ; then
134        echo "*** The DOWN-config script installed by $1 could not be found"
135        echo "*** If $1 was installed in PREFIX, make sure PREFIX/bin is in"
136        echo "*** your path, or set the UP[]_CONFIG environment variable to the"
137        echo "*** full path to DOWN-config."
138      fi
139      UP[]_CFLAGS=""
140      UP[]_LIBS=""
141      ifelse([$4], , :, [$4])
142   fi
143   AC_SUBST(UP[]_CFLAGS)
144   AC_SUBST(UP[]_LIBS)
146   popdef([UP])
147   popdef([DOWN])
149 # xft.m4
150 # Copyright (c) 2002 Henrik Kinnunen (fluxgen at linuxmail.org)
152 # Permission is hereby granted, free of charge, to any person obtaining a
153 # copy of this software and associated documentation files (the "Software"),
154 # to deal in the Software without restriction, including without limitation
155 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
156 # and/or sell copies of the Software, and to permit persons to whom the 
157 # Software is furnished to do so, subject to the following conditions:
159 # The above copyright notice and this permission notice shall be included in 
160 # all copies or substantial portions of the Software. 
162 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
163 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
164 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
165 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
166 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
167 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
168 # DEALINGS IN THE SOFTWARE.
170 # AM_PATH_XFT1([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
171 AC_DEFUN([AM_PATH_XFT1],
173         AC_CHECK_LIB(Xft, XftFontOpen,
174                 XFT_LIBS="-lXft"
175                 [$1],
176                 [$2]
177         )
180 # AM_PATH_XFT2([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
181 AC_DEFUN([AM_PATH_XFT2],
183         if test x$pkg_exec_prefix != x ; then
184            xft_args="$xft_args --exec-prefix=$pkg_exec_prefix"
185            if test x${PKG_CONFIG+set} != xset ; then
186                PKG_CONFIG=$pkg_exec_prefix/bin/pkg-config
187     fi
190 if test x$xft_prefix != x ; then
191    xft_args="$xft_args --prefix=$xft_prefix"
192    if test x${PKG_CONFIG+set} != xset ; then
193       PKG_CONFIG=$xft_prefix/bin/pkg-config       
194    fi
197 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
198 if test "x$PKG_CONFIG" = "xno" ; then
199         ifelse([$2], , :, [$2])
200 else 
201         XFT_CFLAGS=`$PKG_CONFIG $xftconf_args --cflags xft`
202         XFT_LIBS=`$PKG_CONFIG $xftconf_args --libs xft`
203         ifelse([$1], , :, [$1])
208 # AM_PATH_XFT(default-value, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
209 # Test for Xft, and define XFT_CFLAGS and XFT_LIBS
210 AC_DEFUN([AM_PATH_XFT],
212  AC_ARG_WITH(xft-prefix,[  --with-xft-prefix=path  Prefix where Xft is installed (optional)],
213             xft_prefix="$withval", xft_prefix="")
214  AC_ARG_WITH(pkg-exec-prefix,[  --with-pkg-exec-prefix=path Exec prefix where pkg-config is installed (optional)],
215             pkg_exec_prefix="$withval", pkg_exec_prefix="")
216  AC_ARG_ENABLE(xft, [  --enable-xft            Xft (antialias) support (default=$1)],
217         if test "x$enableval" = "xyes"; then
218                 TRY_XFT=yes
219         else
220                 TRY_XFT=no
221         fi
222         ,
223         TRY_XFT=$1
226 if test "x$TRY_XFT" = "xyes"; then
227         AC_MSG_RESULT(yes)
228         AM_PATH_XFT2(
229                 [$2],
230                 # xft2 failed: try xft1
231                 AM_PATH_XFT1(
232                 [$2],
233                 [$3]
234                 AC_MSG_RESULT([Cant find Xft libraries! Disabling Xft]))
235         )
236 else
237         AC_MSG_RESULT(no)
238         [$3]
241 CFLAGS="$CFLAGS $XFT_CFLAGS"
242 CXXFLAGS="$CXXFLAGS $XFT_CFLAGS"
243 LIBS="$LIBS $XFT_LIBS"
247 # lib-prefix.m4 serial 4 (gettext-0.14.2)
248 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
249 dnl This file is free software; the Free Software Foundation
250 dnl gives unlimited permission to copy and/or distribute it,
251 dnl with or without modifications, as long as this notice is preserved.
253 dnl From Bruno Haible.
255 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
256 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
257 dnl require excessive bracketing.
258 ifdef([AC_HELP_STRING],
259 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
260 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
262 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
263 dnl to access previously installed libraries. The basic assumption is that
264 dnl a user will want packages to use other packages he previously installed
265 dnl with the same --prefix option.
266 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
267 dnl libraries, but is otherwise very convenient.
268 AC_DEFUN([AC_LIB_PREFIX],
270   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
271   AC_REQUIRE([AC_PROG_CC])
272   AC_REQUIRE([AC_CANONICAL_HOST])
273   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
274   dnl By default, look in $includedir and $libdir.
275   use_additional=yes
276   AC_LIB_WITH_FINAL_PREFIX([
277     eval additional_includedir=\"$includedir\"
278     eval additional_libdir=\"$libdir\"
279   ])
280   AC_LIB_ARG_WITH([lib-prefix],
281 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
282   --without-lib-prefix    don't search for libraries in includedir and libdir],
284     if test "X$withval" = "Xno"; then
285       use_additional=no
286     else
287       if test "X$withval" = "X"; then
288         AC_LIB_WITH_FINAL_PREFIX([
289           eval additional_includedir=\"$includedir\"
290           eval additional_libdir=\"$libdir\"
291         ])
292       else
293         additional_includedir="$withval/include"
294         additional_libdir="$withval/lib"
295       fi
296     fi
298   if test $use_additional = yes; then
299     dnl Potentially add $additional_includedir to $CPPFLAGS.
300     dnl But don't add it
301     dnl   1. if it's the standard /usr/include,
302     dnl   2. if it's already present in $CPPFLAGS,
303     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
304     dnl   4. if it doesn't exist as a directory.
305     if test "X$additional_includedir" != "X/usr/include"; then
306       haveit=
307       for x in $CPPFLAGS; do
308         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
309         if test "X$x" = "X-I$additional_includedir"; then
310           haveit=yes
311           break
312         fi
313       done
314       if test -z "$haveit"; then
315         if test "X$additional_includedir" = "X/usr/local/include"; then
316           if test -n "$GCC"; then
317             case $host_os in
318               linux* | gnu* | k*bsd*-gnu) haveit=yes;;
319             esac
320           fi
321         fi
322         if test -z "$haveit"; then
323           if test -d "$additional_includedir"; then
324             dnl Really add $additional_includedir to $CPPFLAGS.
325             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
326           fi
327         fi
328       fi
329     fi
330     dnl Potentially add $additional_libdir to $LDFLAGS.
331     dnl But don't add it
332     dnl   1. if it's the standard /usr/lib,
333     dnl   2. if it's already present in $LDFLAGS,
334     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
335     dnl   4. if it doesn't exist as a directory.
336     if test "X$additional_libdir" != "X/usr/lib"; then
337       haveit=
338       for x in $LDFLAGS; do
339         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
340         if test "X$x" = "X-L$additional_libdir"; then
341           haveit=yes
342           break
343         fi
344       done
345       if test -z "$haveit"; then
346         if test "X$additional_libdir" = "X/usr/local/lib"; then
347           if test -n "$GCC"; then
348             case $host_os in
349               linux*) haveit=yes;;
350             esac
351           fi
352         fi
353         if test -z "$haveit"; then
354           if test -d "$additional_libdir"; then
355             dnl Really add $additional_libdir to $LDFLAGS.
356             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
357           fi
358         fi
359       fi
360     fi
361   fi
364 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
365 dnl acl_final_exec_prefix, containing the values to which $prefix and
366 dnl $exec_prefix will expand at the end of the configure script.
367 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
369   dnl Unfortunately, prefix and exec_prefix get only finally determined
370   dnl at the end of configure.
371   if test "X$prefix" = "XNONE"; then
372     acl_final_prefix="$ac_default_prefix"
373   else
374     acl_final_prefix="$prefix"
375   fi
376   if test "X$exec_prefix" = "XNONE"; then
377     acl_final_exec_prefix='${prefix}'
378   else
379     acl_final_exec_prefix="$exec_prefix"
380   fi
381   acl_save_prefix="$prefix"
382   prefix="$acl_final_prefix"
383   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
384   prefix="$acl_save_prefix"
387 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
388 dnl variables prefix and exec_prefix bound to the values they will have
389 dnl at the end of the configure script.
390 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
392   acl_save_prefix="$prefix"
393   prefix="$acl_final_prefix"
394   acl_save_exec_prefix="$exec_prefix"
395   exec_prefix="$acl_final_exec_prefix"
396   $1
397   exec_prefix="$acl_save_exec_prefix"
398   prefix="$acl_save_prefix"
401 # lib-link.m4 serial 6 (gettext-0.14.3)
402 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
403 dnl This file is free software; the Free Software Foundation
404 dnl gives unlimited permission to copy and/or distribute it,
405 dnl with or without modifications, as long as this notice is preserved.
407 dnl From Bruno Haible.
409 AC_PREREQ(2.50)
411 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
412 dnl the libraries corresponding to explicit and implicit dependencies.
413 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
414 dnl augments the CPPFLAGS variable.
415 AC_DEFUN([AC_LIB_LINKFLAGS],
417   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
418   AC_REQUIRE([AC_LIB_RPATH])
419   define([Name],[translit([$1],[./-], [___])])
420   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
421                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
422   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
423     AC_LIB_LINKFLAGS_BODY([$1], [$2])
424     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
425     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
426     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
427   ])
428   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
429   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
430   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
431   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
432   AC_SUBST([LIB]NAME)
433   AC_SUBST([LTLIB]NAME)
434   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
435   dnl results of this search when this library appears as a dependency.
436   HAVE_LIB[]NAME=yes
437   undefine([Name])
438   undefine([NAME])
441 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
442 dnl searches for libname and the libraries corresponding to explicit and
443 dnl implicit dependencies, together with the specified include files and
444 dnl the ability to compile and link the specified testcode. If found, it
445 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
446 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
447 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
448 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
449 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
451   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
452   AC_REQUIRE([AC_LIB_RPATH])
453   define([Name],[translit([$1],[./-], [___])])
454   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
455                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
457   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
458   dnl accordingly.
459   AC_LIB_LINKFLAGS_BODY([$1], [$2])
461   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
462   dnl because if the user has installed lib[]Name and not disabled its use
463   dnl via --without-lib[]Name-prefix, he wants to use it.
464   ac_save_CPPFLAGS="$CPPFLAGS"
465   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
467   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
468     ac_save_LIBS="$LIBS"
469     LIBS="$LIBS $LIB[]NAME"
470     AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
471     LIBS="$ac_save_LIBS"
472   ])
473   if test "$ac_cv_lib[]Name" = yes; then
474     HAVE_LIB[]NAME=yes
475     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
476     AC_MSG_CHECKING([how to link with lib[]$1])
477     AC_MSG_RESULT([$LIB[]NAME])
478   else
479     HAVE_LIB[]NAME=no
480     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
481     dnl $INC[]NAME either.
482     CPPFLAGS="$ac_save_CPPFLAGS"
483     LIB[]NAME=
484     LTLIB[]NAME=
485   fi
486   AC_SUBST([HAVE_LIB]NAME)
487   AC_SUBST([LIB]NAME)
488   AC_SUBST([LTLIB]NAME)
489   undefine([Name])
490   undefine([NAME])
493 dnl Determine the platform dependent parameters needed to use rpath:
494 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
495 dnl hardcode_direct, hardcode_minus_L.
496 AC_DEFUN([AC_LIB_RPATH],
498   dnl Tell automake >= 1.10 to complain if config.rpath is missing.
499   m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
500   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
501   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
502   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
503   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
504   AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
505     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
506     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
507     . ./conftest.sh
508     rm -f ./conftest.sh
509     acl_cv_rpath=done
510   ])
511   wl="$acl_cv_wl"
512   libext="$acl_cv_libext"
513   shlibext="$acl_cv_shlibext"
514   hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
515   hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
516   hardcode_direct="$acl_cv_hardcode_direct"
517   hardcode_minus_L="$acl_cv_hardcode_minus_L"
518   dnl Determine whether the user wants rpath handling at all.
519   AC_ARG_ENABLE(rpath,
520     [  --disable-rpath         do not hardcode runtime library paths],
521     :, enable_rpath=yes)
524 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
525 dnl the libraries corresponding to explicit and implicit dependencies.
526 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
527 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
529   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
530                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
531   dnl By default, look in $includedir and $libdir.
532   use_additional=yes
533   AC_LIB_WITH_FINAL_PREFIX([
534     eval additional_includedir=\"$includedir\"
535     eval additional_libdir=\"$libdir\"
536   ])
537   AC_LIB_ARG_WITH([lib$1-prefix],
538 [  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
539   --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
541     if test "X$withval" = "Xno"; then
542       use_additional=no
543     else
544       if test "X$withval" = "X"; then
545         AC_LIB_WITH_FINAL_PREFIX([
546           eval additional_includedir=\"$includedir\"
547           eval additional_libdir=\"$libdir\"
548         ])
549       else
550         additional_includedir="$withval/include"
551         additional_libdir="$withval/lib"
552       fi
553     fi
555   dnl Search the library and its dependencies in $additional_libdir and
556   dnl $LDFLAGS. Using breadth-first-seach.
557   LIB[]NAME=
558   LTLIB[]NAME=
559   INC[]NAME=
560   rpathdirs=
561   ltrpathdirs=
562   names_already_handled=
563   names_next_round='$1 $2'
564   while test -n "$names_next_round"; do
565     names_this_round="$names_next_round"
566     names_next_round=
567     for name in $names_this_round; do
568       already_handled=
569       for n in $names_already_handled; do
570         if test "$n" = "$name"; then
571           already_handled=yes
572           break
573         fi
574       done
575       if test -z "$already_handled"; then
576         names_already_handled="$names_already_handled $name"
577         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
578         dnl or AC_LIB_HAVE_LINKFLAGS call.
579         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
580         eval value=\"\$HAVE_LIB$uppername\"
581         if test -n "$value"; then
582           if test "$value" = yes; then
583             eval value=\"\$LIB$uppername\"
584             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
585             eval value=\"\$LTLIB$uppername\"
586             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
587           else
588             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
589             dnl that this library doesn't exist. So just drop it.
590             :
591           fi
592         else
593           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
594           dnl and the already constructed $LIBNAME/$LTLIBNAME.
595           found_dir=
596           found_la=
597           found_so=
598           found_a=
599           if test $use_additional = yes; then
600             if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
601               found_dir="$additional_libdir"
602               found_so="$additional_libdir/lib$name.$shlibext"
603               if test -f "$additional_libdir/lib$name.la"; then
604                 found_la="$additional_libdir/lib$name.la"
605               fi
606             else
607               if test -f "$additional_libdir/lib$name.$libext"; then
608                 found_dir="$additional_libdir"
609                 found_a="$additional_libdir/lib$name.$libext"
610                 if test -f "$additional_libdir/lib$name.la"; then
611                   found_la="$additional_libdir/lib$name.la"
612                 fi
613               fi
614             fi
615           fi
616           if test "X$found_dir" = "X"; then
617             for x in $LDFLAGS $LTLIB[]NAME; do
618               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
619               case "$x" in
620                 -L*)
621                   dir=`echo "X$x" | sed -e 's/^X-L//'`
622                   if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
623                     found_dir="$dir"
624                     found_so="$dir/lib$name.$shlibext"
625                     if test -f "$dir/lib$name.la"; then
626                       found_la="$dir/lib$name.la"
627                     fi
628                   else
629                     if test -f "$dir/lib$name.$libext"; then
630                       found_dir="$dir"
631                       found_a="$dir/lib$name.$libext"
632                       if test -f "$dir/lib$name.la"; then
633                         found_la="$dir/lib$name.la"
634                       fi
635                     fi
636                   fi
637                   ;;
638               esac
639               if test "X$found_dir" != "X"; then
640                 break
641               fi
642             done
643           fi
644           if test "X$found_dir" != "X"; then
645             dnl Found the library.
646             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
647             if test "X$found_so" != "X"; then
648               dnl Linking with a shared library. We attempt to hardcode its
649               dnl directory into the executable's runpath, unless it's the
650               dnl standard /usr/lib.
651               if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
652                 dnl No hardcoding is needed.
653                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
654               else
655                 dnl Use an explicit option to hardcode DIR into the resulting
656                 dnl binary.
657                 dnl Potentially add DIR to ltrpathdirs.
658                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
659                 haveit=
660                 for x in $ltrpathdirs; do
661                   if test "X$x" = "X$found_dir"; then
662                     haveit=yes
663                     break
664                   fi
665                 done
666                 if test -z "$haveit"; then
667                   ltrpathdirs="$ltrpathdirs $found_dir"
668                 fi
669                 dnl The hardcoding into $LIBNAME is system dependent.
670                 if test "$hardcode_direct" = yes; then
671                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
672                   dnl resulting binary.
673                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
674                 else
675                   if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
676                     dnl Use an explicit option to hardcode DIR into the resulting
677                     dnl binary.
678                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
679                     dnl Potentially add DIR to rpathdirs.
680                     dnl The rpathdirs will be appended to $LIBNAME at the end.
681                     haveit=
682                     for x in $rpathdirs; do
683                       if test "X$x" = "X$found_dir"; then
684                         haveit=yes
685                         break
686                       fi
687                     done
688                     if test -z "$haveit"; then
689                       rpathdirs="$rpathdirs $found_dir"
690                     fi
691                   else
692                     dnl Rely on "-L$found_dir".
693                     dnl But don't add it if it's already contained in the LDFLAGS
694                     dnl or the already constructed $LIBNAME
695                     haveit=
696                     for x in $LDFLAGS $LIB[]NAME; do
697                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
698                       if test "X$x" = "X-L$found_dir"; then
699                         haveit=yes
700                         break
701                       fi
702                     done
703                     if test -z "$haveit"; then
704                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
705                     fi
706                     if test "$hardcode_minus_L" != no; then
707                       dnl FIXME: Not sure whether we should use
708                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
709                       dnl here.
710                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
711                     else
712                       dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
713                       dnl here, because this doesn't fit in flags passed to the
714                       dnl compiler. So give up. No hardcoding. This affects only
715                       dnl very old systems.
716                       dnl FIXME: Not sure whether we should use
717                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
718                       dnl here.
719                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
720                     fi
721                   fi
722                 fi
723               fi
724             else
725               if test "X$found_a" != "X"; then
726                 dnl Linking with a static library.
727                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
728               else
729                 dnl We shouldn't come here, but anyway it's good to have a
730                 dnl fallback.
731                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
732               fi
733             fi
734             dnl Assume the include files are nearby.
735             additional_includedir=
736             case "$found_dir" in
737               */lib | */lib/)
738                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
739                 additional_includedir="$basedir/include"
740                 ;;
741             esac
742             if test "X$additional_includedir" != "X"; then
743               dnl Potentially add $additional_includedir to $INCNAME.
744               dnl But don't add it
745               dnl   1. if it's the standard /usr/include,
746               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
747               dnl   3. if it's already present in $CPPFLAGS or the already
748               dnl      constructed $INCNAME,
749               dnl   4. if it doesn't exist as a directory.
750               if test "X$additional_includedir" != "X/usr/include"; then
751                 haveit=
752                 if test "X$additional_includedir" = "X/usr/local/include"; then
753                   if test -n "$GCC"; then
754                     case $host_os in
755                       linux* | gnu* | k*bsd*-gnu) haveit=yes;;
756                     esac
757                   fi
758                 fi
759                 if test -z "$haveit"; then
760                   for x in $CPPFLAGS $INC[]NAME; do
761                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
762                     if test "X$x" = "X-I$additional_includedir"; then
763                       haveit=yes
764                       break
765                     fi
766                   done
767                   if test -z "$haveit"; then
768                     if test -d "$additional_includedir"; then
769                       dnl Really add $additional_includedir to $INCNAME.
770                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
771                     fi
772                   fi
773                 fi
774               fi
775             fi
776             dnl Look for dependencies.
777             if test -n "$found_la"; then
778               dnl Read the .la file. It defines the variables
779               dnl dlname, library_names, old_library, dependency_libs, current,
780               dnl age, revision, installed, dlopen, dlpreopen, libdir.
781               save_libdir="$libdir"
782               case "$found_la" in
783                 */* | *\\*) . "$found_la" ;;
784                 *) . "./$found_la" ;;
785               esac
786               libdir="$save_libdir"
787               dnl We use only dependency_libs.
788               for dep in $dependency_libs; do
789                 case "$dep" in
790                   -L*)
791                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
792                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
793                     dnl But don't add it
794                     dnl   1. if it's the standard /usr/lib,
795                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
796                     dnl   3. if it's already present in $LDFLAGS or the already
797                     dnl      constructed $LIBNAME,
798                     dnl   4. if it doesn't exist as a directory.
799                     if test "X$additional_libdir" != "X/usr/lib"; then
800                       haveit=
801                       if test "X$additional_libdir" = "X/usr/local/lib"; then
802                         if test -n "$GCC"; then
803                           case $host_os in
804                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
805                           esac
806                         fi
807                       fi
808                       if test -z "$haveit"; then
809                         haveit=
810                         for x in $LDFLAGS $LIB[]NAME; do
811                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
812                           if test "X$x" = "X-L$additional_libdir"; then
813                             haveit=yes
814                             break
815                           fi
816                         done
817                         if test -z "$haveit"; then
818                           if test -d "$additional_libdir"; then
819                             dnl Really add $additional_libdir to $LIBNAME.
820                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
821                           fi
822                         fi
823                         haveit=
824                         for x in $LDFLAGS $LTLIB[]NAME; do
825                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
826                           if test "X$x" = "X-L$additional_libdir"; then
827                             haveit=yes
828                             break
829                           fi
830                         done
831                         if test -z "$haveit"; then
832                           if test -d "$additional_libdir"; then
833                             dnl Really add $additional_libdir to $LTLIBNAME.
834                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
835                           fi
836                         fi
837                       fi
838                     fi
839                     ;;
840                   -R*)
841                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
842                     if test "$enable_rpath" != no; then
843                       dnl Potentially add DIR to rpathdirs.
844                       dnl The rpathdirs will be appended to $LIBNAME at the end.
845                       haveit=
846                       for x in $rpathdirs; do
847                         if test "X$x" = "X$dir"; then
848                           haveit=yes
849                           break
850                         fi
851                       done
852                       if test -z "$haveit"; then
853                         rpathdirs="$rpathdirs $dir"
854                       fi
855                       dnl Potentially add DIR to ltrpathdirs.
856                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
857                       haveit=
858                       for x in $ltrpathdirs; do
859                         if test "X$x" = "X$dir"; then
860                           haveit=yes
861                           break
862                         fi
863                       done
864                       if test -z "$haveit"; then
865                         ltrpathdirs="$ltrpathdirs $dir"
866                       fi
867                     fi
868                     ;;
869                   -l*)
870                     dnl Handle this in the next round.
871                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
872                     ;;
873                   *.la)
874                     dnl Handle this in the next round. Throw away the .la's
875                     dnl directory; it is already contained in a preceding -L
876                     dnl option.
877                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
878                     ;;
879                   *)
880                     dnl Most likely an immediate library name.
881                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
882                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
883                     ;;
884                 esac
885               done
886             fi
887           else
888             dnl Didn't find the library; assume it is in the system directories
889             dnl known to the linker and runtime loader. (All the system
890             dnl directories known to the linker should also be known to the
891             dnl runtime loader, otherwise the system is severely misconfigured.)
892             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
893             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
894           fi
895         fi
896       fi
897     done
898   done
899   if test "X$rpathdirs" != "X"; then
900     if test -n "$hardcode_libdir_separator"; then
901       dnl Weird platform: only the last -rpath option counts, the user must
902       dnl pass all path elements in one option. We can arrange that for a
903       dnl single library, but not when more than one $LIBNAMEs are used.
904       alldirs=
905       for found_dir in $rpathdirs; do
906         alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
907       done
908       dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
909       acl_save_libdir="$libdir"
910       libdir="$alldirs"
911       eval flag=\"$hardcode_libdir_flag_spec\"
912       libdir="$acl_save_libdir"
913       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
914     else
915       dnl The -rpath options are cumulative.
916       for found_dir in $rpathdirs; do
917         acl_save_libdir="$libdir"
918         libdir="$found_dir"
919         eval flag=\"$hardcode_libdir_flag_spec\"
920         libdir="$acl_save_libdir"
921         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
922       done
923     fi
924   fi
925   if test "X$ltrpathdirs" != "X"; then
926     dnl When using libtool, the option that works for both libraries and
927     dnl executables is -R. The -R options are cumulative.
928     for found_dir in $ltrpathdirs; do
929       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
930     done
931   fi
934 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
935 dnl unless already present in VAR.
936 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
937 dnl contains two or three consecutive elements that belong together.
938 AC_DEFUN([AC_LIB_APPENDTOVAR],
940   for element in [$2]; do
941     haveit=
942     for x in $[$1]; do
943       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
944       if test "X$x" = "X$element"; then
945         haveit=yes
946         break
947       fi
948     done
949     if test -z "$haveit"; then
950       [$1]="${[$1]}${[$1]:+ }$element"
951     fi
952   done
955 # lib-ld.m4 serial 3 (gettext-0.13)
956 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
957 dnl This file is free software; the Free Software Foundation
958 dnl gives unlimited permission to copy and/or distribute it,
959 dnl with or without modifications, as long as this notice is preserved.
961 dnl Subroutines of libtool.m4,
962 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
963 dnl with libtool.m4.
965 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
966 AC_DEFUN([AC_LIB_PROG_LD_GNU],
967 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
968 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
969 case `$LD -v 2>&1 </dev/null` in
970 *GNU* | *'with BFD'*)
971   acl_cv_prog_gnu_ld=yes ;;
973   acl_cv_prog_gnu_ld=no ;;
974 esac])
975 with_gnu_ld=$acl_cv_prog_gnu_ld
978 dnl From libtool-1.4. Sets the variable LD.
979 AC_DEFUN([AC_LIB_PROG_LD],
980 [AC_ARG_WITH(gnu-ld,
981 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
982 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
983 AC_REQUIRE([AC_PROG_CC])dnl
984 AC_REQUIRE([AC_CANONICAL_HOST])dnl
985 # Prepare PATH_SEPARATOR.
986 # The user is always right.
987 if test "${PATH_SEPARATOR+set}" != set; then
988   echo "#! /bin/sh" >conf$$.sh
989   echo  "exit 0"   >>conf$$.sh
990   chmod +x conf$$.sh
991   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
992     PATH_SEPARATOR=';'
993   else
994     PATH_SEPARATOR=:
995   fi
996   rm -f conf$$.sh
998 ac_prog=ld
999 if test "$GCC" = yes; then
1000   # Check if gcc -print-prog-name=ld gives a path.
1001   AC_MSG_CHECKING([for ld used by GCC])
1002   case $host in
1003   *-*-mingw*)
1004     # gcc leaves a trailing carriage return which upsets mingw
1005     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1006   *)
1007     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1008   esac
1009   case $ac_prog in
1010     # Accept absolute paths.
1011     [[\\/]* | [A-Za-z]:[\\/]*)]
1012       [re_direlt='/[^/][^/]*/\.\./']
1013       # Canonicalize the path of ld
1014       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1015       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1016         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1017       done
1018       test -z "$LD" && LD="$ac_prog"
1019       ;;
1020   "")
1021     # If it fails, then pretend we aren't using GCC.
1022     ac_prog=ld
1023     ;;
1024   *)
1025     # If it is relative, then search for the first ld in PATH.
1026     with_gnu_ld=unknown
1027     ;;
1028   esac
1029 elif test "$with_gnu_ld" = yes; then
1030   AC_MSG_CHECKING([for GNU ld])
1031 else
1032   AC_MSG_CHECKING([for non-GNU ld])
1034 AC_CACHE_VAL(acl_cv_path_LD,
1035 [if test -z "$LD"; then
1036   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1037   for ac_dir in $PATH; do
1038     test -z "$ac_dir" && ac_dir=.
1039     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1040       acl_cv_path_LD="$ac_dir/$ac_prog"
1041       # Check to see if the program is GNU ld.  I'd rather use --version,
1042       # but apparently some GNU ld's only accept -v.
1043       # Break only if it was the GNU/non-GNU ld that we prefer.
1044       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1045       *GNU* | *'with BFD'*)
1046         test "$with_gnu_ld" != no && break ;;
1047       *)
1048         test "$with_gnu_ld" != yes && break ;;
1049       esac
1050     fi
1051   done
1052   IFS="$ac_save_ifs"
1053 else
1054   acl_cv_path_LD="$LD" # Let the user override the test with a path.
1055 fi])
1056 LD="$acl_cv_path_LD"
1057 if test -n "$LD"; then
1058   AC_MSG_RESULT($LD)
1059 else
1060   AC_MSG_RESULT(no)
1062 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1063 AC_LIB_PROG_LD_GNU
1066 # Configure paths for GTK+
1067 # Owen Taylor     97-11-3
1069 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1070 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
1072 AC_DEFUN(AM_PATH_GTK,
1073 [dnl 
1074 dnl Get the cflags and libraries from the gtk-config script
1076 AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
1077             gtk_config_prefix="$withval", gtk_config_prefix="")
1078 AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
1079             gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
1080 AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
1081                     , enable_gtktest=yes)
1083   for module in . $4
1084   do
1085       case "$module" in
1086          gthread) 
1087              gtk_config_args="$gtk_config_args gthread"
1088          ;;
1089       esac
1090   done
1092   if test x$gtk_config_exec_prefix != x ; then
1093      gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
1094      if test x${GTK_CONFIG+set} != xset ; then
1095         GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
1096      fi
1097   fi
1098   if test x$gtk_config_prefix != x ; then
1099      gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
1100      if test x${GTK_CONFIG+set} != xset ; then
1101         GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
1102      fi
1103   fi
1105   AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
1106   min_gtk_version=ifelse([$1], ,0.99.7,$1)
1107   AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
1108   no_gtk=""
1109   if test "$GTK_CONFIG" = "no" ; then
1110     no_gtk=yes
1111   else
1112     GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
1113     GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
1114     gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
1115            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1116     gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
1117            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1118     gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
1119            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1120     if test "x$enable_gtktest" = "xyes" ; then
1121       ac_save_CFLAGS="$CFLAGS"
1122       ac_save_LIBS="$LIBS"
1123       CFLAGS="$CFLAGS $GTK_CFLAGS"
1124       LIBS="$GTK_LIBS $LIBS"
1126 dnl Now check if the installed GTK is sufficiently new. (Also sanity
1127 dnl checks the results of gtk-config to some extent
1129       rm -f conf.gtktest
1130       AC_TRY_RUN([
1131 #include <gtk/gtk.h>
1132 #include <stdio.h>
1133 #include <stdlib.h>
1135 int 
1136 main ()
1138   int major, minor, micro;
1139   char *tmp_version;
1141   system ("touch conf.gtktest");
1143   /* HP/UX 9 (%@#!) writes to sscanf strings */
1144   tmp_version = g_strdup("$min_gtk_version");
1145   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1146      printf("%s, bad version string\n", "$min_gtk_version");
1147      exit(1);
1148    }
1150   if ((gtk_major_version != $gtk_config_major_version) ||
1151       (gtk_minor_version != $gtk_config_minor_version) ||
1152       (gtk_micro_version != $gtk_config_micro_version))
1153     {
1154       printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
1155              $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
1156              gtk_major_version, gtk_minor_version, gtk_micro_version);
1157       printf ("*** was found! If gtk-config was correct, then it is best\n");
1158       printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
1159       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1160       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1161       printf("*** required on your system.\n");
1162       printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
1163       printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
1164       printf("*** before re-running configure\n");
1165     } 
1166 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
1167   else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
1168            (gtk_minor_version != GTK_MINOR_VERSION) ||
1169            (gtk_micro_version != GTK_MICRO_VERSION))
1170     {
1171       printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
1172              GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
1173       printf("*** library (version %d.%d.%d)\n",
1174              gtk_major_version, gtk_minor_version, gtk_micro_version);
1175     }
1176 #endif /* defined (GTK_MAJOR_VERSION) ... */
1177   else
1178     {
1179       if ((gtk_major_version > major) ||
1180         ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
1181         ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
1182       {
1183         return 0;
1184        }
1185      else
1186       {
1187         printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
1188                gtk_major_version, gtk_minor_version, gtk_micro_version);
1189         printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
1190                major, minor, micro);
1191         printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
1192         printf("***\n");
1193         printf("*** If you have already installed a sufficiently new version, this error\n");
1194         printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
1195         printf("*** being found. The easiest way to fix this is to remove the old version\n");
1196         printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
1197         printf("*** correct copy of gtk-config. (In this case, you will have to\n");
1198         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1199         printf("*** so that the correct libraries are found at run-time))\n");
1200       }
1201     }
1202   return 1;
1204 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1205        CFLAGS="$ac_save_CFLAGS"
1206        LIBS="$ac_save_LIBS"
1207      fi
1208   fi
1209   if test "x$no_gtk" = x ; then
1210      AC_MSG_RESULT(yes)
1211      ifelse([$2], , :, [$2])     
1212   else
1213      AC_MSG_RESULT(no)
1214      if test "$GTK_CONFIG" = "no" ; then
1215        echo "*** The gtk-config script installed by GTK could not be found"
1216        echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
1217        echo "*** your path, or set the GTK_CONFIG environment variable to the"
1218        echo "*** full path to gtk-config."
1219      else
1220        if test -f conf.gtktest ; then
1221         :
1222        else
1223           echo "*** Could not run GTK test program, checking why..."
1224           CFLAGS="$CFLAGS $GTK_CFLAGS"
1225           LIBS="$LIBS $GTK_LIBS"
1226           AC_TRY_LINK([
1227 #include <gtk/gtk.h>
1228 #include <stdio.h>
1229 ],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
1230         [ echo "*** The test program compiled, but did not run. This usually means"
1231           echo "*** that the run-time linker is not finding GTK or finding the wrong"
1232           echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
1233           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1234           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1235           echo "*** is required on your system"
1236           echo "***"
1237           echo "*** If you have an old version installed, it is best to remove it, although"
1238           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1239           echo "***"
1240           echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
1241           echo "*** came with the system with the command"
1242           echo "***"
1243           echo "***    rpm --erase --nodeps gtk gtk-devel" ],
1244         [ echo "*** The test program failed to compile or link. See the file config.log for the"
1245           echo "*** exact error that occured. This usually means GTK was incorrectly installed"
1246           echo "*** or that you have moved GTK since it was installed. In the latter case, you"
1247           echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
1248           CFLAGS="$ac_save_CFLAGS"
1249           LIBS="$ac_save_LIBS"
1250        fi
1251      fi
1252      GTK_CFLAGS=""
1253      GTK_LIBS=""
1254      ifelse([$3], , :, [$3])
1255   fi
1256   AC_SUBST(GTK_CFLAGS)
1257   AC_SUBST(GTK_LIBS)
1258   rm -f conf.gtktest
1261 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1263 AC_DEFUN([AM_CONFIG_HEADER],
1264 [AC_PREREQ([2.12])
1265 AC_CONFIG_HEADER([$1])
1266 dnl When config.status generates a header, we must update the stamp-h file.
1267 dnl This file resides in the same directory as the config header
1268 dnl that is generated.  We must strip everything past the first ":",
1269 dnl and everything past the last "/".
1270 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1271 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1272 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1273 <<am_indx=1
1274 for am_file in <<$1>>; do
1275   case " <<$>>CONFIG_HEADERS " in
1276   *" <<$>>am_file "*<<)>>
1277     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1278     ;;
1279   esac
1280   am_indx=`expr "<<$>>am_indx" + 1`
1281 done<<>>dnl>>)
1282 changequote([,]))])
1284 # Do all the work for Automake.  This macro actually does too much --
1285 # some checks are only needed if your package does certain things.
1286 # But this isn't really a big deal.
1288 # serial 1
1290 dnl Usage:
1291 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1293 AC_DEFUN([AM_INIT_AUTOMAKE],
1294 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1295 AC_REQUIRE([AC_PROG_INSTALL])
1296 PACKAGE=[$1]
1297 AC_SUBST(PACKAGE)
1298 VERSION=[$2]
1299 AC_SUBST(VERSION)
1300 dnl test to see if srcdir already configured
1301 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1302   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1304 ifelse([$3],,
1305 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1306 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1307 AC_REQUIRE([AM_SANITY_CHECK])
1308 AC_REQUIRE([AC_ARG_PROGRAM])
1309 dnl FIXME This is truly gross.
1310 missing_dir=`cd $ac_aux_dir && pwd`
1311 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
1312 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1313 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
1314 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1315 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1316 AC_REQUIRE([AC_PROG_MAKE_SET])])
1318 # Copyright 2002  Free Software Foundation, Inc.
1320 # This program is free software; you can redistribute it and/or modify
1321 # it under the terms of the GNU General Public License as published by
1322 # the Free Software Foundation; either version 2, or (at your option)
1323 # any later version.
1325 # This program is distributed in the hope that it will be useful,
1326 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1327 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1328 # GNU General Public License for more details.
1330 # You should have received a copy of the GNU General Public License
1331 # along with this program; if not, write to the Free Software
1332 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1334 # AM_AUTOMAKE_VERSION(VERSION)
1335 # ----------------------------
1336 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1337 # generated from the m4 files accompanying Automake X.Y.
1338 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
1340 # AM_SET_CURRENT_AUTOMAKE_VERSION
1341 # -------------------------------
1342 # Call AM_AUTOMAKE_VERSION so it can be traced.
1343 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
1344 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1345          [AM_AUTOMAKE_VERSION([1.4-p6])])
1348 # Check to make sure that the build environment is sane.
1351 AC_DEFUN([AM_SANITY_CHECK],
1352 [AC_MSG_CHECKING([whether build environment is sane])
1353 # Just in case
1354 sleep 1
1355 echo timestamp > conftestfile
1356 # Do `set' in a subshell so we don't clobber the current shell's
1357 # arguments.  Must try -L first in case configure is actually a
1358 # symlink; some systems play weird games with the mod time of symlinks
1359 # (eg FreeBSD returns the mod time of the symlink's containing
1360 # directory).
1361 if (
1362    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1363    if test "[$]*" = "X"; then
1364       # -L didn't work.
1365       set X `ls -t $srcdir/configure conftestfile`
1366    fi
1367    if test "[$]*" != "X $srcdir/configure conftestfile" \
1368       && test "[$]*" != "X conftestfile $srcdir/configure"; then
1370       # If neither matched, then we have a broken ls.  This can happen
1371       # if, for instance, CONFIG_SHELL is bash and it inherits a
1372       # broken ls alias from the environment.  This has actually
1373       # happened.  Such a system could not be considered "sane".
1374       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1375 alias in your environment])
1376    fi
1378    test "[$]2" = conftestfile
1379    )
1380 then
1381    # Ok.
1382    :
1383 else
1384    AC_MSG_ERROR([newly created file is older than distributed files!
1385 Check your system clock])
1387 rm -f conftest*
1388 AC_MSG_RESULT(yes)])
1390 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1391 dnl The program must properly implement --version.
1392 AC_DEFUN([AM_MISSING_PROG],
1393 [AC_MSG_CHECKING(for working $2)
1394 # Run test in a subshell; some versions of sh will print an error if
1395 # an executable is not found, even if stderr is redirected.
1396 # Redirect stdin to placate older versions of autoconf.  Sigh.
1397 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1398    $1=$2
1399    AC_MSG_RESULT(found)
1400 else
1401    $1="$3/missing $2"
1402    AC_MSG_RESULT(missing)
1404 AC_SUBST($1)])
1406 # isc-posix.m4 serial 2 (gettext-0.11.2)
1407 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1408 dnl This file is free software; the Free Software Foundation
1409 dnl gives unlimited permission to copy and/or distribute it,
1410 dnl with or without modifications, as long as this notice is preserved.
1412 # This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
1414 # This test replaces the one in autoconf.
1415 # Currently this macro should have the same name as the autoconf macro
1416 # because gettext's gettext.m4 (distributed in the automake package)
1417 # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
1418 # give these diagnostics:
1419 #   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1420 #   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1422 undefine([AC_ISC_POSIX])
1424 AC_DEFUN([AC_ISC_POSIX],
1425   [
1426     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1427     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1428   ]
1432 # serial 1
1434 # @defmac AC_PROG_CC_STDC
1435 # @maindex PROG_CC_STDC
1436 # @ovindex CC
1437 # If the C compiler in not in ANSI C mode by default, try to add an option
1438 # to output variable @code{CC} to make it so.  This macro tries various
1439 # options that select ANSI C on some system or another.  It considers the
1440 # compiler to be in ANSI C mode if it handles function prototypes correctly.
1442 # If you use this macro, you should check after calling it whether the C
1443 # compiler has been set to accept ANSI C; if not, the shell variable
1444 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
1445 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
1446 # program @code{ansi2knr}, which comes with Ghostscript.
1447 # @end defmac
1449 AC_DEFUN([AM_PROG_CC_STDC],
1450 [AC_REQUIRE([AC_PROG_CC])
1451 AC_BEFORE([$0], [AC_C_INLINE])
1452 AC_BEFORE([$0], [AC_C_CONST])
1453 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
1454 dnl a magic option to avoid problems with ANSI preprocessor commands
1455 dnl like #elif.
1456 dnl FIXME: can't do this because then AC_AIX won't work due to a
1457 dnl circular dependency.
1458 dnl AC_BEFORE([$0], [AC_PROG_CPP])
1459 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
1460 AC_CACHE_VAL(am_cv_prog_cc_stdc,
1461 [am_cv_prog_cc_stdc=no
1462 ac_save_CC="$CC"
1463 # Don't try gcc -ansi; that turns off useful extensions and
1464 # breaks some systems' header files.
1465 # AIX                   -qlanglvl=ansi
1466 # Ultrix and OSF/1      -std1
1467 # HP-UX                 -Aa -D_HPUX_SOURCE
1468 # SVR4                  -Xc -D__EXTENSIONS__
1469 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1471   CC="$ac_save_CC $ac_arg"
1472   AC_TRY_COMPILE(
1473 [#include <stdarg.h>
1474 #include <stdio.h>
1475 #include <sys/types.h>
1476 #include <sys/stat.h>
1477 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1478 struct buf { int x; };
1479 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1480 static char *e (p, i)
1481      char **p;
1482      int i;
1484   return p[i];
1486 static char *f (char * (*g) (char **, int), char **p, ...)
1488   char *s;
1489   va_list v;
1490   va_start (v,p);
1491   s = g (p, va_arg (v,int));
1492   va_end (v);
1493   return s;
1495 int test (int i, double x);
1496 struct s1 {int (*f) (int a);};
1497 struct s2 {int (*f) (double a);};
1498 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1499 int argc;
1500 char **argv;
1501 ], [
1502 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1504 [am_cv_prog_cc_stdc="$ac_arg"; break])
1505 done
1506 CC="$ac_save_CC"
1508 if test -z "$am_cv_prog_cc_stdc"; then
1509   AC_MSG_RESULT([none needed])
1510 else
1511   AC_MSG_RESULT($am_cv_prog_cc_stdc)
1513 case "x$am_cv_prog_cc_stdc" in
1514   x|xno) ;;
1515   *) CC="$CC $am_cv_prog_cc_stdc" ;;
1516 esac
1519 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1521 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1523 # This program is free software; you can redistribute it and/or modify
1524 # it under the terms of the GNU General Public License as published by
1525 # the Free Software Foundation; either version 2 of the License, or
1526 # (at your option) any later version.
1528 # This program is distributed in the hope that it will be useful, but
1529 # WITHOUT ANY WARRANTY; without even the implied warranty of
1530 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1531 # General Public License for more details.
1533 # You should have received a copy of the GNU General Public License
1534 # along with this program; if not, write to the Free Software
1535 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1537 # As a special exception to the GNU General Public License, if you
1538 # distribute this file as part of a program that contains a
1539 # configuration script generated by Autoconf, you may include it under
1540 # the same distribution terms that you use for the rest of that program.
1542 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
1543 # ----------------------------------
1544 AC_DEFUN([PKG_PROG_PKG_CONFIG],
1545 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1546 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1547 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1548 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1549         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1551 if test -n "$PKG_CONFIG"; then
1552         _pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
1553         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1554         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1555                 AC_MSG_RESULT([yes])
1556         else
1557                 AC_MSG_RESULT([no])
1558                 PKG_CONFIG=""
1559         fi
1560                 
1561 fi[]dnl
1562 ])# PKG_PROG_PKG_CONFIG
1564 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1566 # Check to see whether a particular set of modules exists.  Similar
1567 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
1570 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
1571 # this or PKG_CHECK_MODULES is called, or make sure to call
1572 # PKG_CHECK_EXISTS manually
1573 # --------------------------------------------------------------
1574 AC_DEFUN([PKG_CHECK_EXISTS],
1575 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1576 if test -n "$PKG_CONFIG" && \
1577     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1578   m4_ifval([$2], [$2], [:])
1579 m4_ifvaln([$3], [else
1580   $3])dnl
1581 fi])
1584 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1585 # ---------------------------------------------
1586 m4_define([_PKG_CONFIG],
1587 [if test -n "$PKG_CONFIG"; then
1588         PKG_CHECK_EXISTS([$3],
1589                          [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1590                          [pkg_failed=yes])
1591 else
1592         pkg_failed=untried
1593 fi[]dnl
1594 ])# _PKG_CONFIG
1596 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1597 # [ACTION-IF-NOT-FOUND])
1600 # Note that if there is a possibility the first call to
1601 # PKG_CHECK_MODULES might not happen, you should be sure to include an
1602 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1605 # --------------------------------------------------------------
1606 AC_DEFUN([PKG_CHECK_MODULES],
1607 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1608 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1609 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1611 pkg_failed=no
1612 AC_MSG_CHECKING([for $1])
1614 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1615 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
1617 if test $pkg_failed = yes; then
1618         $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1619         # Put the nasty error message in config.log where it belongs
1620         echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
1622         ifelse([$4], , [AC_MSG_ERROR(dnl
1623 [Package requirements ($2) were not met.
1624 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1625 installed software in a non-standard prefix.
1627 Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
1628 to avoid the need to call pkg-config.  See the pkg-config man page for
1629 more details.])],
1630                 [$4])
1631 elif test $pkg_failed = untried; then
1632         ifelse([$4], , [AC_MSG_FAILURE(dnl
1633 [The pkg-config script could not be found or is too old.  Make sure it
1634 is in your PATH or set the PKG_CONFIG environment variable to the full
1635 path to pkg-config.
1637 Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
1638 to avoid the need to call pkg-config.  See the pkg-config man page for
1639 more details.
1641 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
1642                 [$4])
1643 else
1644         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1645         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1646         AC_MSG_RESULT([yes])
1647         ifelse([$3], , :, [$3])
1648 fi[]dnl
1649 ])# PKG_CHECK_MODULES
1651 # Define a conditional.
1653 AC_DEFUN([AM_CONDITIONAL],
1654 [AC_SUBST($1_TRUE)
1655 AC_SUBST($1_FALSE)
1656 if $2; then
1657   $1_TRUE=
1658   $1_FALSE='#'
1659 else
1660   $1_TRUE='#'
1661   $1_FALSE=
1662 fi])