1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 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 sinclude(../config/accross.m4)
15 AC_DEFUN(LIBGCJ_CONFIGURE,
17 dnl Default to --enable-multilib
18 AC_ARG_ENABLE(multilib,
19 [ --enable-multilib build many library versions (default)],
20 [case "${enableval}" in
23 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
24 esac], [multilib=yes])dnl
26 dnl We may get other options which we don't document:
27 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
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
34 if test "${srcdir}" = "."; then
35 if test -z "${with_target_subdir}"; then
38 if test "${with_target_subdir}" != "."; then
39 toprel="${with_multisrctop}../.."
41 toprel="${with_multisrctop}.."
48 libgcj_basedir=$srcdir/$toprel/$1/libjava
49 AC_SUBST(libgcj_basedir)
51 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
53 # This overrides the previous occurrence for automake, but not for
54 # autoconf, which is exactly what we want.
58 # This works around an automake problem.
59 mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
60 AC_SUBST(mkinstalldirs)
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],[])
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.
85 AC_CHECK_PROGS(glibjava_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
88 test -z "$glibjava_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
92 if test $ac_cv_prog_gxx = yes; then
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"
101 if test "$ac_test_CXXFLAGS" = set; then
102 CXXFLAGS="$ac_save_CXXFLAGS"
103 elif test $ac_cv_prog_cxx_g = yes; then
110 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
116 dnl version is pulled out to make it a bit easier to change using sed.
118 dnl Still use "libjava" here to placate dejagnu.
119 AM_INIT_AUTOMAKE(libjava, $version)
121 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
122 # run it explicitly here, it will be run implicitly before
123 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
124 # be run before AC_CANONICAL_HOST.
127 AC_CHECK_TOOL(AS, as)
128 AC_CHECK_TOOL(AR, ar)
129 AC_CHECK_TOOL(RANLIB, ranlib, :)
137 # configure.host sets the following important variables
138 # libgcj_cflags - host specific C compiler flags
139 # libgcj_cxxflags - host specific C++ compiler flags
140 # libgcj_javaflags - host specific Java compiler flags
146 . [$]{srcdir}/configure.host
148 LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
149 LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
150 LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}"
151 AC_SUBST(LIBGCJ_CFLAGS)
152 AC_SUBST(LIBGCJ_CXXFLAGS)
153 AC_SUBST(LIBGCJ_JAVAFLAGS)
156 sinclude(../libtool.m4)
157 dnl The lines below arrange for aclocal not to bring libtool.m4
158 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
159 dnl to add a definition of LIBTOOL to Makefile.in.
161 AC_DEFUN([AM_PROG_LIBTOOL],)
162 AC_DEFUN([AC_LIBTOOL_DLOPEN],)
163 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
164 AC_DEFUN([LT_AC_PROG_GCJ],)
171 dnl From Bruno Haible.
175 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
176 dnl those with the standalone portable GNU libiconv installed).
178 am_cv_lib_iconv_ldpath=
179 AC_ARG_WITH([libiconv-prefix],
180 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
181 for dir in `echo "$withval" | tr : ' '`; do
182 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
183 if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
187 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
188 am_cv_func_iconv="no, consider installing GNU libiconv"
190 AC_TRY_LINK([#include <stdlib.h>
192 [iconv_t cd = iconv_open("","");
193 iconv(cd,NULL,NULL,NULL,NULL);
195 am_cv_func_iconv=yes)
196 if test "$am_cv_func_iconv" != yes; then
198 LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
199 AC_TRY_LINK([#include <stdlib.h>
201 [iconv_t cd = iconv_open("","");
202 iconv(cd,NULL,NULL,NULL,NULL);
205 am_cv_func_iconv=yes)
209 if test "$am_cv_func_iconv" = yes; then
210 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
211 AC_MSG_CHECKING([for iconv declaration])
212 AC_CACHE_VAL(am_cv_proto_iconv, [
220 #if defined(__STDC__) || defined(__cplusplus)
221 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
225 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
226 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);"])
227 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
228 AC_MSG_RESULT([$]{ac_t:-
229 }[$]am_cv_proto_iconv)
230 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
231 [Define as const if the declaration of iconv() needs const.])
234 if test "$am_cv_lib_iconv" = yes; then
235 LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
240 # Check whether LC_MESSAGES is available in <locale.h>.
241 # Ulrich Drepper <drepper@cygnus.com>, 1995.
243 # This file can be copied and used freely without restrictions. It can
244 # be used in projects which are not available under the GNU General Public
245 # License or the GNU Library General Public License but which still want
246 # to provide support for the GNU gettext functionality.
247 # Please note that the actual code of the GNU gettext library is covered
248 # by the GNU Library General Public License, and the rest of the GNU
249 # gettext package package is covered by the GNU General Public License.
250 # They are *not* in the public domain.
254 AC_DEFUN([AM_LC_MESSAGES],
255 [if test $ac_cv_header_locale_h = yes; then
256 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
257 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
258 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
259 if test $am_cv_val_LC_MESSAGES = yes; then
260 AC_DEFINE(HAVE_LC_MESSAGES, 1,
261 [Define if your <locale.h> file defines LC_MESSAGES.])
265 AC_DEFUN([CHECK_FOR_BROKEN_MINGW_LD],
267 AC_MSG_CHECKING(whether 'ld' is at least 2.13)
268 LD_PROG=`$CC --print-prog-name=ld`
269 LD_VERSION=`$LD_PROG --version`
270 LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
271 LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
272 if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
275 if expr "$LD_VERSION_MAJOR" = 2 && expr "$LD_VERSION_MINOR" \>= 13 > /dev/null; then
279 if test "x$LD_OK" != x; then
280 AC_MSG_RESULT([yes; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
282 AC_MSG_RESULT([no; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
283 AC_MSG_WARN([ld <2.13 detected; enabling JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS hack...])
284 AC_DEFINE(JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS, 1,
285 [Indicate that linker is not able to 8-byte align static data])
287 ])# CHECK_FOR_BROKEN_MINGW_LD
289 # Do all the work for Automake. This macro actually does too much --
290 # some checks are only needed if your package does certain things.
291 # But this isn't really a big deal.
296 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
298 AC_DEFUN(AM_INIT_AUTOMAKE,
299 [AC_REQUIRE([AC_PROG_INSTALL])
304 dnl test to see if srcdir already configured
305 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
306 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
309 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
310 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
311 AC_REQUIRE([AM_SANITY_CHECK])
312 AC_REQUIRE([AC_ARG_PROGRAM])
313 dnl FIXME This is truly gross.
314 missing_dir=`cd $ac_aux_dir && pwd`
315 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
316 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
317 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
318 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
319 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
320 AC_REQUIRE([AC_PROG_MAKE_SET])])
323 # Check to make sure that the build environment is sane.
326 AC_DEFUN(AM_SANITY_CHECK,
327 [AC_MSG_CHECKING([whether build environment is sane])
330 echo timestamp > conftestfile
331 # Do `set' in a subshell so we don't clobber the current shell's
332 # arguments. Must try -L first in case configure is actually a
333 # symlink; some systems play weird games with the mod time of symlinks
334 # (eg FreeBSD returns the mod time of the symlink's containing
337 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
338 if test "[$]*" = "X"; then
340 set X `ls -t $srcdir/configure conftestfile`
342 if test "[$]*" != "X $srcdir/configure conftestfile" \
343 && test "[$]*" != "X conftestfile $srcdir/configure"; then
345 # If neither matched, then we have a broken ls. This can happen
346 # if, for instance, CONFIG_SHELL is bash and it inherits a
347 # broken ls alias from the environment. This has actually
348 # happened. Such a system could not be considered "sane".
349 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
350 alias in your environment])
353 test "[$]2" = conftestfile
359 AC_MSG_ERROR([newly created file is older than distributed files!
360 Check your system clock])
365 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
366 dnl The program must properly implement --version.
367 AC_DEFUN(AM_MISSING_PROG,
368 [AC_MSG_CHECKING(for working $2)
369 # Run test in a subshell; some versions of sh will print an error if
370 # an executable is not found, even if stderr is redirected.
371 # Redirect stdin to placate older versions of autoconf. Sigh.
372 if ($2 --version) < /dev/null > /dev/null 2>&1; then
377 AC_MSG_RESULT(missing)
381 # Add --enable-maintainer-mode option to configure.
386 AC_DEFUN(AM_MAINTAINER_MODE,
387 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
388 dnl maintainer-mode is disabled by default
389 AC_ARG_ENABLE(maintainer-mode,
390 [ --enable-maintainer-mode enable make rules and dependencies not useful
391 (and sometimes confusing) to the casual installer],
392 USE_MAINTAINER_MODE=$enableval,
393 USE_MAINTAINER_MODE=no)
394 AC_MSG_RESULT($USE_MAINTAINER_MODE)
395 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
396 MAINT=$MAINTAINER_MODE_TRUE
401 # Define a conditional.
403 AC_DEFUN(AM_CONDITIONAL,
414 # Like AC_CONFIG_HEADER, but automatically create stamp file.
416 AC_DEFUN(AM_CONFIG_HEADER,
418 AC_CONFIG_HEADER([$1])
419 dnl When config.status generates a header, we must update the stamp-h file.
420 dnl This file resides in the same directory as the config header
421 dnl that is generated. We must strip everything past the first ":",
422 dnl and everything past the last "/".
423 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
424 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
425 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
427 for am_file in <<$1>>; do
428 case " <<$>>CONFIG_HEADERS " in
429 *" <<$>>am_file "*<<)>>
430 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
433 am_indx=`expr "<<$>>am_indx" + 1`
437 # Configure paths for GTK+
438 # Owen Taylor 97-11-3
440 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
441 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
443 AC_DEFUN(AM_PATH_GTK,
445 dnl Get the cflags and libraries from the gtk-config script
447 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
448 gtk_config_prefix="$withval", gtk_config_prefix="")
449 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
450 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
451 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
452 , enable_gtktest=yes)
458 gtk_config_args="$gtk_config_args gthread"
463 if test x$gtk_config_exec_prefix != x ; then
464 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
465 if test x${GTK_CONFIG+set} != xset ; then
466 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
469 if test x$gtk_config_prefix != x ; then
470 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
471 if test x${GTK_CONFIG+set} != xset ; then
472 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
476 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
477 min_gtk_version=ifelse([$1], ,0.99.7,$1)
478 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
480 if test "$GTK_CONFIG" = "no" ; then
483 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
484 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
485 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
486 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
487 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
488 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
489 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
490 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
491 if test "x$enable_gtktest" = "xyes" ; then
492 ac_save_CFLAGS="$CFLAGS"
494 CFLAGS="$CFLAGS $GTK_CFLAGS"
495 LIBS="$GTK_LIBS $LIBS"
497 dnl Now check if the installed GTK is sufficiently new. (Also sanity
498 dnl checks the results of gtk-config to some extent
509 int major, minor, micro;
512 system ("touch conf.gtktest");
514 /* HP/UX 9 (%@#!) writes to sscanf strings */
515 tmp_version = g_strdup("$min_gtk_version");
516 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
517 printf("%s, bad version string\n", "$min_gtk_version");
521 if ((gtk_major_version != $gtk_config_major_version) ||
522 (gtk_minor_version != $gtk_config_minor_version) ||
523 (gtk_micro_version != $gtk_config_micro_version))
525 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
526 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
527 gtk_major_version, gtk_minor_version, gtk_micro_version);
528 printf ("*** was found! If gtk-config was correct, then it is best\n");
529 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
530 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
531 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
532 printf("*** required on your system.\n");
533 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
534 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
535 printf("*** before re-running configure\n");
537 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
538 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
539 (gtk_minor_version != GTK_MINOR_VERSION) ||
540 (gtk_micro_version != GTK_MICRO_VERSION))
542 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
543 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
544 printf("*** library (version %d.%d.%d)\n",
545 gtk_major_version, gtk_minor_version, gtk_micro_version);
547 #endif /* defined (GTK_MAJOR_VERSION) ... */
550 if ((gtk_major_version > major) ||
551 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
552 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
558 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
559 gtk_major_version, gtk_minor_version, gtk_micro_version);
560 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
561 major, minor, micro);
562 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
564 printf("*** If you have already installed a sufficiently new version, this error\n");
565 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
566 printf("*** being found. The easiest way to fix this is to remove the old version\n");
567 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
568 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
569 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
570 printf("*** so that the correct libraries are found at run-time))\n");
575 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
576 CFLAGS="$ac_save_CFLAGS"
580 if test "x$no_gtk" = x ; then
582 ifelse([$2], , :, [$2])
585 if test "$GTK_CONFIG" = "no" ; then
586 echo "*** The gtk-config script installed by GTK could not be found"
587 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
588 echo "*** your path, or set the GTK_CONFIG environment variable to the"
589 echo "*** full path to gtk-config."
591 if test -f conf.gtktest ; then
594 echo "*** Could not run GTK test program, checking why..."
595 CFLAGS="$CFLAGS $GTK_CFLAGS"
596 LIBS="$LIBS $GTK_LIBS"
600 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
601 [ echo "*** The test program compiled, but did not run. This usually means"
602 echo "*** that the run-time linker is not finding GTK or finding the wrong"
603 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
604 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
605 echo "*** to the installed location Also, make sure you have run ldconfig if that"
606 echo "*** is required on your system"
608 echo "*** If you have an old version installed, it is best to remove it, although"
609 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
611 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
612 echo "*** came with the system with the command"
614 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
615 [ echo "*** The test program failed to compile or link. See the file config.log for the"
616 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
617 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
618 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
619 CFLAGS="$ac_save_CFLAGS"
625 ifelse([$3], , :, [$3])
632 # Configure paths for GLIB
633 # Owen Taylor 97-11-3
635 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
636 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
637 dnl gthread is specified in MODULES, pass to glib-config
639 AC_DEFUN(AM_PATH_GLIB,
641 dnl Get the cflags and libraries from the glib-config script
643 AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
644 glib_config_prefix="$withval", glib_config_prefix="")
645 AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
646 glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
647 AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
648 , enable_glibtest=yes)
650 if test x$glib_config_exec_prefix != x ; then
651 glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
652 if test x${GLIB_CONFIG+set} != xset ; then
653 GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
656 if test x$glib_config_prefix != x ; then
657 glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
658 if test x${GLIB_CONFIG+set} != xset ; then
659 GLIB_CONFIG=$glib_config_prefix/bin/glib-config
667 glib_config_args="$glib_config_args gmodule"
670 glib_config_args="$glib_config_args gthread"
675 AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
676 min_glib_version=ifelse([$1], ,0.99.7,$1)
677 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
679 if test "$GLIB_CONFIG" = "no" ; then
682 GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
683 GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
684 glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
685 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
686 glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
687 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
688 glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
689 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
690 if test "x$enable_glibtest" = "xyes" ; then
691 ac_save_CFLAGS="$CFLAGS"
693 CFLAGS="$CFLAGS $GLIB_CFLAGS"
694 LIBS="$GLIB_LIBS $LIBS"
696 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
697 dnl checks the results of glib-config to some extent
708 int major, minor, micro;
711 system ("touch conf.glibtest");
713 /* HP/UX 9 (%@#!) writes to sscanf strings */
714 tmp_version = g_strdup("$min_glib_version");
715 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
716 printf("%s, bad version string\n", "$min_glib_version");
720 if ((glib_major_version != $glib_config_major_version) ||
721 (glib_minor_version != $glib_config_minor_version) ||
722 (glib_micro_version != $glib_config_micro_version))
724 printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
725 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
726 glib_major_version, glib_minor_version, glib_micro_version);
727 printf ("*** was found! If glib-config was correct, then it is best\n");
728 printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
729 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
730 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
731 printf("*** required on your system.\n");
732 printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
733 printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
734 printf("*** before re-running configure\n");
736 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
737 (glib_minor_version != GLIB_MINOR_VERSION) ||
738 (glib_micro_version != GLIB_MICRO_VERSION))
740 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
741 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
742 printf("*** library (version %d.%d.%d)\n",
743 glib_major_version, glib_minor_version, glib_micro_version);
747 if ((glib_major_version > major) ||
748 ((glib_major_version == major) && (glib_minor_version > minor)) ||
749 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
755 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
756 glib_major_version, glib_minor_version, glib_micro_version);
757 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
758 major, minor, micro);
759 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
761 printf("*** If you have already installed a sufficiently new version, this error\n");
762 printf("*** probably means that the wrong copy of the glib-config shell script is\n");
763 printf("*** being found. The easiest way to fix this is to remove the old version\n");
764 printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
765 printf("*** correct copy of glib-config. (In this case, you will have to\n");
766 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
767 printf("*** so that the correct libraries are found at run-time))\n");
772 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
773 CFLAGS="$ac_save_CFLAGS"
777 if test "x$no_glib" = x ; then
779 ifelse([$2], , :, [$2])
782 if test "$GLIB_CONFIG" = "no" ; then
783 echo "*** The glib-config script installed by GLIB could not be found"
784 echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
785 echo "*** your path, or set the GLIB_CONFIG environment variable to the"
786 echo "*** full path to glib-config."
788 if test -f conf.glibtest ; then
791 echo "*** Could not run GLIB test program, checking why..."
792 CFLAGS="$CFLAGS $GLIB_CFLAGS"
793 LIBS="$LIBS $GLIB_LIBS"
797 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
798 [ echo "*** The test program compiled, but did not run. This usually means"
799 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
800 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
801 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
802 echo "*** to the installed location Also, make sure you have run ldconfig if that"
803 echo "*** is required on your system"
805 echo "*** If you have an old version installed, it is best to remove it, although"
806 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
808 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
809 echo "*** came with the system with the command"
811 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
812 [ echo "*** The test program failed to compile or link. See the file config.log for the"
813 echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
814 echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
815 echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
816 CFLAGS="$ac_save_CFLAGS"
822 ifelse([$3], , :, [$3])
824 AC_SUBST(GLIB_CFLAGS)
829 # Configure paths for LIBART
830 # Raph Levien 98-11-18
831 # stolen from Manish Singh 98-9-30
832 # stolen back from Frank Belew
833 # stolen from Manish Singh
834 # Shamelessly stolen from Owen Taylor
836 dnl AM_PATH_LIBART([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
837 dnl Test for LIBART, and define LIBART_CFLAGS and LIBART_LIBS
839 AC_DEFUN(AM_PATH_LIBART,
841 dnl Get the cflags and libraries from the libart-config script
843 AC_ARG_WITH(libart-prefix,[ --with-libart-prefix=PFX Prefix where LIBART is installed (optional)],
844 libart_prefix="$withval", libart_prefix="")
845 AC_ARG_WITH(libart-exec-prefix,[ --with-libart-exec-prefix=PFX Exec prefix where LIBART is installed (optional)],
846 libart_exec_prefix="$withval", libart_exec_prefix="")
847 AC_ARG_ENABLE(libarttest, [ --disable-libarttest Do not try to compile and run a test LIBART program],
848 , enable_libarttest=yes)
850 if test x$libart_exec_prefix != x ; then
851 libart_args="$libart_args --exec-prefix=$libart_exec_prefix"
852 if test x${LIBART_CONFIG+set} != xset ; then
853 LIBART_CONFIG=$libart_exec_prefix/bin/libart-config
856 if test x$libart_prefix != x ; then
857 libart_args="$libart_args --prefix=$libart_prefix"
858 if test x${LIBART_CONFIG+set} != xset ; then
859 LIBART_CONFIG=$libart_prefix/bin/libart-config
863 AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
864 min_libart_version=ifelse([$1], ,0.2.5,$1)
865 AC_MSG_CHECKING(for LIBART - version >= $min_libart_version)
867 if test "$LIBART_CONFIG" = "no" ; then
870 LIBART_CFLAGS=`$LIBART_CONFIG $libartconf_args --cflags`
871 LIBART_LIBS=`$LIBART_CONFIG $libartconf_args --libs`
873 libart_major_version=`$LIBART_CONFIG $libart_args --version | \
874 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
875 libart_minor_version=`$LIBART_CONFIG $libart_args --version | \
876 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
877 libart_micro_version=`$LIBART_CONFIG $libart_config_args --version | \
878 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
879 if test "x$enable_libarttest" = "xyes" ; then
880 ac_save_CFLAGS="$CFLAGS"
882 CFLAGS="$CFLAGS $LIBART_CFLAGS"
883 LIBS="$LIBS $LIBART_LIBS"
885 dnl Now check if the installed LIBART is sufficiently new. (Also sanity
886 dnl checks the results of libart-config to some extent
888 rm -f conf.libarttest
893 #include <libart_lgpl/libart.h>
896 my_strdup (char *str)
902 new_str = malloc ((strlen (str) + 1) * sizeof(char));
903 strcpy (new_str, str);
913 int major, minor, micro;
916 system ("touch conf.libarttest");
918 /* HP/UX 9 (%@#!) writes to sscanf strings */
919 tmp_version = my_strdup("$min_libart_version");
920 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
921 printf("%s, bad version string\n", "$min_libart_version");
925 if (($libart_major_version > major) ||
926 (($libart_major_version == major) && ($libart_minor_version > minor)) ||
927 (($libart_major_version == major) && ($libart_minor_version == minor) && ($libart_micro_version >= micro)))
933 printf("\n*** 'libart-config --version' returned %d.%d.%d, but the minimum version\n", $libart_major_version, $libart_minor_version, $libart_micro_version);
934 printf("*** of LIBART required is %d.%d.%d. If libart-config is correct, then it is\n", major, minor, micro);
935 printf("*** best to upgrade to the required version.\n");
936 printf("*** If libart-config was wrong, set the environment variable LIBART_CONFIG\n");
937 printf("*** to point to the correct copy of libart-config, and remove the file\n");
938 printf("*** config.cache before re-running configure\n");
943 ],, no_libart=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
944 CFLAGS="$ac_save_CFLAGS"
948 if test "x$no_libart" = x ; then
950 ifelse([$2], , :, [$2])
953 if test "$LIBART_CONFIG" = "no" ; then
954 echo "*** The libart-config script installed by LIBART could not be found"
955 echo "*** If LIBART was installed in PREFIX, make sure PREFIX/bin is in"
956 echo "*** your path, or set the LIBART_CONFIG environment variable to the"
957 echo "*** full path to libart-config."
959 if test -f conf.libarttest ; then
962 echo "*** Could not run LIBART test program, checking why..."
963 CFLAGS="$CFLAGS $LIBART_CFLAGS"
964 LIBS="$LIBS $LIBART_LIBS"
967 #include <libart_lgpl/libart.h>
969 [ echo "*** The test program compiled, but did not run. This usually means"
970 echo "*** that the run-time linker is not finding LIBART or finding the wrong"
971 echo "*** version of LIBART. If it is not finding LIBART, you'll need to set your"
972 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
973 echo "*** to the installed location Also, make sure you have run ldconfig if that"
974 echo "*** is required on your system"
976 echo "*** If you have an old version installed, it is best to remove it, although"
977 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
978 [ echo "*** The test program failed to compile or link. See the file config.log for the"
979 echo "*** exact error that occured. This usually means LIBART was incorrectly installed"
980 echo "*** or that you have moved LIBART since it was installed. In the latter case, you"
981 echo "*** may want to edit the libart-config script: $LIBART_CONFIG" ])
982 CFLAGS="$ac_save_CFLAGS"
988 ifelse([$3], , :, [$3])
990 AC_SUBST(LIBART_CFLAGS)
991 AC_SUBST(LIBART_LIBS)
992 rm -f conf.libarttest