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 # Do all the work for Automake. This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
22 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AC_PROG_INSTALL])
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
47 # Check to make sure that the build environment is sane.
50 AC_DEFUN(AM_SANITY_CHECK,
51 [AC_MSG_CHECKING([whether build environment is sane])
54 echo timestamp > conftestfile
55 # Do `set' in a subshell so we don't clobber the current shell's
56 # arguments. Must try -L first in case configure is actually a
57 # symlink; some systems play weird games with the mod time of symlinks
58 # (eg FreeBSD returns the mod time of the symlink's containing
61 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62 if test "[$]*" = "X"; then
64 set X `ls -t $srcdir/configure conftestfile`
66 if test "[$]*" != "X $srcdir/configure conftestfile" \
67 && test "[$]*" != "X conftestfile $srcdir/configure"; then
69 # If neither matched, then we have a broken ls. This can happen
70 # if, for instance, CONFIG_SHELL is bash and it inherits a
71 # broken ls alias from the environment. This has actually
72 # happened. Such a system could not be considered "sane".
73 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
74 alias in your environment])
77 test "[$]2" = conftestfile
83 AC_MSG_ERROR([newly created file is older than distributed files!
84 Check your system clock])
89 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90 dnl The program must properly implement --version.
91 AC_DEFUN(AM_MISSING_PROG,
92 [AC_MSG_CHECKING(for working $2)
93 # Run test in a subshell; some versions of sh will print an error if
94 # an executable is not found, even if stderr is redirected.
95 # Redirect stdin to placate older versions of autoconf. Sigh.
96 if ($2 --version) < /dev/null > /dev/null 2>&1; then
101 AC_MSG_RESULT(missing)
105 # Like AC_CONFIG_HEADER, but automatically create stamp file.
107 AC_DEFUN(AM_CONFIG_HEADER,
109 AC_CONFIG_HEADER([$1])
110 dnl When config.status generates a header, we must update the stamp-h file.
111 dnl This file resides in the same directory as the config header
112 dnl that is generated. We must strip everything past the first ":",
113 dnl and everything past the last "/".
114 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
118 for am_file in <<$1>>; do
119 case " <<$>>CONFIG_HEADERS " in
120 *" <<$>>am_file "*<<)>>
121 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
124 am_indx=`expr "<<$>>am_indx" + 1`
130 # This macro adds the name macrodir to the set of directories
131 # that `aclocal' searches for macros.
135 dnl AM_ACLOCAL_INCLUDE(macrodir)
136 AC_DEFUN([AM_ACLOCAL_INCLUDE],
138 AM_CONDITIONAL(INSIDE_GNOME_COMMON, test x = y)
140 test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
142 for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
145 # Define a conditional.
147 AC_DEFUN(AM_CONDITIONAL,
159 dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
161 dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
165 AC_DEFUN([GNOME_INIT_HOOK],[
167 AC_SUBST(GNOMEUI_LIBS)
168 AC_SUBST(GNOMEGNORBA_LIBS)
169 AC_SUBST(GTKXMHTML_LIBS)
171 AC_SUBST(GNOME_LIBDIR)
172 AC_SUBST(GNOME_INCLUDEDIR)
174 AC_ARG_WITH(gnome-includes,
175 [ --with-gnome-includes Specify location of GNOME headers],[
176 CFLAGS="$CFLAGS -I$withval"
179 AC_ARG_WITH(gnome-libs,
180 [ --with-gnome-libs Specify location of GNOME libs],[
181 LDFLAGS="$LDFLAGS -L$withval"
182 gnome_prefix=$withval
186 [ --with-gnome Specify prefix for GNOME files],
187 if test x$withval = xyes; then
189 dnl Note that an empty true branch is not
191 ifelse([$1], [], :, [$1])
193 if test "x$withval" = xno; then
197 LDFLAGS="$LDFLAGS -L$withval/lib"
198 CFLAGS="$CFLAGS -I$withval/include"
199 gnome_prefix=$withval/lib
204 if test "x$want_gnome" = xyes; then
206 AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
207 if test "$GNOME_CONFIG" = "no"; then
208 no_gnome_config="yes"
210 AC_MSG_CHECKING(if $GNOME_CONFIG works)
211 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
213 GNOME_GNORBA_HOOK([],$2)
214 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
215 GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
216 GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
217 GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
218 ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
219 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
220 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
224 no_gnome_config="yes"
228 if test x$exec_prefix = xNONE; then
229 if test x$prefix = xNONE; then
230 gnome_prefix=$ac_default_prefix/lib
232 gnome_prefix=$prefix/lib
235 gnome_prefix=`eval echo \`echo $libdir\``
238 if test "$no_gnome_config" = "yes"; then
239 AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
240 if test -f $gnome_prefix/gnomeConf.sh; then
242 echo "loading gnome configuration from" \
243 "$gnome_prefix/gnomeConf.sh"
244 . $gnome_prefix/gnomeConf.sh
247 AC_MSG_RESULT(not found)
248 if test x$2 = xfail; then
249 AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
255 if test -n "$3"; then
258 AC_MSG_CHECKING(extra library \"$i\")
261 AC_SUBST(GNOME_APPLETS_LIBS)
262 GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
263 AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
265 AC_SUBST(GNOME_CAPPLET_LIBS)
266 GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
267 AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
269 AC_MSG_RESULT(unknown library)
276 dnl GNOME_INIT ([additional-inits])
279 AC_DEFUN([GNOME_INIT],[
280 GNOME_INIT_HOOK([],fail,$1)
284 dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
286 dnl if failflag is "failure" it aborts if gnorba is not found.
289 AC_DEFUN([GNOME_GNORBA_HOOK],[
290 GNOME_ORBIT_HOOK([],$2)
291 AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
292 gnome_cv_gnorba_found=no
293 if test x$gnome_cv_orbit_found = xyes; then
294 GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
295 GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
296 if test -n "$GNORBA_LIBS"; then
297 gnome_cv_gnorba_found=yes
301 AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
302 if test x$gnome_cv_orbit_found = xyes; then
304 GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
305 GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
306 AC_SUBST(GNORBA_CFLAGS)
307 AC_SUBST(GNORBA_LIBS)
309 if test x$2 = xfailure; then
310 AC_MSG_ERROR(gnorba library not installed or installation problem)
315 AC_DEFUN([GNOME_GNORBA_CHECK], [
316 GNOME_GNORBA_HOOK([],failure)
320 dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
322 dnl if failflag is "failure" it aborts if orbit is not found.
325 AC_DEFUN([GNOME_ORBIT_HOOK],[
326 AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
327 AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
328 AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
329 if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
330 gnome_cv_orbit_found=no
332 gnome_cv_orbit_found=yes
335 AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
336 if test x$gnome_cv_orbit_found = xyes; then
338 ORBIT_CFLAGS=`orbit-config --cflags client server`
339 ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
340 AC_SUBST(ORBIT_CFLAGS)
343 if test x$2 = xfailure; then
344 AC_MSG_ERROR(ORBit not installed or installation problem)
349 AC_DEFUN([GNOME_ORBIT_CHECK], [
350 GNOME_ORBIT_HOOK([],failure)
356 # @defmac AC_PROG_CC_STDC
357 # @maindex PROG_CC_STDC
359 # If the C compiler in not in ANSI C mode by default, try to add an option
360 # to output variable @code{CC} to make it so. This macro tries various
361 # options that select ANSI C on some system or another. It considers the
362 # compiler to be in ANSI C mode if it handles function prototypes correctly.
364 # If you use this macro, you should check after calling it whether the C
365 # compiler has been set to accept ANSI C; if not, the shell variable
366 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
367 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
368 # program @code{ansi2knr}, which comes with Ghostscript.
371 AC_DEFUN(AM_PROG_CC_STDC,
372 [AC_REQUIRE([AC_PROG_CC])
373 AC_BEFORE([$0], [AC_C_INLINE])
374 AC_BEFORE([$0], [AC_C_CONST])
375 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
376 dnl a magic option to avoid problems with ANSI preprocessor commands
378 dnl FIXME: can't do this because then AC_AIX won't work due to a
379 dnl circular dependency.
380 dnl AC_BEFORE([$0], [AC_PROG_CPP])
381 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
382 AC_CACHE_VAL(am_cv_prog_cc_stdc,
383 [am_cv_prog_cc_stdc=no
385 # Don't try gcc -ansi; that turns off useful extensions and
386 # breaks some systems' header files.
388 # Ultrix and OSF/1 -std1
389 # HP-UX -Aa -D_HPUX_SOURCE
390 # SVR4 -Xc -D__EXTENSIONS__
391 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
393 CC="$ac_save_CC $ac_arg"
397 #include <sys/types.h>
398 #include <sys/stat.h>
399 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
400 struct buf { int x; };
401 FILE * (*rcsopen) (struct buf *, struct stat *, int);
402 static char *e (p, i)
408 static char *f (char * (*g) (char **, int), char **p, ...)
413 s = g (p, va_arg (v,int));
417 int test (int i, double x);
418 struct s1 {int (*f) (int a);};
419 struct s2 {int (*f) (double a);};
420 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
424 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
426 [am_cv_prog_cc_stdc="$ac_arg"; break])
430 if test -z "$am_cv_prog_cc_stdc"; then
431 AC_MSG_RESULT([none needed])
433 AC_MSG_RESULT($am_cv_prog_cc_stdc)
435 case "x$am_cv_prog_cc_stdc" in
437 *) CC="$CC $am_cv_prog_cc_stdc" ;;
441 dnl GNOME_COMPILE_WARNINGS
442 dnl Turn on many useful compiler warnings
443 dnl For now, only works on GCC
444 AC_DEFUN([GNOME_COMPILE_WARNINGS],[
445 AC_ARG_ENABLE(compile-warnings,
446 [ --enable-compile-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_compile_warnings=minimum)
448 AC_MSG_CHECKING(what warning flags to pass to the C compiler)
450 if test "x$GCC" != xyes; then
451 enable_compile_warnings=no
454 if test "x$enable_compile_warnings" != "xno"; then
455 if test "x$GCC" = "xyes"; then
457 *[\ \ ]-Wall[\ \ ]*) ;;
458 *) warnCFLAGS="-Wall -Wunused" ;;
461 ## -W is not all that useful. And it cannot be controlled
462 ## with individual -Wno-xxx flags, unlike -Wall
463 if test "x$enable_compile_warnings" = "xyes"; then
464 warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith"
468 AC_MSG_RESULT($warnCFLAGS)
471 [ --enable-iso-c Try to warn if code is not ISO C ],,
474 AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
476 if test "x$enable_iso_c" != "xno"; then
477 if test "x$GCC" = "xyes"; then
479 *[\ \ ]-ansi[\ \ ]*) ;;
480 *) complCFLAGS="$complCFLAGS -ansi" ;;
484 *[\ \ ]-pedantic[\ \ ]*) ;;
485 *) complCFLAGS="$complCFLAGS -pedantic" ;;
489 AC_MSG_RESULT($complCFLAGS)
490 if test "x$cflags_set" != "xyes"; then
491 CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS"
497 dnl For C++, do basically the same thing.
499 AC_DEFUN([GNOME_CXX_WARNINGS],[
500 AC_ARG_ENABLE(cxx-warnings,
501 [ --enable-cxx-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_cxx_warnings=minimum)
503 AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
505 if test "x$GCC" != xyes; then
506 enable_compile_warnings=no
508 if test "x$enable_cxx_warnings" != "xno"; then
509 if test "x$GCC" = "xyes"; then
510 case " $CXXFLAGS " in
511 *[\ \ ]-Wall[\ \ ]*) ;;
512 *) warnCXXFLAGS="-Wall -Wno-unused" ;;
515 ## -W is not all that useful. And it cannot be controlled
516 ## with individual -Wno-xxx flags, unlike -Wall
517 if test "x$enable_cxx_warnings" = "xyes"; then
518 warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wshadow -Woverloaded-virtual"
522 AC_MSG_RESULT($warnCXXFLAGS)
524 AC_ARG_ENABLE(iso-cxx,
525 [ --enable-iso-cxx Try to warn if code is not ISO C++ ],,
528 AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
530 if test "x$enable_iso_cxx" != "xno"; then
531 if test "x$GCC" = "xyes"; then
532 case " $CXXFLAGS " in
533 *[\ \ ]-ansi[\ \ ]*) ;;
534 *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
537 case " $CXXFLAGS " in
538 *[\ \ ]-pedantic[\ \ ]*) ;;
539 *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
543 AC_MSG_RESULT($complCXXFLAGS)
544 if test "x$cxxflags_set" != "xyes"; then
545 CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
547 AC_SUBST(cxxflags_set)
553 dnl Basic X11 related checks for X11. At the end, the following will be
555 dnl GTK_{CFLAGS,LIBS} From AM_PATH_GTK
556 dnl CPPFLAGS Will include $X_CFLAGS
557 dnl GNOME_HAVE_SM `true' or `false' depending on whether session
558 dnl management is available. It is available if
559 dnl both -lSM and X11/SM/SMlib.h exist. (Some
560 dnl Solaris boxes have the library but not the header)
561 dnl XPM_LIBS -lXpm if Xpm library is present, otherwise ""
563 dnl The following configure cache variables are defined (but not used):
564 dnl gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS}
566 AC_DEFUN([GNOME_X_CHECKS],
568 AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path))
569 dnl Hope that GTK_CFLAGS have only -I and -D. Otherwise, we could
570 dnl test -z "$x_includes" || CPPFLAGS="$CPPFLAGS -I$x_includes"
572 dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses
573 dnl CPPFLAGS, not CFLAGS
574 CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
576 saved_ldflags="$LDFLAGS"
577 LDFLAGS="$LDFLAGS $GTK_LIBS"
579 gnome_cv_passdown_x_libs="$GTK_LIBS"
580 gnome_cv_passdown_X_LIBS="$GTK_LIBS"
581 gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS"
582 gnome_cv_passdown_GTK_LIBS="$GTK_LIBS"
584 LDFLAGS="$saved_ldflags $GTK_LIBS"
586 dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow.
589 dnl AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x])
590 dnl AC_EGREP_CPP(answer_affirmatively,
591 dnl [#include <gtk/gtkfeatures.h>
592 dnl #ifdef GTK_HAVE_FEATURES_1_1_0
593 dnl answer_affirmatively
595 dnl ], dev_gtk=yes, dev_gtk=no)
596 dnl if test "$dev_gtk" = "yes"; then
599 dnl AC_MSG_RESULT("$dev_gtk")
604 dnl Already found it.
607 dnl Assume that if we have -lSM then we also have -lICE.
608 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
609 [GTK_LIBS="-lSM -lICE $GTK_LIBS"],GNOME_HAVE_SM=false,
614 if test "$GNOME_HAVE_SM" = true; then
615 AC_CHECK_HEADERS(X11/SM/SMlib.h,,GNOME_HAVE_SM=false)
618 if test "$GNOME_HAVE_SM" = true; then
619 AC_DEFINE(HAVE_LIBSM)
623 AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs)
626 AC_REQUIRE([GNOME_PTHREAD_CHECK])
627 LDFLAGS="$saved_ldflags"
629 AC_PROVIDE([GNOME_X_CHECKS])
632 # Configure paths for GTK+
633 # Owen Taylor 97-11-3
635 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
636 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
638 AC_DEFUN(AM_PATH_GTK,
640 dnl Get the cflags and libraries from the gtk-config script
642 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
643 gtk_config_prefix="$withval", gtk_config_prefix="")
644 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
645 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
646 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
647 , enable_gtktest=yes)
653 gtk_config_args="$gtk_config_args gthread"
658 if test x$gtk_config_exec_prefix != x ; then
659 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
660 if test x${GTK_CONFIG+set} != xset ; then
661 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
664 if test x$gtk_config_prefix != x ; then
665 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
666 if test x${GTK_CONFIG+set} != xset ; then
667 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
671 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
672 min_gtk_version=ifelse([$1], ,0.99.7,$1)
673 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
675 if test "$GTK_CONFIG" = "no" ; then
678 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
679 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
680 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
681 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
682 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
683 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
684 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
685 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
686 if test "x$enable_gtktest" = "xyes" ; then
687 ac_save_CFLAGS="$CFLAGS"
689 CFLAGS="$CFLAGS $GTK_CFLAGS"
690 LIBS="$GTK_LIBS $LIBS"
692 dnl Now check if the installed GTK is sufficiently new. (Also sanity
693 dnl checks the results of gtk-config to some extent
704 int major, minor, micro;
707 system ("touch conf.gtktest");
709 /* HP/UX 9 (%@#!) writes to sscanf strings */
710 tmp_version = g_strdup("$min_gtk_version");
711 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
712 printf("%s, bad version string\n", "$min_gtk_version");
716 if ((gtk_major_version != $gtk_config_major_version) ||
717 (gtk_minor_version != $gtk_config_minor_version) ||
718 (gtk_micro_version != $gtk_config_micro_version))
720 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
721 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
722 gtk_major_version, gtk_minor_version, gtk_micro_version);
723 printf ("*** was found! If gtk-config was correct, then it is best\n");
724 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
725 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
726 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
727 printf("*** required on your system.\n");
728 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
729 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
730 printf("*** before re-running configure\n");
732 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
733 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
734 (gtk_minor_version != GTK_MINOR_VERSION) ||
735 (gtk_micro_version != GTK_MICRO_VERSION))
737 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
738 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
739 printf("*** library (version %d.%d.%d)\n",
740 gtk_major_version, gtk_minor_version, gtk_micro_version);
742 #endif /* defined (GTK_MAJOR_VERSION) ... */
745 if ((gtk_major_version > major) ||
746 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
747 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
753 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
754 gtk_major_version, gtk_minor_version, gtk_micro_version);
755 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
756 major, minor, micro);
757 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
759 printf("*** If you have already installed a sufficiently new version, this error\n");
760 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
761 printf("*** being found. The easiest way to fix this is to remove the old version\n");
762 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
763 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
764 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
765 printf("*** so that the correct libraries are found at run-time))\n");
770 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
771 CFLAGS="$ac_save_CFLAGS"
775 if test "x$no_gtk" = x ; then
777 ifelse([$2], , :, [$2])
780 if test "$GTK_CONFIG" = "no" ; then
781 echo "*** The gtk-config script installed by GTK could not be found"
782 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
783 echo "*** your path, or set the GTK_CONFIG environment variable to the"
784 echo "*** full path to gtk-config."
786 if test -f conf.gtktest ; then
789 echo "*** Could not run GTK test program, checking why..."
790 CFLAGS="$CFLAGS $GTK_CFLAGS"
791 LIBS="$LIBS $GTK_LIBS"
795 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
796 [ echo "*** The test program compiled, but did not run. This usually means"
797 echo "*** that the run-time linker is not finding GTK or finding the wrong"
798 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
799 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
800 echo "*** to the installed location Also, make sure you have run ldconfig if that"
801 echo "*** is required on your system"
803 echo "*** If you have an old version installed, it is best to remove it, although"
804 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
806 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
807 echo "*** came with the system with the command"
809 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
810 [ echo "*** The test program failed to compile or link. See the file config.log for the"
811 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
812 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
813 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
814 CFLAGS="$ac_save_CFLAGS"
820 ifelse([$3], , :, [$3])
828 dnl And better, use gthreads instead...
831 AC_DEFUN([GNOME_PTHREAD_CHECK],[
833 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
834 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
835 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
836 [AC_CHECK_FUNC(pthread_create)]
840 AC_SUBST(PTHREAD_LIB)
841 AC_PROVIDE([GNOME_PTHREAD_CHECK])
844 # Macro to add for using GNU gettext.
845 # Ulrich Drepper <drepper@cygnus.com>, 1995.
847 # This file can be copied and used freely without restrictions. It can
848 # be used in projects which are not available under the GNU Public License
849 # but which still want to provide support for the GNU gettext functionality.
850 # Please note that the actual code is *not* freely available.
854 AC_DEFUN(AM_WITH_NLS,
855 [AC_MSG_CHECKING([whether NLS is requested])
856 dnl Default is enabled NLS
858 [ --disable-nls do not use Native Language Support],
859 USE_NLS=$enableval, USE_NLS=yes)
860 AC_MSG_RESULT($USE_NLS)
863 USE_INCLUDED_LIBINTL=no
865 dnl If we use NLS figure out what method
866 if test "$USE_NLS" = "yes"; then
867 AC_DEFINE(ENABLE_NLS)
868 AC_MSG_CHECKING([whether included gettext is requested])
869 AC_ARG_WITH(included-gettext,
870 [ --with-included-gettext use the GNU gettext library included here],
871 nls_cv_force_use_gnu_gettext=$withval,
872 nls_cv_force_use_gnu_gettext=no)
873 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
875 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
876 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
877 dnl User does not insist on using GNU NLS library. Figure out what
878 dnl to use. If gettext or catgets are available (in this order) we
879 dnl use this. Else we have to fall back to GNU NLS library.
880 dnl catgets is only used if permitted by option --with-catgets.
885 AC_CHECK_HEADER(libintl.h,
886 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
887 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
888 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
890 if test "$gt_cv_func_gettext_libc" != "yes"; then
891 AC_CHECK_LIB(intl, bindtextdomain,
892 [AC_CACHE_CHECK([for gettext in libintl],
893 gt_cv_func_gettext_libintl,
894 [AC_CHECK_LIB(intl, gettext,
895 gt_cv_func_gettext_libintl=yes,
896 gt_cv_func_gettext_libintl=no)],
897 gt_cv_func_gettext_libintl=no)])
900 if test "$gt_cv_func_gettext_libc" = "yes" \
901 || test "$gt_cv_func_gettext_libintl" = "yes"; then
902 AC_DEFINE(HAVE_GETTEXT)
903 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
904 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
905 if test "$MSGFMT" != "no"; then
906 AC_CHECK_FUNCS(dcgettext)
907 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
908 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
909 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
910 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
911 return _nl_msg_cat_cntr],
921 if test "$CATOBJEXT" = "NONE"; then
922 AC_MSG_CHECKING([whether catgets can be used])
924 [ --with-catgets use catgets functions if available],
925 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
926 AC_MSG_RESULT($nls_cv_use_catgets)
928 if test "$nls_cv_use_catgets" = "yes"; then
929 dnl No gettext in C library. Try catgets next.
930 AC_CHECK_LIB(i, main)
931 AC_CHECK_FUNC(catgets,
932 [AC_DEFINE(HAVE_CATGETS)
933 INTLOBJS="\$(CATOBJS)"
934 AC_PATH_PROG(GENCAT, gencat, no)dnl
935 if test "$GENCAT" != "no"; then
936 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
937 if test "$GMSGFMT" = "no"; then
938 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
939 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
941 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
942 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
943 USE_INCLUDED_LIBINTL=yes
947 INTLDEPS='$(top_builddir)/intl/libintl.a'
949 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
950 nls_cv_header_intl=intl/libintl.h
951 nls_cv_header_libgt=intl/libgettext.h
956 if test "$CATOBJEXT" = "NONE"; then
957 dnl Neither gettext nor catgets in included in the C library.
958 dnl Fall back on GNU gettext library.
959 nls_cv_use_gnu_gettext=yes
963 if test "$nls_cv_use_gnu_gettext" = "yes"; then
964 dnl Mark actions used to generate GNU NLS library.
965 INTLOBJS="\$(GETTOBJS)"
966 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
967 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
968 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
969 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
970 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
972 USE_INCLUDED_LIBINTL=yes
976 INTLDEPS='$(top_builddir)/intl/libintl.a'
978 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
979 nls_cv_header_intl=intl/libintl.h
980 nls_cv_header_libgt=intl/libgettext.h
983 dnl Test whether we really found GNU xgettext.
984 if test "$XGETTEXT" != ":"; then
985 dnl If it is no GNU xgettext we define it as : so that the
986 dnl Makefiles still can work.
987 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
991 [found xgettext program is not GNU xgettext; ignore it])
996 # We need to process the po/ directory.
1000 nls_cv_header_intl=intl/libintl.h
1001 nls_cv_header_libgt=intl/libgettext.h
1003 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
1005 [case "$CONFIG_FILES" in *po/Makefile.in*)
1006 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1010 # If this is used in GNU gettext we have to set USE_NLS to `yes'
1011 # because some of the sources are only built for this goal.
1012 if test "$PACKAGE" = gettext; then
1014 USE_INCLUDED_LIBINTL=yes
1017 dnl These rules are solely for the distribution goal. While doing this
1018 dnl we only have to keep exactly one list of the available catalogs
1019 dnl in configure.in.
1020 for lang in $ALL_LINGUAS; do
1021 GMOFILES="$GMOFILES $lang.gmo"
1022 POFILES="$POFILES $lang.po"
1025 dnl Make all variables we use known to autoconf.
1026 AC_SUBST(USE_INCLUDED_LIBINTL)
1029 AC_SUBST(DATADIRNAME)
1031 AC_SUBST(INSTOBJEXT)
1039 AC_DEFUN(AM_GNU_GETTEXT,
1040 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1041 AC_REQUIRE([AC_PROG_CC])dnl
1042 AC_REQUIRE([AC_PROG_RANLIB])dnl
1043 AC_REQUIRE([AC_ISC_POSIX])dnl
1044 AC_REQUIRE([AC_HEADER_STDC])dnl
1045 AC_REQUIRE([AC_C_CONST])dnl
1046 AC_REQUIRE([AC_C_INLINE])dnl
1047 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1048 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1049 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1050 AC_REQUIRE([AC_FUNC_MMAP])dnl
1052 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1053 unistd.h sys/param.h])
1054 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1055 strdup __argz_count __argz_stringify __argz_next])
1057 if test "${ac_cv_func_stpcpy+set}" != "set"; then
1058 AC_CHECK_FUNCS(stpcpy)
1060 if test "${ac_cv_func_stpcpy}" = "yes"; then
1061 AC_DEFINE(HAVE_STPCPY)
1067 if test "x$CATOBJEXT" != "x"; then
1068 if test "x$ALL_LINGUAS" = "x"; then
1071 AC_MSG_CHECKING(for catalogs to be installed)
1073 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1074 case "$ALL_LINGUAS" in
1075 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1078 LINGUAS=$NEW_LINGUAS
1079 AC_MSG_RESULT($LINGUAS)
1082 dnl Construct list of names of catalog files to be constructed.
1083 if test -n "$LINGUAS"; then
1084 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1088 dnl The reference to <locale.h> in the installed <libintl.h> file
1089 dnl must be resolved because we cannot expect the users of this
1090 dnl to define HAVE_LOCALE_H.
1091 if test $ac_cv_header_locale_h = yes; then
1092 INCLUDE_LOCALE_H="#include <locale.h>"
1095 /* The system does not provide the header <locale.h>. Take care yourself. */"
1097 AC_SUBST(INCLUDE_LOCALE_H)
1099 dnl Determine which catalog format we have (if any is needed)
1100 dnl For now we know about two different formats:
1101 dnl Linux libc-5 and the normal X/Open format
1102 test -d intl || mkdir intl
1103 if test "$CATOBJEXT" = ".cat"; then
1104 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
1106 dnl Transform the SED scripts while copying because some dumb SEDs
1107 dnl cannot handle comments.
1108 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
1110 dnl po2tbl.sed is always needed.
1111 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
1112 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
1114 dnl In the intl/Makefile.in we have a special dependency which makes
1115 dnl only sense for gettext. We comment this out for non-gettext
1117 if test "$PACKAGE" = "gettext"; then
1127 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1128 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1129 dnl Try to locate is.
1131 if test -n "$ac_aux_dir"; then
1132 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1134 if test -z "$MKINSTALLDIRS"; then
1135 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1137 AC_SUBST(MKINSTALLDIRS)
1139 dnl *** For now the libtool support in intl/Makefile is not for real.
1143 dnl Generate list of files to be processed by xgettext which will
1144 dnl be included in po/Makefile.
1145 test -d po || mkdir po
1146 if test "x$srcdir" != "x."; then
1147 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1148 posrcprefix="$srcdir/"
1150 posrcprefix="../$srcdir/"
1156 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1157 < $srcdir/po/POTFILES.in > po/POTFILES
1160 # Search path for a program which passes the given test.
1161 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1163 # This file can be copied and used freely without restrictions. It can
1164 # be used in projects which are not available under the GNU Public License
1165 # but which still want to provide support for the GNU gettext functionality.
1166 # Please note that the actual code is *not* freely available.
1170 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1171 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1172 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
1173 [# Extract the first word of "$2", so it can be a program name with args.
1174 set dummy $2; ac_word=[$]2
1175 AC_MSG_CHECKING([for $ac_word])
1176 AC_CACHE_VAL(ac_cv_path_$1,
1179 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1182 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1183 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1184 test -z "$ac_dir" && ac_dir=.
1185 if test -f $ac_dir/$ac_word; then
1187 ac_cv_path_$1="$ac_dir/$ac_word"
1193 dnl If no 4th arg is given, leave the cache variable unset,
1194 dnl so AC_PATH_PROGS will keep looking.
1195 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1200 if test -n "[$]$1"; then
1201 AC_MSG_RESULT([$]$1)
1208 # Check whether LC_MESSAGES is available in <locale.h>.
1209 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1211 # This file can be copied and used freely without restrictions. It can
1212 # be used in projects which are not available under the GNU Public License
1213 # but which still want to provide support for the GNU gettext functionality.
1214 # Please note that the actual code is *not* freely available.
1218 AC_DEFUN(AM_LC_MESSAGES,
1219 [if test $ac_cv_header_locale_h = yes; then
1220 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1221 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1222 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1223 if test $am_cv_val_LC_MESSAGES = yes; then
1224 AC_DEFINE(HAVE_LC_MESSAGES)