1 dnl aclocal.m4 generated automatically by aclocal 1.4-p4
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_DOCKLETS_LIBS)
266 GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets`
267 AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);;
269 AC_SUBST(GNOME_CAPPLET_LIBS)
270 GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
271 AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
273 AC_MSG_RESULT(unknown library)
280 dnl GNOME_INIT ([additional-inits])
283 AC_DEFUN([GNOME_INIT],[
284 GNOME_INIT_HOOK([],fail,$1)
288 dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
290 dnl if failflag is "failure" it aborts if gnorba is not found.
293 AC_DEFUN([GNOME_GNORBA_HOOK],[
294 GNOME_ORBIT_HOOK([],$2)
295 AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
296 gnome_cv_gnorba_found=no
297 if test x$gnome_cv_orbit_found = xyes; then
298 GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
299 GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
300 if test -n "$GNORBA_LIBS"; then
301 gnome_cv_gnorba_found=yes
305 AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
306 if test x$gnome_cv_orbit_found = xyes; then
308 GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
309 GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
310 AC_SUBST(GNORBA_CFLAGS)
311 AC_SUBST(GNORBA_LIBS)
313 if test x$2 = xfailure; then
314 AC_MSG_ERROR(gnorba library not installed or installation problem)
319 AC_DEFUN([GNOME_GNORBA_CHECK], [
320 GNOME_GNORBA_HOOK([],failure)
324 dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
326 dnl if failflag is "failure" it aborts if orbit is not found.
329 AC_DEFUN([GNOME_ORBIT_HOOK],[
330 AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
331 AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
332 AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
333 if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
334 gnome_cv_orbit_found=no
336 gnome_cv_orbit_found=yes
339 AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
340 if test x$gnome_cv_orbit_found = xyes; then
342 ORBIT_CFLAGS=`orbit-config --cflags client server`
343 ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
344 AC_SUBST(ORBIT_CFLAGS)
347 if test x$2 = xfailure; then
348 AC_MSG_ERROR(ORBit not installed or installation problem)
353 AC_DEFUN([GNOME_ORBIT_CHECK], [
354 GNOME_ORBIT_HOOK([],failure)
358 # This test replaces the one in autoconf.
359 # Currently this macro should have the same name as the autoconf macro
360 # because gettext's gettext.m4 (distributed in the automake package)
361 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
362 # give these diagnostics:
363 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
364 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
366 undefine([AC_ISC_POSIX])
368 AC_DEFUN([AC_ISC_POSIX],
370 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
371 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
378 # @defmac AC_PROG_CC_STDC
379 # @maindex PROG_CC_STDC
381 # If the C compiler in not in ANSI C mode by default, try to add an option
382 # to output variable @code{CC} to make it so. This macro tries various
383 # options that select ANSI C on some system or another. It considers the
384 # compiler to be in ANSI C mode if it handles function prototypes correctly.
386 # If you use this macro, you should check after calling it whether the C
387 # compiler has been set to accept ANSI C; if not, the shell variable
388 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
389 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
390 # program @code{ansi2knr}, which comes with Ghostscript.
393 AC_DEFUN(AM_PROG_CC_STDC,
394 [AC_REQUIRE([AC_PROG_CC])
395 AC_BEFORE([$0], [AC_C_INLINE])
396 AC_BEFORE([$0], [AC_C_CONST])
397 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
398 dnl a magic option to avoid problems with ANSI preprocessor commands
400 dnl FIXME: can't do this because then AC_AIX won't work due to a
401 dnl circular dependency.
402 dnl AC_BEFORE([$0], [AC_PROG_CPP])
403 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
404 AC_CACHE_VAL(am_cv_prog_cc_stdc,
405 [am_cv_prog_cc_stdc=no
407 # Don't try gcc -ansi; that turns off useful extensions and
408 # breaks some systems' header files.
410 # Ultrix and OSF/1 -std1
411 # HP-UX -Aa -D_HPUX_SOURCE
412 # SVR4 -Xc -D__EXTENSIONS__
413 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
415 CC="$ac_save_CC $ac_arg"
419 #include <sys/types.h>
420 #include <sys/stat.h>
421 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
422 struct buf { int x; };
423 FILE * (*rcsopen) (struct buf *, struct stat *, int);
424 static char *e (p, i)
430 static char *f (char * (*g) (char **, int), char **p, ...)
435 s = g (p, va_arg (v,int));
439 int test (int i, double x);
440 struct s1 {int (*f) (int a);};
441 struct s2 {int (*f) (double a);};
442 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
446 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
448 [am_cv_prog_cc_stdc="$ac_arg"; break])
452 if test -z "$am_cv_prog_cc_stdc"; then
453 AC_MSG_RESULT([none needed])
455 AC_MSG_RESULT($am_cv_prog_cc_stdc)
457 case "x$am_cv_prog_cc_stdc" in
459 *) CC="$CC $am_cv_prog_cc_stdc" ;;
463 # Add --enable-maintainer-mode option to configure.
468 AC_DEFUN(AM_MAINTAINER_MODE,
469 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
470 dnl maintainer-mode is disabled by default
471 AC_ARG_ENABLE(maintainer-mode,
472 [ --enable-maintainer-mode enable make rules and dependencies not useful
473 (and sometimes confusing) to the casual installer],
474 USE_MAINTAINER_MODE=$enableval,
475 USE_MAINTAINER_MODE=no)
476 AC_MSG_RESULT($USE_MAINTAINER_MODE)
477 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
478 MAINT=$MAINTAINER_MODE_TRUE
483 dnl GNOME_COMPILE_WARNINGS
484 dnl Turn on many useful compiler warnings
485 dnl For now, only works on GCC
486 AC_DEFUN([GNOME_COMPILE_WARNINGS],[
487 AC_ARG_ENABLE(compile-warnings,
488 [ --enable-compile-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_compile_warnings=minimum)
490 AC_MSG_CHECKING(what warning flags to pass to the C compiler)
492 if test "x$GCC" != xyes; then
493 enable_compile_warnings=no
496 if test "x$enable_compile_warnings" != "xno"; then
497 if test "x$GCC" = "xyes"; then
499 *[\ \ ]-Wall[\ \ ]*) ;;
500 *) warnCFLAGS="-Wall -Wunused" ;;
503 ## -W is not all that useful. And it cannot be controlled
504 ## with individual -Wno-xxx flags, unlike -Wall
505 if test "x$enable_compile_warnings" = "xyes"; then
506 warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations"
510 AC_MSG_RESULT($warnCFLAGS)
513 [ --enable-iso-c Try to warn if code is not ISO C ],,
516 AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
518 if test "x$enable_iso_c" != "xno"; then
519 if test "x$GCC" = "xyes"; then
521 *[\ \ ]-ansi[\ \ ]*) ;;
522 *) complCFLAGS="$complCFLAGS -ansi" ;;
526 *[\ \ ]-pedantic[\ \ ]*) ;;
527 *) complCFLAGS="$complCFLAGS -pedantic" ;;
531 AC_MSG_RESULT($complCFLAGS)
532 if test "x$cflags_set" != "xyes"; then
533 CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS"
539 dnl For C++, do basically the same thing.
541 AC_DEFUN([GNOME_CXX_WARNINGS],[
542 AC_ARG_ENABLE(cxx-warnings,
543 [ --enable-cxx-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_cxx_warnings=minimum)
545 AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
547 if test "x$GCC" != xyes; then
548 enable_compile_warnings=no
550 if test "x$enable_cxx_warnings" != "xno"; then
551 if test "x$GCC" = "xyes"; then
552 case " $CXXFLAGS " in
553 *[\ \ ]-Wall[\ \ ]*) ;;
554 *) warnCXXFLAGS="-Wall -Wno-unused" ;;
557 ## -W is not all that useful. And it cannot be controlled
558 ## with individual -Wno-xxx flags, unlike -Wall
559 if test "x$enable_cxx_warnings" = "xyes"; then
560 warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wshadow -Woverloaded-virtual"
564 AC_MSG_RESULT($warnCXXFLAGS)
566 AC_ARG_ENABLE(iso-cxx,
567 [ --enable-iso-cxx Try to warn if code is not ISO C++ ],,
570 AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
572 if test "x$enable_iso_cxx" != "xno"; then
573 if test "x$GCC" = "xyes"; then
574 case " $CXXFLAGS " in
575 *[\ \ ]-ansi[\ \ ]*) ;;
576 *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
579 case " $CXXFLAGS " in
580 *[\ \ ]-pedantic[\ \ ]*) ;;
581 *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
585 AC_MSG_RESULT($complCXXFLAGS)
586 if test "x$cxxflags_set" != "xyes"; then
587 CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
589 AC_SUBST(cxxflags_set)
595 dnl Basic X11 related checks for X11. At the end, the following will be
597 dnl GTK_{CFLAGS,LIBS} From AM_PATH_GTK
598 dnl CPPFLAGS Will include $X_CFLAGS
599 dnl GNOME_HAVE_SM `true' or `false' depending on whether session
600 dnl management is available. It is available if
601 dnl both -lSM and X11/SM/SMlib.h exist. (Some
602 dnl Solaris boxes have the library but not the header)
603 dnl XPM_LIBS -lXpm if Xpm library is present, otherwise ""
605 dnl The following configure cache variables are defined (but not used):
606 dnl gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS}
608 AC_DEFUN([GNOME_X_CHECKS],
610 AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path))
611 dnl Hope that GTK_CFLAGS have only -I and -D. Otherwise, we could
612 dnl test -z "$x_includes" || CPPFLAGS="$CPPFLAGS -I$x_includes"
614 dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses
615 dnl CPPFLAGS, not CFLAGS
616 CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
618 saved_ldflags="$LDFLAGS"
619 LDFLAGS="$LDFLAGS $GTK_LIBS"
621 gnome_cv_passdown_x_libs="$GTK_LIBS"
622 gnome_cv_passdown_X_LIBS="$GTK_LIBS"
623 gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS"
624 gnome_cv_passdown_GTK_LIBS="$GTK_LIBS"
626 LDFLAGS="$saved_ldflags $GTK_LIBS"
628 dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow.
631 dnl AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x])
632 dnl AC_EGREP_CPP(answer_affirmatively,
633 dnl [#include <gtk/gtkfeatures.h>
634 dnl #ifdef GTK_HAVE_FEATURES_1_1_0
635 dnl answer_affirmatively
637 dnl ], dev_gtk=yes, dev_gtk=no)
638 dnl if test "$dev_gtk" = "yes"; then
641 dnl AC_MSG_RESULT("$dev_gtk")
646 dnl Already found it.
649 dnl Assume that if we have -lSM then we also have -lICE.
650 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
651 [GTK_LIBS="-lSM -lICE $GTK_LIBS"],GNOME_HAVE_SM=false,
656 if test "$GNOME_HAVE_SM" = true; then
657 AC_CHECK_HEADERS(X11/SM/SMlib.h,,GNOME_HAVE_SM=false)
660 if test "$GNOME_HAVE_SM" = true; then
661 AC_DEFINE(HAVE_LIBSM)
665 AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs)
668 AC_REQUIRE([GNOME_PTHREAD_CHECK])
669 LDFLAGS="$saved_ldflags"
671 AC_PROVIDE([GNOME_X_CHECKS])
674 # Configure paths for GTK+
675 # Owen Taylor 97-11-3
677 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
678 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
680 AC_DEFUN(AM_PATH_GTK,
682 dnl Get the cflags and libraries from the gtk-config script
684 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
685 gtk_config_prefix="$withval", gtk_config_prefix="")
686 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
687 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
688 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
689 , enable_gtktest=yes)
695 gtk_config_args="$gtk_config_args gthread"
700 if test x$gtk_config_exec_prefix != x ; then
701 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
702 if test x${GTK_CONFIG+set} != xset ; then
703 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
706 if test x$gtk_config_prefix != x ; then
707 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
708 if test x${GTK_CONFIG+set} != xset ; then
709 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
713 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
714 min_gtk_version=ifelse([$1], ,0.99.7,$1)
715 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
717 if test "$GTK_CONFIG" = "no" ; then
720 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
721 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
722 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
723 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
724 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
725 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
726 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
727 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
728 if test "x$enable_gtktest" = "xyes" ; then
729 ac_save_CFLAGS="$CFLAGS"
731 CFLAGS="$CFLAGS $GTK_CFLAGS"
732 LIBS="$GTK_LIBS $LIBS"
734 dnl Now check if the installed GTK is sufficiently new. (Also sanity
735 dnl checks the results of gtk-config to some extent
746 int major, minor, micro;
749 system ("touch conf.gtktest");
751 /* HP/UX 9 (%@#!) writes to sscanf strings */
752 tmp_version = g_strdup("$min_gtk_version");
753 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
754 printf("%s, bad version string\n", "$min_gtk_version");
758 if ((gtk_major_version != $gtk_config_major_version) ||
759 (gtk_minor_version != $gtk_config_minor_version) ||
760 (gtk_micro_version != $gtk_config_micro_version))
762 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
763 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
764 gtk_major_version, gtk_minor_version, gtk_micro_version);
765 printf ("*** was found! If gtk-config was correct, then it is best\n");
766 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
767 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
768 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
769 printf("*** required on your system.\n");
770 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
771 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
772 printf("*** before re-running configure\n");
774 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
775 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
776 (gtk_minor_version != GTK_MINOR_VERSION) ||
777 (gtk_micro_version != GTK_MICRO_VERSION))
779 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
780 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
781 printf("*** library (version %d.%d.%d)\n",
782 gtk_major_version, gtk_minor_version, gtk_micro_version);
784 #endif /* defined (GTK_MAJOR_VERSION) ... */
787 if ((gtk_major_version > major) ||
788 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
789 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
795 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
796 gtk_major_version, gtk_minor_version, gtk_micro_version);
797 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
798 major, minor, micro);
799 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
801 printf("*** If you have already installed a sufficiently new version, this error\n");
802 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
803 printf("*** being found. The easiest way to fix this is to remove the old version\n");
804 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
805 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
806 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
807 printf("*** so that the correct libraries are found at run-time))\n");
812 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
813 CFLAGS="$ac_save_CFLAGS"
817 if test "x$no_gtk" = x ; then
819 ifelse([$2], , :, [$2])
822 if test "$GTK_CONFIG" = "no" ; then
823 echo "*** The gtk-config script installed by GTK could not be found"
824 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
825 echo "*** your path, or set the GTK_CONFIG environment variable to the"
826 echo "*** full path to gtk-config."
828 if test -f conf.gtktest ; then
831 echo "*** Could not run GTK test program, checking why..."
832 CFLAGS="$CFLAGS $GTK_CFLAGS"
833 LIBS="$LIBS $GTK_LIBS"
837 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
838 [ echo "*** The test program compiled, but did not run. This usually means"
839 echo "*** that the run-time linker is not finding GTK or finding the wrong"
840 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
841 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
842 echo "*** to the installed location Also, make sure you have run ldconfig if that"
843 echo "*** is required on your system"
845 echo "*** If you have an old version installed, it is best to remove it, although"
846 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
848 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
849 echo "*** came with the system with the command"
851 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
852 [ echo "*** The test program failed to compile or link. See the file config.log for the"
853 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
854 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
855 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
856 CFLAGS="$ac_save_CFLAGS"
862 ifelse([$3], , :, [$3])
870 dnl And better, use gthreads instead...
873 AC_DEFUN([GNOME_PTHREAD_CHECK],[
875 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
876 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
877 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
878 [AC_CHECK_FUNC(pthread_create)]
882 AC_SUBST(PTHREAD_LIB)
883 AC_PROVIDE([GNOME_PTHREAD_CHECK])
886 # Macro to add for using GNU gettext.
887 # Ulrich Drepper <drepper@cygnus.com>, 1995.
889 # This file can be copied and used freely without restrictions. It can
890 # be used in projects which are not available under the GNU General Public
891 # License or the GNU Library General Public License but which still want
892 # to provide support for the GNU gettext functionality.
893 # Please note that the actual code of the GNU gettext library is covered
894 # by the GNU Library General Public License, and the rest of the GNU
895 # gettext package package is covered by the GNU General Public License.
896 # They are *not* in the public domain.
900 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
901 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
902 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
903 dnl depending on --{enable,disable}-{shared,static} and on the presence of
904 dnl AM-DISABLE-SHARED). Otherwise, a static library
905 dnl $(top_builddir)/intl/libintl.a will be created.
906 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
907 dnl implementations (in libc or libintl) without the ngettext() function
909 dnl LIBDIR is used to find the intl libraries. If empty,
910 dnl the value `$(top_builddir)/intl/' is used.
912 dnl The result of the configuration is one of three cases:
913 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
915 dnl Catalog format: GNU --> install in $(datadir)
916 dnl Catalog extension: .mo after installation, .gmo in source tree
917 dnl 2) GNU gettext has been found in the system's C library.
918 dnl Catalog format: GNU --> install in $(datadir)
919 dnl Catalog extension: .mo after installation, .gmo in source tree
920 dnl 3) No internationalization, always use English msgid.
921 dnl Catalog format: none
922 dnl Catalog extension: none
923 dnl The use of .gmo is historical (it was needed to avoid overwriting the
924 dnl GNU format catalogs when building on a platform with an X/Open gettext),
925 dnl but we keep it in order not to force irrelevant filename changes on the
928 AC_DEFUN([AM_WITH_NLS],
929 [AC_MSG_CHECKING([whether NLS is requested])
930 dnl Default is enabled NLS
932 [ --disable-nls do not use Native Language Support],
933 USE_NLS=$enableval, USE_NLS=yes)
934 AC_MSG_RESULT($USE_NLS)
937 BUILD_INCLUDED_LIBINTL=no
938 USE_INCLUDED_LIBINTL=no
941 dnl If we use NLS figure out what method
942 if test "$USE_NLS" = "yes"; then
943 AC_DEFINE(ENABLE_NLS, 1,
944 [Define to 1 if translation of program messages to the user's native language
946 AC_MSG_CHECKING([whether included gettext is requested])
947 AC_ARG_WITH(included-gettext,
948 [ --with-included-gettext use the GNU gettext library included here],
949 nls_cv_force_use_gnu_gettext=$withval,
950 nls_cv_force_use_gnu_gettext=no)
951 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
953 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
954 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
955 dnl User does not insist on using GNU NLS library. Figure out what
956 dnl to use. If GNU gettext is available we use this. Else we have
957 dnl to fall back to GNU NLS library.
960 dnl Add a version number to the cache macros.
961 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
962 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
964 AC_CHECK_HEADER(libintl.h,
965 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
966 [AC_TRY_LINK([#include <libintl.h>
967 extern int _nl_msg_cat_cntr;],
968 [bindtextdomain ("", "");
969 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
970 gt_cv_func_gnugettext_libc=yes,
971 gt_cv_func_gnugettext_libc=no)])
973 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
974 AC_CACHE_CHECK([for GNU gettext in libintl],
975 gt_cv_func_gnugettext_libintl,
976 [gt_save_LIBS="$LIBS"
977 LIBS="$LIBS -lintl $LIBICONV"
978 AC_TRY_LINK([#include <libintl.h>
979 extern int _nl_msg_cat_cntr;],
980 [bindtextdomain ("", "");
981 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
982 gt_cv_func_gnugettext_libintl=yes,
983 gt_cv_func_gnugettext_libintl=no)
984 LIBS="$gt_save_LIBS"])
987 dnl If an already present or preinstalled GNU gettext() is found,
988 dnl use it. But if this macro is used in GNU gettext, and GNU
989 dnl gettext is already preinstalled in libintl, we update this
990 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
991 if test "$gt_cv_func_gnugettext_libc" = "yes" \
992 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
993 && test "$PACKAGE" != gettext; }; then
994 AC_DEFINE(HAVE_GETTEXT, 1,
995 [Define if the GNU gettext() function is already present or preinstalled.])
997 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
998 dnl If iconv() is in a separate libiconv library, then anyone
999 dnl linking with libintl{.a,.so} also needs to link with
1001 INTLLIBS="-lintl $LIBICONV"
1004 gt_save_LIBS="$LIBS"
1005 LIBS="$LIBS $INTLLIBS"
1006 AC_CHECK_FUNCS(dcgettext)
1007 LIBS="$gt_save_LIBS"
1009 dnl Search for GNU msgfmt in the PATH.
1010 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1011 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1012 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1014 dnl Search for GNU xgettext in the PATH.
1015 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1016 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1022 if test "$CATOBJEXT" = "NONE"; then
1023 dnl GNU gettext is not found in the C library.
1024 dnl Fall back on GNU gettext library.
1025 nls_cv_use_gnu_gettext=yes
1029 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1030 dnl Mark actions used to generate GNU NLS library.
1031 INTLOBJS="\$(GETTOBJS)"
1032 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1033 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1034 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1035 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1036 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1038 BUILD_INCLUDED_LIBINTL=yes
1039 USE_INCLUDED_LIBINTL=yes
1041 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
1042 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1045 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1046 dnl Test whether we really found GNU msgfmt.
1047 if test "$GMSGFMT" != ":"; then
1048 dnl If it is no GNU msgfmt we define it as : so that the
1049 dnl Makefiles still can work.
1050 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
1054 [found msgfmt program is not GNU msgfmt; ignore it])
1059 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1060 dnl Test whether we really found GNU xgettext.
1061 if test "$XGETTEXT" != ":"; then
1062 dnl If it is no GNU xgettext we define it as : so that the
1063 dnl Makefiles still can work.
1064 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
1068 [found xgettext program is not GNU xgettext; ignore it])
1073 dnl We need to process the po/ directory.
1077 [for ac_file in $CONFIG_FILES; do
1078 # Support "outfile[:infile[:infile...]]"
1080 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1082 # PO directories have a Makefile.in generated from Makefile.in.in.
1083 case "$ac_file" in */Makefile.in)
1084 # Adjust a relative srcdir.
1085 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1086 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1087 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1088 # In autoconf-2.13 it is called $ac_given_srcdir.
1089 # In autoconf-2.50 it is called $srcdir.
1090 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1091 case "$ac_given_srcdir" in
1092 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1093 /*) top_srcdir="$ac_given_srcdir" ;;
1094 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1096 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1097 rm -f "$ac_dir/POTFILES"
1098 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1099 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
1100 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1101 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1108 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1109 dnl to 'yes' because some of the testsuite requires it.
1110 if test "$PACKAGE" = gettext; then
1111 BUILD_INCLUDED_LIBINTL=yes
1114 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1115 dnl because plural.y uses bison specific features. It requires at least
1116 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1118 dnl bison is only needed for the maintainer (who touches plural.y). But in
1119 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1120 dnl the rule in general Makefile. Now, some people carelessly touch the
1121 dnl files or have a broken "make" program, hence the plural.c rule will
1122 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1123 dnl present or too old.
1124 AC_CHECK_PROGS([INTLBISON], [bison])
1125 if test -z "$INTLBISON"; then
1128 dnl Found it, now check the version.
1129 AC_MSG_CHECKING([version of bison])
1130 changequote(<<,>>)dnl
1131 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1132 case $ac_prog_version in
1133 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1134 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1136 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1137 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1139 AC_MSG_RESULT([$ac_prog_version])
1141 if test $ac_verc_fail = yes; then
1145 dnl These rules are solely for the distribution goal. While doing this
1146 dnl we only have to keep exactly one list of the available catalogs
1147 dnl in configure.in.
1148 for lang in $ALL_LINGUAS; do
1149 GMOFILES="$GMOFILES $lang.gmo"
1150 POFILES="$POFILES $lang.po"
1153 dnl Make all variables we use known to autoconf.
1154 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1155 AC_SUBST(USE_INCLUDED_LIBINTL)
1164 dnl For backward compatibility. Some configure.ins may be using this.
1166 nls_cv_header_libgt=
1168 dnl For backward compatibility. Some Makefiles may be using this.
1170 AC_SUBST(DATADIRNAME)
1172 dnl For backward compatibility. Some Makefiles may be using this.
1174 AC_SUBST(INSTOBJEXT)
1176 dnl For backward compatibility. Some Makefiles may be using this.
1181 dnl Usage: Just like AM_WITH_NLS, which see.
1182 AC_DEFUN([AM_GNU_GETTEXT],
1183 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1184 AC_REQUIRE([AC_PROG_CC])dnl
1185 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1186 AC_REQUIRE([AC_PROG_RANLIB])dnl
1187 AC_REQUIRE([AC_ISC_POSIX])dnl
1188 AC_REQUIRE([AC_HEADER_STDC])dnl
1189 AC_REQUIRE([AC_C_CONST])dnl
1190 AC_REQUIRE([AC_C_INLINE])dnl
1191 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1192 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1193 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1194 AC_REQUIRE([AC_FUNC_MMAP])dnl
1195 AC_REQUIRE([jm_GLIBC21])dnl
1197 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1198 stdlib.h string.h unistd.h sys/param.h])
1199 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1200 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1201 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1206 AM_WITH_NLS([$1],[$2],[$3])
1208 if test "x$CATOBJEXT" != "x"; then
1209 if test "x$ALL_LINGUAS" = "x"; then
1212 AC_MSG_CHECKING(for catalogs to be installed)
1214 for presentlang in $ALL_LINGUAS; do
1216 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1217 # Use the presentlang catalog if desiredlang is
1218 # a. equal to presentlang, or
1219 # b. a variant of presentlang (because in this case,
1220 # presentlang can be used as a fallback for messages
1221 # which are not translated in the desiredlang catalog).
1222 case "$desiredlang" in
1223 "$presentlang"*) useit=yes;;
1226 if test $useit = yes; then
1227 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1230 LINGUAS=$NEW_LINGUAS
1231 AC_MSG_RESULT($LINGUAS)
1234 dnl Construct list of names of catalog files to be constructed.
1235 if test -n "$LINGUAS"; then
1236 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1240 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1241 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1242 dnl Try to locate is.
1244 if test -n "$ac_aux_dir"; then
1245 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1247 if test -z "$MKINSTALLDIRS"; then
1248 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1250 AC_SUBST(MKINSTALLDIRS)
1252 dnl Enable libtool support if the surrounding package wishes it.
1253 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1254 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1257 # Search path for a program which passes the given test.
1258 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1260 # This file can be copied and used freely without restrictions. It can
1261 # be used in projects which are not available under the GNU General Public
1262 # License or the GNU Library General Public License but which still want
1263 # to provide support for the GNU gettext functionality.
1264 # Please note that the actual code of the GNU gettext library is covered
1265 # by the GNU Library General Public License, and the rest of the GNU
1266 # gettext package package is covered by the GNU General Public License.
1267 # They are *not* in the public domain.
1271 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1272 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1273 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1274 [# Extract the first word of "$2", so it can be a program name with args.
1275 set dummy $2; ac_word=[$]2
1276 AC_MSG_CHECKING([for $ac_word])
1277 AC_CACHE_VAL(ac_cv_path_$1,
1280 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1283 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1284 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1285 test -z "$ac_dir" && ac_dir=.
1286 if test -f $ac_dir/$ac_word; then
1288 ac_cv_path_$1="$ac_dir/$ac_word"
1294 dnl If no 4th arg is given, leave the cache variable unset,
1295 dnl so AC_PATH_PROGS will keep looking.
1296 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1301 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1302 AC_MSG_RESULT([$]$1)
1311 # Test for the GNU C Library, version 2.1 or newer.
1312 # From Bruno Haible.
1314 AC_DEFUN([jm_GLIBC21],
1316 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1317 ac_cv_gnu_library_2_1,
1318 [AC_EGREP_CPP([Lucky GNU user],
1320 #include <features.h>
1321 #ifdef __GNU_LIBRARY__
1322 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1327 ac_cv_gnu_library_2_1=yes,
1328 ac_cv_gnu_library_2_1=no)
1332 GLIBC21="$ac_cv_gnu_library_2_1"
1338 dnl From Bruno Haible.
1340 AC_DEFUN([AM_ICONV],
1342 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1343 dnl those with the standalone portable GNU libiconv installed).
1345 AC_ARG_WITH([libiconv-prefix],
1346 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
1347 for dir in `echo "$withval" | tr : ' '`; do
1348 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1349 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1353 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1354 am_cv_func_iconv="no, consider installing GNU libiconv"
1356 AC_TRY_LINK([#include <stdlib.h>
1357 #include <iconv.h>],
1358 [iconv_t cd = iconv_open("","");
1359 iconv(cd,NULL,NULL,NULL,NULL);
1361 am_cv_func_iconv=yes)
1362 if test "$am_cv_func_iconv" != yes; then
1363 am_save_LIBS="$LIBS"
1364 LIBS="$LIBS -liconv"
1365 AC_TRY_LINK([#include <stdlib.h>
1366 #include <iconv.h>],
1367 [iconv_t cd = iconv_open("","");
1368 iconv(cd,NULL,NULL,NULL,NULL);
1371 am_cv_func_iconv=yes)
1372 LIBS="$am_save_LIBS"
1375 if test "$am_cv_func_iconv" = yes; then
1376 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1377 AC_MSG_CHECKING([for iconv declaration])
1378 AC_CACHE_VAL(am_cv_proto_iconv, [
1386 #if defined(__STDC__) || defined(__cplusplus)
1387 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1391 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1392 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);"])
1393 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1394 AC_MSG_RESULT([$]{ac_t:-
1395 }[$]am_cv_proto_iconv)
1396 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1397 [Define as const if the declaration of iconv() needs const.])
1400 if test "$am_cv_lib_iconv" = yes; then
1408 dnl From Bruno Haible.
1410 AC_DEFUN([AM_LANGINFO_CODESET],
1412 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1413 [AC_TRY_LINK([#include <langinfo.h>],
1414 [char* cs = nl_langinfo(CODESET);],
1415 am_cv_langinfo_codeset=yes,
1416 am_cv_langinfo_codeset=no)
1418 if test $am_cv_langinfo_codeset = yes; then
1419 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1420 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1424 # Check whether LC_MESSAGES is available in <locale.h>.
1425 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1427 # This file can be copied and used freely without restrictions. It can
1428 # be used in projects which are not available under the GNU General Public
1429 # License or the GNU Library General Public License but which still want
1430 # to provide support for the GNU gettext functionality.
1431 # Please note that the actual code of the GNU gettext library is covered
1432 # by the GNU Library General Public License, and the rest of the GNU
1433 # gettext package package is covered by the GNU General Public License.
1434 # They are *not* in the public domain.
1438 AC_DEFUN([AM_LC_MESSAGES],
1439 [if test $ac_cv_header_locale_h = yes; then
1440 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1441 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1442 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1443 if test $am_cv_val_LC_MESSAGES = yes; then
1444 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1445 [Define if your <locale.h> file defines LC_MESSAGES.])