source: trunk/third/gtk/aclocal.m4 @ 14482

Revision 14482, 42.1 KB checked in by ghudson, 25 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14481, which included commits to RCS files with non-trunk default branches.
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13
14# serial 40 AC_PROG_LIBTOOL
15AC_DEFUN(AC_PROG_LIBTOOL,
16[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
17
18# Save cache, so that ltconfig can load it
19AC_CACHE_SAVE
20
21# Actually configure libtool.  ac_aux_dir is where install-sh is found.
22CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
23LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
24LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
25DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
26${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
27$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
28|| AC_MSG_ERROR([libtool configure failed])
29
30# Reload cache, that may have been modified by ltconfig
31AC_CACHE_LOAD
32
33# This can be used to rebuild libtool when needed
34LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
35
36# Always use our own libtool.
37LIBTOOL='$(SHELL) $(top_builddir)/libtool'
38AC_SUBST(LIBTOOL)dnl
39
40# Redirect the config.log output again, so that the ltconfig log is not
41# clobbered by the next message.
42exec 5>>./config.log
43])
44
45AC_DEFUN(AC_LIBTOOL_SETUP,
46[AC_PREREQ(2.13)dnl
47AC_REQUIRE([AC_ENABLE_SHARED])dnl
48AC_REQUIRE([AC_ENABLE_STATIC])dnl
49AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
50AC_REQUIRE([AC_CANONICAL_HOST])dnl
51AC_REQUIRE([AC_CANONICAL_BUILD])dnl
52AC_REQUIRE([AC_PROG_RANLIB])dnl
53AC_REQUIRE([AC_PROG_CC])dnl
54AC_REQUIRE([AC_PROG_LD])dnl
55AC_REQUIRE([AC_PROG_NM])dnl
56AC_REQUIRE([AC_PROG_LN_S])dnl
57dnl
58
59case "$target" in
60NONE) lt_target="$host" ;;
61*) lt_target="$target" ;;
62esac
63
64# Check for any special flags to pass to ltconfig.
65libtool_flags="--cache-file=$cache_file"
66test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
67test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
68test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
69test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
70test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
71ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
72[libtool_flags="$libtool_flags --enable-dlopen"])
73ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
74[libtool_flags="$libtool_flags --enable-win32-dll"])
75AC_ARG_ENABLE(libtool-lock,
76  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
77test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
78test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
79
80# Some flags need to be propagated to the compiler or linker for good
81# libtool support.
82case "$lt_target" in
83*-*-irix6*)
84  # Find out which ABI we are using.
85  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
86  if AC_TRY_EVAL(ac_compile); then
87    case "`/usr/bin/file conftest.o`" in
88    *32-bit*)
89      LD="${LD-ld} -32"
90      ;;
91    *N32*)
92      LD="${LD-ld} -n32"
93      ;;
94    *64-bit*)
95      LD="${LD-ld} -64"
96      ;;
97    esac
98  fi
99  rm -rf conftest*
100  ;;
101
102*-*-sco3.2v5*)
103  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
104  SAVE_CFLAGS="$CFLAGS"
105  CFLAGS="$CFLAGS -belf"
106  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
107    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
108  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
109    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
110    CFLAGS="$SAVE_CFLAGS"
111  fi
112  ;;
113
114ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
115[*-*-cygwin* | *-*-mingw*)
116  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
117  AC_CHECK_TOOL(AS, as, false)
118  AC_CHECK_TOOL(OBJDUMP, objdump, false)
119  ;;
120])
121esac
122])
123
124# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
125AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
126
127# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
128AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
129
130# AC_ENABLE_SHARED - implement the --enable-shared flag
131# Usage: AC_ENABLE_SHARED[(DEFAULT)]
132#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
133#   `yes'.
134AC_DEFUN(AC_ENABLE_SHARED, [dnl
135define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
136AC_ARG_ENABLE(shared,
137changequote(<<, >>)dnl
138<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
139changequote([, ])dnl
140[p=${PACKAGE-default}
141case "$enableval" in
142yes) enable_shared=yes ;;
143no) enable_shared=no ;;
144*)
145  enable_shared=no
146  # Look at the argument we got.  We use all the common list separators.
147  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
148  for pkg in $enableval; do
149    if test "X$pkg" = "X$p"; then
150      enable_shared=yes
151    fi
152  done
153  IFS="$ac_save_ifs"
154  ;;
155esac],
156enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
157])
158
159# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
160AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
161AC_ENABLE_SHARED(no)])
162
163# AC_ENABLE_STATIC - implement the --enable-static flag
164# Usage: AC_ENABLE_STATIC[(DEFAULT)]
165#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
166#   `yes'.
167AC_DEFUN(AC_ENABLE_STATIC, [dnl
168define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
169AC_ARG_ENABLE(static,
170changequote(<<, >>)dnl
171<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
172changequote([, ])dnl
173[p=${PACKAGE-default}
174case "$enableval" in
175yes) enable_static=yes ;;
176no) enable_static=no ;;
177*)
178  enable_static=no
179  # Look at the argument we got.  We use all the common list separators.
180  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
181  for pkg in $enableval; do
182    if test "X$pkg" = "X$p"; then
183      enable_static=yes
184    fi
185  done
186  IFS="$ac_save_ifs"
187  ;;
188esac],
189enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
190])
191
192# AC_DISABLE_STATIC - set the default static flag to --disable-static
193AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
194AC_ENABLE_STATIC(no)])
195
196
197# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
198# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
199#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
200#   `yes'.
201AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
202define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
203AC_ARG_ENABLE(fast-install,
204changequote(<<, >>)dnl
205<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
206changequote([, ])dnl
207[p=${PACKAGE-default}
208case "$enableval" in
209yes) enable_fast_install=yes ;;
210no) enable_fast_install=no ;;
211*)
212  enable_fast_install=no
213  # Look at the argument we got.  We use all the common list separators.
214  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
215  for pkg in $enableval; do
216    if test "X$pkg" = "X$p"; then
217      enable_fast_install=yes
218    fi
219  done
220  IFS="$ac_save_ifs"
221  ;;
222esac],
223enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
224])
225
226# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
227AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
228AC_ENABLE_FAST_INSTALL(no)])
229
230# AC_PROG_LD - find the path to the GNU or non-GNU linker
231AC_DEFUN(AC_PROG_LD,
232[AC_ARG_WITH(gnu-ld,
233[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
234test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
235AC_REQUIRE([AC_PROG_CC])dnl
236AC_REQUIRE([AC_CANONICAL_HOST])dnl
237AC_REQUIRE([AC_CANONICAL_BUILD])dnl
238ac_prog=ld
239if test "$ac_cv_prog_gcc" = yes; then
240  # Check if gcc -print-prog-name=ld gives a path.
241  AC_MSG_CHECKING([for ld used by GCC])
242  ac_prog=`($CC -print-prog-name=ld) 2>&5`
243  case "$ac_prog" in
244    # Accept absolute paths.
245changequote(,)dnl
246    [\\/]* | [A-Za-z]:[\\/]*)
247      re_direlt='/[^/][^/]*/\.\./'
248changequote([,])dnl
249      # Canonicalize the path of ld
250      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
251      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
252        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
253      done
254      test -z "$LD" && LD="$ac_prog"
255      ;;
256  "")
257    # If it fails, then pretend we aren't using GCC.
258    ac_prog=ld
259    ;;
260  *)
261    # If it is relative, then search for the first ld in PATH.
262    with_gnu_ld=unknown
263    ;;
264  esac
265elif test "$with_gnu_ld" = yes; then
266  AC_MSG_CHECKING([for GNU ld])
267else
268  AC_MSG_CHECKING([for non-GNU ld])
269fi
270AC_CACHE_VAL(ac_cv_path_LD,
271[if test -z "$LD"; then
272  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
273  for ac_dir in $PATH; do
274    test -z "$ac_dir" && ac_dir=.
275    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
276      ac_cv_path_LD="$ac_dir/$ac_prog"
277      # Check to see if the program is GNU ld.  I'd rather use --version,
278      # but apparently some GNU ld's only accept -v.
279      # Break only if it was the GNU/non-GNU ld that we prefer.
280      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
281        test "$with_gnu_ld" != no && break
282      else
283        test "$with_gnu_ld" != yes && break
284      fi
285    fi
286  done
287  IFS="$ac_save_ifs"
288else
289  ac_cv_path_LD="$LD" # Let the user override the test with a path.
290fi])
291LD="$ac_cv_path_LD"
292if test -n "$LD"; then
293  AC_MSG_RESULT($LD)
294else
295  AC_MSG_RESULT(no)
296fi
297test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
298AC_PROG_LD_GNU
299])
300
301AC_DEFUN(AC_PROG_LD_GNU,
302[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
303[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
304if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
305  ac_cv_prog_gnu_ld=yes
306else
307  ac_cv_prog_gnu_ld=no
308fi])
309])
310
311# AC_PROG_NM - find the path to a BSD-compatible name lister
312AC_DEFUN(AC_PROG_NM,
313[AC_MSG_CHECKING([for BSD-compatible nm])
314AC_CACHE_VAL(ac_cv_path_NM,
315[if test -n "$NM"; then
316  # Let the user override the test.
317  ac_cv_path_NM="$NM"
318else
319  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
320  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
321    test -z "$ac_dir" && ac_dir=.
322    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
323      # Check to see if the nm accepts a BSD-compat flag.
324      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
325      #   nm: unknown option "B" ignored
326      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
327        ac_cv_path_NM="$ac_dir/nm -B"
328        break
329      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
330        ac_cv_path_NM="$ac_dir/nm -p"
331        break
332      else
333        ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
334        continue # so that we can try to find one that supports BSD flags
335      fi
336    fi
337  done
338  IFS="$ac_save_ifs"
339  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
340fi])
341NM="$ac_cv_path_NM"
342AC_MSG_RESULT([$NM])
343])
344
345# AC_CHECK_LIBM - check for math library
346AC_DEFUN(AC_CHECK_LIBM,
347[AC_REQUIRE([AC_CANONICAL_HOST])dnl
348LIBM=
349case "$lt_target" in
350*-*-beos* | *-*-cygwin*)
351  # These system don't have libm
352  ;;
353*-ncr-sysv4.3*)
354  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
355  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
356  ;;
357*)
358  AC_CHECK_LIB(m, main, LIBM="-lm")
359  ;;
360esac
361])
362
363# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
364# the libltdl convenience library, adds --enable-ltdl-convenience to
365# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
366# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
367# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
368# '${top_builddir}/' (note the single quotes!) if your package is not
369# flat, and, if you're not using automake, define top_builddir as
370# appropriate in the Makefiles.
371AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
372  case "$enable_ltdl_convenience" in
373  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
374  "") enable_ltdl_convenience=yes
375      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
376  esac
377  LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
378  INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
379])
380
381# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
382# the libltdl installable library, and adds --enable-ltdl-install to
383# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
384# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
385# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
386# '${top_builddir}/' (note the single quotes!) if your package is not
387# flat, and, if you're not using automake, define top_builddir as
388# appropriate in the Makefiles.
389# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
390AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
391  AC_CHECK_LIB(ltdl, main,
392  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
393  [if test x"$enable_ltdl_install" = xno; then
394     AC_MSG_WARN([libltdl not installed, but installation disabled])
395   else
396     enable_ltdl_install=yes
397   fi
398  ])
399  if test x"$enable_ltdl_install" = x"yes"; then
400    ac_configure_args="$ac_configure_args --enable-ltdl-install"
401    LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
402    INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
403  else
404    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
405    LIBLTDL="-lltdl"
406    INCLTDL=
407  fi
408])
409
410dnl old names
411AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
412AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
413AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
414AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
415AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
416AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
417AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
418
419dnl This is just to silence aclocal about the macro not being used
420ifelse([AC_DISABLE_FAST_INSTALL])dnl
421
422# Macro to add for using GNU gettext.
423# Ulrich Drepper <drepper@cygnus.com>, 1995.
424#
425# Modified to never use included libintl.
426# Owen Taylor <otaylor@redhat.com>, 12/15/1998
427#
428#
429# This file can be copied and used freely without restrictions.  It can
430# be used in projects which are not available under the GNU Public License
431# but which still want to provide support for the GNU gettext functionality.
432# Please note that the actual code is *not* freely available.
433
434# serial 5
435
436AC_DEFUN(AM_GTK_WITH_NLS,
437  [AC_MSG_CHECKING([whether NLS is requested])
438    dnl Default is enabled NLS
439    AC_ARG_ENABLE(nls,
440      [  --disable-nls           do not use Native Language Support],
441      USE_NLS=$enableval, USE_NLS=yes)
442    AC_MSG_RESULT($USE_NLS)
443    AC_SUBST(USE_NLS)
444
445    USE_INCLUDED_LIBINTL=no
446
447    dnl If we use NLS figure out what method
448    if test "$USE_NLS" = "yes"; then
449#      AC_DEFINE(ENABLE_NLS)
450#      AC_MSG_CHECKING([whether included gettext is requested])
451#      AC_ARG_WITH(included-gettext,
452#        [  --with-included-gettext use the GNU gettext library included here],
453#        nls_cv_force_use_gnu_gettext=$withval,
454#        nls_cv_force_use_gnu_gettext=no)
455#      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
456      nls_cv_force_use_gnu_gettext="no"
457
458      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
459      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
460        dnl User does not insist on using GNU NLS library.  Figure out what
461        dnl to use.  If gettext or catgets are available (in this order) we
462        dnl use this.  Else we have to fall back to GNU NLS library.
463        dnl catgets is only used if permitted by option --with-catgets.
464        nls_cv_header_intl=
465        nls_cv_header_libgt=
466        CATOBJEXT=NONE
467
468        AC_CHECK_HEADER(libintl.h,
469          [AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
470            [AC_TRY_LINK([#include <libintl.h>], [return (int) dgettext ("","")],
471               gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no)])
472
473           if test "$gt_cv_func_dgettext_libc" != "yes"; then
474             AC_CHECK_LIB(intl, bindtextdomain,
475               [AC_CACHE_CHECK([for dgettext in libintl],
476                 gt_cv_func_dgettext_libintl,
477                 [AC_CHECK_LIB(intl, dgettext,
478                  gt_cv_func_dgettext_libintl=yes,
479                  gt_cv_func_dgettext_libintl=no)],
480                 gt_cv_func_dgettext_libintl=no)])
481           fi
482
483           if test "$gt_cv_func_dgettext_libintl" = "yes"; then
484             LIBS="$LIBS -lintl";
485           fi
486
487           if test "$gt_cv_func_dgettext_libc" = "yes" \
488              || test "$gt_cv_func_dgettext_libintl" = "yes"; then
489              AC_DEFINE(HAVE_GETTEXT)
490              AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
491                [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
492              if test "$MSGFMT" != "no"; then
493                AC_CHECK_FUNCS(dcgettext)
494                AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
495                AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
496                  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
497                AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
498                               return _nl_msg_cat_cntr],
499                  [CATOBJEXT=.gmo
500                   DATADIRNAME=share],
501                  [CATOBJEXT=.mo
502                   DATADIRNAME=lib])
503                INSTOBJEXT=.mo
504              fi
505            fi
506
507            # Added by Martin Baulig 12/15/98 for libc5 systems
508            if test "$gt_cv_func_dgettext_libc" != "yes" \
509               && test "$gt_cv_func_dgettext_libintl" = "yes"; then
510               INTLLIBS=-lintl
511               LIBS=`echo $LIBS | sed -e 's/-lintl//'`
512            fi
513        ])
514
515        if test "$CATOBJEXT" = "NONE"; then
516          AC_MSG_CHECKING([whether catgets can be used])
517          AC_ARG_WITH(catgets,
518            [  --with-catgets          use catgets functions if available],
519            nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
520          AC_MSG_RESULT($nls_cv_use_catgets)
521
522          if test "$nls_cv_use_catgets" = "yes"; then
523            dnl No gettext in C library.  Try catgets next.
524            AC_CHECK_LIB(i, main)
525            AC_CHECK_FUNC(catgets,
526              [AC_DEFINE(HAVE_CATGETS)
527               INTLOBJS="\$(CATOBJS)"
528               AC_PATH_PROG(GENCAT, gencat, no)dnl
529#              if test "$GENCAT" != "no"; then
530#                AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
531#                if test "$GMSGFMT" = "no"; then
532#                  AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
533#                   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
534#                fi
535#                AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
536#                  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
537#                USE_INCLUDED_LIBINTL=yes
538#                CATOBJEXT=.cat
539#                INSTOBJEXT=.cat
540#                DATADIRNAME=lib
541#                INTLDEPS='$(top_builddir)/intl/libintl.a'
542#                INTLLIBS=$INTLDEPS
543#                LIBS=`echo $LIBS | sed -e 's/-lintl//'`
544#                nls_cv_header_intl=intl/libintl.h
545#                nls_cv_header_libgt=intl/libgettext.h
546#              fi
547            ])
548          fi
549        fi
550
551        if test "$CATOBJEXT" = "NONE"; then
552          dnl Neither gettext nor catgets in included in the C library.
553          dnl Fall back on GNU gettext library.
554          nls_cv_use_gnu_gettext=yes
555        fi
556      fi
557
558      if test "$nls_cv_use_gnu_gettext" != "yes"; then
559        AC_DEFINE(ENABLE_NLS)
560      else
561         # Unset this variable since we use the non-zero value as a flag.
562         CATOBJEXT=
563#        dnl Mark actions used to generate GNU NLS library.
564#        INTLOBJS="\$(GETTOBJS)"
565#        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
566#         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
567#        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
568#        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
569#         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
570#        AC_SUBST(MSGFMT)
571#       USE_INCLUDED_LIBINTL=yes
572#        CATOBJEXT=.gmo
573#        INSTOBJEXT=.mo
574#        DATADIRNAME=share
575#       INTLDEPS='$(top_builddir)/intl/libintl.a'
576#       INTLLIBS=$INTLDEPS
577#       LIBS=`echo $LIBS | sed -e 's/-lintl//'`
578#        nls_cv_header_intl=intl/libintl.h
579#        nls_cv_header_libgt=intl/libgettext.h
580      fi
581
582      dnl Test whether we really found GNU xgettext.
583      if test "$XGETTEXT" != ":"; then
584        dnl If it is no GNU xgettext we define it as : so that the
585        dnl Makefiles still can work.
586        if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
587          : ;
588        else
589          AC_MSG_RESULT(
590            [found xgettext program is not GNU xgettext; ignore it])
591          XGETTEXT=":"
592        fi
593      fi
594
595      # We need to process the po/ directory.
596      POSUB=po
597    else
598      DATADIRNAME=share
599      nls_cv_header_intl=intl/libintl.h
600      nls_cv_header_libgt=intl/libgettext.h
601    fi
602    AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
603    AC_OUTPUT_COMMANDS(
604     [case "$CONFIG_FILES" in *po/Makefile.in*)
605        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
606      esac])
607
608
609#    # If this is used in GNU gettext we have to set USE_NLS to `yes'
610#    # because some of the sources are only built for this goal.
611#    if test "$PACKAGE" = gettext; then
612#      USE_NLS=yes
613#      USE_INCLUDED_LIBINTL=yes
614#    fi
615
616    dnl These rules are solely for the distribution goal.  While doing this
617    dnl we only have to keep exactly one list of the available catalogs
618    dnl in configure.in.
619    for lang in $ALL_LINGUAS; do
620      GMOFILES="$GMOFILES $lang.gmo"
621      POFILES="$POFILES $lang.po"
622    done
623
624    dnl Make all variables we use known to autoconf.
625    AC_SUBST(USE_INCLUDED_LIBINTL)
626    AC_SUBST(CATALOGS)
627    AC_SUBST(CATOBJEXT)
628    AC_SUBST(DATADIRNAME)
629    AC_SUBST(GMOFILES)
630    AC_SUBST(INSTOBJEXT)
631    AC_SUBST(INTLDEPS)
632    AC_SUBST(INTLLIBS)
633    AC_SUBST(INTLOBJS)
634    AC_SUBST(POFILES)
635    AC_SUBST(POSUB)
636  ])
637
638AC_DEFUN(AM_GTK_GNU_GETTEXT,
639  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
640   AC_REQUIRE([AC_PROG_CC])dnl
641   AC_REQUIRE([AC_PROG_RANLIB])dnl
642   AC_REQUIRE([AC_ISC_POSIX])dnl
643   AC_REQUIRE([AC_HEADER_STDC])dnl
644   AC_REQUIRE([AC_C_CONST])dnl
645   AC_REQUIRE([AC_C_INLINE])dnl
646   AC_REQUIRE([AC_TYPE_OFF_T])dnl
647   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
648   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
649   AC_REQUIRE([AC_FUNC_MMAP])dnl
650
651   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
652unistd.h sys/param.h])
653   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
654strdup __argz_count __argz_stringify __argz_next])
655
656   if test "${ac_cv_func_stpcpy+set}" != "set"; then
657     AC_CHECK_FUNCS(stpcpy)
658   fi
659   if test "${ac_cv_func_stpcpy}" = "yes"; then
660     AC_DEFINE(HAVE_STPCPY)
661   fi
662
663   AM_LC_MESSAGES
664   AM_GTK_WITH_NLS
665
666   if test "x$CATOBJEXT" != "x"; then
667     if test "x$ALL_LINGUAS" = "x"; then
668       LINGUAS=
669     else
670       AC_MSG_CHECKING(for catalogs to be installed)
671       NEW_LINGUAS=
672       for lang in ${LINGUAS=$ALL_LINGUAS}; do
673         case "$ALL_LINGUAS" in
674          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
675         esac
676       done
677       LINGUAS=$NEW_LINGUAS
678       AC_MSG_RESULT($LINGUAS)
679     fi
680
681     dnl Construct list of names of catalog files to be constructed.
682     if test -n "$LINGUAS"; then
683       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
684     fi
685   fi
686
687   dnl The reference to <locale.h> in the installed <libintl.h> file
688   dnl must be resolved because we cannot expect the users of this
689   dnl to define HAVE_LOCALE_H.
690   if test $ac_cv_header_locale_h = yes; then
691     INCLUDE_LOCALE_H="#include <locale.h>"
692   else
693     INCLUDE_LOCALE_H="\
694/* The system does not provide the header <locale.h>.  Take care yourself.  */"
695   fi
696   AC_SUBST(INCLUDE_LOCALE_H)
697
698   dnl Determine which catalog format we have (if any is needed)
699   dnl For now we know about two different formats:
700   dnl   Linux libc-5 and the normal X/Open format
701   test -d intl || mkdir intl
702   if test "$CATOBJEXT" = ".cat"; then
703     AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
704
705     dnl Transform the SED scripts while copying because some dumb SEDs
706     dnl cannot handle comments.
707     sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
708   fi
709   dnl po2tbl.sed is always needed.
710   sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
711     $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
712
713   dnl In the intl/Makefile.in we have a special dependency which makes
714   dnl only sense for gettext.  We comment this out for non-gettext
715   dnl packages.
716   if test "$PACKAGE" = "gettext"; then
717     GT_NO="#NO#"
718     GT_YES=
719   else
720     GT_NO=
721     GT_YES="#YES#"
722   fi
723   AC_SUBST(GT_NO)
724   AC_SUBST(GT_YES)
725
726   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
727   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
728   dnl Try to locate is.
729   MKINSTALLDIRS=
730   if test -n "$ac_aux_dir"; then
731     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
732   fi
733   if test -z "$MKINSTALLDIRS"; then
734     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
735   fi
736   AC_SUBST(MKINSTALLDIRS)
737
738   dnl *** For now the libtool support in intl/Makefile is not for real.
739   l=
740   AC_SUBST(l)
741
742   dnl Generate list of files to be processed by xgettext which will
743   dnl be included in po/Makefile.
744   test -d po || mkdir po
745   if test "x$srcdir" != "x."; then
746     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
747       posrcprefix="$srcdir/"
748     else
749       posrcprefix="../$srcdir/"
750     fi
751   else
752     posrcprefix="../"
753   fi
754   rm -f po/POTFILES
755   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
756        < $srcdir/po/POTFILES.in > po/POTFILES
757  ])
758
759
760# Search path for a program which passes the given test.
761# Ulrich Drepper <drepper@cygnus.com>, 1996.
762#
763# This file can be copied and used freely without restrictions.  It can
764# be used in projects which are not available under the GNU Public License
765# but which still want to provide support for the GNU gettext functionality.
766# Please note that the actual code is *not* freely available.
767
768# serial 1
769
770dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
771dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
772AC_DEFUN(AM_PATH_PROG_WITH_TEST,
773[# Extract the first word of "$2", so it can be a program name with args.
774set dummy $2; ac_word=[$]2
775AC_MSG_CHECKING([for $ac_word])
776AC_CACHE_VAL(ac_cv_path_$1,
777[case "[$]$1" in
778  /*)
779  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
780  ;;
781  *)
782  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
783  for ac_dir in ifelse([$5], , $PATH, [$5]); do
784    test -z "$ac_dir" && ac_dir=.
785    if test -f $ac_dir/$ac_word; then
786      if [$3]; then
787        ac_cv_path_$1="$ac_dir/$ac_word"
788        break
789      fi
790    fi
791  done
792  IFS="$ac_save_ifs"
793dnl If no 4th arg is given, leave the cache variable unset,
794dnl so AC_PATH_PROGS will keep looking.
795ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
796])dnl
797  ;;
798esac])dnl
799$1="$ac_cv_path_$1"
800if test -n "[$]$1"; then
801  AC_MSG_RESULT([$]$1)
802else
803  AC_MSG_RESULT(no)
804fi
805AC_SUBST($1)dnl
806])
807
808# Check whether LC_MESSAGES is available in <locale.h>.
809# Ulrich Drepper <drepper@cygnus.com>, 1995.
810#
811# This file can be copied and used freely without restrictions.  It can
812# be used in projects which are not available under the GNU Public License
813# but which still want to provide support for the GNU gettext functionality.
814# Please note that the actual code is *not* freely available.
815
816# serial 1
817
818AC_DEFUN(AM_LC_MESSAGES,
819  [if test $ac_cv_header_locale_h = yes; then
820    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
821      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
822       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
823    if test $am_cv_val_LC_MESSAGES = yes; then
824      AC_DEFINE(HAVE_LC_MESSAGES)
825    fi
826  fi])
827
828# Do all the work for Automake.  This macro actually does too much --
829# some checks are only needed if your package does certain things.
830# But this isn't really a big deal.
831
832# serial 1
833
834dnl Usage:
835dnl AM_INIT_AUTOMAKE(package,version, [no-define])
836
837AC_DEFUN(AM_INIT_AUTOMAKE,
838[AC_REQUIRE([AC_PROG_INSTALL])
839PACKAGE=[$1]
840AC_SUBST(PACKAGE)
841VERSION=[$2]
842AC_SUBST(VERSION)
843dnl test to see if srcdir already configured
844if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
845  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
846fi
847ifelse([$3],,
848AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
849AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
850AC_REQUIRE([AM_SANITY_CHECK])
851AC_REQUIRE([AC_ARG_PROGRAM])
852dnl FIXME This is truly gross.
853missing_dir=`cd $ac_aux_dir && pwd`
854AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
855AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
856AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
857AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
858AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
859AC_REQUIRE([AC_PROG_MAKE_SET])])
860
861#
862# Check to make sure that the build environment is sane.
863#
864
865AC_DEFUN(AM_SANITY_CHECK,
866[AC_MSG_CHECKING([whether build environment is sane])
867# Just in case
868sleep 1
869echo timestamp > conftestfile
870# Do `set' in a subshell so we don't clobber the current shell's
871# arguments.  Must try -L first in case configure is actually a
872# symlink; some systems play weird games with the mod time of symlinks
873# (eg FreeBSD returns the mod time of the symlink's containing
874# directory).
875if (
876   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
877   if test "[$]*" = "X"; then
878      # -L didn't work.
879      set X `ls -t $srcdir/configure conftestfile`
880   fi
881   if test "[$]*" != "X $srcdir/configure conftestfile" \
882      && test "[$]*" != "X conftestfile $srcdir/configure"; then
883
884      # If neither matched, then we have a broken ls.  This can happen
885      # if, for instance, CONFIG_SHELL is bash and it inherits a
886      # broken ls alias from the environment.  This has actually
887      # happened.  Such a system could not be considered "sane".
888      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
889alias in your environment])
890   fi
891
892   test "[$]2" = conftestfile
893   )
894then
895   # Ok.
896   :
897else
898   AC_MSG_ERROR([newly created file is older than distributed files!
899Check your system clock])
900fi
901rm -f conftest*
902AC_MSG_RESULT(yes)])
903
904dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
905dnl The program must properly implement --version.
906AC_DEFUN(AM_MISSING_PROG,
907[AC_MSG_CHECKING(for working $2)
908# Run test in a subshell; some versions of sh will print an error if
909# an executable is not found, even if stderr is redirected.
910# Redirect stdin to placate older versions of autoconf.  Sigh.
911if ($2 --version) < /dev/null > /dev/null 2>&1; then
912   $1=$2
913   AC_MSG_RESULT(found)
914else
915   $1="$3/missing $2"
916   AC_MSG_RESULT(missing)
917fi
918AC_SUBST($1)])
919
920# Like AC_CONFIG_HEADER, but automatically create stamp file.
921
922AC_DEFUN(AM_CONFIG_HEADER,
923[AC_PREREQ([2.12])
924AC_CONFIG_HEADER([$1])
925dnl When config.status generates a header, we must update the stamp-h file.
926dnl This file resides in the same directory as the config header
927dnl that is generated.  We must strip everything past the first ":",
928dnl and everything past the last "/".
929AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
930ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
931<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
932<<am_indx=1
933for am_file in <<$1>>; do
934  case " <<$>>CONFIG_HEADERS " in
935  *" <<$>>am_file "*<<)>>
936    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
937    ;;
938  esac
939  am_indx=`expr "<<$>>am_indx" + 1`
940done<<>>dnl>>)
941changequote([,]))])
942
943# Add --enable-maintainer-mode option to configure.
944# From Jim Meyering
945
946# serial 1
947
948AC_DEFUN(AM_MAINTAINER_MODE,
949[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
950  dnl maintainer-mode is disabled by default
951  AC_ARG_ENABLE(maintainer-mode,
952[  --enable-maintainer-mode enable make rules and dependencies not useful
953                          (and sometimes confusing) to the casual installer],
954      USE_MAINTAINER_MODE=$enableval,
955      USE_MAINTAINER_MODE=no)
956  AC_MSG_RESULT($USE_MAINTAINER_MODE)
957  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
958  MAINT=$MAINTAINER_MODE_TRUE
959  AC_SUBST(MAINT)dnl
960]
961)
962
963# Define a conditional.
964
965AC_DEFUN(AM_CONDITIONAL,
966[AC_SUBST($1_TRUE)
967AC_SUBST($1_FALSE)
968if $2; then
969  $1_TRUE=
970  $1_FALSE='#'
971else
972  $1_TRUE='#'
973  $1_FALSE=
974fi])
975
976
977# serial 1
978
979# @defmac AC_PROG_CC_STDC
980# @maindex PROG_CC_STDC
981# @ovindex CC
982# If the C compiler in not in ANSI C mode by default, try to add an option
983# to output variable @code{CC} to make it so.  This macro tries various
984# options that select ANSI C on some system or another.  It considers the
985# compiler to be in ANSI C mode if it handles function prototypes correctly.
986#
987# If you use this macro, you should check after calling it whether the C
988# compiler has been set to accept ANSI C; if not, the shell variable
989# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
990# code in ANSI C, you can make an un-ANSIfied copy of it by using the
991# program @code{ansi2knr}, which comes with Ghostscript.
992# @end defmac
993
994AC_DEFUN(AM_PROG_CC_STDC,
995[AC_REQUIRE([AC_PROG_CC])
996AC_BEFORE([$0], [AC_C_INLINE])
997AC_BEFORE([$0], [AC_C_CONST])
998dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
999dnl a magic option to avoid problems with ANSI preprocessor commands
1000dnl like #elif.
1001dnl FIXME: can't do this because then AC_AIX won't work due to a
1002dnl circular dependency.
1003dnl AC_BEFORE([$0], [AC_PROG_CPP])
1004AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
1005AC_CACHE_VAL(am_cv_prog_cc_stdc,
1006[am_cv_prog_cc_stdc=no
1007ac_save_CC="$CC"
1008# Don't try gcc -ansi; that turns off useful extensions and
1009# breaks some systems' header files.
1010# AIX                   -qlanglvl=ansi
1011# Ultrix and OSF/1      -std1
1012# HP-UX                 -Aa -D_HPUX_SOURCE
1013# SVR4                  -Xc -D__EXTENSIONS__
1014for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1015do
1016  CC="$ac_save_CC $ac_arg"
1017  AC_TRY_COMPILE(
1018[#include <stdarg.h>
1019#include <stdio.h>
1020#include <sys/types.h>
1021#include <sys/stat.h>
1022/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1023struct buf { int x; };
1024FILE * (*rcsopen) (struct buf *, struct stat *, int);
1025static char *e (p, i)
1026     char **p;
1027     int i;
1028{
1029  return p[i];
1030}
1031static char *f (char * (*g) (char **, int), char **p, ...)
1032{
1033  char *s;
1034  va_list v;
1035  va_start (v,p);
1036  s = g (p, va_arg (v,int));
1037  va_end (v);
1038  return s;
1039}
1040int test (int i, double x);
1041struct s1 {int (*f) (int a);};
1042struct s2 {int (*f) (double a);};
1043int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1044int argc;
1045char **argv;
1046], [
1047return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1048],
1049[am_cv_prog_cc_stdc="$ac_arg"; break])
1050done
1051CC="$ac_save_CC"
1052])
1053if test -z "$am_cv_prog_cc_stdc"; then
1054  AC_MSG_RESULT([none needed])
1055else
1056  AC_MSG_RESULT($am_cv_prog_cc_stdc)
1057fi
1058case "x$am_cv_prog_cc_stdc" in
1059  x|xno) ;;
1060  *) CC="$CC $am_cv_prog_cc_stdc" ;;
1061esac
1062])
1063
1064# Configure paths for GLIB
1065# Owen Taylor     97-11-3
1066
1067dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1068dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
1069dnl gthread is specified in MODULES, pass to glib-config
1070dnl
1071AC_DEFUN(AM_PATH_GLIB,
1072[dnl
1073dnl Get the cflags and libraries from the glib-config script
1074dnl
1075AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
1076            glib_config_prefix="$withval", glib_config_prefix="")
1077AC_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="")
1079AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
1080                    , enable_glibtest=yes)
1081
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
1086     fi
1087  fi
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
1092     fi
1093  fi
1094
1095  for module in . $4
1096  do
1097      case "$module" in
1098         gmodule)
1099             glib_config_args="$glib_config_args gmodule"
1100         ;;
1101         gthread)
1102             glib_config_args="$glib_config_args gthread"
1103         ;;
1104      esac
1105  done
1106
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)
1110  no_glib=""
1111  if test "$GLIB_CONFIG" = "no" ; then
1112    no_glib=yes
1113  else
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"
1127dnl
1128dnl Now check if the installed GLIB is sufficiently new. (Also sanity
1129dnl checks the results of glib-config to some extent
1130dnl
1131      rm -f conf.glibtest
1132      AC_TRY_RUN([
1133#include <glib.h>
1134#include <stdio.h>
1135#include <stdlib.h>
1136
1137int
1138main ()
1139{
1140  int major, minor, micro;
1141  char *tmp_version;
1142
1143  system ("touch conf.glibtest");
1144
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, &micro) != 3) {
1148     printf("%s, bad version string\n", "$min_glib_version");
1149     exit(1);
1150   }
1151
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))
1155    {
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");
1167    }
1168  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
1169           (glib_minor_version != GLIB_MINOR_VERSION) ||
1170           (glib_micro_version != GLIB_MICRO_VERSION))
1171    {
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);
1176    }
1177  else
1178    {
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)))
1182      {
1183        return 0;
1184       }
1185     else
1186      {
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");
1192        printf("***\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");
1200      }
1201    }
1202  return 1;
1203}
1204],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1205       CFLAGS="$ac_save_CFLAGS"
1206       LIBS="$ac_save_LIBS"
1207     fi
1208  fi
1209  if test "x$no_glib" = x ; then
1210     AC_MSG_RESULT(yes)
1211     ifelse([$2], , :, [$2])     
1212  else
1213     AC_MSG_RESULT(no)
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."
1219     else
1220       if test -f conf.glibtest ; then
1221        :
1222       else
1223          echo "*** Could not run GLIB test program, checking why..."
1224          CFLAGS="$CFLAGS $GLIB_CFLAGS"
1225          LIBS="$LIBS $GLIB_LIBS"
1226          AC_TRY_LINK([
1227#include <glib.h>
1228#include <stdio.h>
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"
1236          echo "***"
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"
1239          echo "***"
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"
1242          echo "***"
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"
1250       fi
1251     fi
1252     GLIB_CFLAGS=""
1253     GLIB_LIBS=""
1254     ifelse([$3], , :, [$3])
1255  fi
1256  AC_SUBST(GLIB_CFLAGS)
1257  AC_SUBST(GLIB_LIBS)
1258  rm -f conf.glibtest
1259])
1260
Note: See TracBrowser for help on using the repository browser.