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 dnl ---------------------------------------------------------------------------
15 dnl Macros for configure.in for wxWindows by Robert Roebling, Phil Blecker,
16 dnl Vadim Zeitlin and Ron Lee
18 dnl This script is under the wxWindows licence.
21 dnl ---------------------------------------------------------------------------
23 dnl ===========================================================================
24 dnl macros to find the a file in the list of include/lib paths
25 dnl ===========================================================================
27 dnl ---------------------------------------------------------------------------
28 dnl call WX_PATH_FIND_INCLUDES(search path, header name), sets ac_find_includes
29 dnl to the full name of the file that was found or leaves it empty if not found
30 dnl ---------------------------------------------------------------------------
31 AC_DEFUN([WX_PATH_FIND_INCLUDES],
36 if test -f "$ac_dir/$2"; then
37 ac_find_includes=$ac_dir
43 dnl ---------------------------------------------------------------------------
44 dnl call WX_PATH_FIND_LIBRARIES(search path, header name), sets ac_find_libraries
45 dnl to the full name of the file that was found or leaves it empty if not found
46 dnl ---------------------------------------------------------------------------
47 AC_DEFUN([WX_PATH_FIND_LIBRARIES],
52 for ac_extension in a so sl dylib; do
53 if test -f "$ac_dir/lib$2.$ac_extension"; then
54 ac_find_libraries=$ac_dir
61 dnl ---------------------------------------------------------------------------
62 dnl Path to include, already defined
63 dnl ---------------------------------------------------------------------------
64 AC_DEFUN([WX_INCLUDE_PATH_EXIST],
67 echo "$2" | grep "\-I$1" > /dev/null
69 if test $result = 0; then
72 ac_path_to_include=" -I$1"
76 dnl ---------------------------------------------------------------------------
77 dnl Path to link, already defined
78 dnl ---------------------------------------------------------------------------
79 AC_DEFUN([WX_LINK_PATH_EXIST],
81 echo "$2" | grep "\-L$1" > /dev/null
83 if test $result = 0; then
86 ac_path_to_link=" -L$1"
90 dnl ===========================================================================
92 dnl ===========================================================================
94 dnl ---------------------------------------------------------------------------
95 dnl WX_CPP_NEW_HEADERS checks whether the compiler has "new" <iostream> header
96 dnl or only the old <iostream.h> one - it may be generally assumed that if
97 dnl <iostream> exists, the other "new" headers (without .h) exist too.
99 dnl call WX_CPP_NEW_HEADERS(actiof-if-true, action-if-false-or-cross-compiling)
100 dnl ---------------------------------------------------------------------------
102 AC_DEFUN([WX_CPP_NEW_HEADERS],
104 if test "$cross_compiling" = "yes"; then
105 ifelse([$2], , :, [$2])
110 AC_CHECK_HEADERS(iostream)
112 if test "$ac_cv_header_iostream" = "yes" ; then
113 ifelse([$1], , :, [$1])
115 ifelse([$2], , :, [$2])
122 dnl ---------------------------------------------------------------------------
123 dnl WX_CPP_BOOL checks whether the C++ compiler has a built in bool type
125 dnl call WX_CPP_BOOL - will define HAVE_BOOL if the compiler supports bool
126 dnl ---------------------------------------------------------------------------
128 AC_DEFUN([WX_CPP_BOOL],
130 AC_CACHE_CHECK([if C++ compiler supports bool], wx_cv_cpp_bool,
154 if test "$wx_cv_cpp_bool" = "yes"; then
159 dnl ---------------------------------------------------------------------------
160 dnl WX_CPP_EXPLICIT checks whether the C++ compiler support the explicit
161 dnl keyword and defines HAVE_EXPLICIT if this is the case
162 dnl ---------------------------------------------------------------------------
164 AC_DEFUN([WX_CPP_EXPLICIT],
166 AC_CACHE_CHECK([if C++ compiler supports the explicit keyword],
172 dnl do the test in 2 steps: first check that the compiler knows about the
173 dnl explicit keyword at all and then verify that it really honours it
176 class Foo { public: explicit Foo(int) {} };
184 class Foo { public: explicit Foo(int) {} };
185 static void TakeFoo(const Foo& foo) { }
201 if test "$wx_cv_explicit" = "yes"; then
202 AC_DEFINE(HAVE_EXPLICIT)
206 dnl ---------------------------------------------------------------------------
207 dnl a slightly better AC_C_BIGENDIAN macro which allows cross-compiling
208 dnl ---------------------------------------------------------------------------
210 AC_DEFUN([WX_C_BIGENDIAN],
211 [AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian,
212 [ac_cv_c_bigendian=unknown
213 # See if sys/param.h defines the BYTE_ORDER macro.
214 AC_TRY_COMPILE([#include <sys/types.h>
215 #include <sys/param.h>], [
216 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
218 #endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
219 AC_TRY_COMPILE([#include <sys/types.h>
220 #include <sys/param.h>], [
221 #if BYTE_ORDER != BIG_ENDIAN
223 #endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
224 if test $ac_cv_c_bigendian = unknown; then
225 AC_TRY_RUN([main () {
226 /* Are we little or big endian? From Harbison&Steele. */
230 char c[sizeof (long)];
233 exit (u.c[sizeof (long) - 1] == 1);
234 }], [ac_cv_c_bigendian=no], [ac_cv_c_bigendian=yes], [ac_cv_c_bigendian=unknown])
236 if test $ac_cv_c_bigendian = unknown; then
237 AC_MSG_WARN([Assuming little-endian target machine - this may be overriden by adding the line "ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}" to config.cache file])
239 if test $ac_cv_c_bigendian = yes; then
240 AC_DEFINE(WORDS_BIGENDIAN)
244 dnl ---------------------------------------------------------------------------
245 dnl override AC_ARG_ENABLE/WITH to cache the results in .cache file
246 dnl ---------------------------------------------------------------------------
248 AC_DEFUN([WX_ARG_CACHE_INIT],
250 wx_arg_cache_file="configarg.cache"
251 echo "loading argument cache $wx_arg_cache_file"
252 rm -f ${wx_arg_cache_file}.tmp
253 touch ${wx_arg_cache_file}.tmp
254 touch ${wx_arg_cache_file}
257 AC_DEFUN([WX_ARG_CACHE_FLUSH],
259 echo "saving argument cache $wx_arg_cache_file"
260 mv ${wx_arg_cache_file}.tmp ${wx_arg_cache_file}
263 dnl this macro checks for a three-valued command line --with argument:
264 dnl possible arguments are 'yes', 'no', 'sys', or 'builtin'
265 dnl usage: WX_ARG_SYS_WITH(option, helpmessage, variable-name)
266 AC_DEFUN([WX_ARG_SYS_WITH],
268 AC_MSG_CHECKING([for --with-$1])
270 AC_ARG_WITH($1, [$2],
272 if test "$withval" = yes; then
273 ac_cv_use_$1='$3=yes'
274 elif test "$withval" = no; then
276 elif test "$withval" = sys; then
277 ac_cv_use_$1='$3=sys'
278 elif test "$withval" = builtin; then
279 ac_cv_use_$1='$3=builtin'
281 AC_MSG_ERROR([Invalid value for --with-$1: should be yes, no, sys, or builtin])
285 LINE=`grep "$3" ${wx_arg_cache_file}`
286 if test "x$LINE" != x ; then
292 ac_cv_use_$1='$3='$DEFAULT_$3
296 if test "$no_cache" != 1; then
297 echo $ac_cv_use_$1 >> ${wx_arg_cache_file}.tmp
300 if test "$$3" = yes; then
302 elif test "$$3" = no; then
304 elif test "$$3" = sys; then
305 AC_MSG_RESULT([system version])
306 elif test "$$3" = builtin; then
307 AC_MSG_RESULT([builtin version])
309 AC_MSG_ERROR([Invalid value for --with-$1: should be yes, no, sys, or builtin])
313 dnl this macro checks for a command line argument and caches the result
314 dnl usage: WX_ARG_WITH(option, helpmessage, variable-name)
315 AC_DEFUN([WX_ARG_WITH],
317 AC_MSG_CHECKING([for --with-$1])
319 AC_ARG_WITH($1, [$2],
321 if test "$withval" = yes; then
322 ac_cv_use_$1='$3=yes'
328 LINE=`grep "$3" ${wx_arg_cache_file}`
329 if test "x$LINE" != x ; then
335 ac_cv_use_$1='$3='$DEFAULT_$3
339 if test "$no_cache" != 1; then
340 echo $ac_cv_use_$1 >> ${wx_arg_cache_file}.tmp
343 if test "$$3" = yes; then
350 dnl like WX_ARG_WITH but uses AC_ARG_ENABLE instead of AC_ARG_WITH
351 dnl usage: WX_ARG_ENABLE(option, helpmessage, variable-name)
352 AC_DEFUN([WX_ARG_ENABLE],
354 AC_MSG_CHECKING([for --enable-$1])
356 AC_ARG_ENABLE($1, [$2],
358 if test "$enableval" = yes; then
359 ac_cv_use_$1='$3=yes'
365 LINE=`grep "$3" ${wx_arg_cache_file}`
366 if test "x$LINE" != x ; then
372 ac_cv_use_$1='$3='$DEFAULT_$3
376 if test "$no_cache" != 1; then
377 echo $ac_cv_use_$1 >> ${wx_arg_cache_file}.tmp
380 if test "$$3" = yes; then
389 dnl ===========================================================================
390 dnl "3rd party" macros included here because they are not widely available
391 dnl ===========================================================================
393 dnl ---------------------------------------------------------------------------
394 dnl test for availability of iconv()
395 dnl ---------------------------------------------------------------------------
397 dnl From Bruno Haible.
401 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
402 dnl those with the standalone portable GNU libiconv installed).
404 AC_ARG_WITH([libiconv-prefix],
405 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
406 for dir in `echo "$withval" | tr : ' '`; do
407 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
408 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
412 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
413 am_cv_func_iconv="no, consider installing GNU libiconv"
415 AC_TRY_LINK([#include <stdlib.h>
417 [iconv_t cd = iconv_open("","");
418 iconv(cd,NULL,NULL,NULL,NULL);
420 am_cv_func_iconv=yes)
421 if test "$am_cv_func_iconv" != yes; then
424 AC_TRY_LINK([#include <stdlib.h>
426 [iconv_t cd = iconv_open("","");
427 iconv(cd,NULL,NULL,NULL,NULL);
430 am_cv_func_iconv=yes)
434 if test "$am_cv_func_iconv" = yes; then
435 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
436 AC_CACHE_CHECK([if iconv needs const], wx_cv_func_iconv_const,
444 #if defined(__STDC__) || defined(__cplusplus)
445 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
451 wx_cv_func_iconv_const="no",
452 wx_cv_func_iconv_const="yes"
457 if test "x$wx_cv_func_iconv_const" = "xyes"; then
461 AC_DEFINE_UNQUOTED(ICONV_CONST, $iconv_const,
462 [Define as const if the declaration of iconv() needs const.])
465 if test "$am_cv_lib_iconv" = yes; then
471 dnl ---------------------------------------------------------------------------
472 dnl AC_SYS_LARGEFILE (partly based on the code from autoconf 2.5x)
473 dnl ---------------------------------------------------------------------------
475 dnl WX_SYS_LARGEFILE_TEST
477 dnl NB: original autoconf test was checking if compiler supported 6 bit off_t
478 dnl arithmetic properly but this failed miserably with gcc under Linux
479 dnl whereas the system still supports 64 bit files, so now simply check
480 dnl that off_t is big enough
481 define(WX_SYS_LARGEFILE_TEST,
483 unsigned int field: sizeof(off_t) == 8;
488 dnl WX_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR)
489 define(WX_SYS_LARGEFILE_MACRO_VALUE,
491 AC_CACHE_CHECK([for $1 value needed for large files], [$3],
493 AC_TRY_COMPILE([#define $1 $2
494 #include <sys/types.h>],
495 WX_SYS_LARGEFILE_TEST,
501 if test "$$3" != no; then
503 AC_DEFINE_UNQUOTED([$1], [$$3])
510 dnl By default, many hosts won't let programs access large files;
511 dnl one must use special compiler options to get large-file access to work.
512 dnl For more details about this brain damage please see:
513 dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
514 AC_DEFUN([AC_SYS_LARGEFILE],
515 [AC_ARG_ENABLE(largefile,
516 [ --disable-largefile omit support for large files])
517 if test "$enable_largefile" != no; then
518 dnl _FILE_OFFSET_BITS==64 is needed for Linux, Solaris, ...
519 dnl _LARGE_FILES -- for AIX
521 WX_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, ac_cv_sys_file_offset_bits)
522 if test "x$wx_largefile" != "xyes"; then
523 WX_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, ac_cv_sys_large_files)
526 AC_MSG_CHECKING(if large file support is available)
527 if test "x$wx_largefile" = "xyes"; then
528 AC_DEFINE(HAVE_LARGEFILE_SUPPORT)
530 AC_MSG_RESULT($wx_largefile)
534 # Configure paths for GTK+
535 # Owen Taylor 1997-2001
537 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
538 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
539 dnl pass to pkg-config
541 AC_DEFUN(AM_PATH_GTK_2_0,
543 dnl Get the cflags and libraries from pkg-config
545 AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
546 , enable_gtktest=yes)
548 pkg_config_args=gtk+-2.0
553 pkg_config_args="$pkg_config_args gthread-2.0"
560 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
562 if test x$PKG_CONFIG != xno ; then
563 if pkg-config --atleast-pkgconfig-version 0.7 ; then
566 echo *** pkg-config too old; version 0.7 or better required.
574 min_gtk_version=ifelse([$1], ,2.0.0,$1)
575 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
577 if test x$PKG_CONFIG != xno ; then
578 ## don't try to run the test against uninstalled libtool libs
579 if $PKG_CONFIG --uninstalled $pkg_config_args; then
580 echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
584 if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
591 if test x"$no_gtk" = x ; then
592 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
593 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
594 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
595 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
596 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
597 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
598 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
599 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
600 if test "x$enable_gtktest" = "xyes" ; then
601 ac_save_CFLAGS="$CFLAGS"
603 CFLAGS="$CFLAGS $GTK_CFLAGS"
604 LIBS="$GTK_LIBS $LIBS"
606 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
607 dnl checks the results of pkg-config to some extent)
618 int major, minor, micro;
621 system ("touch conf.gtktest");
623 /* HP/UX 9 (%@#!) writes to sscanf strings */
624 tmp_version = g_strdup("$min_gtk_version");
625 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
626 printf("%s, bad version string\n", "$min_gtk_version");
630 if ((gtk_major_version != $gtk_config_major_version) ||
631 (gtk_minor_version != $gtk_config_minor_version) ||
632 (gtk_micro_version != $gtk_config_micro_version))
634 printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
635 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
636 gtk_major_version, gtk_minor_version, gtk_micro_version);
637 printf ("*** was found! If pkg-config was correct, then it is best\n");
638 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
639 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
640 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
641 printf("*** required on your system.\n");
642 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
643 printf("*** to point to the correct configuration files\n");
645 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
646 (gtk_minor_version != GTK_MINOR_VERSION) ||
647 (gtk_micro_version != GTK_MICRO_VERSION))
649 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
650 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
651 printf("*** library (version %d.%d.%d)\n",
652 gtk_major_version, gtk_minor_version, gtk_micro_version);
656 if ((gtk_major_version > major) ||
657 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
658 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
664 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
665 gtk_major_version, gtk_minor_version, gtk_micro_version);
666 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
667 major, minor, micro);
668 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
670 printf("*** If you have already installed a sufficiently new version, this error\n");
671 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
672 printf("*** being found. The easiest way to fix this is to remove the old version\n");
673 printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
674 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
675 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
676 printf("*** so that the correct libraries are found at run-time))\n");
681 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
682 CFLAGS="$ac_save_CFLAGS"
686 if test "x$no_gtk" = x ; then
687 AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
688 ifelse([$2], , :, [$2])
691 if test "$PKG_CONFIG" = "no" ; then
692 echo "*** A new enough version of pkg-config was not found."
693 echo "*** See http://pkgconfig.sourceforge.net"
695 if test -f conf.gtktest ; then
698 echo "*** Could not run GTK+ test program, checking why..."
699 CFLAGS="$CFLAGS $GTK_CFLAGS"
700 LIBS="$LIBS $GTK_LIBS"
704 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
705 [ echo "*** The test program compiled, but did not run. This usually means"
706 echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
707 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
708 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
709 echo "*** to the installed location Also, make sure you have run ldconfig if that"
710 echo "*** is required on your system"
712 echo "*** If you have an old version installed, it is best to remove it, although"
713 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
714 [ echo "*** The test program failed to compile or link. See the file config.log for the"
715 echo "*** exact error that occured. This usually means GTK+ was incorrectly installed"
716 echo "*** or that you have moved GTK+ since it was installed. In the latter case, you"
717 echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
718 CFLAGS="$ac_save_CFLAGS"
724 ifelse([$3], , :, [$3])
731 # Configure paths for GTK+
732 # Owen Taylor 97-11-3
734 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
735 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
737 AC_DEFUN(AM_PATH_GTK,
739 dnl Get the cflags and libraries from the gtk-config script
741 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
742 gtk_config_prefix="$withval", gtk_config_prefix="")
743 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
744 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
745 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
746 , enable_gtktest=yes)
752 gtk_config_args="$gtk_config_args gthread"
757 if test x$gtk_config_exec_prefix != x ; then
758 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
759 if test x${GTK_CONFIG+set} != xset ; then
760 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
763 if test x$gtk_config_prefix != x ; then
764 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
765 if test x${GTK_CONFIG+set} != xset ; then
766 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
770 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
771 min_gtk_version=ifelse([$1], ,0.99.7,$1)
772 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
774 if test "$GTK_CONFIG" = "no" ; then
777 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
778 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
779 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
780 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
781 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
782 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
783 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
784 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
785 if test "x$enable_gtktest" = "xyes" ; then
786 ac_save_CFLAGS="$CFLAGS"
788 CFLAGS="$CFLAGS $GTK_CFLAGS"
789 LIBS="$GTK_LIBS $LIBS"
791 dnl Now check if the installed GTK is sufficiently new. (Also sanity
792 dnl checks the results of gtk-config to some extent
803 int major, minor, micro;
806 system ("touch conf.gtktest");
808 /* HP/UX 9 (%@#!) writes to sscanf strings */
809 tmp_version = g_strdup("$min_gtk_version");
810 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
811 printf("%s, bad version string\n", "$min_gtk_version");
815 if ((gtk_major_version != $gtk_config_major_version) ||
816 (gtk_minor_version != $gtk_config_minor_version) ||
817 (gtk_micro_version != $gtk_config_micro_version))
819 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
820 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
821 gtk_major_version, gtk_minor_version, gtk_micro_version);
822 printf ("*** was found! If gtk-config was correct, then it is best\n");
823 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
824 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
825 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
826 printf("*** required on your system.\n");
827 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
828 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
829 printf("*** before re-running configure\n");
831 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
832 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
833 (gtk_minor_version != GTK_MINOR_VERSION) ||
834 (gtk_micro_version != GTK_MICRO_VERSION))
836 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
837 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
838 printf("*** library (version %d.%d.%d)\n",
839 gtk_major_version, gtk_minor_version, gtk_micro_version);
841 #endif /* defined (GTK_MAJOR_VERSION) ... */
844 if ((gtk_major_version > major) ||
845 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
846 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
852 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
853 gtk_major_version, gtk_minor_version, gtk_micro_version);
854 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
855 major, minor, micro);
856 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
858 printf("*** If you have already installed a sufficiently new version, this error\n");
859 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
860 printf("*** being found. The easiest way to fix this is to remove the old version\n");
861 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
862 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
863 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
864 printf("*** so that the correct libraries are found at run-time))\n");
869 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
870 CFLAGS="$ac_save_CFLAGS"
874 if test "x$no_gtk" = x ; then
876 ifelse([$2], , :, [$2])
879 if test "$GTK_CONFIG" = "no" ; then
880 echo "*** The gtk-config script installed by GTK could not be found"
881 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
882 echo "*** your path, or set the GTK_CONFIG environment variable to the"
883 echo "*** full path to gtk-config."
885 if test -f conf.gtktest ; then
888 echo "*** Could not run GTK test program, checking why..."
889 CFLAGS="$CFLAGS $GTK_CFLAGS"
890 LIBS="$LIBS $GTK_LIBS"
894 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
895 [ echo "*** The test program compiled, but did not run. This usually means"
896 echo "*** that the run-time linker is not finding GTK or finding the wrong"
897 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
898 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
899 echo "*** to the installed location Also, make sure you have run ldconfig if that"
900 echo "*** is required on your system"
902 echo "*** If you have an old version installed, it is best to remove it, although"
903 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
905 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
906 echo "*** came with the system with the command"
908 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
909 [ echo "*** The test program failed to compile or link. See the file config.log for the"
910 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
911 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
912 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
913 CFLAGS="$ac_save_CFLAGS"
919 ifelse([$3], , :, [$3])