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`
129 # serial 40 AC_PROG_LIBTOOL
130 AC_DEFUN(AC_PROG_LIBTOOL,
131 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
133 # Save cache, so that ltconfig can load it
136 # Actually configure libtool. ac_aux_dir is where install-sh is found.
137 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
138 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
139 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
140 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
141 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
142 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
143 || AC_MSG_ERROR([libtool configure failed])
145 # Reload cache, that may have been modified by ltconfig
148 # This can be used to rebuild libtool when needed
149 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
151 # Always use our own libtool.
152 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
155 # Redirect the config.log output again, so that the ltconfig log is not
156 # clobbered by the next message.
160 AC_DEFUN(AC_LIBTOOL_SETUP,
162 AC_REQUIRE([AC_ENABLE_SHARED])dnl
163 AC_REQUIRE([AC_ENABLE_STATIC])dnl
164 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
165 AC_REQUIRE([AC_CANONICAL_HOST])dnl
166 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
167 AC_REQUIRE([AC_PROG_RANLIB])dnl
168 AC_REQUIRE([AC_PROG_CC])dnl
169 AC_REQUIRE([AC_PROG_LD])dnl
170 AC_REQUIRE([AC_PROG_NM])dnl
171 AC_REQUIRE([AC_PROG_LN_S])dnl
175 NONE) lt_target="$host" ;;
176 *) lt_target="$target" ;;
179 # Check for any special flags to pass to ltconfig.
181 # the following will cause an existing older ltconfig to fail, so
182 # we ignore this at the expense of the cache file... Checking this
183 # will just take longer ... bummer!
184 #libtool_flags="--cache-file=$cache_file"
186 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
187 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
188 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
189 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
190 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
191 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
192 [libtool_flags="$libtool_flags --enable-dlopen"])
193 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
194 [libtool_flags="$libtool_flags --enable-win32-dll"])
195 AC_ARG_ENABLE(libtool-lock,
196 [ --disable-libtool-lock avoid locking (might break parallel builds)])
197 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
198 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
200 # Some flags need to be propagated to the compiler or linker for good
204 # Find out which ABI we are using.
205 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
206 if AC_TRY_EVAL(ac_compile); then
207 case "`/usr/bin/file conftest.o`" in
223 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
224 SAVE_CFLAGS="$CFLAGS"
225 CFLAGS="$CFLAGS -belf"
226 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
227 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
228 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
229 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
230 CFLAGS="$SAVE_CFLAGS"
234 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
235 [*-*-cygwin* | *-*-mingw*)
236 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
237 AC_CHECK_TOOL(AS, as, false)
238 AC_CHECK_TOOL(OBJDUMP, objdump, false)
244 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
245 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
247 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
248 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
250 # AC_ENABLE_SHARED - implement the --enable-shared flag
251 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
252 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
254 AC_DEFUN(AC_ENABLE_SHARED, [dnl
255 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
256 AC_ARG_ENABLE(shared,
257 changequote(<<, >>)dnl
258 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
260 [p=${PACKAGE-default}
262 yes) enable_shared=yes ;;
263 no) enable_shared=no ;;
266 # Look at the argument we got. We use all the common list separators.
267 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
268 for pkg in $enableval; do
269 if test "X$pkg" = "X$p"; then
276 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
279 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
280 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
281 AC_ENABLE_SHARED(no)])
283 # AC_ENABLE_STATIC - implement the --enable-static flag
284 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
285 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
287 AC_DEFUN(AC_ENABLE_STATIC, [dnl
288 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
289 AC_ARG_ENABLE(static,
290 changequote(<<, >>)dnl
291 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
293 [p=${PACKAGE-default}
295 yes) enable_static=yes ;;
296 no) enable_static=no ;;
299 # Look at the argument we got. We use all the common list separators.
300 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
301 for pkg in $enableval; do
302 if test "X$pkg" = "X$p"; then
309 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
312 # AC_DISABLE_STATIC - set the default static flag to --disable-static
313 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
314 AC_ENABLE_STATIC(no)])
317 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
318 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
319 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
321 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
322 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
323 AC_ARG_ENABLE(fast-install,
324 changequote(<<, >>)dnl
325 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
327 [p=${PACKAGE-default}
329 yes) enable_fast_install=yes ;;
330 no) enable_fast_install=no ;;
332 enable_fast_install=no
333 # Look at the argument we got. We use all the common list separators.
334 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
335 for pkg in $enableval; do
336 if test "X$pkg" = "X$p"; then
337 enable_fast_install=yes
343 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
346 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
347 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
348 AC_ENABLE_FAST_INSTALL(no)])
350 # AC_PROG_LD - find the path to the GNU or non-GNU linker
353 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
354 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
355 AC_REQUIRE([AC_PROG_CC])dnl
356 AC_REQUIRE([AC_CANONICAL_HOST])dnl
357 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
359 if test "$ac_cv_prog_gcc" = yes; then
360 # Check if gcc -print-prog-name=ld gives a path.
361 AC_MSG_CHECKING([for ld used by GCC])
362 ac_prog=`($CC -print-prog-name=ld) 2>&5`
364 # Accept absolute paths.
366 [\\/]* | [A-Za-z]:[\\/]*)
367 re_direlt='/[^/][^/]*/\.\./'
369 # Canonicalize the path of ld
370 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
371 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
372 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
374 test -z "$LD" && LD="$ac_prog"
377 # If it fails, then pretend we aren't using GCC.
381 # If it is relative, then search for the first ld in PATH.
385 elif test "$with_gnu_ld" = yes; then
386 AC_MSG_CHECKING([for GNU ld])
388 AC_MSG_CHECKING([for non-GNU ld])
390 AC_CACHE_VAL(ac_cv_path_LD,
391 [if test -z "$LD"; then
392 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
393 for ac_dir in $PATH; do
394 test -z "$ac_dir" && ac_dir=.
395 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
396 ac_cv_path_LD="$ac_dir/$ac_prog"
397 # Check to see if the program is GNU ld. I'd rather use --version,
398 # but apparently some GNU ld's only accept -v.
399 # Break only if it was the GNU/non-GNU ld that we prefer.
400 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
401 test "$with_gnu_ld" != no && break
403 test "$with_gnu_ld" != yes && break
409 ac_cv_path_LD="$LD" # Let the user override the test with a path.
412 if test -n "$LD"; then
417 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
421 AC_DEFUN(AC_PROG_LD_GNU,
422 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
423 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
424 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
425 ac_cv_prog_gnu_ld=yes
431 # AC_PROG_NM - find the path to a BSD-compatible name lister
433 [AC_MSG_CHECKING([for BSD-compatible nm])
434 AC_CACHE_VAL(ac_cv_path_NM,
435 [if test -n "$NM"; then
436 # Let the user override the test.
439 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
440 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
441 test -z "$ac_dir" && ac_dir=.
442 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
443 # Check to see if the nm accepts a BSD-compat flag.
444 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
445 # nm: unknown option "B" ignored
446 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
447 ac_cv_path_NM="$ac_dir/nm -B"
449 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
450 ac_cv_path_NM="$ac_dir/nm -p"
453 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
454 continue # so that we can try to find one that supports BSD flags
459 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
465 # AC_CHECK_LIBM - check for math library
466 AC_DEFUN(AC_CHECK_LIBM,
467 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
470 *-*-beos* | *-*-cygwin*)
471 # These system don't have libm
474 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
475 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
478 AC_CHECK_LIB(m, main, LIBM="-lm")
483 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
484 # the libltdl convenience library and INCLTDL to the include flags for
485 # the libltdl header and adds --enable-ltdl-convenience to the
486 # configure arguments. Note that LIBLTDL and INCLTDL are not
487 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
488 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
489 # with '${top_builddir}/' and INCLTDL will be prefixed with
490 # '${top_srcdir}/' (note the single quotes!). If your package is not
491 # flat and you're not using automake, define top_builddir and
492 # top_srcdir appropriately in the Makefiles.
493 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
494 case "$enable_ltdl_convenience" in
495 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
496 "") enable_ltdl_convenience=yes
497 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
499 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
500 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
503 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
504 # the libltdl installable library and INCLTDL to the include flags for
505 # the libltdl header and adds --enable-ltdl-install to the configure
506 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
507 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
508 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
509 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
510 # with '${top_srcdir}/' (note the single quotes!). If your package is
511 # not flat and you're not using automake, define top_builddir and
512 # top_srcdir appropriately in the Makefiles.
513 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
514 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
515 AC_CHECK_LIB(ltdl, main,
516 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
517 [if test x"$enable_ltdl_install" = xno; then
518 AC_MSG_WARN([libltdl not installed, but installation disabled])
520 enable_ltdl_install=yes
523 if test x"$enable_ltdl_install" = x"yes"; then
524 ac_configure_args="$ac_configure_args --enable-ltdl-install"
525 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
526 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
528 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
535 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
536 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
537 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
538 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
539 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
540 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
541 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
543 dnl This is just to silence aclocal about the macro not being used
544 ifelse([AC_DISABLE_FAST_INSTALL])dnl
546 # Add --enable-maintainer-mode option to configure.
551 AC_DEFUN(AM_MAINTAINER_MODE,
552 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
553 dnl maintainer-mode is disabled by default
554 AC_ARG_ENABLE(maintainer-mode,
555 [ --enable-maintainer-mode enable make rules and dependencies not useful
556 (and sometimes confusing) to the casual installer],
557 USE_MAINTAINER_MODE=$enableval,
558 USE_MAINTAINER_MODE=no)
559 AC_MSG_RESULT($USE_MAINTAINER_MODE)
560 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
561 MAINT=$MAINTAINER_MODE_TRUE
566 # Define a conditional.
568 AC_DEFUN(AM_CONDITIONAL,
582 # @defmac AC_PROG_CC_STDC
583 # @maindex PROG_CC_STDC
585 # If the C compiler in not in ANSI C mode by default, try to add an option
586 # to output variable @code{CC} to make it so. This macro tries various
587 # options that select ANSI C on some system or another. It considers the
588 # compiler to be in ANSI C mode if it handles function prototypes correctly.
590 # If you use this macro, you should check after calling it whether the C
591 # compiler has been set to accept ANSI C; if not, the shell variable
592 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
593 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
594 # program @code{ansi2knr}, which comes with Ghostscript.
597 AC_DEFUN(AM_PROG_CC_STDC,
598 [AC_REQUIRE([AC_PROG_CC])
599 AC_BEFORE([$0], [AC_C_INLINE])
600 AC_BEFORE([$0], [AC_C_CONST])
601 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
602 dnl a magic option to avoid problems with ANSI preprocessor commands
604 dnl FIXME: can't do this because then AC_AIX won't work due to a
605 dnl circular dependency.
606 dnl AC_BEFORE([$0], [AC_PROG_CPP])
607 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
608 AC_CACHE_VAL(am_cv_prog_cc_stdc,
609 [am_cv_prog_cc_stdc=no
611 # Don't try gcc -ansi; that turns off useful extensions and
612 # breaks some systems' header files.
614 # Ultrix and OSF/1 -std1
615 # HP-UX -Aa -D_HPUX_SOURCE
616 # SVR4 -Xc -D__EXTENSIONS__
617 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
619 CC="$ac_save_CC $ac_arg"
623 #include <sys/types.h>
624 #include <sys/stat.h>
625 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
626 struct buf { int x; };
627 FILE * (*rcsopen) (struct buf *, struct stat *, int);
628 static char *e (p, i)
634 static char *f (char * (*g) (char **, int), char **p, ...)
639 s = g (p, va_arg (v,int));
643 int test (int i, double x);
644 struct s1 {int (*f) (int a);};
645 struct s2 {int (*f) (double a);};
646 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
650 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
652 [am_cv_prog_cc_stdc="$ac_arg"; break])
656 if test -z "$am_cv_prog_cc_stdc"; then
657 AC_MSG_RESULT([none needed])
659 AC_MSG_RESULT($am_cv_prog_cc_stdc)
661 case "x$am_cv_prog_cc_stdc" in
663 *) CC="$CC $am_cv_prog_cc_stdc" ;;
669 # This macro adds the name macrodir to the set of directories
670 # that `aclocal' searches for macros.
672 dnl SYLPHEED_ACLOCAL_INCLUDE(macrodir)
673 AC_DEFUN([SYLPHEED_ACLOCAL_INCLUDE],
675 test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
677 for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
680 # Macro to add for using GNU gettext.
681 # Ulrich Drepper <drepper@cygnus.com>, 1995.
683 # This file can be copied and used freely without restrictions. It can
684 # be used in projects which are not available under the GNU Public License
685 # but which still want to provide support for the GNU gettext functionality.
686 # Please note that the actual code is *not* freely available.
690 AC_DEFUN(AM_WITH_NLS,
691 [AC_MSG_CHECKING([whether NLS is requested])
692 dnl Default is enabled NLS
694 [ --disable-nls do not use Native Language Support],
695 USE_NLS=$enableval, USE_NLS=yes)
696 AC_MSG_RESULT($USE_NLS)
699 USE_INCLUDED_LIBINTL=no
701 dnl If we use NLS figure out what method
702 if test "$USE_NLS" = "yes"; then
703 AC_DEFINE(ENABLE_NLS)
704 AC_MSG_CHECKING([whether included gettext is requested])
705 AC_ARG_WITH(included-gettext,
706 [ --with-included-gettext use the GNU gettext library included here],
707 nls_cv_force_use_gnu_gettext=$withval,
708 nls_cv_force_use_gnu_gettext=no)
709 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
711 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
712 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
713 dnl User does not insist on using GNU NLS library. Figure out what
714 dnl to use. If gettext or catgets are available (in this order) we
715 dnl use this. Else we have to fall back to GNU NLS library.
716 dnl catgets is only used if permitted by option --with-catgets.
721 AC_CHECK_HEADER(libintl.h,
722 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
723 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
724 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
726 if test "$gt_cv_func_gettext_libc" != "yes"; then
727 AC_CHECK_LIB(intl, bindtextdomain,
728 [AC_CACHE_CHECK([for gettext in libintl],
729 gt_cv_func_gettext_libintl,
730 [AC_CHECK_LIB(intl, gettext,
731 gt_cv_func_gettext_libintl=yes,
732 gt_cv_func_gettext_libintl=no)],
733 gt_cv_func_gettext_libintl=no)])
736 if test "$gt_cv_func_gettext_libc" = "yes" \
737 || test "$gt_cv_func_gettext_libintl" = "yes"; then
738 AC_DEFINE(HAVE_GETTEXT)
739 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
740 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
741 if test "$MSGFMT" != "no"; then
742 AC_CHECK_FUNCS(dcgettext)
743 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
744 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
745 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
746 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
747 return _nl_msg_cat_cntr],
757 if test "$CATOBJEXT" = "NONE"; then
758 AC_MSG_CHECKING([whether catgets can be used])
760 [ --with-catgets use catgets functions if available],
761 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
762 AC_MSG_RESULT($nls_cv_use_catgets)
764 if test "$nls_cv_use_catgets" = "yes"; then
765 dnl No gettext in C library. Try catgets next.
766 AC_CHECK_LIB(i, main)
767 AC_CHECK_FUNC(catgets,
768 [AC_DEFINE(HAVE_CATGETS)
769 INTLOBJS="\$(CATOBJS)"
770 AC_PATH_PROG(GENCAT, gencat, no)dnl
771 if test "$GENCAT" != "no"; then
772 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
773 if test "$GMSGFMT" = "no"; then
774 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
775 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
777 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
778 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
779 USE_INCLUDED_LIBINTL=yes
783 INTLDEPS='$(top_builddir)/intl/libintl.a'
785 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
786 nls_cv_header_intl=intl/libintl.h
787 nls_cv_header_libgt=intl/libgettext.h
792 if test "$CATOBJEXT" = "NONE"; then
793 dnl Neither gettext nor catgets in included in the C library.
794 dnl Fall back on GNU gettext library.
795 nls_cv_use_gnu_gettext=yes
799 if test "$nls_cv_use_gnu_gettext" = "yes"; then
800 dnl Mark actions used to generate GNU NLS library.
801 INTLOBJS="\$(GETTOBJS)"
802 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
803 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
804 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
805 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
806 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
808 USE_INCLUDED_LIBINTL=yes
812 INTLDEPS='$(top_builddir)/intl/libintl.a'
814 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
815 nls_cv_header_intl=intl/libintl.h
816 nls_cv_header_libgt=intl/libgettext.h
819 dnl Test whether we really found GNU xgettext.
820 if test "$XGETTEXT" != ":"; then
821 dnl If it is no GNU xgettext we define it as : so that the
822 dnl Makefiles still can work.
823 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
827 [found xgettext program is not GNU xgettext; ignore it])
832 # We need to process the po/ directory.
836 nls_cv_header_intl=intl/libintl.h
837 nls_cv_header_libgt=intl/libgettext.h
839 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
841 [case "$CONFIG_FILES" in *po/Makefile.in*)
842 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
846 # If this is used in GNU gettext we have to set USE_NLS to `yes'
847 # because some of the sources are only built for this goal.
848 if test "$PACKAGE" = gettext; then
850 USE_INCLUDED_LIBINTL=yes
853 dnl These rules are solely for the distribution goal. While doing this
854 dnl we only have to keep exactly one list of the available catalogs
856 for lang in $ALL_LINGUAS; do
857 GMOFILES="$GMOFILES $lang.gmo"
858 POFILES="$POFILES $lang.po"
861 dnl Make all variables we use known to autoconf.
862 AC_SUBST(USE_INCLUDED_LIBINTL)
865 AC_SUBST(DATADIRNAME)
875 AC_DEFUN(AM_GNU_GETTEXT,
876 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
877 AC_REQUIRE([AC_PROG_CC])dnl
878 AC_REQUIRE([AC_PROG_RANLIB])dnl
879 AC_REQUIRE([AC_ISC_POSIX])dnl
880 AC_REQUIRE([AC_HEADER_STDC])dnl
881 AC_REQUIRE([AC_C_CONST])dnl
882 AC_REQUIRE([AC_C_INLINE])dnl
883 AC_REQUIRE([AC_TYPE_OFF_T])dnl
884 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
885 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
886 AC_REQUIRE([AC_FUNC_MMAP])dnl
888 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
889 unistd.h sys/param.h])
890 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
891 strdup __argz_count __argz_stringify __argz_next])
893 if test "${ac_cv_func_stpcpy+set}" != "set"; then
894 AC_CHECK_FUNCS(stpcpy)
896 if test "${ac_cv_func_stpcpy}" = "yes"; then
897 AC_DEFINE(HAVE_STPCPY)
903 if test "x$CATOBJEXT" != "x"; then
904 if test "x$ALL_LINGUAS" = "x"; then
907 AC_MSG_CHECKING(for catalogs to be installed)
909 for lang in ${LINGUAS=$ALL_LINGUAS}; do
910 case "$ALL_LINGUAS" in
911 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
915 AC_MSG_RESULT($LINGUAS)
918 dnl Construct list of names of catalog files to be constructed.
919 if test -n "$LINGUAS"; then
920 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
924 dnl The reference to <locale.h> in the installed <libintl.h> file
925 dnl must be resolved because we cannot expect the users of this
926 dnl to define HAVE_LOCALE_H.
927 if test $ac_cv_header_locale_h = yes; then
928 INCLUDE_LOCALE_H="#include <locale.h>"
931 /* The system does not provide the header <locale.h>. Take care yourself. */"
933 AC_SUBST(INCLUDE_LOCALE_H)
935 dnl Determine which catalog format we have (if any is needed)
936 dnl For now we know about two different formats:
937 dnl Linux libc-5 and the normal X/Open format
938 test -d intl || mkdir intl
939 if test "$CATOBJEXT" = ".cat"; then
940 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
942 dnl Transform the SED scripts while copying because some dumb SEDs
943 dnl cannot handle comments.
944 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
946 dnl po2tbl.sed is always needed.
947 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
948 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
950 dnl In the intl/Makefile.in we have a special dependency which makes
951 dnl only sense for gettext. We comment this out for non-gettext
953 if test "$PACKAGE" = "gettext"; then
963 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
964 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
965 dnl Try to locate is.
967 if test -n "$ac_aux_dir"; then
968 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
970 if test -z "$MKINSTALLDIRS"; then
971 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
973 AC_SUBST(MKINSTALLDIRS)
975 dnl *** For now the libtool support in intl/Makefile is not for real.
979 dnl Generate list of files to be processed by xgettext which will
980 dnl be included in po/Makefile.
981 test -d po || mkdir po
982 if test "x$srcdir" != "x."; then
983 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
984 posrcprefix="$srcdir/"
986 posrcprefix="../$srcdir/"
992 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
993 < $srcdir/po/POTFILES.in > po/POTFILES
996 # Search path for a program which passes the given test.
997 # Ulrich Drepper <drepper@cygnus.com>, 1996.
999 # This file can be copied and used freely without restrictions. It can
1000 # be used in projects which are not available under the GNU Public License
1001 # but which still want to provide support for the GNU gettext functionality.
1002 # Please note that the actual code is *not* freely available.
1006 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1007 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1008 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
1009 [# Extract the first word of "$2", so it can be a program name with args.
1010 set dummy $2; ac_word=[$]2
1011 AC_MSG_CHECKING([for $ac_word])
1012 AC_CACHE_VAL(ac_cv_path_$1,
1015 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1018 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1019 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1020 test -z "$ac_dir" && ac_dir=.
1021 if test -f $ac_dir/$ac_word; then
1023 ac_cv_path_$1="$ac_dir/$ac_word"
1029 dnl If no 4th arg is given, leave the cache variable unset,
1030 dnl so AC_PATH_PROGS will keep looking.
1031 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1036 if test -n "[$]$1"; then
1037 AC_MSG_RESULT([$]$1)
1044 # Check whether LC_MESSAGES is available in <locale.h>.
1045 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1047 # This file can be copied and used freely without restrictions. It can
1048 # be used in projects which are not available under the GNU Public License
1049 # but which still want to provide support for the GNU gettext functionality.
1050 # Please note that the actual code is *not* freely available.
1054 AC_DEFUN(AM_LC_MESSAGES,
1055 [if test $ac_cv_header_locale_h = yes; then
1056 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1057 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1058 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1059 if test $am_cv_val_LC_MESSAGES = yes; then
1060 AC_DEFINE(HAVE_LC_MESSAGES)
1064 # Configure paths for GLIB
1065 # Owen Taylor 97-11-3
1067 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1068 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
1069 dnl gthread is specified in MODULES, pass to glib-config
1071 AC_DEFUN(AM_PATH_GLIB,
1073 dnl Get the cflags and libraries from the glib-config script
1075 AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
1076 glib_config_prefix="$withval", glib_config_prefix="")
1077 AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
1078 glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
1079 AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
1080 , enable_glibtest=yes)
1082 if test x$glib_config_exec_prefix != x ; then
1083 glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
1084 if test x${GLIB_CONFIG+set} != xset ; then
1085 GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
1088 if test x$glib_config_prefix != x ; then
1089 glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
1090 if test x${GLIB_CONFIG+set} != xset ; then
1091 GLIB_CONFIG=$glib_config_prefix/bin/glib-config
1099 glib_config_args="$glib_config_args gmodule"
1102 glib_config_args="$glib_config_args gthread"
1107 AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
1108 min_glib_version=ifelse([$1], ,0.99.7,$1)
1109 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
1111 if test "$GLIB_CONFIG" = "no" ; then
1114 GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
1115 GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
1116 glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
1117 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1118 glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
1119 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1120 glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
1121 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1122 if test "x$enable_glibtest" = "xyes" ; then
1123 ac_save_CFLAGS="$CFLAGS"
1124 ac_save_LIBS="$LIBS"
1125 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1126 LIBS="$GLIB_LIBS $LIBS"
1128 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
1129 dnl checks the results of glib-config to some extent
1140 int major, minor, micro;
1143 system ("touch conf.glibtest");
1145 /* HP/UX 9 (%@#!) writes to sscanf strings */
1146 tmp_version = g_strdup("$min_glib_version");
1147 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1148 printf("%s, bad version string\n", "$min_glib_version");
1152 if ((glib_major_version != $glib_config_major_version) ||
1153 (glib_minor_version != $glib_config_minor_version) ||
1154 (glib_micro_version != $glib_config_micro_version))
1156 printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
1157 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
1158 glib_major_version, glib_minor_version, glib_micro_version);
1159 printf ("*** was found! If glib-config was correct, then it is best\n");
1160 printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
1161 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1162 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1163 printf("*** required on your system.\n");
1164 printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
1165 printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
1166 printf("*** before re-running configure\n");
1168 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
1169 (glib_minor_version != GLIB_MINOR_VERSION) ||
1170 (glib_micro_version != GLIB_MICRO_VERSION))
1172 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
1173 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
1174 printf("*** library (version %d.%d.%d)\n",
1175 glib_major_version, glib_minor_version, glib_micro_version);
1179 if ((glib_major_version > major) ||
1180 ((glib_major_version == major) && (glib_minor_version > minor)) ||
1181 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
1187 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
1188 glib_major_version, glib_minor_version, glib_micro_version);
1189 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
1190 major, minor, micro);
1191 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
1193 printf("*** If you have already installed a sufficiently new version, this error\n");
1194 printf("*** probably means that the wrong copy of the glib-config shell script is\n");
1195 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1196 printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
1197 printf("*** correct copy of glib-config. (In this case, you will have to\n");
1198 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1199 printf("*** so that the correct libraries are found at run-time))\n");
1204 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1205 CFLAGS="$ac_save_CFLAGS"
1206 LIBS="$ac_save_LIBS"
1209 if test "x$no_glib" = x ; then
1211 ifelse([$2], , :, [$2])
1214 if test "$GLIB_CONFIG" = "no" ; then
1215 echo "*** The glib-config script installed by GLIB could not be found"
1216 echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
1217 echo "*** your path, or set the GLIB_CONFIG environment variable to the"
1218 echo "*** full path to glib-config."
1220 if test -f conf.glibtest ; then
1223 echo "*** Could not run GLIB test program, checking why..."
1224 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1225 LIBS="$LIBS $GLIB_LIBS"
1229 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
1230 [ echo "*** The test program compiled, but did not run. This usually means"
1231 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
1232 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
1233 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1234 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1235 echo "*** is required on your system"
1237 echo "*** If you have an old version installed, it is best to remove it, although"
1238 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1240 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
1241 echo "*** came with the system with the command"
1243 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
1244 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1245 echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
1246 echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
1247 echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
1248 CFLAGS="$ac_save_CFLAGS"
1249 LIBS="$ac_save_LIBS"
1254 ifelse([$3], , :, [$3])
1256 AC_SUBST(GLIB_CFLAGS)
1261 # Configure paths for GTK+
1262 # Owen Taylor 97-11-3
1264 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1265 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
1267 AC_DEFUN(AM_PATH_GTK,
1269 dnl Get the cflags and libraries from the gtk-config script
1271 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
1272 gtk_config_prefix="$withval", gtk_config_prefix="")
1273 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
1274 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
1275 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
1276 , enable_gtktest=yes)
1282 gtk_config_args="$gtk_config_args gthread"
1287 if test x$gtk_config_exec_prefix != x ; then
1288 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
1289 if test x${GTK_CONFIG+set} != xset ; then
1290 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
1293 if test x$gtk_config_prefix != x ; then
1294 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
1295 if test x${GTK_CONFIG+set} != xset ; then
1296 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
1300 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
1301 min_gtk_version=ifelse([$1], ,0.99.7,$1)
1302 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
1304 if test "$GTK_CONFIG" = "no" ; then
1307 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
1308 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
1309 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
1310 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1311 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
1312 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1313 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
1314 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1315 if test "x$enable_gtktest" = "xyes" ; then
1316 ac_save_CFLAGS="$CFLAGS"
1317 ac_save_LIBS="$LIBS"
1318 CFLAGS="$CFLAGS $GTK_CFLAGS"
1319 LIBS="$GTK_LIBS $LIBS"
1321 dnl Now check if the installed GTK is sufficiently new. (Also sanity
1322 dnl checks the results of gtk-config to some extent
1326 #include <gtk/gtk.h>
1333 int major, minor, micro;
1336 system ("touch conf.gtktest");
1338 /* HP/UX 9 (%@#!) writes to sscanf strings */
1339 tmp_version = g_strdup("$min_gtk_version");
1340 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1341 printf("%s, bad version string\n", "$min_gtk_version");
1345 if ((gtk_major_version != $gtk_config_major_version) ||
1346 (gtk_minor_version != $gtk_config_minor_version) ||
1347 (gtk_micro_version != $gtk_config_micro_version))
1349 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
1350 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
1351 gtk_major_version, gtk_minor_version, gtk_micro_version);
1352 printf ("*** was found! If gtk-config was correct, then it is best\n");
1353 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
1354 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1355 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1356 printf("*** required on your system.\n");
1357 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
1358 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
1359 printf("*** before re-running configure\n");
1361 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
1362 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
1363 (gtk_minor_version != GTK_MINOR_VERSION) ||
1364 (gtk_micro_version != GTK_MICRO_VERSION))
1366 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
1367 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
1368 printf("*** library (version %d.%d.%d)\n",
1369 gtk_major_version, gtk_minor_version, gtk_micro_version);
1371 #endif /* defined (GTK_MAJOR_VERSION) ... */
1374 if ((gtk_major_version > major) ||
1375 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
1376 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
1382 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
1383 gtk_major_version, gtk_minor_version, gtk_micro_version);
1384 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
1385 major, minor, micro);
1386 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
1388 printf("*** If you have already installed a sufficiently new version, this error\n");
1389 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
1390 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1391 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
1392 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
1393 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1394 printf("*** so that the correct libraries are found at run-time))\n");
1399 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1400 CFLAGS="$ac_save_CFLAGS"
1401 LIBS="$ac_save_LIBS"
1404 if test "x$no_gtk" = x ; then
1406 ifelse([$2], , :, [$2])
1409 if test "$GTK_CONFIG" = "no" ; then
1410 echo "*** The gtk-config script installed by GTK could not be found"
1411 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
1412 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1413 echo "*** full path to gtk-config."
1415 if test -f conf.gtktest ; then
1418 echo "*** Could not run GTK test program, checking why..."
1419 CFLAGS="$CFLAGS $GTK_CFLAGS"
1420 LIBS="$LIBS $GTK_LIBS"
1422 #include <gtk/gtk.h>
1424 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
1425 [ echo "*** The test program compiled, but did not run. This usually means"
1426 echo "*** that the run-time linker is not finding GTK or finding the wrong"
1427 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
1428 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1429 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1430 echo "*** is required on your system"
1432 echo "*** If you have an old version installed, it is best to remove it, although"
1433 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1435 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
1436 echo "*** came with the system with the command"
1438 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
1439 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1440 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
1441 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
1442 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
1443 CFLAGS="$ac_save_CFLAGS"
1444 LIBS="$ac_save_LIBS"
1449 ifelse([$3], , :, [$3])
1451 AC_SUBST(GTK_CFLAGS)
1456 # Configure paths for gdk-pixbuf
1457 # Elliot Lee 2000-01-10
1458 # stolen from Raph Levien 98-11-18
1459 # stolen from Manish Singh 98-9-30
1460 # stolen back from Frank Belew
1461 # stolen from Manish Singh
1462 # Shamelessly stolen from Owen Taylor
1464 dnl AM_PATH_GDK_PIXBUF([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1465 dnl Test for GDK_PIXBUF, and define GDK_PIXBUF_CFLAGS and GDK_PIXBUF_LIBS
1467 AC_DEFUN(AM_PATH_GDK_PIXBUF,
1469 dnl Get the cflags and libraries from the gdk-pixbuf-config script
1471 AC_ARG_WITH(gdk-pixbuf-prefix,[ --with-gdk-pixbuf-prefix=PFX Prefix where GDK_PIXBUF is installed (optional)],
1472 gdk_pixbuf_prefix="$withval", gdk_pixbuf_prefix="")
1473 AC_ARG_WITH(gdk-pixbuf-exec-prefix,[ --with-gdk-pixbuf-exec-prefix=PFX Exec prefix where GDK_PIXBUF is installed (optional)],
1474 gdk_pixbuf_exec_prefix="$withval", gdk_pixbuf_exec_prefix="")
1475 AC_ARG_ENABLE(gdk_pixbuftest, [ --disable-gdk_pixbuftest Do not try to compile and run a test GDK_PIXBUF program],
1476 , enable_gdk_pixbuftest=yes)
1478 if test x$gdk_pixbuf_exec_prefix != x ; then
1479 gdk_pixbuf_args="$gdk_pixbuf_args --exec-prefix=$gdk_pixbuf_exec_prefix"
1480 if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
1481 GDK_PIXBUF_CONFIG=$gdk_pixbuf_exec_prefix/gdk-pixbuf-config
1484 if test x$gdk_pixbuf_prefix != x ; then
1485 gdk_pixbuf_args="$gdk_pixbuf_args --prefix=$gdk_pixbuf_prefix"
1486 if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
1487 GDK_PIXBUF_CONFIG=$gdk_pixbuf_prefix/bin/gdk-pixbuf-config
1491 AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no)
1492 min_gdk_pixbuf_version=ifelse([$1], ,0.2.5,$1)
1493 AC_MSG_CHECKING(for GDK_PIXBUF - version >= $min_gdk_pixbuf_version)
1495 if test "$GDK_PIXBUF_CONFIG" = "no" ; then
1498 GDK_PIXBUF_CFLAGS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --cflags`
1499 GDK_PIXBUF_LIBS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --libs`
1501 gdk_pixbuf_major_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
1502 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1503 gdk_pixbuf_minor_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
1504 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1505 gdk_pixbuf_micro_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_config_args --version | \
1506 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1507 if test "x$enable_gdk_pixbuftest" = "xyes" ; then
1508 ac_save_CFLAGS="$CFLAGS"
1509 ac_save_LIBS="$LIBS"
1510 CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
1511 LIBS="$LIBS $GDK_PIXBUF_LIBS"
1513 dnl Now check if the installed GDK_PIXBUF is sufficiently new. (Also sanity
1514 dnl checks the results of gdk-pixbuf-config to some extent
1516 rm -f conf.gdk_pixbuftest
1521 #include <gdk-pixbuf/gdk-pixbuf.h>
1524 my_strdup (char *str)
1530 new_str = malloc ((strlen (str) + 1) * sizeof(char));
1531 strcpy (new_str, str);
1541 int major, minor, micro;
1544 system ("touch conf.gdk_pixbuftest");
1546 /* HP/UX 9 (%@#!) writes to sscanf strings */
1547 tmp_version = my_strdup("$min_gdk_pixbuf_version");
1548 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1549 printf("%s, bad version string\n", "$min_gdk_pixbuf_version");
1553 if (($gdk_pixbuf_major_version > major) ||
1554 (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version > minor)) ||
1555 (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version == minor) && ($gdk_pixbuf_micro_version >= micro)))
1561 printf("\n*** 'gdk-pixbuf-config --version' returned %d.%d.%d, but the minimum version\n", $gdk_pixbuf_major_version, $gdk_pixbuf_minor_version, $gdk_pixbuf_micro_version);
1562 printf("*** of GDK_PIXBUF required is %d.%d.%d. If gdk-pixbuf-config is correct, then it is\n", major, minor, micro);
1563 printf("*** best to upgrade to the required version.\n");
1564 printf("*** If gdk-pixbuf-config was wrong, set the environment variable GDK_PIXBUF_CONFIG\n");
1565 printf("*** to point to the correct copy of gdk-pixbuf-config, and remove the file\n");
1566 printf("*** config.cache before re-running configure\n");
1571 ],, no_gdk_pixbuf=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1572 CFLAGS="$ac_save_CFLAGS"
1573 LIBS="$ac_save_LIBS"
1576 if test "x$no_gdk_pixbuf" = x ; then
1578 ifelse([$2], , :, [$2])
1581 if test "$GDK_PIXBUF_CONFIG" = "no" ; then
1582 echo "*** The gdk-pixbuf-config script installed by GDK_PIXBUF could not be found"
1583 echo "*** If GDK_PIXBUF was installed in PREFIX, make sure PREFIX/bin is in"
1584 echo "*** your path, or set the GDK_PIXBUF_CONFIG environment variable to the"
1585 echo "*** full path to gdk-pixbuf-config."
1587 if test -f conf.gdk_pixbuftest ; then
1590 echo "*** Could not run GDK_PIXBUF test program, checking why..."
1591 CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
1592 LIBS="$LIBS $GDK_PIXBUF_LIBS"
1595 #include <gdk-pixbuf/gdk-pixbuf.h>
1597 [ echo "*** The test program compiled, but did not run. This usually means"
1598 echo "*** that the run-time linker is not finding GDK_PIXBUF or finding the wrong"
1599 echo "*** version of GDK_PIXBUF. If it is not finding GDK_PIXBUF, you'll need to set your"
1600 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1601 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1602 echo "*** is required on your system"
1604 echo "*** If you have an old version installed, it is best to remove it, although"
1605 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
1606 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1607 echo "*** exact error that occured. This usually means GDK_PIXBUF was incorrectly installed"
1608 echo "*** or that you have moved GDK_PIXBUF since it was installed. In the latter case, you"
1609 echo "*** may want to edit the gdk-pixbuf-config script: $GDK_PIXBUF_CONFIG" ])
1610 CFLAGS="$ac_save_CFLAGS"
1611 LIBS="$ac_save_LIBS"
1614 GDK_PIXBUF_CFLAGS=""
1616 ifelse([$3], , :, [$3])
1618 AC_SUBST(GDK_PIXBUF_CFLAGS)
1619 AC_SUBST(GDK_PIXBUF_LIBS)
1620 rm -f conf.gdk_pixbuftest
1623 # Configure paths for IMLIB
1624 # Frank Belew 98-8-31
1625 # stolen from Manish Singh
1626 # Shamelessly stolen from Owen Taylor
1628 dnl AM_PATH_IMLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1629 dnl Test for IMLIB, and define IMLIB_CFLAGS and IMLIB_LIBS
1631 AC_DEFUN(AM_PATH_IMLIB,
1633 dnl Get the cflags and libraries from the imlib-config script
1635 AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX Prefix where IMLIB is installed (optional)],
1636 imlib_prefix="$withval", imlib_prefix="")
1637 AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)],
1638 imlib_exec_prefix="$withval", imlib_exec_prefix="")
1639 AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest Do not try to compile and run a test IMLIB program],
1640 , enable_imlibtest=yes)
1642 if test x$imlib_exec_prefix != x ; then
1643 imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
1644 if test x${IMLIB_CONFIG+set} != xset ; then
1645 IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config
1648 if test x$imlib_prefix != x ; then
1649 imlib_args="$imlib_args --prefix=$imlib_prefix"
1650 if test x${IMLIB_CONFIG+set} != xset ; then
1651 IMLIB_CONFIG=$imlib_prefix/bin/imlib-config
1655 AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
1656 min_imlib_version=ifelse([$1], ,1.9.5,$1)
1657 AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
1659 if test "$IMLIB_CONFIG" = "no" ; then
1662 IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags`
1663 IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs`
1665 imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \
1666 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1667 imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \
1668 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1669 imlib_micro_version=`$IMLIB_CONFIG $imlib_args --version | \
1670 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1671 if test "x$enable_imlibtest" = "xyes" ; then
1672 ac_save_CFLAGS="$CFLAGS"
1673 ac_save_LIBS="$LIBS"
1674 CFLAGS="$CFLAGS $IMLIB_CFLAGS"
1675 LIBS="$LIBS $IMLIB_LIBS"
1677 dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
1678 dnl checks the results of imlib-config to some extent
1680 rm -f conf.imlibtest
1688 my_strdup (char *str)
1694 new_str = malloc ((strlen (str) + 1) * sizeof(char));
1695 strcpy (new_str, str);
1705 int major, minor, micro;
1708 system ("touch conf.imlibtest");
1710 /* HP/UX 9 (%@#!) writes to sscanf strings */
1711 tmp_version = my_strdup("$min_imlib_version");
1712 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1713 printf("%s, bad version string\n", "$min_imlib_version");
1717 if (($imlib_major_version > major) ||
1718 (($imlib_major_version == major) && ($imlib_minor_version > minor)) ||
1719 (($imlib_major_version == major) && ($imlib_minor_version == minor) &&
1720 ($imlib_micro_version >= micro)))
1726 printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
1727 printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
1728 printf("*** best to upgrade to the required version.\n");
1729 printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n");
1730 printf("*** to point to the correct copy of imlib-config, and remove the file\n");
1731 printf("*** config.cache before re-running configure\n");
1736 ],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1737 CFLAGS="$ac_save_CFLAGS"
1738 LIBS="$ac_save_LIBS"
1741 if test "x$no_imlib" = x ; then
1743 ifelse([$2], , :, [$2])
1746 if test "$IMLIB_CONFIG" = "no" ; then
1747 echo "*** The imlib-config script installed by IMLIB could not be found"
1748 echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
1749 echo "*** your path, or set the IMLIB_CONFIG environment variable to the"
1750 echo "*** full path to imlib-config."
1752 if test -f conf.imlibtest ; then
1755 echo "*** Could not run IMLIB test program, checking why..."
1756 CFLAGS="$CFLAGS $IMLIB_CFLAGS"
1757 LIBS="$LIBS $IMLIB_LIBS"
1762 [ echo "*** The test program compiled, but did not run. This usually means"
1763 echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
1764 echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
1765 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1766 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1767 echo "*** is required on your system"
1769 echo "*** If you have an old version installed, it is best to remove it, although"
1770 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
1771 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1772 echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
1773 echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
1774 echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ])
1775 CFLAGS="$ac_save_CFLAGS"
1776 LIBS="$ac_save_LIBS"
1781 ifelse([$3], , :, [$3])
1783 AC_SUBST(IMLIB_CFLAGS)
1784 AC_SUBST(IMLIB_LIBS)
1785 rm -f conf.imlibtest
1788 # Check for gdk-imlib
1789 AC_DEFUN(AM_PATH_GDK_IMLIB,
1791 dnl Get the cflags and libraries from the imlib-config script
1793 AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX Prefix where IMLIB is installed (optional)],
1794 imlib_prefix="$withval", imlib_prefix="")
1795 AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)],
1796 imlib_exec_prefix="$withval", imlib_exec_prefix="")
1797 AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest Do not try to compile and run a test IMLIB program],
1798 , enable_imlibtest=yes)
1800 if test x$imlib_exec_prefix != x ; then
1801 imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
1802 if test x${IMLIB_CONFIG+set} != xset ; then
1803 IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config
1806 if test x$imlib_prefix != x ; then
1807 imlib_args="$imlib_args --prefix=$imlib_prefix"
1808 if test x${IMLIB_CONFIG+set} != xset ; then
1809 IMLIB_CONFIG=$imlib_prefix/bin/imlib-config
1813 AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
1814 min_imlib_version=ifelse([$1], ,1.9.5,$1)
1815 AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
1817 if test "$IMLIB_CONFIG" = "no" ; then
1820 GDK_IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags-gdk`
1821 GDK_IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs-gdk`
1823 imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \
1824 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1825 imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \
1826 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1827 if test "x$enable_imlibtest" = "xyes" ; then
1828 ac_save_CFLAGS="$CFLAGS"
1829 ac_save_LIBS="$LIBS"
1830 CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
1831 LIBS="$LIBS $GDK_IMLIB_LIBS"
1833 dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
1834 dnl checks the results of imlib-config to some extent
1836 rm -f conf.imlibtest
1840 #include <gdk_imlib.h>
1847 system ("touch conf.gdkimlibtest");
1849 /* HP/UX 9 (%@#!) writes to sscanf strings */
1850 tmp_version = g_strdup("$min_imlib_version");
1851 if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) {
1852 printf("%s, bad version string\n", "$min_imlib_version");
1856 if (($imlib_major_version > major) ||
1857 (($imlib_major_version == major) && ($imlib_minor_version >= minor)))
1863 printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
1864 printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
1865 printf("*** best to upgrade to the required version.\n");
1866 printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n");
1867 printf("*** to point to the correct copy of imlib-config, and remove the file\n");
1868 printf("*** config.cache before re-running configure\n");
1873 ],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1874 CFLAGS="$ac_save_CFLAGS"
1875 LIBS="$ac_save_LIBS"
1878 if test "x$no_imlib" = x ; then
1880 ifelse([$2], , :, [$2])
1883 if test "$IMLIB_CONFIG" = "no" ; then
1884 echo "*** The imlib-config script installed by IMLIB could not be found"
1885 echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
1886 echo "*** your path, or set the IMLIB_CONFIG environment variable to the"
1887 echo "*** full path to imlib-config."
1889 if test -f conf.gdkimlibtest ; then
1892 echo "*** Could not run IMLIB test program, checking why..."
1893 CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
1894 LIBS="$LIBS $GDK_IMLIB_LIBS"
1897 #include <gdk_imlib.h>
1899 [ echo "*** The test program compiled, but did not run. This usually means"
1900 echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
1901 echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
1902 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1903 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1904 echo "*** is required on your system"
1906 echo "*** If you have an old version installed, it is best to remove it, although"
1907 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
1908 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1909 echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
1910 echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
1911 echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ])
1912 CFLAGS="$ac_save_CFLAGS"
1913 LIBS="$ac_save_LIBS"
1918 ifelse([$3], , :, [$3])
1920 AC_SUBST(GDK_IMLIB_CFLAGS)
1921 AC_SUBST(GDK_IMLIB_LIBS)
1922 rm -f conf.gdkimlibtest
1925 dnl Autoconf macros for libgpgme
1928 # Configure paths for GPGME
1929 # Shamelessly stolen from the one of XDELTA by Owen Taylor
1930 # Werner Koch 2000-11-17
1932 dnl AM_PATH_GPGME([MINIMUM-VERSION,
1933 dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
1934 dnl Test for gpgme, and define GPGME_CFLAGS and GPGME_LIBS
1936 AC_DEFUN(AM_PATH_GPGME,
1938 dnl Get the cflags and libraries from the gpgme-config script
1940 AC_ARG_WITH(gpgme-prefix,
1941 [ --with-gpgme-prefix=PFX Prefix where gpgme is installed (optional)],
1942 gpgme_config_prefix="$withval", gpgme_config_prefix="")
1943 AC_ARG_ENABLE(gpgmetest,
1944 [ --disable-gpgmetest Do not try to compile and run a test gpgme program],
1945 , enable_gpgmetest=yes)
1947 if test x$gpgme_config_prefix != x ; then
1948 gpgme_config_args="$gpgme_config_args --prefix=$gpgme_config_prefix"
1949 if test x${GPGME_CONFIG+set} != xset ; then
1950 GPGME_CONFIG=$gpgme_config_prefix/bin/gpgme-config
1954 AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no)
1955 min_gpgme_version=ifelse([$1], ,1.0.0,$1)
1956 AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version)
1958 if test "$GPGME_CONFIG" = "no" ; then
1961 GPGME_CFLAGS=`$GPGME_CONFIG $gpgme_config_args --cflags`
1962 GPGME_LIBS=`$GPGME_CONFIG $gpgme_config_args --libs`
1963 gpgme_config_version=`$GPGME_CONFIG $gpgme_config_args --version`
1964 if test "x$enable_gpgmetest" = "xyes" ; then
1965 ac_save_CFLAGS="$CFLAGS"
1966 ac_save_LIBS="$LIBS"
1967 CFLAGS="$CFLAGS $GPGME_CFLAGS"
1968 LIBS="$LIBS $GPGME_LIBS"
1970 dnl Now check if the installed gpgme is sufficiently new. Also sanity
1971 dnl checks the results of gpgme-config to some extent
1973 rm -f conf.gpgmetest
1983 system ("touch conf.gpgmetest");
1985 if( strcmp( gpgme_check_version(NULL), "$gpgme_config_version" ) )
1988 "*** 'gpgme-config --version' returned %s, but GPGME (%s) was found!\n",
1989 "$gpgme_config_version", gpgme_check_version(NULL) );
1991 "*** If gpgme-config was correct, then it is best to remove the old\n"
1992 "*** version of GPGME. You may also be able to fix the error\n"
1993 "*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"
1994 "*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"
1995 "*** required on your system.\n"
1996 "*** If gpgme-config was wrong, set the environment variable GPGME_CONFIG\n"
1997 "*** to point to the correct copy of gpgme-config, \n"
1998 "*** and remove the file config.cache before re-running configure\n"
2001 else if ( strcmp(gpgme_check_version(NULL), GPGME_VERSION ) )
2003 printf("\n*** GPGME header file (version %s) does not match\n",
2005 printf("*** library (version %s)\n", gpgme_check_version(NULL) );
2009 if ( gpgme_check_version( "$min_gpgme_version" ) )
2012 "*** An old version of GPGME (%s) was found.\n", gpgme_check_version(NULL) );
2014 "*** You need a version of GPGME newer than %s.\n", "$min_gpgme_version" );
2016 "*** The latest version of GPGME is always available at\n"
2017 "*** ftp://ftp.gnupg.org/pub/gcrypt/alpha/gpgme/\n"
2019 "*** If you have already installed a sufficiently new version, this error\n"
2020 "*** probably means that the wrong copy of the gpgme-config shell script is\n"
2021 "*** being found. The easiest way to fix this is to remove the old version\n"
2022 "*** of GPGME, but you can also set the GPGME_CONFIG environment to point to\n"
2023 "*** the correct copy of gpgme-config. (In this case, you will have to\n"
2024 "*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"
2025 "*** so that the correct libraries are found at run-time).\n"
2030 ],, no_gpgme=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
2031 CFLAGS="$ac_save_CFLAGS"
2032 LIBS="$ac_save_LIBS"
2035 if test "x$no_gpgme" = x ; then
2037 ifelse([$2], , :, [$2])
2039 if test -f conf.gpgmetest ; then
2044 if test "$GPGME_CONFIG" = "no" ; then
2045 echo "*** The gpgme-config script installed by GPGME could not be found"
2046 echo "*** If GPGME was installed in PREFIX, make sure PREFIX/bin is in"
2047 echo "*** your path, or set the GPGME_CONFIG environment variable to the"
2048 echo "*** full path to gpgme-config."
2050 if test -f conf.gpgmetest ; then
2053 echo "*** Could not run gpgme test program, checking why..."
2054 CFLAGS="$CFLAGS $GPGME_CFLAGS"
2055 LIBS="$LIBS $GPGME_LIBS"
2061 ], [ gpgme_check_version(NULL); return 0 ],
2063 echo "*** The test program compiled, but did not run. This usually means"
2064 echo "*** that the run-time linker is not finding GPGME or finding the wrong"
2065 echo "*** version of GPGME. If it is not finding GPGME, you'll need to set your"
2066 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
2067 echo "*** to the installed location Also, make sure you have run ldconfig if"
2068 echo "*** that is required on your system"
2070 echo "*** If you have an old version installed, it is best to remove it,"
2071 echo "*** although you may also be able to get things to work by"
2072 echo "*** modifying LD_LIBRARY_PATH"
2076 echo "*** The test program failed to compile or link. See the file config.log"
2077 echo "*** for the exact error that occured. This usually means GPGME was"
2078 echo "*** incorrectly installed or that you have moved GPGME since it was"
2079 echo "*** installed. In the latter case, you may want to edit the"
2080 echo "*** gpgme-config script: $GPGME_CONFIG"
2082 CFLAGS="$ac_save_CFLAGS"
2083 LIBS="$ac_save_LIBS"
2088 ifelse([$3], , :, [$3])
2090 AC_SUBST(GPGME_CFLAGS)
2091 AC_SUBST(GPGME_LIBS)
2092 rm -f conf.gpgmetest