source: trunk/third/scrollkeeper/aclocal.m4 @ 15983

Revision 15983, 30.2 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15982, 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# Like AC_CONFIG_HEADER, but automatically create stamp file.
14
15AC_DEFUN(AM_CONFIG_HEADER,
16[AC_PREREQ([2.12])
17AC_CONFIG_HEADER([$1])
18dnl When config.status generates a header, we must update the stamp-h file.
19dnl This file resides in the same directory as the config header
20dnl that is generated.  We must strip everything past the first ":",
21dnl and everything past the last "/".
22AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
23ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
24<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
25<<am_indx=1
26for am_file in <<$1>>; do
27  case " <<$>>CONFIG_HEADERS " in
28  *" <<$>>am_file "*<<)>>
29    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
30    ;;
31  esac
32  am_indx=`expr "<<$>>am_indx" + 1`
33done<<>>dnl>>)
34changequote([,]))])
35
36# Do all the work for Automake.  This macro actually does too much --
37# some checks are only needed if your package does certain things.
38# But this isn't really a big deal.
39
40# serial 1
41
42dnl Usage:
43dnl AM_INIT_AUTOMAKE(package,version, [no-define])
44
45AC_DEFUN(AM_INIT_AUTOMAKE,
46[AC_REQUIRE([AC_PROG_INSTALL])
47PACKAGE=[$1]
48AC_SUBST(PACKAGE)
49VERSION=[$2]
50AC_SUBST(VERSION)
51dnl test to see if srcdir already configured
52if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
53  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
54fi
55ifelse([$3],,
56AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
57AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
58AC_REQUIRE([AM_SANITY_CHECK])
59AC_REQUIRE([AC_ARG_PROGRAM])
60dnl FIXME This is truly gross.
61missing_dir=`cd $ac_aux_dir && pwd`
62AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
63AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
64AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
65AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
66AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
67AC_REQUIRE([AC_PROG_MAKE_SET])])
68
69#
70# Check to make sure that the build environment is sane.
71#
72
73AC_DEFUN(AM_SANITY_CHECK,
74[AC_MSG_CHECKING([whether build environment is sane])
75# Just in case
76sleep 1
77echo timestamp > conftestfile
78# Do `set' in a subshell so we don't clobber the current shell's
79# arguments.  Must try -L first in case configure is actually a
80# symlink; some systems play weird games with the mod time of symlinks
81# (eg FreeBSD returns the mod time of the symlink's containing
82# directory).
83if (
84   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
85   if test "[$]*" = "X"; then
86      # -L didn't work.
87      set X `ls -t $srcdir/configure conftestfile`
88   fi
89   if test "[$]*" != "X $srcdir/configure conftestfile" \
90      && test "[$]*" != "X conftestfile $srcdir/configure"; then
91
92      # If neither matched, then we have a broken ls.  This can happen
93      # if, for instance, CONFIG_SHELL is bash and it inherits a
94      # broken ls alias from the environment.  This has actually
95      # happened.  Such a system could not be considered "sane".
96      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
97alias in your environment])
98   fi
99
100   test "[$]2" = conftestfile
101   )
102then
103   # Ok.
104   :
105else
106   AC_MSG_ERROR([newly created file is older than distributed files!
107Check your system clock])
108fi
109rm -f conftest*
110AC_MSG_RESULT(yes)])
111
112dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
113dnl The program must properly implement --version.
114AC_DEFUN(AM_MISSING_PROG,
115[AC_MSG_CHECKING(for working $2)
116# Run test in a subshell; some versions of sh will print an error if
117# an executable is not found, even if stderr is redirected.
118# Redirect stdin to placate older versions of autoconf.  Sigh.
119if ($2 --version) < /dev/null > /dev/null 2>&1; then
120   $1=$2
121   AC_MSG_RESULT(found)
122else
123   $1="$3/missing $2"
124   AC_MSG_RESULT(missing)
125fi
126AC_SUBST($1)])
127
128
129# serial 40 AC_PROG_LIBTOOL
130AC_DEFUN(AC_PROG_LIBTOOL,
131[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
132
133# Save cache, so that ltconfig can load it
134AC_CACHE_SAVE
135
136# Actually configure libtool.  ac_aux_dir is where install-sh is found.
137CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
138LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
139LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
140DLLTOOL="$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])
144
145# Reload cache, that may have been modified by ltconfig
146AC_CACHE_LOAD
147
148# This can be used to rebuild libtool when needed
149LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
150
151# Always use our own libtool.
152LIBTOOL='$(SHELL) $(top_builddir)/libtool'
153AC_SUBST(LIBTOOL)dnl
154
155# Redirect the config.log output again, so that the ltconfig log is not
156# clobbered by the next message.
157exec 5>>./config.log
158])
159
160AC_DEFUN(AC_LIBTOOL_SETUP,
161[AC_PREREQ(2.13)dnl
162AC_REQUIRE([AC_ENABLE_SHARED])dnl
163AC_REQUIRE([AC_ENABLE_STATIC])dnl
164AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
165AC_REQUIRE([AC_CANONICAL_HOST])dnl
166AC_REQUIRE([AC_CANONICAL_BUILD])dnl
167AC_REQUIRE([AC_PROG_RANLIB])dnl
168AC_REQUIRE([AC_PROG_CC])dnl
169AC_REQUIRE([AC_PROG_LD])dnl
170AC_REQUIRE([AC_PROG_NM])dnl
171AC_REQUIRE([AC_PROG_LN_S])dnl
172dnl
173
174case "$target" in
175NONE) lt_target="$host" ;;
176*) lt_target="$target" ;;
177esac
178
179# Check for any special flags to pass to ltconfig.
180#
181# the following will cause an existing older ltconfig to fail, so
182# we ignore this at the expense of the cache file... Checking this
183# will just take longer ... bummer!
184#libtool_flags="--cache-file=$cache_file"
185#
186test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
187test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
188test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
189test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
190test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
191ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
192[libtool_flags="$libtool_flags --enable-dlopen"])
193ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
194[libtool_flags="$libtool_flags --enable-win32-dll"])
195AC_ARG_ENABLE(libtool-lock,
196  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
197test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
198test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
199
200# Some flags need to be propagated to the compiler or linker for good
201# libtool support.
202case "$lt_target" in
203*-*-irix6*)
204  # Find out which ABI we are using.
205  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
206  if AC_TRY_EVAL(ac_compile); then
207    case "`/usr/bin/file conftest.o`" in
208    *32-bit*)
209      LD="${LD-ld} -32"
210      ;;
211    *N32*)
212      LD="${LD-ld} -n32"
213      ;;
214    *64-bit*)
215      LD="${LD-ld} -64"
216      ;;
217    esac
218  fi
219  rm -rf conftest*
220  ;;
221
222*-*-sco3.2v5*)
223  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
224  SAVE_CFLAGS="$CFLAGS"
225  CFLAGS="$CFLAGS -belf"
226  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
227    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
228  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
229    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
230    CFLAGS="$SAVE_CFLAGS"
231  fi
232  ;;
233
234ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
235[*-*-cygwin* | *-*-mingw*)
236  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
237  AC_CHECK_TOOL(AS, as, false)
238  AC_CHECK_TOOL(OBJDUMP, objdump, false)
239  ;;
240])
241esac
242])
243
244# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
245AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
246
247# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
248AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
249
250# AC_ENABLE_SHARED - implement the --enable-shared flag
251# Usage: AC_ENABLE_SHARED[(DEFAULT)]
252#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
253#   `yes'.
254AC_DEFUN(AC_ENABLE_SHARED, [dnl
255define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
256AC_ARG_ENABLE(shared,
257changequote(<<, >>)dnl
258<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
259changequote([, ])dnl
260[p=${PACKAGE-default}
261case "$enableval" in
262yes) enable_shared=yes ;;
263no) enable_shared=no ;;
264*)
265  enable_shared=no
266  # Look at the argument we got.  We use all the common list separators.
267  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
268  for pkg in $enableval; do
269    if test "X$pkg" = "X$p"; then
270      enable_shared=yes
271    fi
272  done
273  IFS="$ac_save_ifs"
274  ;;
275esac],
276enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
277])
278
279# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
280AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
281AC_ENABLE_SHARED(no)])
282
283# AC_ENABLE_STATIC - implement the --enable-static flag
284# Usage: AC_ENABLE_STATIC[(DEFAULT)]
285#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
286#   `yes'.
287AC_DEFUN(AC_ENABLE_STATIC, [dnl
288define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
289AC_ARG_ENABLE(static,
290changequote(<<, >>)dnl
291<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
292changequote([, ])dnl
293[p=${PACKAGE-default}
294case "$enableval" in
295yes) enable_static=yes ;;
296no) enable_static=no ;;
297*)
298  enable_static=no
299  # Look at the argument we got.  We use all the common list separators.
300  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
301  for pkg in $enableval; do
302    if test "X$pkg" = "X$p"; then
303      enable_static=yes
304    fi
305  done
306  IFS="$ac_save_ifs"
307  ;;
308esac],
309enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
310])
311
312# AC_DISABLE_STATIC - set the default static flag to --disable-static
313AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
314AC_ENABLE_STATIC(no)])
315
316
317# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
318# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
319#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
320#   `yes'.
321AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
322define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
323AC_ARG_ENABLE(fast-install,
324changequote(<<, >>)dnl
325<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
326changequote([, ])dnl
327[p=${PACKAGE-default}
328case "$enableval" in
329yes) enable_fast_install=yes ;;
330no) enable_fast_install=no ;;
331*)
332  enable_fast_install=no
333  # Look at the argument we got.  We use all the common list separators.
334  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
335  for pkg in $enableval; do
336    if test "X$pkg" = "X$p"; then
337      enable_fast_install=yes
338    fi
339  done
340  IFS="$ac_save_ifs"
341  ;;
342esac],
343enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
344])
345
346# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
347AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
348AC_ENABLE_FAST_INSTALL(no)])
349
350# AC_PROG_LD - find the path to the GNU or non-GNU linker
351AC_DEFUN(AC_PROG_LD,
352[AC_ARG_WITH(gnu-ld,
353[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
354test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
355AC_REQUIRE([AC_PROG_CC])dnl
356AC_REQUIRE([AC_CANONICAL_HOST])dnl
357AC_REQUIRE([AC_CANONICAL_BUILD])dnl
358ac_prog=ld
359if test "$ac_cv_prog_gcc" = yes; then
360  # Check if gcc -print-prog-name=ld gives a path.
361  AC_MSG_CHECKING([for ld used by GCC])
362  ac_prog=`($CC -print-prog-name=ld) 2>&5`
363  case "$ac_prog" in
364    # Accept absolute paths.
365changequote(,)dnl
366    [\\/]* | [A-Za-z]:[\\/]*)
367      re_direlt='/[^/][^/]*/\.\./'
368changequote([,])dnl
369      # Canonicalize the path of ld
370      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
371      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
372        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
373      done
374      test -z "$LD" && LD="$ac_prog"
375      ;;
376  "")
377    # If it fails, then pretend we aren't using GCC.
378    ac_prog=ld
379    ;;
380  *)
381    # If it is relative, then search for the first ld in PATH.
382    with_gnu_ld=unknown
383    ;;
384  esac
385elif test "$with_gnu_ld" = yes; then
386  AC_MSG_CHECKING([for GNU ld])
387else
388  AC_MSG_CHECKING([for non-GNU ld])
389fi
390AC_CACHE_VAL(ac_cv_path_LD,
391[if test -z "$LD"; then
392  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
393  for ac_dir in $PATH; do
394    test -z "$ac_dir" && ac_dir=.
395    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
396      ac_cv_path_LD="$ac_dir/$ac_prog"
397      # Check to see if the program is GNU ld.  I'd rather use --version,
398      # but apparently some GNU ld's only accept -v.
399      # Break only if it was the GNU/non-GNU ld that we prefer.
400      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
401        test "$with_gnu_ld" != no && break
402      else
403        test "$with_gnu_ld" != yes && break
404      fi
405    fi
406  done
407  IFS="$ac_save_ifs"
408else
409  ac_cv_path_LD="$LD" # Let the user override the test with a path.
410fi])
411LD="$ac_cv_path_LD"
412if test -n "$LD"; then
413  AC_MSG_RESULT($LD)
414else
415  AC_MSG_RESULT(no)
416fi
417test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
418AC_PROG_LD_GNU
419])
420
421AC_DEFUN(AC_PROG_LD_GNU,
422[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
423[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
424if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
425  ac_cv_prog_gnu_ld=yes
426else
427  ac_cv_prog_gnu_ld=no
428fi])
429])
430
431# AC_PROG_NM - find the path to a BSD-compatible name lister
432AC_DEFUN(AC_PROG_NM,
433[AC_MSG_CHECKING([for BSD-compatible nm])
434AC_CACHE_VAL(ac_cv_path_NM,
435[if test -n "$NM"; then
436  # Let the user override the test.
437  ac_cv_path_NM="$NM"
438else
439  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
440  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
441    test -z "$ac_dir" && ac_dir=.
442    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
443      # Check to see if the nm accepts a BSD-compat flag.
444      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
445      #   nm: unknown option "B" ignored
446      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
447        ac_cv_path_NM="$ac_dir/nm -B"
448        break
449      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
450        ac_cv_path_NM="$ac_dir/nm -p"
451        break
452      else
453        ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
454        continue # so that we can try to find one that supports BSD flags
455      fi
456    fi
457  done
458  IFS="$ac_save_ifs"
459  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
460fi])
461NM="$ac_cv_path_NM"
462AC_MSG_RESULT([$NM])
463])
464
465# AC_CHECK_LIBM - check for math library
466AC_DEFUN(AC_CHECK_LIBM,
467[AC_REQUIRE([AC_CANONICAL_HOST])dnl
468LIBM=
469case "$lt_target" in
470*-*-beos* | *-*-cygwin*)
471  # These system don't have libm
472  ;;
473*-ncr-sysv4.3*)
474  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
475  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
476  ;;
477*)
478  AC_CHECK_LIB(m, main, LIBM="-lm")
479  ;;
480esac
481])
482
483# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
484# the libltdl convenience library and INCLTDL to the include flags for
485# the libltdl header and adds --enable-ltdl-convenience to the
486# configure arguments.  Note that LIBLTDL and INCLTDL are not
487# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
488# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
489# with '${top_builddir}/' and INCLTDL will be prefixed with
490# '${top_srcdir}/' (note the single quotes!).  If your package is not
491# flat and you're not using automake, define top_builddir and
492# top_srcdir appropriately in the Makefiles.
493AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
494  case "$enable_ltdl_convenience" in
495  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
496  "") enable_ltdl_convenience=yes
497      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
498  esac
499  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
500  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
501])
502
503# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
504# the libltdl installable library and INCLTDL to the include flags for
505# the libltdl header and adds --enable-ltdl-install to the configure
506# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
507# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
508# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
509# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
510# with '${top_srcdir}/' (note the single quotes!).  If your package is
511# not flat and you're not using automake, define top_builddir and
512# top_srcdir appropriately in the Makefiles.
513# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
514AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
515  AC_CHECK_LIB(ltdl, main,
516  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
517  [if test x"$enable_ltdl_install" = xno; then
518     AC_MSG_WARN([libltdl not installed, but installation disabled])
519   else
520     enable_ltdl_install=yes
521   fi
522  ])
523  if test x"$enable_ltdl_install" = x"yes"; then
524    ac_configure_args="$ac_configure_args --enable-ltdl-install"
525    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
526    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
527  else
528    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
529    LIBLTDL="-lltdl"
530    INCLTDL=
531  fi
532])
533
534dnl old names
535AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
536AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
537AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
538AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
539AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
540AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
541AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
542
543dnl This is just to silence aclocal about the macro not being used
544ifelse([AC_DISABLE_FAST_INSTALL])dnl
545
546# Macro to add for using GNU gettext.
547# Ulrich Drepper <drepper@cygnus.com>, 1995.
548#
549# This file can be copied and used freely without restrictions.  It can
550# be used in projects which are not available under the GNU Public License
551# but which still want to provide support for the GNU gettext functionality.
552# Please note that the actual code is *not* freely available.
553
554# serial 5
555
556AC_DEFUN(AM_WITH_NLS,
557  [AC_MSG_CHECKING([whether NLS is requested])
558    dnl Default is enabled NLS
559    AC_ARG_ENABLE(nls,
560      [  --disable-nls           do not use Native Language Support],
561      USE_NLS=$enableval, USE_NLS=yes)
562    AC_MSG_RESULT($USE_NLS)
563    AC_SUBST(USE_NLS)
564
565    USE_INCLUDED_LIBINTL=no
566
567    dnl If we use NLS figure out what method
568    if test "$USE_NLS" = "yes"; then
569      AC_DEFINE(ENABLE_NLS)
570      AC_MSG_CHECKING([whether included gettext is requested])
571      AC_ARG_WITH(included-gettext,
572        [  --with-included-gettext use the GNU gettext library included here],
573        nls_cv_force_use_gnu_gettext=$withval,
574        nls_cv_force_use_gnu_gettext=no)
575      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
576
577      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
578      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
579        dnl User does not insist on using GNU NLS library.  Figure out what
580        dnl to use.  If gettext or catgets are available (in this order) we
581        dnl use this.  Else we have to fall back to GNU NLS library.
582        dnl catgets is only used if permitted by option --with-catgets.
583        nls_cv_header_intl=
584        nls_cv_header_libgt=
585        CATOBJEXT=NONE
586
587        AC_CHECK_HEADER(libintl.h,
588          [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
589            [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
590               gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
591
592           if test "$gt_cv_func_gettext_libc" != "yes"; then
593             AC_CHECK_LIB(intl, bindtextdomain,
594               [AC_CACHE_CHECK([for gettext in libintl],
595                 gt_cv_func_gettext_libintl,
596                 [AC_CHECK_LIB(intl, gettext,
597                  gt_cv_func_gettext_libintl=yes,
598                  gt_cv_func_gettext_libintl=no)],
599                 gt_cv_func_gettext_libintl=no)])
600           fi
601
602           if test "$gt_cv_func_gettext_libc" = "yes" \
603              || test "$gt_cv_func_gettext_libintl" = "yes"; then
604              AC_DEFINE(HAVE_GETTEXT)
605              AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
606                [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
607              if test "$MSGFMT" != "no"; then
608                AC_CHECK_FUNCS(dcgettext)
609                AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
610                AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
611                  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
612                AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
613                               return _nl_msg_cat_cntr],
614                  [CATOBJEXT=.gmo
615                   DATADIRNAME=share],
616                  [CATOBJEXT=.mo
617                   DATADIRNAME=lib])
618                INSTOBJEXT=.mo
619              fi
620            fi
621        ])
622
623        if test "$CATOBJEXT" = "NONE"; then
624          AC_MSG_CHECKING([whether catgets can be used])
625          AC_ARG_WITH(catgets,
626            [  --with-catgets          use catgets functions if available],
627            nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
628          AC_MSG_RESULT($nls_cv_use_catgets)
629
630          if test "$nls_cv_use_catgets" = "yes"; then
631            dnl No gettext in C library.  Try catgets next.
632            AC_CHECK_LIB(i, main)
633            AC_CHECK_FUNC(catgets,
634              [AC_DEFINE(HAVE_CATGETS)
635               INTLOBJS="\$(CATOBJS)"
636               AC_PATH_PROG(GENCAT, gencat, no)dnl
637               if test "$GENCAT" != "no"; then
638                 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
639                 if test "$GMSGFMT" = "no"; then
640                   AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
641                    [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
642                 fi
643                 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
644                   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
645                 USE_INCLUDED_LIBINTL=yes
646                 CATOBJEXT=.cat
647                 INSTOBJEXT=.cat
648                 DATADIRNAME=lib
649                 INTLDEPS='$(top_builddir)/intl/libintl.a'
650                 INTLLIBS=$INTLDEPS
651                 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
652                 nls_cv_header_intl=intl/libintl.h
653                 nls_cv_header_libgt=intl/libgettext.h
654               fi])
655          fi
656        fi
657
658        if test "$CATOBJEXT" = "NONE"; then
659          dnl Neither gettext nor catgets in included in the C library.
660          dnl Fall back on GNU gettext library.
661          nls_cv_use_gnu_gettext=yes
662        fi
663      fi
664
665      if test "$nls_cv_use_gnu_gettext" = "yes"; then
666        dnl Mark actions used to generate GNU NLS library.
667        INTLOBJS="\$(GETTOBJS)"
668        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
669          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
670        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
671        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
672          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
673        AC_SUBST(MSGFMT)
674        USE_INCLUDED_LIBINTL=yes
675        CATOBJEXT=.gmo
676        INSTOBJEXT=.mo
677        DATADIRNAME=share
678        INTLDEPS='$(top_builddir)/intl/libintl.a'
679        INTLLIBS=$INTLDEPS
680        LIBS=`echo $LIBS | sed -e 's/-lintl//'`
681        nls_cv_header_intl=intl/libintl.h
682        nls_cv_header_libgt=intl/libgettext.h
683      fi
684
685      dnl Test whether we really found GNU xgettext.
686      if test "$XGETTEXT" != ":"; then
687        dnl If it is no GNU xgettext we define it as : so that the
688        dnl Makefiles still can work.
689        if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
690          : ;
691        else
692          AC_MSG_RESULT(
693            [found xgettext program is not GNU xgettext; ignore it])
694          XGETTEXT=":"
695        fi
696      fi
697
698      # We need to process the po/ directory.
699      POSUB=po
700    else
701      DATADIRNAME=share
702      nls_cv_header_intl=intl/libintl.h
703      nls_cv_header_libgt=intl/libgettext.h
704    fi
705    AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
706    AC_OUTPUT_COMMANDS(
707     [case "$CONFIG_FILES" in *po/Makefile.in*)
708        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
709      esac])
710
711
712    # If this is used in GNU gettext we have to set USE_NLS to `yes'
713    # because some of the sources are only built for this goal.
714    if test "$PACKAGE" = gettext; then
715      USE_NLS=yes
716      USE_INCLUDED_LIBINTL=yes
717    fi
718
719    dnl These rules are solely for the distribution goal.  While doing this
720    dnl we only have to keep exactly one list of the available catalogs
721    dnl in configure.in.
722    for lang in $ALL_LINGUAS; do
723      GMOFILES="$GMOFILES $lang.gmo"
724      POFILES="$POFILES $lang.po"
725    done
726
727    dnl Make all variables we use known to autoconf.
728    AC_SUBST(USE_INCLUDED_LIBINTL)
729    AC_SUBST(CATALOGS)
730    AC_SUBST(CATOBJEXT)
731    AC_SUBST(DATADIRNAME)
732    AC_SUBST(GMOFILES)
733    AC_SUBST(INSTOBJEXT)
734    AC_SUBST(INTLDEPS)
735    AC_SUBST(INTLLIBS)
736    AC_SUBST(INTLOBJS)
737    AC_SUBST(POFILES)
738    AC_SUBST(POSUB)
739  ])
740
741AC_DEFUN(AM_GNU_GETTEXT,
742  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
743   AC_REQUIRE([AC_PROG_CC])dnl
744   AC_REQUIRE([AC_PROG_RANLIB])dnl
745   AC_REQUIRE([AC_ISC_POSIX])dnl
746   AC_REQUIRE([AC_HEADER_STDC])dnl
747   AC_REQUIRE([AC_C_CONST])dnl
748   AC_REQUIRE([AC_C_INLINE])dnl
749   AC_REQUIRE([AC_TYPE_OFF_T])dnl
750   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
751   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
752   AC_REQUIRE([AC_FUNC_MMAP])dnl
753
754   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
755unistd.h sys/param.h])
756   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
757strdup __argz_count __argz_stringify __argz_next])
758
759   if test "${ac_cv_func_stpcpy+set}" != "set"; then
760     AC_CHECK_FUNCS(stpcpy)
761   fi
762   if test "${ac_cv_func_stpcpy}" = "yes"; then
763     AC_DEFINE(HAVE_STPCPY)
764   fi
765
766   AM_LC_MESSAGES
767   AM_WITH_NLS
768
769   if test "x$CATOBJEXT" != "x"; then
770     if test "x$ALL_LINGUAS" = "x"; then
771       LINGUAS=
772     else
773       AC_MSG_CHECKING(for catalogs to be installed)
774       NEW_LINGUAS=
775       for lang in ${LINGUAS=$ALL_LINGUAS}; do
776         case "$ALL_LINGUAS" in
777          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
778         esac
779       done
780       LINGUAS=$NEW_LINGUAS
781       AC_MSG_RESULT($LINGUAS)
782     fi
783
784     dnl Construct list of names of catalog files to be constructed.
785     if test -n "$LINGUAS"; then
786       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
787     fi
788   fi
789
790   dnl The reference to <locale.h> in the installed <libintl.h> file
791   dnl must be resolved because we cannot expect the users of this
792   dnl to define HAVE_LOCALE_H.
793   if test $ac_cv_header_locale_h = yes; then
794     INCLUDE_LOCALE_H="#include <locale.h>"
795   else
796     INCLUDE_LOCALE_H="\
797/* The system does not provide the header <locale.h>.  Take care yourself.  */"
798   fi
799   AC_SUBST(INCLUDE_LOCALE_H)
800
801   dnl Determine which catalog format we have (if any is needed)
802   dnl For now we know about two different formats:
803   dnl   Linux libc-5 and the normal X/Open format
804   test -d intl || mkdir intl
805   if test "$CATOBJEXT" = ".cat"; then
806     AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
807
808     dnl Transform the SED scripts while copying because some dumb SEDs
809     dnl cannot handle comments.
810     sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
811   fi
812   dnl po2tbl.sed is always needed.
813   sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
814     $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
815
816   dnl In the intl/Makefile.in we have a special dependency which makes
817   dnl only sense for gettext.  We comment this out for non-gettext
818   dnl packages.
819   if test "$PACKAGE" = "gettext"; then
820     GT_NO="#NO#"
821     GT_YES=
822   else
823     GT_NO=
824     GT_YES="#YES#"
825   fi
826   AC_SUBST(GT_NO)
827   AC_SUBST(GT_YES)
828
829   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
830   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
831   dnl Try to locate is.
832   MKINSTALLDIRS=
833   if test -n "$ac_aux_dir"; then
834     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
835   fi
836   if test -z "$MKINSTALLDIRS"; then
837     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
838   fi
839   AC_SUBST(MKINSTALLDIRS)
840
841   dnl *** For now the libtool support in intl/Makefile is not for real.
842   l=
843   AC_SUBST(l)
844
845   dnl Generate list of files to be processed by xgettext which will
846   dnl be included in po/Makefile.
847   test -d po || mkdir po
848   if test "x$srcdir" != "x."; then
849     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
850       posrcprefix="$srcdir/"
851     else
852       posrcprefix="../$srcdir/"
853     fi
854   else
855     posrcprefix="../"
856   fi
857   rm -f po/POTFILES
858   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
859        < $srcdir/po/POTFILES.in > po/POTFILES
860  ])
861
862# Search path for a program which passes the given test.
863# Ulrich Drepper <drepper@cygnus.com>, 1996.
864#
865# This file can be copied and used freely without restrictions.  It can
866# be used in projects which are not available under the GNU Public License
867# but which still want to provide support for the GNU gettext functionality.
868# Please note that the actual code is *not* freely available.
869
870# serial 1
871
872dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
873dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
874AC_DEFUN(AM_PATH_PROG_WITH_TEST,
875[# Extract the first word of "$2", so it can be a program name with args.
876set dummy $2; ac_word=[$]2
877AC_MSG_CHECKING([for $ac_word])
878AC_CACHE_VAL(ac_cv_path_$1,
879[case "[$]$1" in
880  /*)
881  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
882  ;;
883  *)
884  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
885  for ac_dir in ifelse([$5], , $PATH, [$5]); do
886    test -z "$ac_dir" && ac_dir=.
887    if test -f $ac_dir/$ac_word; then
888      if [$3]; then
889        ac_cv_path_$1="$ac_dir/$ac_word"
890        break
891      fi
892    fi
893  done
894  IFS="$ac_save_ifs"
895dnl If no 4th arg is given, leave the cache variable unset,
896dnl so AC_PATH_PROGS will keep looking.
897ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
898])dnl
899  ;;
900esac])dnl
901$1="$ac_cv_path_$1"
902if test -n "[$]$1"; then
903  AC_MSG_RESULT([$]$1)
904else
905  AC_MSG_RESULT(no)
906fi
907AC_SUBST($1)dnl
908])
909
910# Check whether LC_MESSAGES is available in <locale.h>.
911# Ulrich Drepper <drepper@cygnus.com>, 1995.
912#
913# This file can be copied and used freely without restrictions.  It can
914# be used in projects which are not available under the GNU Public License
915# but which still want to provide support for the GNU gettext functionality.
916# Please note that the actual code is *not* freely available.
917
918# serial 1
919
920AC_DEFUN(AM_LC_MESSAGES,
921  [if test $ac_cv_header_locale_h = yes; then
922    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
923      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
924       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
925    if test $am_cv_val_LC_MESSAGES = yes; then
926      AC_DEFINE(HAVE_LC_MESSAGES)
927    fi
928  fi])
929
Note: See TracBrowser for help on using the repository browser.