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.
180 libtool_flags="--cache-file=$cache_file"
181 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
182 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
183 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
184 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
185 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
186 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
187 [libtool_flags="$libtool_flags --enable-dlopen"])
188 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
189 [libtool_flags="$libtool_flags --enable-win32-dll"])
190 AC_ARG_ENABLE(libtool-lock,
191 [ --disable-libtool-lock avoid locking (might break parallel builds)])
192 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
193 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
195 # Some flags need to be propagated to the compiler or linker for good
199 # Find out which ABI we are using.
200 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
201 if AC_TRY_EVAL(ac_compile); then
202 case "`/usr/bin/file conftest.o`" in
218 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
219 SAVE_CFLAGS="$CFLAGS"
220 CFLAGS="$CFLAGS -belf"
221 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
222 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
223 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
224 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
225 CFLAGS="$SAVE_CFLAGS"
229 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
230 [*-*-cygwin* | *-*-mingw*)
231 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
232 AC_CHECK_TOOL(AS, as, false)
233 AC_CHECK_TOOL(OBJDUMP, objdump, false)
239 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
240 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
242 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
243 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
245 # AC_ENABLE_SHARED - implement the --enable-shared flag
246 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
247 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
249 AC_DEFUN(AC_ENABLE_SHARED, [dnl
250 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
251 AC_ARG_ENABLE(shared,
252 changequote(<<, >>)dnl
253 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
255 [p=${PACKAGE-default}
257 yes) enable_shared=yes ;;
258 no) enable_shared=no ;;
261 # Look at the argument we got. We use all the common list separators.
262 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
263 for pkg in $enableval; do
264 if test "X$pkg" = "X$p"; then
271 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
274 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
275 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
276 AC_ENABLE_SHARED(no)])
278 # AC_ENABLE_STATIC - implement the --enable-static flag
279 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
280 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
282 AC_DEFUN(AC_ENABLE_STATIC, [dnl
283 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
284 AC_ARG_ENABLE(static,
285 changequote(<<, >>)dnl
286 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
288 [p=${PACKAGE-default}
290 yes) enable_static=yes ;;
291 no) enable_static=no ;;
294 # Look at the argument we got. We use all the common list separators.
295 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
296 for pkg in $enableval; do
297 if test "X$pkg" = "X$p"; then
304 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
307 # AC_DISABLE_STATIC - set the default static flag to --disable-static
308 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
309 AC_ENABLE_STATIC(no)])
312 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
313 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
314 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
316 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
317 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
318 AC_ARG_ENABLE(fast-install,
319 changequote(<<, >>)dnl
320 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
322 [p=${PACKAGE-default}
324 yes) enable_fast_install=yes ;;
325 no) enable_fast_install=no ;;
327 enable_fast_install=no
328 # Look at the argument we got. We use all the common list separators.
329 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
330 for pkg in $enableval; do
331 if test "X$pkg" = "X$p"; then
332 enable_fast_install=yes
338 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
341 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
342 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
343 AC_ENABLE_FAST_INSTALL(no)])
345 # AC_PROG_LD - find the path to the GNU or non-GNU linker
348 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
349 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
350 AC_REQUIRE([AC_PROG_CC])dnl
351 AC_REQUIRE([AC_CANONICAL_HOST])dnl
352 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
354 if test "$ac_cv_prog_gcc" = yes; then
355 # Check if gcc -print-prog-name=ld gives a path.
356 AC_MSG_CHECKING([for ld used by GCC])
357 ac_prog=`($CC -print-prog-name=ld) 2>&5`
359 # Accept absolute paths.
361 [\\/]* | [A-Za-z]:[\\/]*)
362 re_direlt='/[^/][^/]*/\.\./'
364 # Canonicalize the path of ld
365 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
366 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
367 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
369 test -z "$LD" && LD="$ac_prog"
372 # If it fails, then pretend we aren't using GCC.
376 # If it is relative, then search for the first ld in PATH.
380 elif test "$with_gnu_ld" = yes; then
381 AC_MSG_CHECKING([for GNU ld])
383 AC_MSG_CHECKING([for non-GNU ld])
385 AC_CACHE_VAL(ac_cv_path_LD,
386 [if test -z "$LD"; then
387 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
388 for ac_dir in $PATH; do
389 test -z "$ac_dir" && ac_dir=.
390 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
391 ac_cv_path_LD="$ac_dir/$ac_prog"
392 # Check to see if the program is GNU ld. I'd rather use --version,
393 # but apparently some GNU ld's only accept -v.
394 # Break only if it was the GNU/non-GNU ld that we prefer.
395 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
396 test "$with_gnu_ld" != no && break
398 test "$with_gnu_ld" != yes && break
404 ac_cv_path_LD="$LD" # Let the user override the test with a path.
407 if test -n "$LD"; then
412 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
416 AC_DEFUN(AC_PROG_LD_GNU,
417 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
418 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
419 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
420 ac_cv_prog_gnu_ld=yes
426 # AC_PROG_NM - find the path to a BSD-compatible name lister
428 [AC_MSG_CHECKING([for BSD-compatible nm])
429 AC_CACHE_VAL(ac_cv_path_NM,
430 [if test -n "$NM"; then
431 # Let the user override the test.
434 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
435 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
436 test -z "$ac_dir" && ac_dir=.
437 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
438 # Check to see if the nm accepts a BSD-compat flag.
439 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
440 # nm: unknown option "B" ignored
441 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
442 ac_cv_path_NM="$ac_dir/nm -B"
444 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
445 ac_cv_path_NM="$ac_dir/nm -p"
448 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
449 continue # so that we can try to find one that supports BSD flags
454 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
460 # AC_CHECK_LIBM - check for math library
461 AC_DEFUN(AC_CHECK_LIBM,
462 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
465 *-*-beos* | *-*-cygwin*)
466 # These system don't have libm
469 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
470 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
473 AC_CHECK_LIB(m, main, LIBM="-lm")
478 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
479 # the libltdl convenience library and INCLTDL to the include flags for
480 # the libltdl header and adds --enable-ltdl-convenience to the
481 # configure arguments. Note that LIBLTDL and INCLTDL are not
482 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
483 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
484 # with '${top_builddir}/' and INCLTDL will be prefixed with
485 # '${top_srcdir}/' (note the single quotes!). If your package is not
486 # flat and you're not using automake, define top_builddir and
487 # top_srcdir appropriately in the Makefiles.
488 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
489 case "$enable_ltdl_convenience" in
490 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
491 "") enable_ltdl_convenience=yes
492 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
494 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
495 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
498 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
499 # the libltdl installable library and INCLTDL to the include flags for
500 # the libltdl header and adds --enable-ltdl-install to the configure
501 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
502 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
503 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
504 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
505 # with '${top_srcdir}/' (note the single quotes!). If your package is
506 # not flat and you're not using automake, define top_builddir and
507 # top_srcdir appropriately in the Makefiles.
508 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
509 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
510 AC_CHECK_LIB(ltdl, main,
511 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
512 [if test x"$enable_ltdl_install" = xno; then
513 AC_MSG_WARN([libltdl not installed, but installation disabled])
515 enable_ltdl_install=yes
518 if test x"$enable_ltdl_install" = x"yes"; then
519 ac_configure_args="$ac_configure_args --enable-ltdl-install"
520 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
521 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
523 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
530 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
531 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
532 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
533 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
534 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
535 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
536 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
538 dnl This is just to silence aclocal about the macro not being used
539 ifelse([AC_DISABLE_FAST_INSTALL])dnl
541 # Add --enable-maintainer-mode option to configure.
546 AC_DEFUN(AM_MAINTAINER_MODE,
547 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
548 dnl maintainer-mode is disabled by default
549 AC_ARG_ENABLE(maintainer-mode,
550 [ --enable-maintainer-mode enable make rules and dependencies not useful
551 (and sometimes confusing) to the casual installer],
552 USE_MAINTAINER_MODE=$enableval,
553 USE_MAINTAINER_MODE=no)
554 AC_MSG_RESULT($USE_MAINTAINER_MODE)
555 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
556 MAINT=$MAINTAINER_MODE_TRUE
561 # Define a conditional.
563 AC_DEFUN(AM_CONDITIONAL,
577 # @defmac AC_PROG_CC_STDC
578 # @maindex PROG_CC_STDC
580 # If the C compiler in not in ANSI C mode by default, try to add an option
581 # to output variable @code{CC} to make it so. This macro tries various
582 # options that select ANSI C on some system or another. It considers the
583 # compiler to be in ANSI C mode if it handles function prototypes correctly.
585 # If you use this macro, you should check after calling it whether the C
586 # compiler has been set to accept ANSI C; if not, the shell variable
587 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
588 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
589 # program @code{ansi2knr}, which comes with Ghostscript.
592 AC_DEFUN(AM_PROG_CC_STDC,
593 [AC_REQUIRE([AC_PROG_CC])
594 AC_BEFORE([$0], [AC_C_INLINE])
595 AC_BEFORE([$0], [AC_C_CONST])
596 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
597 dnl a magic option to avoid problems with ANSI preprocessor commands
599 dnl FIXME: can't do this because then AC_AIX won't work due to a
600 dnl circular dependency.
601 dnl AC_BEFORE([$0], [AC_PROG_CPP])
602 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
603 AC_CACHE_VAL(am_cv_prog_cc_stdc,
604 [am_cv_prog_cc_stdc=no
606 # Don't try gcc -ansi; that turns off useful extensions and
607 # breaks some systems' header files.
609 # Ultrix and OSF/1 -std1
610 # HP-UX -Aa -D_HPUX_SOURCE
611 # SVR4 -Xc -D__EXTENSIONS__
612 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
614 CC="$ac_save_CC $ac_arg"
618 #include <sys/types.h>
619 #include <sys/stat.h>
620 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
621 struct buf { int x; };
622 FILE * (*rcsopen) (struct buf *, struct stat *, int);
623 static char *e (p, i)
629 static char *f (char * (*g) (char **, int), char **p, ...)
634 s = g (p, va_arg (v,int));
638 int test (int i, double x);
639 struct s1 {int (*f) (int a);};
640 struct s2 {int (*f) (double a);};
641 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
645 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
647 [am_cv_prog_cc_stdc="$ac_arg"; break])
651 if test -z "$am_cv_prog_cc_stdc"; then
652 AC_MSG_RESULT([none needed])
654 AC_MSG_RESULT($am_cv_prog_cc_stdc)
656 case "x$am_cv_prog_cc_stdc" in
658 *) CC="$CC $am_cv_prog_cc_stdc" ;;
664 # This macro adds the name macrodir to the set of directories
665 # that `aclocal' searches for macros.
667 dnl SYLPHEED_ACLOCAL_INCLUDE(macrodir)
668 AC_DEFUN([SYLPHEED_ACLOCAL_INCLUDE],
670 test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
672 for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
675 # Macro to add for using GNU gettext.
676 # Ulrich Drepper <drepper@cygnus.com>, 1995.
678 # This file can be copied and used freely without restrictions. It can
679 # be used in projects which are not available under the GNU Public License
680 # but which still want to provide support for the GNU gettext functionality.
681 # Please note that the actual code is *not* freely available.
685 AC_DEFUN(AM_WITH_NLS,
686 [AC_MSG_CHECKING([whether NLS is requested])
687 dnl Default is enabled NLS
689 [ --disable-nls do not use Native Language Support],
690 USE_NLS=$enableval, USE_NLS=yes)
691 AC_MSG_RESULT($USE_NLS)
694 USE_INCLUDED_LIBINTL=no
696 dnl If we use NLS figure out what method
697 if test "$USE_NLS" = "yes"; then
698 AC_DEFINE(ENABLE_NLS)
699 AC_MSG_CHECKING([whether included gettext is requested])
700 AC_ARG_WITH(included-gettext,
701 [ --with-included-gettext use the GNU gettext library included here],
702 nls_cv_force_use_gnu_gettext=$withval,
703 nls_cv_force_use_gnu_gettext=no)
704 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
706 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
707 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
708 dnl User does not insist on using GNU NLS library. Figure out what
709 dnl to use. If gettext or catgets are available (in this order) we
710 dnl use this. Else we have to fall back to GNU NLS library.
711 dnl catgets is only used if permitted by option --with-catgets.
716 AC_CHECK_HEADER(libintl.h,
717 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
718 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
719 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
721 if test "$gt_cv_func_gettext_libc" != "yes"; then
722 AC_CHECK_LIB(intl, bindtextdomain,
723 [AC_CACHE_CHECK([for gettext in libintl],
724 gt_cv_func_gettext_libintl,
725 [AC_CHECK_LIB(intl, gettext,
726 gt_cv_func_gettext_libintl=yes,
727 gt_cv_func_gettext_libintl=no)],
728 gt_cv_func_gettext_libintl=no)])
731 if test "$gt_cv_func_gettext_libc" = "yes" \
732 || test "$gt_cv_func_gettext_libintl" = "yes"; then
733 AC_DEFINE(HAVE_GETTEXT)
734 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
735 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
736 if test "$MSGFMT" != "no"; then
737 AC_CHECK_FUNCS(dcgettext)
738 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
739 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
740 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
741 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
742 return _nl_msg_cat_cntr],
752 if test "$CATOBJEXT" = "NONE"; then
753 AC_MSG_CHECKING([whether catgets can be used])
755 [ --with-catgets use catgets functions if available],
756 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
757 AC_MSG_RESULT($nls_cv_use_catgets)
759 if test "$nls_cv_use_catgets" = "yes"; then
760 dnl No gettext in C library. Try catgets next.
761 AC_CHECK_LIB(i, main)
762 AC_CHECK_FUNC(catgets,
763 [AC_DEFINE(HAVE_CATGETS)
764 INTLOBJS="\$(CATOBJS)"
765 AC_PATH_PROG(GENCAT, gencat, no)dnl
766 if test "$GENCAT" != "no"; then
767 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
768 if test "$GMSGFMT" = "no"; then
769 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
770 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
772 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
773 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
774 USE_INCLUDED_LIBINTL=yes
778 INTLDEPS='$(top_builddir)/intl/libintl.a'
780 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
781 nls_cv_header_intl=intl/libintl.h
782 nls_cv_header_libgt=intl/libgettext.h
787 if test "$CATOBJEXT" = "NONE"; then
788 dnl Neither gettext nor catgets in included in the C library.
789 dnl Fall back on GNU gettext library.
790 nls_cv_use_gnu_gettext=yes
794 if test "$nls_cv_use_gnu_gettext" = "yes"; then
795 dnl Mark actions used to generate GNU NLS library.
796 INTLOBJS="\$(GETTOBJS)"
797 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
798 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
799 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
800 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
801 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
803 USE_INCLUDED_LIBINTL=yes
807 INTLDEPS='$(top_builddir)/intl/libintl.a'
809 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
810 nls_cv_header_intl=intl/libintl.h
811 nls_cv_header_libgt=intl/libgettext.h
814 dnl Test whether we really found GNU xgettext.
815 if test "$XGETTEXT" != ":"; then
816 dnl If it is no GNU xgettext we define it as : so that the
817 dnl Makefiles still can work.
818 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
822 [found xgettext program is not GNU xgettext; ignore it])
827 # We need to process the po/ directory.
831 nls_cv_header_intl=intl/libintl.h
832 nls_cv_header_libgt=intl/libgettext.h
834 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
836 [case "$CONFIG_FILES" in *po/Makefile.in*)
837 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
841 # If this is used in GNU gettext we have to set USE_NLS to `yes'
842 # because some of the sources are only built for this goal.
843 if test "$PACKAGE" = gettext; then
845 USE_INCLUDED_LIBINTL=yes
848 dnl These rules are solely for the distribution goal. While doing this
849 dnl we only have to keep exactly one list of the available catalogs
851 for lang in $ALL_LINGUAS; do
852 GMOFILES="$GMOFILES $lang.gmo"
853 POFILES="$POFILES $lang.po"
856 dnl Make all variables we use known to autoconf.
857 AC_SUBST(USE_INCLUDED_LIBINTL)
860 AC_SUBST(DATADIRNAME)
870 AC_DEFUN(AM_GNU_GETTEXT,
871 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
872 AC_REQUIRE([AC_PROG_CC])dnl
873 AC_REQUIRE([AC_PROG_RANLIB])dnl
874 AC_REQUIRE([AC_ISC_POSIX])dnl
875 AC_REQUIRE([AC_HEADER_STDC])dnl
876 AC_REQUIRE([AC_C_CONST])dnl
877 AC_REQUIRE([AC_C_INLINE])dnl
878 AC_REQUIRE([AC_TYPE_OFF_T])dnl
879 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
880 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
881 AC_REQUIRE([AC_FUNC_MMAP])dnl
883 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
884 unistd.h sys/param.h])
885 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
886 strdup __argz_count __argz_stringify __argz_next])
888 if test "${ac_cv_func_stpcpy+set}" != "set"; then
889 AC_CHECK_FUNCS(stpcpy)
891 if test "${ac_cv_func_stpcpy}" = "yes"; then
892 AC_DEFINE(HAVE_STPCPY)
898 if test "x$CATOBJEXT" != "x"; then
899 if test "x$ALL_LINGUAS" = "x"; then
902 AC_MSG_CHECKING(for catalogs to be installed)
904 for lang in ${LINGUAS=$ALL_LINGUAS}; do
905 case "$ALL_LINGUAS" in
906 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
910 AC_MSG_RESULT($LINGUAS)
913 dnl Construct list of names of catalog files to be constructed.
914 if test -n "$LINGUAS"; then
915 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
919 dnl The reference to <locale.h> in the installed <libintl.h> file
920 dnl must be resolved because we cannot expect the users of this
921 dnl to define HAVE_LOCALE_H.
922 if test $ac_cv_header_locale_h = yes; then
923 INCLUDE_LOCALE_H="#include <locale.h>"
926 /* The system does not provide the header <locale.h>. Take care yourself. */"
928 AC_SUBST(INCLUDE_LOCALE_H)
930 dnl Determine which catalog format we have (if any is needed)
931 dnl For now we know about two different formats:
932 dnl Linux libc-5 and the normal X/Open format
933 test -d intl || mkdir intl
934 if test "$CATOBJEXT" = ".cat"; then
935 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
937 dnl Transform the SED scripts while copying because some dumb SEDs
938 dnl cannot handle comments.
939 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
941 dnl po2tbl.sed is always needed.
942 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
943 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
945 dnl In the intl/Makefile.in we have a special dependency which makes
946 dnl only sense for gettext. We comment this out for non-gettext
948 if test "$PACKAGE" = "gettext"; then
958 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
959 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
960 dnl Try to locate is.
962 if test -n "$ac_aux_dir"; then
963 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
965 if test -z "$MKINSTALLDIRS"; then
966 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
968 AC_SUBST(MKINSTALLDIRS)
970 dnl *** For now the libtool support in intl/Makefile is not for real.
974 dnl Generate list of files to be processed by xgettext which will
975 dnl be included in po/Makefile.
976 test -d po || mkdir po
977 if test "x$srcdir" != "x."; then
978 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
979 posrcprefix="$srcdir/"
981 posrcprefix="../$srcdir/"
987 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
988 < $srcdir/po/POTFILES.in > po/POTFILES
991 # Search path for a program which passes the given test.
992 # Ulrich Drepper <drepper@cygnus.com>, 1996.
994 # This file can be copied and used freely without restrictions. It can
995 # be used in projects which are not available under the GNU Public License
996 # but which still want to provide support for the GNU gettext functionality.
997 # Please note that the actual code is *not* freely available.
1001 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1002 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1003 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
1004 [# Extract the first word of "$2", so it can be a program name with args.
1005 set dummy $2; ac_word=[$]2
1006 AC_MSG_CHECKING([for $ac_word])
1007 AC_CACHE_VAL(ac_cv_path_$1,
1010 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1013 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1014 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1015 test -z "$ac_dir" && ac_dir=.
1016 if test -f $ac_dir/$ac_word; then
1018 ac_cv_path_$1="$ac_dir/$ac_word"
1024 dnl If no 4th arg is given, leave the cache variable unset,
1025 dnl so AC_PATH_PROGS will keep looking.
1026 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1031 if test -n "[$]$1"; then
1032 AC_MSG_RESULT([$]$1)
1039 # Check whether LC_MESSAGES is available in <locale.h>.
1040 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1042 # This file can be copied and used freely without restrictions. It can
1043 # be used in projects which are not available under the GNU Public License
1044 # but which still want to provide support for the GNU gettext functionality.
1045 # Please note that the actual code is *not* freely available.
1049 AC_DEFUN(AM_LC_MESSAGES,
1050 [if test $ac_cv_header_locale_h = yes; then
1051 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1052 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1053 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1054 if test $am_cv_val_LC_MESSAGES = yes; then
1055 AC_DEFINE(HAVE_LC_MESSAGES)
1059 # Configure paths for GLIB
1060 # Owen Taylor 97-11-3
1062 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1063 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
1064 dnl gthread is specified in MODULES, pass to glib-config
1066 AC_DEFUN(AM_PATH_GLIB,
1068 dnl Get the cflags and libraries from the glib-config script
1070 AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
1071 glib_config_prefix="$withval", glib_config_prefix="")
1072 AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
1073 glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
1074 AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
1075 , enable_glibtest=yes)
1077 if test x$glib_config_exec_prefix != x ; then
1078 glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
1079 if test x${GLIB_CONFIG+set} != xset ; then
1080 GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
1083 if test x$glib_config_prefix != x ; then
1084 glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
1085 if test x${GLIB_CONFIG+set} != xset ; then
1086 GLIB_CONFIG=$glib_config_prefix/bin/glib-config
1094 glib_config_args="$glib_config_args gmodule"
1097 glib_config_args="$glib_config_args gthread"
1102 AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
1103 min_glib_version=ifelse([$1], ,0.99.7,$1)
1104 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
1106 if test "$GLIB_CONFIG" = "no" ; then
1109 GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
1110 GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
1111 glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
1112 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1113 glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
1114 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1115 glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
1116 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1117 if test "x$enable_glibtest" = "xyes" ; then
1118 ac_save_CFLAGS="$CFLAGS"
1119 ac_save_LIBS="$LIBS"
1120 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1121 LIBS="$GLIB_LIBS $LIBS"
1123 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
1124 dnl checks the results of glib-config to some extent
1135 int major, minor, micro;
1138 system ("touch conf.glibtest");
1140 /* HP/UX 9 (%@#!) writes to sscanf strings */
1141 tmp_version = g_strdup("$min_glib_version");
1142 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1143 printf("%s, bad version string\n", "$min_glib_version");
1147 if ((glib_major_version != $glib_config_major_version) ||
1148 (glib_minor_version != $glib_config_minor_version) ||
1149 (glib_micro_version != $glib_config_micro_version))
1151 printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
1152 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
1153 glib_major_version, glib_minor_version, glib_micro_version);
1154 printf ("*** was found! If glib-config was correct, then it is best\n");
1155 printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
1156 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1157 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1158 printf("*** required on your system.\n");
1159 printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
1160 printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
1161 printf("*** before re-running configure\n");
1163 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
1164 (glib_minor_version != GLIB_MINOR_VERSION) ||
1165 (glib_micro_version != GLIB_MICRO_VERSION))
1167 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
1168 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
1169 printf("*** library (version %d.%d.%d)\n",
1170 glib_major_version, glib_minor_version, glib_micro_version);
1174 if ((glib_major_version > major) ||
1175 ((glib_major_version == major) && (glib_minor_version > minor)) ||
1176 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
1182 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
1183 glib_major_version, glib_minor_version, glib_micro_version);
1184 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
1185 major, minor, micro);
1186 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
1188 printf("*** If you have already installed a sufficiently new version, this error\n");
1189 printf("*** probably means that the wrong copy of the glib-config shell script is\n");
1190 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1191 printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
1192 printf("*** correct copy of glib-config. (In this case, you will have to\n");
1193 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1194 printf("*** so that the correct libraries are found at run-time))\n");
1199 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1200 CFLAGS="$ac_save_CFLAGS"
1201 LIBS="$ac_save_LIBS"
1204 if test "x$no_glib" = x ; then
1206 ifelse([$2], , :, [$2])
1209 if test "$GLIB_CONFIG" = "no" ; then
1210 echo "*** The glib-config script installed by GLIB could not be found"
1211 echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
1212 echo "*** your path, or set the GLIB_CONFIG environment variable to the"
1213 echo "*** full path to glib-config."
1215 if test -f conf.glibtest ; then
1218 echo "*** Could not run GLIB test program, checking why..."
1219 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1220 LIBS="$LIBS $GLIB_LIBS"
1224 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
1225 [ echo "*** The test program compiled, but did not run. This usually means"
1226 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
1227 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
1228 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1229 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1230 echo "*** is required on your system"
1232 echo "*** If you have an old version installed, it is best to remove it, although"
1233 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1235 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
1236 echo "*** came with the system with the command"
1238 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
1239 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1240 echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
1241 echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
1242 echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
1243 CFLAGS="$ac_save_CFLAGS"
1244 LIBS="$ac_save_LIBS"
1249 ifelse([$3], , :, [$3])
1251 AC_SUBST(GLIB_CFLAGS)
1256 # Configure paths for GTK+
1257 # Owen Taylor 97-11-3
1259 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1260 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
1262 AC_DEFUN(AM_PATH_GTK,
1264 dnl Get the cflags and libraries from the gtk-config script
1266 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
1267 gtk_config_prefix="$withval", gtk_config_prefix="")
1268 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
1269 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
1270 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
1271 , enable_gtktest=yes)
1277 gtk_config_args="$gtk_config_args gthread"
1282 if test x$gtk_config_exec_prefix != x ; then
1283 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
1284 if test x${GTK_CONFIG+set} != xset ; then
1285 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
1288 if test x$gtk_config_prefix != x ; then
1289 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
1290 if test x${GTK_CONFIG+set} != xset ; then
1291 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
1295 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
1296 min_gtk_version=ifelse([$1], ,0.99.7,$1)
1297 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
1299 if test "$GTK_CONFIG" = "no" ; then
1302 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
1303 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
1304 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
1305 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1306 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
1307 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1308 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
1309 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1310 if test "x$enable_gtktest" = "xyes" ; then
1311 ac_save_CFLAGS="$CFLAGS"
1312 ac_save_LIBS="$LIBS"
1313 CFLAGS="$CFLAGS $GTK_CFLAGS"
1314 LIBS="$GTK_LIBS $LIBS"
1316 dnl Now check if the installed GTK is sufficiently new. (Also sanity
1317 dnl checks the results of gtk-config to some extent
1321 #include <gtk/gtk.h>
1328 int major, minor, micro;
1331 system ("touch conf.gtktest");
1333 /* HP/UX 9 (%@#!) writes to sscanf strings */
1334 tmp_version = g_strdup("$min_gtk_version");
1335 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1336 printf("%s, bad version string\n", "$min_gtk_version");
1340 if ((gtk_major_version != $gtk_config_major_version) ||
1341 (gtk_minor_version != $gtk_config_minor_version) ||
1342 (gtk_micro_version != $gtk_config_micro_version))
1344 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
1345 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
1346 gtk_major_version, gtk_minor_version, gtk_micro_version);
1347 printf ("*** was found! If gtk-config was correct, then it is best\n");
1348 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
1349 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1350 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1351 printf("*** required on your system.\n");
1352 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
1353 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
1354 printf("*** before re-running configure\n");
1356 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
1357 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
1358 (gtk_minor_version != GTK_MINOR_VERSION) ||
1359 (gtk_micro_version != GTK_MICRO_VERSION))
1361 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
1362 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
1363 printf("*** library (version %d.%d.%d)\n",
1364 gtk_major_version, gtk_minor_version, gtk_micro_version);
1366 #endif /* defined (GTK_MAJOR_VERSION) ... */
1369 if ((gtk_major_version > major) ||
1370 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
1371 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
1377 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
1378 gtk_major_version, gtk_minor_version, gtk_micro_version);
1379 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
1380 major, minor, micro);
1381 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
1383 printf("*** If you have already installed a sufficiently new version, this error\n");
1384 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
1385 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1386 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
1387 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
1388 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1389 printf("*** so that the correct libraries are found at run-time))\n");
1394 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1395 CFLAGS="$ac_save_CFLAGS"
1396 LIBS="$ac_save_LIBS"
1399 if test "x$no_gtk" = x ; then
1401 ifelse([$2], , :, [$2])
1404 if test "$GTK_CONFIG" = "no" ; then
1405 echo "*** The gtk-config script installed by GTK could not be found"
1406 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
1407 echo "*** your path, or set the GTK_CONFIG environment variable to the"
1408 echo "*** full path to gtk-config."
1410 if test -f conf.gtktest ; then
1413 echo "*** Could not run GTK test program, checking why..."
1414 CFLAGS="$CFLAGS $GTK_CFLAGS"
1415 LIBS="$LIBS $GTK_LIBS"
1417 #include <gtk/gtk.h>
1419 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
1420 [ echo "*** The test program compiled, but did not run. This usually means"
1421 echo "*** that the run-time linker is not finding GTK or finding the wrong"
1422 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
1423 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1424 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1425 echo "*** is required on your system"
1427 echo "*** If you have an old version installed, it is best to remove it, although"
1428 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1430 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
1431 echo "*** came with the system with the command"
1433 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
1434 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1435 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
1436 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
1437 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
1438 CFLAGS="$ac_save_CFLAGS"
1439 LIBS="$ac_save_LIBS"
1444 ifelse([$3], , :, [$3])
1446 AC_SUBST(GTK_CFLAGS)
1451 # Configure paths for gdk-pixbuf
1452 # Elliot Lee 2000-01-10
1453 # stolen from Raph Levien 98-11-18
1454 # stolen from Manish Singh 98-9-30
1455 # stolen back from Frank Belew
1456 # stolen from Manish Singh
1457 # Shamelessly stolen from Owen Taylor
1459 dnl AM_PATH_GDK_PIXBUF([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1460 dnl Test for GDK_PIXBUF, and define GDK_PIXBUF_CFLAGS and GDK_PIXBUF_LIBS
1462 AC_DEFUN(AM_PATH_GDK_PIXBUF,
1464 dnl Get the cflags and libraries from the gdk-pixbuf-config script
1466 AC_ARG_WITH(gdk-pixbuf-prefix,[ --with-gdk-pixbuf-prefix=PFX Prefix where GDK_PIXBUF is installed (optional)],
1467 gdk_pixbuf_prefix="$withval", gdk_pixbuf_prefix="")
1468 AC_ARG_WITH(gdk-pixbuf-exec-prefix,[ --with-gdk-pixbuf-exec-prefix=PFX Exec prefix where GDK_PIXBUF is installed (optional)],
1469 gdk_pixbuf_exec_prefix="$withval", gdk_pixbuf_exec_prefix="")
1470 AC_ARG_ENABLE(gdk_pixbuftest, [ --disable-gdk_pixbuftest Do not try to compile and run a test GDK_PIXBUF program],
1471 , enable_gdk_pixbuftest=yes)
1473 if test x$gdk_pixbuf_exec_prefix != x ; then
1474 gdk_pixbuf_args="$gdk_pixbuf_args --exec-prefix=$gdk_pixbuf_exec_prefix"
1475 if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
1476 GDK_PIXBUF_CONFIG=$gdk_pixbuf_exec_prefix/gdk-pixbuf-config
1479 if test x$gdk_pixbuf_prefix != x ; then
1480 gdk_pixbuf_args="$gdk_pixbuf_args --prefix=$gdk_pixbuf_prefix"
1481 if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
1482 GDK_PIXBUF_CONFIG=$gdk_pixbuf_prefix/bin/gdk-pixbuf-config
1486 AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no)
1487 min_gdk_pixbuf_version=ifelse([$1], ,0.2.5,$1)
1488 AC_MSG_CHECKING(for GDK_PIXBUF - version >= $min_gdk_pixbuf_version)
1490 if test "$GDK_PIXBUF_CONFIG" = "no" ; then
1493 GDK_PIXBUF_CFLAGS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --cflags`
1494 GDK_PIXBUF_LIBS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --libs`
1496 gdk_pixbuf_major_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
1497 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1498 gdk_pixbuf_minor_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
1499 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1500 gdk_pixbuf_micro_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_config_args --version | \
1501 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1502 if test "x$enable_gdk_pixbuftest" = "xyes" ; then
1503 ac_save_CFLAGS="$CFLAGS"
1504 ac_save_LIBS="$LIBS"
1505 CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
1506 LIBS="$LIBS $GDK_PIXBUF_LIBS"
1508 dnl Now check if the installed GDK_PIXBUF is sufficiently new. (Also sanity
1509 dnl checks the results of gdk-pixbuf-config to some extent
1511 rm -f conf.gdk_pixbuftest
1516 #include <gdk-pixbuf/gdk-pixbuf.h>
1519 my_strdup (char *str)
1525 new_str = malloc ((strlen (str) + 1) * sizeof(char));
1526 strcpy (new_str, str);
1536 int major, minor, micro;
1539 system ("touch conf.gdk_pixbuftest");
1541 /* HP/UX 9 (%@#!) writes to sscanf strings */
1542 tmp_version = my_strdup("$min_gdk_pixbuf_version");
1543 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1544 printf("%s, bad version string\n", "$min_gdk_pixbuf_version");
1548 if (($gdk_pixbuf_major_version > major) ||
1549 (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version > minor)) ||
1550 (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version == minor) && ($gdk_pixbuf_micro_version >= micro)))
1556 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);
1557 printf("*** of GDK_PIXBUF required is %d.%d.%d. If gdk-pixbuf-config is correct, then it is\n", major, minor, micro);
1558 printf("*** best to upgrade to the required version.\n");
1559 printf("*** If gdk-pixbuf-config was wrong, set the environment variable GDK_PIXBUF_CONFIG\n");
1560 printf("*** to point to the correct copy of gdk-pixbuf-config, and remove the file\n");
1561 printf("*** config.cache before re-running configure\n");
1566 ],, no_gdk_pixbuf=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1567 CFLAGS="$ac_save_CFLAGS"
1568 LIBS="$ac_save_LIBS"
1571 if test "x$no_gdk_pixbuf" = x ; then
1573 ifelse([$2], , :, [$2])
1576 if test "$GDK_PIXBUF_CONFIG" = "no" ; then
1577 echo "*** The gdk-pixbuf-config script installed by GDK_PIXBUF could not be found"
1578 echo "*** If GDK_PIXBUF was installed in PREFIX, make sure PREFIX/bin is in"
1579 echo "*** your path, or set the GDK_PIXBUF_CONFIG environment variable to the"
1580 echo "*** full path to gdk-pixbuf-config."
1582 if test -f conf.gdk_pixbuftest ; then
1585 echo "*** Could not run GDK_PIXBUF test program, checking why..."
1586 CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
1587 LIBS="$LIBS $GDK_PIXBUF_LIBS"
1590 #include <gdk-pixbuf/gdk-pixbuf.h>
1592 [ echo "*** The test program compiled, but did not run. This usually means"
1593 echo "*** that the run-time linker is not finding GDK_PIXBUF or finding the wrong"
1594 echo "*** version of GDK_PIXBUF. If it is not finding GDK_PIXBUF, you'll need to set your"
1595 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1596 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1597 echo "*** is required on your system"
1599 echo "*** If you have an old version installed, it is best to remove it, although"
1600 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
1601 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1602 echo "*** exact error that occured. This usually means GDK_PIXBUF was incorrectly installed"
1603 echo "*** or that you have moved GDK_PIXBUF since it was installed. In the latter case, you"
1604 echo "*** may want to edit the gdk-pixbuf-config script: $GDK_PIXBUF_CONFIG" ])
1605 CFLAGS="$ac_save_CFLAGS"
1606 LIBS="$ac_save_LIBS"
1609 GDK_PIXBUF_CFLAGS=""
1611 ifelse([$3], , :, [$3])
1613 AC_SUBST(GDK_PIXBUF_CFLAGS)
1614 AC_SUBST(GDK_PIXBUF_LIBS)
1615 rm -f conf.gdk_pixbuftest
1618 # Configure paths for IMLIB
1619 # Frank Belew 98-8-31
1620 # stolen from Manish Singh
1621 # Shamelessly stolen from Owen Taylor
1623 dnl AM_PATH_IMLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1624 dnl Test for IMLIB, and define IMLIB_CFLAGS and IMLIB_LIBS
1626 AC_DEFUN(AM_PATH_IMLIB,
1628 dnl Get the cflags and libraries from the imlib-config script
1630 AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX Prefix where IMLIB is installed (optional)],
1631 imlib_prefix="$withval", imlib_prefix="")
1632 AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)],
1633 imlib_exec_prefix="$withval", imlib_exec_prefix="")
1634 AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest Do not try to compile and run a test IMLIB program],
1635 , enable_imlibtest=yes)
1637 if test x$imlib_exec_prefix != x ; then
1638 imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
1639 if test x${IMLIB_CONFIG+set} != xset ; then
1640 IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config
1643 if test x$imlib_prefix != x ; then
1644 imlib_args="$imlib_args --prefix=$imlib_prefix"
1645 if test x${IMLIB_CONFIG+set} != xset ; then
1646 IMLIB_CONFIG=$imlib_prefix/bin/imlib-config
1650 AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
1651 min_imlib_version=ifelse([$1], ,1.8.2,$1)
1652 AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
1654 if test "$IMLIB_CONFIG" = "no" ; then
1657 IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags`
1658 IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs`
1660 imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \
1661 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1662 imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \
1663 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1664 imlib_micro_version=`$IMLIB_CONFIG $imlib_args --version | \
1665 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1666 if test "x$enable_imlibtest" = "xyes" ; then
1667 ac_save_CFLAGS="$CFLAGS"
1668 ac_save_LIBS="$LIBS"
1669 CFLAGS="$CFLAGS $IMLIB_CFLAGS"
1670 LIBS="$LIBS $IMLIB_LIBS"
1672 dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
1673 dnl checks the results of imlib-config to some extent
1675 rm -f conf.imlibtest
1683 my_strdup (char *str)
1689 new_str = malloc ((strlen (str) + 1) * sizeof(char));
1690 strcpy (new_str, str);
1700 int major, minor, micro;
1703 system ("touch conf.imlibtest");
1705 /* HP/UX 9 (%@#!) writes to sscanf strings */
1706 tmp_version = my_strdup("$min_imlib_version");
1707 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1708 printf("%s, bad version string\n", "$min_imlib_version");
1712 if (($imlib_major_version > major) ||
1713 (($imlib_major_version == major) && ($imlib_minor_version > minor)) ||
1714 (($imlib_major_version == major) && ($imlib_minor_version == minor) &&
1715 ($imlib_micro_version >= micro)))
1721 printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
1722 printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
1723 printf("*** best to upgrade to the required version.\n");
1724 printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n");
1725 printf("*** to point to the correct copy of imlib-config, and remove the file\n");
1726 printf("*** config.cache before re-running configure\n");
1731 ],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1732 CFLAGS="$ac_save_CFLAGS"
1733 LIBS="$ac_save_LIBS"
1736 if test "x$no_imlib" = x ; then
1738 ifelse([$2], , :, [$2])
1741 if test "$IMLIB_CONFIG" = "no" ; then
1742 echo "*** The imlib-config script installed by IMLIB could not be found"
1743 echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
1744 echo "*** your path, or set the IMLIB_CONFIG environment variable to the"
1745 echo "*** full path to imlib-config."
1747 if test -f conf.imlibtest ; then
1750 echo "*** Could not run IMLIB test program, checking why..."
1751 CFLAGS="$CFLAGS $IMLIB_CFLAGS"
1752 LIBS="$LIBS $IMLIB_LIBS"
1757 [ echo "*** The test program compiled, but did not run. This usually means"
1758 echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
1759 echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
1760 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1761 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1762 echo "*** is required on your system"
1764 echo "*** If you have an old version installed, it is best to remove it, although"
1765 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
1766 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1767 echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
1768 echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
1769 echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ])
1770 CFLAGS="$ac_save_CFLAGS"
1771 LIBS="$ac_save_LIBS"
1776 ifelse([$3], , :, [$3])
1778 AC_SUBST(IMLIB_CFLAGS)
1779 AC_SUBST(IMLIB_LIBS)
1780 rm -f conf.imlibtest
1783 # Check for gdk-imlib
1784 AC_DEFUN(AM_PATH_GDK_IMLIB,
1786 dnl Get the cflags and libraries from the imlib-config script
1788 AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX Prefix where IMLIB is installed (optional)],
1789 imlib_prefix="$withval", imlib_prefix="")
1790 AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)],
1791 imlib_exec_prefix="$withval", imlib_exec_prefix="")
1792 AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest Do not try to compile and run a test IMLIB program],
1793 , enable_imlibtest=yes)
1795 if test x$imlib_exec_prefix != x ; then
1796 imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
1797 if test x${IMLIB_CONFIG+set} != xset ; then
1798 IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config
1801 if test x$imlib_prefix != x ; then
1802 imlib_args="$imlib_args --prefix=$imlib_prefix"
1803 if test x${IMLIB_CONFIG+set} != xset ; then
1804 IMLIB_CONFIG=$imlib_prefix/bin/imlib-config
1808 AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
1809 min_imlib_version=ifelse([$1], ,1.8.2,$1)
1810 AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
1812 if test "$IMLIB_CONFIG" = "no" ; then
1815 GDK_IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags-gdk`
1816 GDK_IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs-gdk`
1818 imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \
1819 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1820 imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \
1821 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1822 if test "x$enable_imlibtest" = "xyes" ; then
1823 ac_save_CFLAGS="$CFLAGS"
1824 ac_save_LIBS="$LIBS"
1825 CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
1826 LIBS="$LIBS $GDK_IMLIB_LIBS"
1828 dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
1829 dnl checks the results of imlib-config to some extent
1831 rm -f conf.imlibtest
1835 #include <gdk_imlib.h>
1842 system ("touch conf.gdkimlibtest");
1844 /* HP/UX 9 (%@#!) writes to sscanf strings */
1845 tmp_version = g_strdup("$min_imlib_version");
1846 if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) {
1847 printf("%s, bad version string\n", "$min_imlib_version");
1851 if (($imlib_major_version > major) ||
1852 (($imlib_major_version == major) && ($imlib_minor_version >= minor)))
1858 printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
1859 printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
1860 printf("*** best to upgrade to the required version.\n");
1861 printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n");
1862 printf("*** to point to the correct copy of imlib-config, and remove the file\n");
1863 printf("*** config.cache before re-running configure\n");
1868 ],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1869 CFLAGS="$ac_save_CFLAGS"
1870 LIBS="$ac_save_LIBS"
1873 if test "x$no_imlib" = x ; then
1875 ifelse([$2], , :, [$2])
1878 if test "$IMLIB_CONFIG" = "no" ; then
1879 echo "*** The imlib-config script installed by IMLIB could not be found"
1880 echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
1881 echo "*** your path, or set the IMLIB_CONFIG environment variable to the"
1882 echo "*** full path to imlib-config."
1884 if test -f conf.gdkimlibtest ; then
1887 echo "*** Could not run IMLIB test program, checking why..."
1888 CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
1889 LIBS="$LIBS $GDK_IMLIB_LIBS"
1892 #include <gdk_imlib.h>
1894 [ echo "*** The test program compiled, but did not run. This usually means"
1895 echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
1896 echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
1897 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1898 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1899 echo "*** is required on your system"
1901 echo "*** If you have an old version installed, it is best to remove it, although"
1902 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
1903 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1904 echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
1905 echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
1906 echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ])
1907 CFLAGS="$ac_save_CFLAGS"
1908 LIBS="$ac_save_LIBS"
1913 ifelse([$3], , :, [$3])
1915 AC_SUBST(GDK_IMLIB_CFLAGS)
1916 AC_SUBST(GDK_IMLIB_LIBS)
1917 rm -f conf.gdkimlibtest
1920 dnl Autoconf macros for libgpgme
1923 # Configure paths for GPGME
1924 # Shamelessly stolen from the one of XDELTA by Owen Taylor
1925 # Werner Koch 2000-11-17
1927 dnl AM_PATH_GPGME([MINIMUM-VERSION,
1928 dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
1929 dnl Test for gpgme, and define GPGME_CFLAGS and GPGME_LIBS
1931 AC_DEFUN(AM_PATH_GPGME,
1933 dnl Get the cflags and libraries from the gpgme-config script
1935 AC_ARG_WITH(gpgme-prefix,
1936 [ --with-gpgme-prefix=PFX Prefix where gpgme is installed (optional)],
1937 gpgme_config_prefix="$withval", gpgme_config_prefix="")
1938 AC_ARG_ENABLE(gpgmetest,
1939 [ --disable-gpgmetest Do not try to compile and run a test gpgme program],
1940 , enable_gpgmetest=yes)
1942 if test x$gpgme_config_prefix != x ; then
1943 gpgme_config_args="$gpgme_config_args --prefix=$gpgme_config_prefix"
1944 if test x${GPGME_CONFIG+set} != xset ; then
1945 GPGME_CONFIG=$gpgme_config_prefix/bin/gpgme-config
1949 AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no)
1950 min_gpgme_version=ifelse([$1], ,1.0.0,$1)
1951 AC_MSG_CHECKING(for gpgme - version >= $min_gpgme_version)
1953 if test "$GPGME_CONFIG" = "no" ; then
1956 GPGME_CFLAGS=`$GPGME_CONFIG $gpgme_config_args --cflags`
1957 GPGME_LIBS=`$GPGME_CONFIG $gpgme_config_args --libs`
1958 gpgme_config_version=`$GPGME_CONFIG $gpgme_config_args --version`
1959 if test "x$enable_gpgmetest" = "xyes" ; then
1960 ac_save_CFLAGS="$CFLAGS"
1961 ac_save_LIBS="$LIBS"
1962 CFLAGS="$CFLAGS $GPGME_CFLAGS"
1963 LIBS="$LIBS $GPGME_LIBS"
1965 dnl Now check if the installed gpgme is sufficiently new. Also sanity
1966 dnl checks the results of gpgme-config to some extent
1968 rm -f conf.gpgmetest
1978 system ("touch conf.gpgmetest");
1980 if( strcmp( gpgme_check_version(NULL), "$gpgme_config_version" ) )
1983 "*** 'gpgme-config --version' returned %s, but GPGME (%s) was found!\n",
1984 "$gpgme_config_version", gpgme_check_version(NULL) );
1986 "*** If gpgme-config was correct, then it is best to remove the old\n"
1987 "*** version of GPGME. You may also be able to fix the error\n"
1988 "*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"
1989 "*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"
1990 "*** required on your system.\n"
1991 "*** If gpgme-config was wrong, set the environment variable GPGME_CONFIG\n"
1992 "*** to point to the correct copy of gpgme-config, \n"
1993 "*** and remove the file config.cache before re-running configure\n"
1996 else if ( strcmp(gpgme_check_version(NULL), GPGME_VERSION ) )
1998 printf("\n*** GPGME header file (version %s) does not match\n",
2000 printf("*** library (version %s)\n", gpgme_check_version(NULL) );
2004 if ( gpgme_check_version( "$min_gpgme_version" ) )
2007 "*** An old version of GPGME (%s) was found.\n", gpgme_check_version(NULL) );
2009 "*** You need a version of GPGME newer than %s.\n", "$min_gpgme_version" );
2011 "*** The latest version of GPGME is always available at\n"
2012 "*** ftp://ftp.gnupg.org/pub/gcrypt/alpha/gpgme/\n"
2014 "*** If you have already installed a sufficiently new version, this error\n"
2015 "*** probably means that the wrong copy of the gpgme-config shell script is\n"
2016 "*** being found. The easiest way to fix this is to remove the old version\n"
2017 "*** of GPGME, but you can also set the GPGME_CONFIG environment to point to\n"
2018 "*** the correct copy of gpgme-config. (In this case, you will have to\n"
2019 "*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"
2020 "*** so that the correct libraries are found at run-time).\n"
2025 ],, no_gpgme=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
2026 CFLAGS="$ac_save_CFLAGS"
2027 LIBS="$ac_save_LIBS"
2030 if test "x$no_gpgme" = x ; then
2032 ifelse([$2], , :, [$2])
2034 if test -f conf.gpgmetest ; then
2039 if test "$GPGME_CONFIG" = "no" ; then
2040 echo "*** The gpgme-config script installed by GPGME could not be found"
2041 echo "*** If GPGME was installed in PREFIX, make sure PREFIX/bin is in"
2042 echo "*** your path, or set the GPGME_CONFIG environment variable to the"
2043 echo "*** full path to gpgme-config."
2045 if test -f conf.gpgmetest ; then
2048 echo "*** Could not run gpgme test program, checking why..."
2049 CFLAGS="$CFLAGS $GPGME_CFLAGS"
2050 LIBS="$LIBS $GPGME_LIBS"
2056 ], [ gpgme_check_version(NULL); return 0 ],
2058 echo "*** The test program compiled, but did not run. This usually means"
2059 echo "*** that the run-time linker is not finding GPGME or finding the wrong"
2060 echo "*** version of GPGME. If it is not finding GPGME, you'll need to set your"
2061 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
2062 echo "*** to the installed location Also, make sure you have run ldconfig if"
2063 echo "*** that is required on your system"
2065 echo "*** If you have an old version installed, it is best to remove it,"
2066 echo "*** although you may also be able to get things to work by"
2067 echo "*** modifying LD_LIBRARY_PATH"
2071 echo "*** The test program failed to compile or link. See the file config.log"
2072 echo "*** for the exact error that occured. This usually means GPGME was"
2073 echo "*** incorrectly installed or that you have moved GPGME since it was"
2074 echo "*** installed. In the latter case, you may want to edit the"
2075 echo "*** gpgme-config script: $GPGME_CONFIG"
2077 CFLAGS="$ac_save_CFLAGS"
2078 LIBS="$ac_save_LIBS"
2083 ifelse([$3], , :, [$3])
2085 AC_SUBST(GPGME_CFLAGS)
2086 AC_SUBST(GPGME_LIBS)
2087 rm -f conf.gpgmetest