OSDN Git Service

0a6a15eae71ddf83b1650cac762e56fe39ad11e5
[pf3gnuchains/gcc-fork.git] / libjava / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
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.
7
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.
12
13 sinclude(../config/accross.m4)
14
15 AC_DEFUN(LIBGCJ_CONFIGURE,
16 [
17 dnl Default to --enable-multilib
18 AC_ARG_ENABLE(multilib,
19 [  --enable-multilib       build many library versions (default)],
20 [case "${enableval}" in
21   yes) multilib=yes ;;
22   no)  multilib=no ;;
23   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
24  esac], [multilib=yes])dnl
25
26 dnl We may get other options which we don't document:
27 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
28
29 # When building with srcdir == objdir, links to the source files will
30 # be created in directories within the target_subdir.  We have to
31 # adjust toplevel_srcdir accordingly, so that configure finds
32 # install-sh and other auxiliary files that live in the top-level
33 # source directory.
34 if test "${srcdir}" = "."; then
35   if test -z "${with_target_subdir}"; then
36     toprel=".."
37   else
38     if test "${with_target_subdir}" != "."; then
39       toprel="${with_multisrctop}../.."
40     else
41       toprel="${with_multisrctop}.."
42     fi
43   fi
44 else
45   toprel=".."
46 fi
47
48 libgcj_basedir=$srcdir/$toprel/$1/libjava
49 AC_SUBST(libgcj_basedir)
50
51 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
52 if :; then :; else
53   # This overrides the previous occurrence for automake, but not for
54   # autoconf, which is exactly what we want.
55   AC_CONFIG_AUX_DIR(..)
56 fi
57
58 # This works around an automake problem.
59 mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
60 AC_SUBST(mkinstalldirs)
61
62 AC_CANONICAL_SYSTEM
63
64 dnl This shouldn't be needed, as long as top-level dependencies are
65 dnl defined correctly and shared-library paths are set up so that
66 dnl execution tests succeed.  FIXME.
67 define([AC_PROG_CC_WORKS],[])
68 define([AC_PROG_CXX_WORKS],[])
69
70 AC_PROG_CC
71
72 # We use the libstdc++-v3 version of LIB_AC_PROG_CXX, but use
73 # glibjava_CXX instead of glibcpp_CXX.  That's because we're passed a
74 # different definition of CXX than other directories, since we don't
75 # depend on libstdc++-v3 having already been built.
76 AC_DEFUN(LIB_AC_PROG_CXX,
77 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
78 dnl Fool anybody using AC_PROG_CXX.
79 AC_PROVIDE([AC_PROG_CXX])
80 # Use glibjava_CXX so that we do not cause CXX to be cached with the
81 # flags that come in CXX while configuring libjava.  They're different
82 # from those used for all other target libraries.  If CXX is set in
83 # the environment, respect that here.
84 glibjava_CXX=$CXX
85 AC_CHECK_PROGS(glibjava_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
86 AC_SUBST(CXX)
87 CXX=$glibjava_CXX
88 test -z "$glibjava_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
89
90 AC_PROG_CXX_GNU
91
92 if test $ac_cv_prog_gxx = yes; then
93   GXX=yes
94 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
95 dnl plays around with CXXFLAGS (such as to build both debugging and
96 dnl normal versions of a library), tasteless as that idea is.
97   ac_test_CXXFLAGS="${CXXFLAGS+set}"
98   ac_save_CXXFLAGS="$CXXFLAGS"
99   CXXFLAGS=
100   AC_PROG_CXX_G
101   if test "$ac_test_CXXFLAGS" = set; then
102     CXXFLAGS="$ac_save_CXXFLAGS"
103   elif test $ac_cv_prog_cxx_g = yes; then
104     CXXFLAGS="-g -O2"
105   else
106     CXXFLAGS="-O2"
107   fi
108 else
109   GXX=
110   test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
111 fi
112 ])
113
114 LIB_AC_PROG_CXX
115
116 dnl version is pulled out to make it a bit easier to change using sed.
117 version=0.0.7
118 dnl Still use "libjava" here to placate dejagnu.
119 AM_INIT_AUTOMAKE(libjava, $version)
120
121 AC_CHECK_TOOL(AS, as)
122 AC_CHECK_TOOL(AR, ar)
123 AC_CHECK_TOOL(RANLIB, ranlib, :)
124
125 AC_PROG_INSTALL
126
127 AM_MAINTAINER_MODE
128
129 AC_EXEEXT
130
131 # configure.host sets the following important variables
132 #       libgcj_cflags    - host specific C compiler flags
133 #       libgcj_cxxflags  - host specific C++ compiler flags
134 #       libgcj_javaflags - host specific Java compiler flags
135
136 libgcj_cflags=
137 libgcj_cxxflags=
138 libgcj_javaflags=
139
140 . [$]{srcdir}/configure.host
141
142 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
143 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
144 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
145 AC_SUBST(LIBGCJ_CFLAGS)
146 AC_SUBST(LIBGCJ_CXXFLAGS)
147 AC_SUBST(LIBGCJ_JAVAFLAGS)
148 ])dnl
149
150 sinclude(../libtool.m4)
151 dnl The lines below arrange for aclocal not to bring libtool.m4
152 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
153 dnl to add a definition of LIBTOOL to Makefile.in.
154 ifelse(yes,no,[
155 AC_DEFUN([AM_PROG_LIBTOOL],)
156 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
157 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
158 AC_DEFUN([LT_AC_PROG_GCJ],)
159 AC_SUBST(GCJ)
160 AC_SUBST(LIBTOOL)
161 ])
162
163 #serial AM2
164
165 dnl From Bruno Haible.
166
167 AC_DEFUN([AM_ICONV],
168 [
169   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
170   dnl those with the standalone portable GNU libiconv installed).
171
172   am_cv_lib_iconv_ldpath=
173   AC_ARG_WITH([libiconv-prefix],
174 [  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib], [
175     for dir in `echo "$withval" | tr : ' '`; do
176       if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
177       if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
178     done
179    ])
180
181   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
182     am_cv_func_iconv="no, consider installing GNU libiconv"
183     am_cv_lib_iconv=no
184     AC_TRY_LINK([#include <stdlib.h>
185 #include <iconv.h>],
186       [iconv_t cd = iconv_open("","");
187        iconv(cd,NULL,NULL,NULL,NULL);
188        iconv_close(cd);],
189       am_cv_func_iconv=yes)
190     if test "$am_cv_func_iconv" != yes; then
191       am_save_LIBS="$LIBS"
192       LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
193       AC_TRY_LINK([#include <stdlib.h>
194 #include <iconv.h>],
195         [iconv_t cd = iconv_open("","");
196          iconv(cd,NULL,NULL,NULL,NULL);
197          iconv_close(cd);],
198         am_cv_lib_iconv=yes
199         am_cv_func_iconv=yes)
200       LIBS="$am_save_LIBS"
201     fi
202   ])
203   if test "$am_cv_func_iconv" = yes; then
204     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
205     AC_MSG_CHECKING([for iconv declaration])
206     AC_CACHE_VAL(am_cv_proto_iconv, [
207       AC_TRY_COMPILE([
208 #include <stdlib.h>
209 #include <iconv.h>
210 extern
211 #ifdef __cplusplus
212 "C"
213 #endif
214 #if defined(__STDC__) || defined(__cplusplus)
215 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
216 #else
217 size_t iconv();
218 #endif
219 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
220       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
221     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
222     AC_MSG_RESULT([$]{ac_t:-
223          }[$]am_cv_proto_iconv)
224     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
225       [Define as const if the declaration of iconv() needs const.])
226   fi
227   LIBICONV=
228   if test "$am_cv_lib_iconv" = yes; then
229     LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
230   fi
231   AC_SUBST(LIBICONV)
232 ])
233
234 # Check whether LC_MESSAGES is available in <locale.h>.
235 # Ulrich Drepper <drepper@cygnus.com>, 1995.
236 #
237 # This file can be copied and used freely without restrictions.  It can
238 # be used in projects which are not available under the GNU General Public
239 # License or the GNU Library General Public License but which still want
240 # to provide support for the GNU gettext functionality.
241 # Please note that the actual code of the GNU gettext library is covered
242 # by the GNU Library General Public License, and the rest of the GNU
243 # gettext package package is covered by the GNU General Public License.
244 # They are *not* in the public domain.
245
246 # serial 2
247
248 AC_DEFUN([AM_LC_MESSAGES],
249   [AC_CHECK_HEADERS(locale.h)
250   if test $ac_cv_header_locale_h = yes; then
251     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
252       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
253        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
254     if test $am_cv_val_LC_MESSAGES = yes; then
255       AC_DEFINE(HAVE_LC_MESSAGES, 1,
256         [Define if your <locale.h> file defines LC_MESSAGES.])
257     fi
258   fi])
259
260 AC_DEFUN([CHECK_FOR_BROKEN_MINGW_LD],
261 [
262 AC_MSG_CHECKING(whether 'ld' is at least 2.13)
263 LD_PROG=`$CC --print-prog-name=ld`
264 LD_VERSION=`$LD_PROG --version`
265 LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
266 LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
267 if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
268   LD_OK="ok"
269 else
270   if expr "$LD_VERSION_MAJOR" = 2 && expr "$LD_VERSION_MINOR" \>= 13 > /dev/null; then
271     LD_OK="ok"
272   fi
273 fi
274 if test "x$LD_OK" != x; then
275   AC_MSG_RESULT([yes; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
276 else
277   AC_MSG_RESULT([no; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
278   AC_MSG_WARN([ld <2.13 detected; enabling JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS hack...])
279   AC_DEFINE(JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS, 1,
280             [Indicate that linker is not able to 8-byte align static data])
281 fi[]dnl
282 ])# CHECK_FOR_BROKEN_MINGW_LD
283
284 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
285 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
286 dnl also defines GSTUFF_PKG_ERRORS on error
287 AC_DEFUN(PKG_CHECK_MODULES, [
288   succeeded=no
289
290   if test -z "$PKG_CONFIG"; then
291     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
292   fi
293
294   if test "$PKG_CONFIG" = "no" ; then
295      echo "*** The pkg-config script could not be found. Make sure it is"
296      echo "*** in your path, or set the PKG_CONFIG environment variable"
297      echo "*** to the full path to pkg-config."
298      echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
299   else
300      PKG_CONFIG_MIN_VERSION=0.9.0
301      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
302         AC_MSG_CHECKING(for $2)
303
304         if $PKG_CONFIG --exists "$2" ; then
305             AC_MSG_RESULT(yes)
306             succeeded=yes
307
308             AC_MSG_CHECKING($1_CFLAGS)
309             $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
310             AC_MSG_RESULT($$1_CFLAGS)
311
312             AC_MSG_CHECKING($1_LIBS)
313             $1_LIBS=`$PKG_CONFIG --libs "$2"`
314             AC_MSG_RESULT($$1_LIBS)
315         else
316             $1_CFLAGS=""
317             $1_LIBS=""
318             ## If we have a custom action on failure, don't print errors, but 
319             ## do set a variable so people can do so.
320             $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
321             ifelse([$4], ,echo $$1_PKG_ERRORS,)
322         fi
323
324         AC_SUBST($1_CFLAGS)
325         AC_SUBST($1_LIBS)
326      else
327         echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
328         echo "*** See http://www.freedesktop.org/software/pkgconfig"
329      fi
330   fi
331
332   if test $succeeded = yes; then
333      ifelse([$3], , :, [$3])
334   else
335      ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
336   fi
337 ])
338
339
340
341 # Do all the work for Automake.  This macro actually does too much --
342 # some checks are only needed if your package does certain things.
343 # But this isn't really a big deal.
344
345 # serial 1
346
347 dnl Usage:
348 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
349
350 AC_DEFUN([AM_INIT_AUTOMAKE],
351 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
352 AC_REQUIRE([AC_PROG_INSTALL])
353 PACKAGE=[$1]
354 AC_SUBST(PACKAGE)
355 VERSION=[$2]
356 AC_SUBST(VERSION)
357 dnl test to see if srcdir already configured
358 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
359   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
360 fi
361 ifelse([$3],,
362 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
363 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
364 AC_REQUIRE([AM_SANITY_CHECK])
365 AC_REQUIRE([AC_ARG_PROGRAM])
366 dnl FIXME This is truly gross.
367 missing_dir=`cd $ac_aux_dir && pwd`
368 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
369 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
370 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
371 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
372 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
373 AC_REQUIRE([AC_PROG_MAKE_SET])])
374
375 # Copyright 2002  Free Software Foundation, Inc.
376
377 # This program is free software; you can redistribute it and/or modify
378 # it under the terms of the GNU General Public License as published by
379 # the Free Software Foundation; either version 2, or (at your option)
380 # any later version.
381
382 # This program is distributed in the hope that it will be useful,
383 # but WITHOUT ANY WARRANTY; without even the implied warranty of
384 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
385 # GNU General Public License for more details.
386
387 # You should have received a copy of the GNU General Public License
388 # along with this program; if not, write to the Free Software
389 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
390
391 # AM_AUTOMAKE_VERSION(VERSION)
392 # ----------------------------
393 # Automake X.Y traces this macro to ensure aclocal.m4 has been
394 # generated from the m4 files accompanying Automake X.Y.
395 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
396
397 # AM_SET_CURRENT_AUTOMAKE_VERSION
398 # -------------------------------
399 # Call AM_AUTOMAKE_VERSION so it can be traced.
400 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
401 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
402          [AM_AUTOMAKE_VERSION([1.4-p6])])
403
404 #
405 # Check to make sure that the build environment is sane.
406 #
407
408 AC_DEFUN([AM_SANITY_CHECK],
409 [AC_MSG_CHECKING([whether build environment is sane])
410 # Just in case
411 sleep 1
412 echo timestamp > conftestfile
413 # Do `set' in a subshell so we don't clobber the current shell's
414 # arguments.  Must try -L first in case configure is actually a
415 # symlink; some systems play weird games with the mod time of symlinks
416 # (eg FreeBSD returns the mod time of the symlink's containing
417 # directory).
418 if (
419    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
420    if test "[$]*" = "X"; then
421       # -L didn't work.
422       set X `ls -t $srcdir/configure conftestfile`
423    fi
424    if test "[$]*" != "X $srcdir/configure conftestfile" \
425       && test "[$]*" != "X conftestfile $srcdir/configure"; then
426
427       # If neither matched, then we have a broken ls.  This can happen
428       # if, for instance, CONFIG_SHELL is bash and it inherits a
429       # broken ls alias from the environment.  This has actually
430       # happened.  Such a system could not be considered "sane".
431       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
432 alias in your environment])
433    fi
434
435    test "[$]2" = conftestfile
436    )
437 then
438    # Ok.
439    :
440 else
441    AC_MSG_ERROR([newly created file is older than distributed files!
442 Check your system clock])
443 fi
444 rm -f conftest*
445 AC_MSG_RESULT(yes)])
446
447 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
448 dnl The program must properly implement --version.
449 AC_DEFUN([AM_MISSING_PROG],
450 [AC_MSG_CHECKING(for working $2)
451 # Run test in a subshell; some versions of sh will print an error if
452 # an executable is not found, even if stderr is redirected.
453 # Redirect stdin to placate older versions of autoconf.  Sigh.
454 if ($2 --version) < /dev/null > /dev/null 2>&1; then
455    $1=$2
456    AC_MSG_RESULT(found)
457 else
458    $1="$3/missing $2"
459    AC_MSG_RESULT(missing)
460 fi
461 AC_SUBST($1)])
462
463 # Add --enable-maintainer-mode option to configure.
464 # From Jim Meyering
465
466 # serial 1
467
468 AC_DEFUN([AM_MAINTAINER_MODE],
469 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
470   dnl maintainer-mode is disabled by default
471   AC_ARG_ENABLE(maintainer-mode,
472 [  --enable-maintainer-mode enable make rules and dependencies not useful
473                           (and sometimes confusing) to the casual installer],
474       USE_MAINTAINER_MODE=$enableval,
475       USE_MAINTAINER_MODE=no)
476   AC_MSG_RESULT($USE_MAINTAINER_MODE)
477   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
478   MAINT=$MAINTAINER_MODE_TRUE
479   AC_SUBST(MAINT)dnl
480 ]
481 )
482
483 # Define a conditional.
484
485 AC_DEFUN([AM_CONDITIONAL],
486 [AC_SUBST($1_TRUE)
487 AC_SUBST($1_FALSE)
488 if $2; then
489   $1_TRUE=
490   $1_FALSE='#'
491 else
492   $1_TRUE='#'
493   $1_FALSE=
494 fi])
495
496 # Like AC_CONFIG_HEADER, but automatically create stamp file.
497
498 AC_DEFUN([AM_CONFIG_HEADER],
499 [AC_PREREQ([2.12])
500 AC_CONFIG_HEADER([$1])
501 dnl When config.status generates a header, we must update the stamp-h file.
502 dnl This file resides in the same directory as the config header
503 dnl that is generated.  We must strip everything past the first ":",
504 dnl and everything past the last "/".
505 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
506 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
507 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
508 <<am_indx=1
509 for am_file in <<$1>>; do
510   case " <<$>>CONFIG_HEADERS " in
511   *" <<$>>am_file "*<<)>>
512     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
513     ;;
514   esac
515   am_indx=`expr "<<$>>am_indx" + 1`
516 done<<>>dnl>>)
517 changequote([,]))])
518
519 # Configure paths for GTK+
520 # Owen Taylor     1997-2001
521
522 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
523 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 
524 dnl pass to pkg-config
525 dnl
526 AC_DEFUN(AM_PATH_GTK_2_0,
527 [dnl 
528 dnl Get the cflags and libraries from pkg-config
529 dnl
530 AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
531                     , enable_gtktest=yes)
532
533   pkg_config_args=gtk+-2.0
534   for module in . $4
535   do
536       case "$module" in
537          gthread) 
538              pkg_config_args="$pkg_config_args gthread-2.0"
539          ;;
540       esac
541   done
542
543   no_gtk=""
544
545   AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
546
547   if test x$PKG_CONFIG != xno ; then
548     if pkg-config --atleast-pkgconfig-version 0.7 ; then
549       :
550     else
551       echo *** pkg-config too old; version 0.7 or better required.
552       no_gtk=yes
553       PKG_CONFIG=no
554     fi
555   else
556     no_gtk=yes
557   fi
558
559   min_gtk_version=ifelse([$1], ,2.0.0,$1)
560   AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
561
562   if test x$PKG_CONFIG != xno ; then
563     ## don't try to run the test against uninstalled libtool libs
564     if $PKG_CONFIG --uninstalled $pkg_config_args; then
565           echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
566           enable_gtktest=no
567     fi
568
569     if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
570           :
571     else
572           no_gtk=yes
573     fi
574   fi
575
576   if test x"$no_gtk" = x ; then
577     GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
578     GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
579     gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
580            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
581     gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
582            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
583     gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
584            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
585     if test "x$enable_gtktest" = "xyes" ; then
586       ac_save_CFLAGS="$CFLAGS"
587       ac_save_LIBS="$LIBS"
588       CFLAGS="$CFLAGS $GTK_CFLAGS"
589       LIBS="$GTK_LIBS $LIBS"
590 dnl
591 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
592 dnl checks the results of pkg-config to some extent)
593 dnl
594       rm -f conf.gtktest
595       AC_TRY_RUN([
596 #include <gtk/gtk.h>
597 #include <stdio.h>
598 #include <stdlib.h>
599
600 int 
601 main ()
602 {
603   int major, minor, micro;
604   char *tmp_version;
605
606   system ("touch conf.gtktest");
607
608   /* HP/UX 9 (%@#!) writes to sscanf strings */
609   tmp_version = g_strdup("$min_gtk_version");
610   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
611      printf("%s, bad version string\n", "$min_gtk_version");
612      exit(1);
613    }
614
615   if ((gtk_major_version != $gtk_config_major_version) ||
616       (gtk_minor_version != $gtk_config_minor_version) ||
617       (gtk_micro_version != $gtk_config_micro_version))
618     {
619       printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
620              $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
621              gtk_major_version, gtk_minor_version, gtk_micro_version);
622       printf ("*** was found! If pkg-config was correct, then it is best\n");
623       printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
624       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
625       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
626       printf("*** required on your system.\n");
627       printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
628       printf("*** to point to the correct configuration files\n");
629     } 
630   else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
631            (gtk_minor_version != GTK_MINOR_VERSION) ||
632            (gtk_micro_version != GTK_MICRO_VERSION))
633     {
634       printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
635              GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
636       printf("*** library (version %d.%d.%d)\n",
637              gtk_major_version, gtk_minor_version, gtk_micro_version);
638     }
639   else
640     {
641       if ((gtk_major_version > major) ||
642         ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
643         ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
644       {
645         return 0;
646        }
647      else
648       {
649         printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
650                gtk_major_version, gtk_minor_version, gtk_micro_version);
651         printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
652                major, minor, micro);
653         printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
654         printf("***\n");
655         printf("*** If you have already installed a sufficiently new version, this error\n");
656         printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
657         printf("*** being found. The easiest way to fix this is to remove the old version\n");
658         printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
659         printf("*** correct copy of pkg-config. (In this case, you will have to\n");
660         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
661         printf("*** so that the correct libraries are found at run-time))\n");
662       }
663     }
664   return 1;
665 }
666 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
667        CFLAGS="$ac_save_CFLAGS"
668        LIBS="$ac_save_LIBS"
669      fi
670   fi
671   if test "x$no_gtk" = x ; then
672      AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
673      ifelse([$2], , :, [$2])     
674   else
675      AC_MSG_RESULT(no)
676      if test "$PKG_CONFIG" = "no" ; then
677        echo "*** A new enough version of pkg-config was not found."
678        echo "*** See http://pkgconfig.sourceforge.net"
679      else
680        if test -f conf.gtktest ; then
681         :
682        else
683           echo "*** Could not run GTK+ test program, checking why..."
684           ac_save_CFLAGS="$CFLAGS"
685           ac_save_LIBS="$LIBS"
686           CFLAGS="$CFLAGS $GTK_CFLAGS"
687           LIBS="$LIBS $GTK_LIBS"
688           AC_TRY_LINK([
689 #include <gtk/gtk.h>
690 #include <stdio.h>
691 ],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
692         [ echo "*** The test program compiled, but did not run. This usually means"
693           echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
694           echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
695           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
696           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
697           echo "*** is required on your system"
698           echo "***"
699           echo "*** If you have an old version installed, it is best to remove it, although"
700           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
701         [ echo "*** The test program failed to compile or link. See the file config.log for the"
702           echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
703           CFLAGS="$ac_save_CFLAGS"
704           LIBS="$ac_save_LIBS"
705        fi
706      fi
707      GTK_CFLAGS=""
708      GTK_LIBS=""
709      ifelse([$3], , :, [$3])
710   fi
711   AC_SUBST(GTK_CFLAGS)
712   AC_SUBST(GTK_LIBS)
713   rm -f conf.gtktest
714 ])
715
716 # Configure paths for GLIB
717 # Owen Taylor     1997-2001
718
719 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
720 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or 
721 dnl gthread is specified in MODULES, pass to pkg-config
722 dnl
723 AC_DEFUN(AM_PATH_GLIB_2_0,
724 [dnl 
725 dnl Get the cflags and libraries from pkg-config
726 dnl
727 AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
728                     , enable_glibtest=yes)
729
730   pkg_config_args=glib-2.0
731   for module in . $4
732   do
733       case "$module" in
734          gmodule) 
735              pkg_config_args="$pkg_config_args gmodule-2.0"
736          ;;
737          gobject) 
738              pkg_config_args="$pkg_config_args gobject-2.0"
739          ;;
740          gthread) 
741              pkg_config_args="$pkg_config_args gthread-2.0"
742          ;;
743       esac
744   done
745
746   AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
747
748   no_glib=""
749
750   if test x$PKG_CONFIG != xno ; then
751     if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
752       :
753     else
754       echo *** pkg-config too old; version 0.7 or better required.
755       no_glib=yes
756       PKG_CONFIG=no
757     fi
758   else
759     no_glib=yes
760   fi
761
762   min_glib_version=ifelse([$1], ,2.0.0,$1)
763   AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
764
765   if test x$PKG_CONFIG != xno ; then
766     ## don't try to run the test against uninstalled libtool libs
767     if $PKG_CONFIG --uninstalled $pkg_config_args; then
768           echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
769           enable_glibtest=no
770     fi
771
772     if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
773           :
774     else
775           no_glib=yes
776     fi
777   fi
778
779   if test x"$no_glib" = x ; then
780     GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
781     GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
782     GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
783
784     GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
785     GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
786     glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
787            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
788     glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
789            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
790     glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
791            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
792     if test "x$enable_glibtest" = "xyes" ; then
793       ac_save_CFLAGS="$CFLAGS"
794       ac_save_LIBS="$LIBS"
795       CFLAGS="$CFLAGS $GLIB_CFLAGS"
796       LIBS="$GLIB_LIBS $LIBS"
797 dnl
798 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
799 dnl checks the results of pkg-config to some extent)
800 dnl
801       rm -f conf.glibtest
802       AC_TRY_RUN([
803 #include <glib.h>
804 #include <stdio.h>
805 #include <stdlib.h>
806
807 int 
808 main ()
809 {
810   int major, minor, micro;
811   char *tmp_version;
812
813   system ("touch conf.glibtest");
814
815   /* HP/UX 9 (%@#!) writes to sscanf strings */
816   tmp_version = g_strdup("$min_glib_version");
817   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
818      printf("%s, bad version string\n", "$min_glib_version");
819      exit(1);
820    }
821
822   if ((glib_major_version != $glib_config_major_version) ||
823       (glib_minor_version != $glib_config_minor_version) ||
824       (glib_micro_version != $glib_config_micro_version))
825     {
826       printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
827              $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
828              glib_major_version, glib_minor_version, glib_micro_version);
829       printf ("*** was found! If pkg-config was correct, then it is best\n");
830       printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
831       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
832       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
833       printf("*** required on your system.\n");
834       printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
835       printf("*** to point to the correct configuration files\n");
836     } 
837   else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
838            (glib_minor_version != GLIB_MINOR_VERSION) ||
839            (glib_micro_version != GLIB_MICRO_VERSION))
840     {
841       printf("*** GLIB header files (version %d.%d.%d) do not match\n",
842              GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
843       printf("*** library (version %d.%d.%d)\n",
844              glib_major_version, glib_minor_version, glib_micro_version);
845     }
846   else
847     {
848       if ((glib_major_version > major) ||
849         ((glib_major_version == major) && (glib_minor_version > minor)) ||
850         ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
851       {
852         return 0;
853        }
854      else
855       {
856         printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
857                glib_major_version, glib_minor_version, glib_micro_version);
858         printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
859                major, minor, micro);
860         printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
861         printf("***\n");
862         printf("*** If you have already installed a sufficiently new version, this error\n");
863         printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
864         printf("*** being found. The easiest way to fix this is to remove the old version\n");
865         printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
866         printf("*** correct copy of pkg-config. (In this case, you will have to\n");
867         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
868         printf("*** so that the correct libraries are found at run-time))\n");
869       }
870     }
871   return 1;
872 }
873 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
874        CFLAGS="$ac_save_CFLAGS"
875        LIBS="$ac_save_LIBS"
876      fi
877   fi
878   if test "x$no_glib" = x ; then
879      AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
880      ifelse([$2], , :, [$2])     
881   else
882      AC_MSG_RESULT(no)
883      if test "$PKG_CONFIG" = "no" ; then
884        echo "*** A new enough version of pkg-config was not found."
885        echo "*** See http://www.freedesktop.org/software/pkgconfig/"
886      else
887        if test -f conf.glibtest ; then
888         :
889        else
890           echo "*** Could not run GLIB test program, checking why..."
891           ac_save_CFLAGS="$CFLAGS"
892           ac_save_LIBS="$LIBS"
893           CFLAGS="$CFLAGS $GLIB_CFLAGS"
894           LIBS="$LIBS $GLIB_LIBS"
895           AC_TRY_LINK([
896 #include <glib.h>
897 #include <stdio.h>
898 ],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
899         [ echo "*** The test program compiled, but did not run. This usually means"
900           echo "*** that the run-time linker is not finding GLIB or finding the wrong"
901           echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
902           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
903           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
904           echo "*** is required on your system"
905           echo "***"
906           echo "*** If you have an old version installed, it is best to remove it, although"
907           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
908         [ echo "*** The test program failed to compile or link. See the file config.log for the"
909           echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
910           CFLAGS="$ac_save_CFLAGS"
911           LIBS="$ac_save_LIBS"
912        fi
913      fi
914      GLIB_CFLAGS=""
915      GLIB_LIBS=""
916      GLIB_GENMARSHAL=""
917      GOBJECT_QUERY=""
918      GLIB_MKENUMS=""
919      ifelse([$3], , :, [$3])
920   fi
921   AC_SUBST(GLIB_CFLAGS)
922   AC_SUBST(GLIB_LIBS)
923   AC_SUBST(GLIB_GENMARSHAL)
924   AC_SUBST(GOBJECT_QUERY)
925   AC_SUBST(GLIB_MKENUMS)
926   rm -f conf.glibtest
927 ])
928
929 # Configure paths for LIBART
930 # Raph Levien 98-11-18
931 # stolen from Manish Singh    98-9-30
932 # stolen back from Frank Belew
933 # stolen from Manish Singh
934 # Shamelessly stolen from Owen Taylor
935
936 dnl AM_PATH_LIBART([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
937 dnl Test for LIBART, and define LIBART_CFLAGS and LIBART_LIBS
938 dnl
939 AC_DEFUN(AM_PATH_LIBART,
940 [dnl 
941 dnl Get the cflags and libraries from the libart-config script
942 dnl
943 AC_ARG_WITH(libart-prefix,[  --with-libart-prefix=PFX   Prefix where LIBART is installed (optional)],
944             libart_prefix="$withval", libart_prefix="")
945 AC_ARG_WITH(libart-exec-prefix,[  --with-libart-exec-prefix=PFX Exec prefix where LIBART is installed (optional)],
946             libart_exec_prefix="$withval", libart_exec_prefix="")
947 AC_ARG_ENABLE(libarttest, [  --disable-libarttest       Do not try to compile and run a test LIBART program],
948                     , enable_libarttest=yes)
949
950   if test x$libart_exec_prefix != x ; then
951      libart_args="$libart_args --exec-prefix=$libart_exec_prefix"
952      if test x${LIBART_CONFIG+set} != xset ; then
953         LIBART_CONFIG=$libart_exec_prefix/bin/libart-config
954      fi
955   fi
956   if test x$libart_prefix != x ; then
957      libart_args="$libart_args --prefix=$libart_prefix"
958      if test x${LIBART_CONFIG+set} != xset ; then
959         LIBART_CONFIG=$libart_prefix/bin/libart-config
960      fi
961   fi
962
963   AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
964   min_libart_version=ifelse([$1], ,0.2.5,$1)
965   AC_MSG_CHECKING(for LIBART - version >= $min_libart_version)
966   no_libart=""
967   if test "$LIBART_CONFIG" = "no" ; then
968     no_libart=yes
969   else
970     LIBART_CFLAGS=`$LIBART_CONFIG $libartconf_args --cflags`
971     LIBART_LIBS=`$LIBART_CONFIG $libartconf_args --libs`
972
973     libart_major_version=`$LIBART_CONFIG $libart_args --version | \
974            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
975     libart_minor_version=`$LIBART_CONFIG $libart_args --version | \
976            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
977     libart_micro_version=`$LIBART_CONFIG $libart_config_args --version | \
978            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
979     if test "x$enable_libarttest" = "xyes" ; then
980       ac_save_CFLAGS="$CFLAGS"
981       ac_save_LIBS="$LIBS"
982       CFLAGS="$CFLAGS $LIBART_CFLAGS"
983       LIBS="$LIBS $LIBART_LIBS"
984 dnl
985 dnl Now check if the installed LIBART is sufficiently new. (Also sanity
986 dnl checks the results of libart-config to some extent
987 dnl
988       rm -f conf.libarttest
989       AC_TRY_RUN([
990 #include <stdio.h>
991 #include <stdlib.h>
992 #include <string.h>
993 #include <libart_lgpl/libart.h>
994
995 char*
996 my_strdup (char *str)
997 {
998   char *new_str;
999   
1000   if (str)
1001     {
1002       new_str = malloc ((strlen (str) + 1) * sizeof(char));
1003       strcpy (new_str, str);
1004     }
1005   else
1006     new_str = NULL;
1007   
1008   return new_str;
1009 }
1010
1011 int main ()
1012 {
1013   int major, minor, micro;
1014   char *tmp_version;
1015
1016   system ("touch conf.libarttest");
1017
1018   /* HP/UX 9 (%@#!) writes to sscanf strings */
1019   tmp_version = my_strdup("$min_libart_version");
1020   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1021      printf("%s, bad version string\n", "$min_libart_version");
1022      exit(1);
1023    }
1024
1025    if (($libart_major_version > major) ||
1026       (($libart_major_version == major) && ($libart_minor_version > minor)) ||
1027       (($libart_major_version == major) && ($libart_minor_version == minor) && ($libart_micro_version >= micro)))
1028     {
1029       return 0;
1030     }
1031   else
1032     {
1033       printf("\n*** 'libart-config --version' returned %d.%d.%d, but the minimum version\n", $libart_major_version, $libart_minor_version, $libart_micro_version);
1034       printf("*** of LIBART required is %d.%d.%d. If libart-config is correct, then it is\n", major, minor, micro);
1035       printf("*** best to upgrade to the required version.\n");
1036       printf("*** If libart-config was wrong, set the environment variable LIBART_CONFIG\n");
1037       printf("*** to point to the correct copy of libart-config, and remove the file\n");
1038       printf("*** config.cache before re-running configure\n");
1039       return 1;
1040     }
1041 }
1042
1043 ],, no_libart=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1044        CFLAGS="$ac_save_CFLAGS"
1045        LIBS="$ac_save_LIBS"
1046      fi
1047   fi
1048   if test "x$no_libart" = x ; then
1049      AC_MSG_RESULT(yes)
1050      ifelse([$2], , :, [$2])     
1051   else
1052      AC_MSG_RESULT(no)
1053      if test "$LIBART_CONFIG" = "no" ; then
1054        echo "*** The libart-config script installed by LIBART could not be found"
1055        echo "*** If LIBART was installed in PREFIX, make sure PREFIX/bin is in"
1056        echo "*** your path, or set the LIBART_CONFIG environment variable to the"
1057        echo "*** full path to libart-config."
1058      else
1059        if test -f conf.libarttest ; then
1060         :
1061        else
1062           echo "*** Could not run LIBART test program, checking why..."
1063           CFLAGS="$CFLAGS $LIBART_CFLAGS"
1064           LIBS="$LIBS $LIBART_LIBS"
1065           AC_TRY_LINK([
1066 #include <stdio.h>
1067 #include <libart_lgpl/libart.h>
1068 ],      [ return 0; ],
1069         [ echo "*** The test program compiled, but did not run. This usually means"
1070           echo "*** that the run-time linker is not finding LIBART or finding the wrong"
1071           echo "*** version of LIBART. If it is not finding LIBART, you'll need to set your"
1072           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1073           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1074           echo "*** is required on your system"
1075           echo "***"
1076           echo "*** If you have an old version installed, it is best to remove it, although"
1077           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
1078         [ echo "*** The test program failed to compile or link. See the file config.log for the"
1079           echo "*** exact error that occured. This usually means LIBART was incorrectly installed"
1080           echo "*** or that you have moved LIBART since it was installed. In the latter case, you"
1081           echo "*** may want to edit the libart-config script: $LIBART_CONFIG" ])
1082           CFLAGS="$ac_save_CFLAGS"
1083           LIBS="$ac_save_LIBS"
1084        fi
1085      fi
1086      LIBART_CFLAGS=""
1087      LIBART_LIBS=""
1088      ifelse([$3], , :, [$3])
1089   fi
1090   AC_SUBST(LIBART_CFLAGS)
1091   AC_SUBST(LIBART_LIBS)
1092   rm -f conf.libarttest
1093 ])
1094