xref: /freebsd/contrib/openpam/aclocal.m4 (revision 2546665afcaf0d53dc2c7058fee96354b3680f5a)
1# aclocal.m4 generated automatically by aclocal 1.5
2
3# Copyright 1996, 1997, 1998, 1999, 2000, 2001
4# Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14# Like AC_CONFIG_HEADER, but automatically create stamp file.
15
16# serial 3
17
18# When config.status generates a header, we must update the stamp-h file.
19# This file resides in the same directory as the config header
20# that is generated.  We must strip everything past the first ":",
21# and everything past the last "/".
22
23AC_PREREQ([2.12])
24
25AC_DEFUN([AM_CONFIG_HEADER],
26[ifdef([AC_FOREACH],dnl
27	 [dnl init our file count if it isn't already
28	 m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
29	 dnl prepare to store our destination file list for use in config.status
30	 AC_FOREACH([_AM_File], [$1],
31		    [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
32		    m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
33		    dnl and add it to the list of files AC keeps track of, along
34		    dnl with our hook
35		    AC_CONFIG_HEADERS(_AM_File,
36dnl COMMANDS, [, INIT-CMDS]
37[# update the timestamp
38echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
39][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
40		    m4_popdef([_AM_Dest])])],dnl
41[AC_CONFIG_HEADER([$1])
42  AC_OUTPUT_COMMANDS(
43   ifelse(patsubst([$1], [[^ ]], []),
44	  [],
45	  [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
46	   patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
47[am_indx=1
48for am_file in $1; do
49  case " \$CONFIG_HEADERS " in
50  *" \$am_file "*)
51    am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
52    if test -n "\$am_dir"; then
53      am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
54      for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
55        am_tmpdir=\$am_tmpdir\$am_subdir/
56        if test ! -d \$am_tmpdir; then
57          mkdir \$am_tmpdir
58        fi
59      done
60    fi
61    echo timestamp > "\$am_dir"stamp-h\$am_indx
62    ;;
63  esac
64  am_indx=\`expr \$am_indx + 1\`
65done])
66])]) # AM_CONFIG_HEADER
67
68# _AM_DIRNAME(PATH)
69# -----------------
70# Like AS_DIRNAME, only do it during macro expansion
71AC_DEFUN([_AM_DIRNAME],
72       [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
73	      m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
74		    m4_if(m4_regexp([$1], [^/.*]), -1,
75			  [.],
76			  m4_patsubst([$1], [^\(/\).*], [\1])),
77		    m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
78	      m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
79]) # _AM_DIRNAME
80
81
82# serial 40 AC_PROG_LIBTOOL
83AC_DEFUN(AC_PROG_LIBTOOL,
84[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
85
86# Save cache, so that ltconfig can load it
87AC_CACHE_SAVE
88
89# Actually configure libtool.  ac_aux_dir is where install-sh is found.
90CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
91LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
92LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
93DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
94${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
95$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
96|| AC_MSG_ERROR([libtool configure failed])
97
98# Reload cache, that may have been modified by ltconfig
99AC_CACHE_LOAD
100
101# This can be used to rebuild libtool when needed
102LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
103
104# Always use our own libtool.
105LIBTOOL='$(SHELL) $(top_builddir)/libtool'
106AC_SUBST(LIBTOOL)dnl
107
108# Redirect the config.log output again, so that the ltconfig log is not
109# clobbered by the next message.
110exec 5>>./config.log
111])
112
113AC_DEFUN(AC_LIBTOOL_SETUP,
114[AC_PREREQ(2.13)dnl
115AC_REQUIRE([AC_ENABLE_SHARED])dnl
116AC_REQUIRE([AC_ENABLE_STATIC])dnl
117AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
118AC_REQUIRE([AC_CANONICAL_HOST])dnl
119AC_REQUIRE([AC_CANONICAL_BUILD])dnl
120AC_REQUIRE([AC_PROG_RANLIB])dnl
121AC_REQUIRE([AC_PROG_CC])dnl
122AC_REQUIRE([AC_PROG_LD])dnl
123AC_REQUIRE([AC_PROG_NM])dnl
124AC_REQUIRE([AC_PROG_LN_S])dnl
125dnl
126
127case "$target" in
128NONE) lt_target="$host" ;;
129*) lt_target="$target" ;;
130esac
131
132# Check for any special flags to pass to ltconfig.
133libtool_flags="--cache-file=$cache_file"
134test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
135test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
136test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
137test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
138test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
139ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
140[libtool_flags="$libtool_flags --enable-dlopen"])
141ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
142[libtool_flags="$libtool_flags --enable-win32-dll"])
143AC_ARG_ENABLE(libtool-lock,
144  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
145test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
146test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
147
148# Some flags need to be propagated to the compiler or linker for good
149# libtool support.
150case "$lt_target" in
151*-*-irix6*)
152  # Find out which ABI we are using.
153  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
154  if AC_TRY_EVAL(ac_compile); then
155    case "`/usr/bin/file conftest.o`" in
156    *32-bit*)
157      LD="${LD-ld} -32"
158      ;;
159    *N32*)
160      LD="${LD-ld} -n32"
161      ;;
162    *64-bit*)
163      LD="${LD-ld} -64"
164      ;;
165    esac
166  fi
167  rm -rf conftest*
168  ;;
169
170*-*-sco3.2v5*)
171  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
172  SAVE_CFLAGS="$CFLAGS"
173  CFLAGS="$CFLAGS -belf"
174  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
175    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
176  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
177    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
178    CFLAGS="$SAVE_CFLAGS"
179  fi
180  ;;
181
182ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
183[*-*-cygwin* | *-*-mingw*)
184  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
185  AC_CHECK_TOOL(AS, as, false)
186  AC_CHECK_TOOL(OBJDUMP, objdump, false)
187  ;;
188])
189esac
190])
191
192# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
193AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
194
195# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
196AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
197
198# AC_ENABLE_SHARED - implement the --enable-shared flag
199# Usage: AC_ENABLE_SHARED[(DEFAULT)]
200#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
201#   `yes'.
202AC_DEFUN(AC_ENABLE_SHARED, [dnl
203define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
204AC_ARG_ENABLE(shared,
205changequote(<<, >>)dnl
206<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
207changequote([, ])dnl
208[p=${PACKAGE-default}
209case "$enableval" in
210yes) enable_shared=yes ;;
211no) enable_shared=no ;;
212*)
213  enable_shared=no
214  # Look at the argument we got.  We use all the common list separators.
215  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
216  for pkg in $enableval; do
217    if test "X$pkg" = "X$p"; then
218      enable_shared=yes
219    fi
220  done
221  IFS="$ac_save_ifs"
222  ;;
223esac],
224enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
225])
226
227# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
228AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
229AC_ENABLE_SHARED(no)])
230
231# AC_ENABLE_STATIC - implement the --enable-static flag
232# Usage: AC_ENABLE_STATIC[(DEFAULT)]
233#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
234#   `yes'.
235AC_DEFUN(AC_ENABLE_STATIC, [dnl
236define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
237AC_ARG_ENABLE(static,
238changequote(<<, >>)dnl
239<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
240changequote([, ])dnl
241[p=${PACKAGE-default}
242case "$enableval" in
243yes) enable_static=yes ;;
244no) enable_static=no ;;
245*)
246  enable_static=no
247  # Look at the argument we got.  We use all the common list separators.
248  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
249  for pkg in $enableval; do
250    if test "X$pkg" = "X$p"; then
251      enable_static=yes
252    fi
253  done
254  IFS="$ac_save_ifs"
255  ;;
256esac],
257enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
258])
259
260# AC_DISABLE_STATIC - set the default static flag to --disable-static
261AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
262AC_ENABLE_STATIC(no)])
263
264
265# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
266# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
267#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
268#   `yes'.
269AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
270define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
271AC_ARG_ENABLE(fast-install,
272changequote(<<, >>)dnl
273<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
274changequote([, ])dnl
275[p=${PACKAGE-default}
276case "$enableval" in
277yes) enable_fast_install=yes ;;
278no) enable_fast_install=no ;;
279*)
280  enable_fast_install=no
281  # Look at the argument we got.  We use all the common list separators.
282  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
283  for pkg in $enableval; do
284    if test "X$pkg" = "X$p"; then
285      enable_fast_install=yes
286    fi
287  done
288  IFS="$ac_save_ifs"
289  ;;
290esac],
291enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
292])
293
294# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
295AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
296AC_ENABLE_FAST_INSTALL(no)])
297
298# AC_PROG_LD - find the path to the GNU or non-GNU linker
299AC_DEFUN(AC_PROG_LD,
300[AC_ARG_WITH(gnu-ld,
301[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
302test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
303AC_REQUIRE([AC_PROG_CC])dnl
304AC_REQUIRE([AC_CANONICAL_HOST])dnl
305AC_REQUIRE([AC_CANONICAL_BUILD])dnl
306ac_prog=ld
307if test "$ac_cv_prog_gcc" = yes; then
308  # Check if gcc -print-prog-name=ld gives a path.
309  AC_MSG_CHECKING([for ld used by GCC])
310  ac_prog=`($CC -print-prog-name=ld) 2>&5`
311  case "$ac_prog" in
312    # Accept absolute paths.
313changequote(,)dnl
314    [\\/]* | [A-Za-z]:[\\/]*)
315      re_direlt='/[^/][^/]*/\.\./'
316changequote([,])dnl
317      # Canonicalize the path of ld
318      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
319      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
320	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
321      done
322      test -z "$LD" && LD="$ac_prog"
323      ;;
324  "")
325    # If it fails, then pretend we aren't using GCC.
326    ac_prog=ld
327    ;;
328  *)
329    # If it is relative, then search for the first ld in PATH.
330    with_gnu_ld=unknown
331    ;;
332  esac
333elif test "$with_gnu_ld" = yes; then
334  AC_MSG_CHECKING([for GNU ld])
335else
336  AC_MSG_CHECKING([for non-GNU ld])
337fi
338AC_CACHE_VAL(ac_cv_path_LD,
339[if test -z "$LD"; then
340  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
341  for ac_dir in $PATH; do
342    test -z "$ac_dir" && ac_dir=.
343    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
344      ac_cv_path_LD="$ac_dir/$ac_prog"
345      # Check to see if the program is GNU ld.  I'd rather use --version,
346      # but apparently some GNU ld's only accept -v.
347      # Break only if it was the GNU/non-GNU ld that we prefer.
348      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
349	test "$with_gnu_ld" != no && break
350      else
351	test "$with_gnu_ld" != yes && break
352      fi
353    fi
354  done
355  IFS="$ac_save_ifs"
356else
357  ac_cv_path_LD="$LD" # Let the user override the test with a path.
358fi])
359LD="$ac_cv_path_LD"
360if test -n "$LD"; then
361  AC_MSG_RESULT($LD)
362else
363  AC_MSG_RESULT(no)
364fi
365test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
366AC_PROG_LD_GNU
367])
368
369AC_DEFUN(AC_PROG_LD_GNU,
370[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
371[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
372if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
373  ac_cv_prog_gnu_ld=yes
374else
375  ac_cv_prog_gnu_ld=no
376fi])
377])
378
379# AC_PROG_NM - find the path to a BSD-compatible name lister
380AC_DEFUN(AC_PROG_NM,
381[AC_MSG_CHECKING([for BSD-compatible nm])
382AC_CACHE_VAL(ac_cv_path_NM,
383[if test -n "$NM"; then
384  # Let the user override the test.
385  ac_cv_path_NM="$NM"
386else
387  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
388  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
389    test -z "$ac_dir" && ac_dir=.
390    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
391      # Check to see if the nm accepts a BSD-compat flag.
392      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
393      #   nm: unknown option "B" ignored
394      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
395	ac_cv_path_NM="$ac_dir/nm -B"
396	break
397      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
398	ac_cv_path_NM="$ac_dir/nm -p"
399	break
400      else
401	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
402	continue # so that we can try to find one that supports BSD flags
403      fi
404    fi
405  done
406  IFS="$ac_save_ifs"
407  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
408fi])
409NM="$ac_cv_path_NM"
410AC_MSG_RESULT([$NM])
411])
412
413# AC_CHECK_LIBM - check for math library
414AC_DEFUN(AC_CHECK_LIBM,
415[AC_REQUIRE([AC_CANONICAL_HOST])dnl
416LIBM=
417case "$lt_target" in
418*-*-beos* | *-*-cygwin*)
419  # These system don't have libm
420  ;;
421*-ncr-sysv4.3*)
422  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
423  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
424  ;;
425*)
426  AC_CHECK_LIB(m, main, LIBM="-lm")
427  ;;
428esac
429])
430
431# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
432# the libltdl convenience library and INCLTDL to the include flags for
433# the libltdl header and adds --enable-ltdl-convenience to the
434# configure arguments.  Note that LIBLTDL and INCLTDL are not
435# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
436# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
437# with '${top_builddir}/' and INCLTDL will be prefixed with
438# '${top_srcdir}/' (note the single quotes!).  If your package is not
439# flat and you're not using automake, define top_builddir and
440# top_srcdir appropriately in the Makefiles.
441AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
442  case "$enable_ltdl_convenience" in
443  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
444  "") enable_ltdl_convenience=yes
445      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
446  esac
447  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
448  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
449])
450
451# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
452# the libltdl installable library and INCLTDL to the include flags for
453# the libltdl header and adds --enable-ltdl-install to the configure
454# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
455# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
456# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
457# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
458# with '${top_srcdir}/' (note the single quotes!).  If your package is
459# not flat and you're not using automake, define top_builddir and
460# top_srcdir appropriately in the Makefiles.
461# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
462AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
463  AC_CHECK_LIB(ltdl, main,
464  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
465  [if test x"$enable_ltdl_install" = xno; then
466     AC_MSG_WARN([libltdl not installed, but installation disabled])
467   else
468     enable_ltdl_install=yes
469   fi
470  ])
471  if test x"$enable_ltdl_install" = x"yes"; then
472    ac_configure_args="$ac_configure_args --enable-ltdl-install"
473    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
474    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
475  else
476    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
477    LIBLTDL="-lltdl"
478    INCLTDL=
479  fi
480])
481
482dnl old names
483AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
484AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
485AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
486AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
487AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
488AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
489AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
490
491dnl This is just to silence aclocal about the macro not being used
492ifelse([AC_DISABLE_FAST_INSTALL])dnl
493
494# Do all the work for Automake.  This macro actually does too much --
495# some checks are only needed if your package does certain things.
496# But this isn't really a big deal.
497
498# serial 5
499
500# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
501# written in clear, in which case automake, when reading aclocal.m4,
502# will think it sees a *use*, and therefore will trigger all it's
503# C support machinery.  Also note that it means that autoscan, seeing
504# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
505
506
507# We require 2.13 because we rely on SHELL being computed by configure.
508AC_PREREQ([2.13])
509
510# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
511# -----------------------------------------------------------
512# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
513# The purpose of this macro is to provide the user with a means to
514# check macros which are provided without letting her know how the
515# information is coded.
516# If this macro is not defined by Autoconf, define it here.
517ifdef([AC_PROVIDE_IFELSE],
518      [],
519      [define([AC_PROVIDE_IFELSE],
520              [ifdef([AC_PROVIDE_$1],
521                     [$2], [$3])])])
522
523
524# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
525# ----------------------------------------------
526AC_DEFUN([AM_INIT_AUTOMAKE],
527[AC_REQUIRE([AC_PROG_INSTALL])dnl
528# test to see if srcdir already configured
529if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
530   test -f $srcdir/config.status; then
531  AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
532fi
533
534# Define the identity of the package.
535PACKAGE=$1
536AC_SUBST(PACKAGE)dnl
537VERSION=$2
538AC_SUBST(VERSION)dnl
539ifelse([$3],,
540[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
541AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
542
543# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
544# the ones we care about.
545ifdef([m4_pattern_allow],
546      [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
547
548# Autoconf 2.50 always computes EXEEXT.  However we need to be
549# compatible with 2.13, for now.  So we always define EXEEXT, but we
550# don't compute it.
551AC_SUBST(EXEEXT)
552# Similar for OBJEXT -- only we only use OBJEXT if the user actually
553# requests that it be used.  This is a bit dumb.
554: ${OBJEXT=o}
555AC_SUBST(OBJEXT)
556
557# Some tools Automake needs.
558AC_REQUIRE([AM_SANITY_CHECK])dnl
559AC_REQUIRE([AC_ARG_PROGRAM])dnl
560AM_MISSING_PROG(ACLOCAL, aclocal)
561AM_MISSING_PROG(AUTOCONF, autoconf)
562AM_MISSING_PROG(AUTOMAKE, automake)
563AM_MISSING_PROG(AUTOHEADER, autoheader)
564AM_MISSING_PROG(MAKEINFO, makeinfo)
565AM_MISSING_PROG(AMTAR, tar)
566AM_PROG_INSTALL_SH
567AM_PROG_INSTALL_STRIP
568# We need awk for the "check" target.  The system "awk" is bad on
569# some platforms.
570AC_REQUIRE([AC_PROG_AWK])dnl
571AC_REQUIRE([AC_PROG_MAKE_SET])dnl
572AC_REQUIRE([AM_DEP_TRACK])dnl
573AC_REQUIRE([AM_SET_DEPDIR])dnl
574AC_PROVIDE_IFELSE([AC_PROG_][CC],
575                  [_AM_DEPENDENCIES(CC)],
576                  [define([AC_PROG_][CC],
577                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
578AC_PROVIDE_IFELSE([AC_PROG_][CXX],
579                  [_AM_DEPENDENCIES(CXX)],
580                  [define([AC_PROG_][CXX],
581                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
582])
583
584#
585# Check to make sure that the build environment is sane.
586#
587
588# serial 3
589
590# AM_SANITY_CHECK
591# ---------------
592AC_DEFUN([AM_SANITY_CHECK],
593[AC_MSG_CHECKING([whether build environment is sane])
594# Just in case
595sleep 1
596echo timestamp > conftest.file
597# Do `set' in a subshell so we don't clobber the current shell's
598# arguments.  Must try -L first in case configure is actually a
599# symlink; some systems play weird games with the mod time of symlinks
600# (eg FreeBSD returns the mod time of the symlink's containing
601# directory).
602if (
603   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
604   if test "$[*]" = "X"; then
605      # -L didn't work.
606      set X `ls -t $srcdir/configure conftest.file`
607   fi
608   rm -f conftest.file
609   if test "$[*]" != "X $srcdir/configure conftest.file" \
610      && test "$[*]" != "X conftest.file $srcdir/configure"; then
611
612      # If neither matched, then we have a broken ls.  This can happen
613      # if, for instance, CONFIG_SHELL is bash and it inherits a
614      # broken ls alias from the environment.  This has actually
615      # happened.  Such a system could not be considered "sane".
616      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
617alias in your environment])
618   fi
619
620   test "$[2]" = conftest.file
621   )
622then
623   # Ok.
624   :
625else
626   AC_MSG_ERROR([newly created file is older than distributed files!
627Check your system clock])
628fi
629AC_MSG_RESULT(yes)])
630
631
632# serial 2
633
634# AM_MISSING_PROG(NAME, PROGRAM)
635# ------------------------------
636AC_DEFUN([AM_MISSING_PROG],
637[AC_REQUIRE([AM_MISSING_HAS_RUN])
638$1=${$1-"${am_missing_run}$2"}
639AC_SUBST($1)])
640
641
642# AM_MISSING_HAS_RUN
643# ------------------
644# Define MISSING if not defined so far and test if it supports --run.
645# If it does, set am_missing_run to use it, otherwise, to nothing.
646AC_DEFUN([AM_MISSING_HAS_RUN],
647[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
648test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
649# Use eval to expand $SHELL
650if eval "$MISSING --run true"; then
651  am_missing_run="$MISSING --run "
652else
653  am_missing_run=
654  am_backtick='`'
655  AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
656fi
657])
658
659# AM_AUX_DIR_EXPAND
660
661# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
662# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
663# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
664#
665# Of course, Automake must honor this variable whenever it calls a
666# tool from the auxiliary directory.  The problem is that $srcdir (and
667# therefore $ac_aux_dir as well) can be either absolute or relative,
668# depending on how configure is run.  This is pretty annoying, since
669# it makes $ac_aux_dir quite unusable in subdirectories: in the top
670# source directory, any form will work fine, but in subdirectories a
671# relative path needs to be adjusted first.
672#
673# $ac_aux_dir/missing
674#    fails when called from a subdirectory if $ac_aux_dir is relative
675# $top_srcdir/$ac_aux_dir/missing
676#    fails if $ac_aux_dir is absolute,
677#    fails when called from a subdirectory in a VPATH build with
678#          a relative $ac_aux_dir
679#
680# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
681# are both prefixed by $srcdir.  In an in-source build this is usually
682# harmless because $srcdir is `.', but things will broke when you
683# start a VPATH build or use an absolute $srcdir.
684#
685# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
686# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
687#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
688# and then we would define $MISSING as
689#   MISSING="\${SHELL} $am_aux_dir/missing"
690# This will work as long as MISSING is not called from configure, because
691# unfortunately $(top_srcdir) has no meaning in configure.
692# However there are other variables, like CC, which are often used in
693# configure, and could therefore not use this "fixed" $ac_aux_dir.
694#
695# Another solution, used here, is to always expand $ac_aux_dir to an
696# absolute PATH.  The drawback is that using absolute paths prevent a
697# configured tree to be moved without reconfiguration.
698
699AC_DEFUN([AM_AUX_DIR_EXPAND], [
700# expand $ac_aux_dir to an absolute path
701am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
702])
703
704# AM_PROG_INSTALL_SH
705# ------------------
706# Define $install_sh.
707AC_DEFUN([AM_PROG_INSTALL_SH],
708[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
709install_sh=${install_sh-"$am_aux_dir/install-sh"}
710AC_SUBST(install_sh)])
711
712# One issue with vendor `install' (even GNU) is that you can't
713# specify the program used to strip binaries.  This is especially
714# annoying in cross-compiling environments, where the build's strip
715# is unlikely to handle the host's binaries.
716# Fortunately install-sh will honor a STRIPPROG variable, so we
717# always use install-sh in `make install-strip', and initialize
718# STRIPPROG with the value of the STRIP variable (set by the user).
719AC_DEFUN([AM_PROG_INSTALL_STRIP],
720[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
721INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
722AC_SUBST([INSTALL_STRIP_PROGRAM])])
723
724# serial 4						-*- Autoconf -*-
725
726
727
728# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
729# written in clear, in which case automake, when reading aclocal.m4,
730# will think it sees a *use*, and therefore will trigger all it's
731# C support machinery.  Also note that it means that autoscan, seeing
732# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
733
734
735
736# _AM_DEPENDENCIES(NAME)
737# ---------------------
738# See how the compiler implements dependency checking.
739# NAME is "CC", "CXX" or "OBJC".
740# We try a few techniques and use that to set a single cache variable.
741#
742# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
743# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
744# dependency, and given that the user is not expected to run this macro,
745# just rely on AC_PROG_CC.
746AC_DEFUN([_AM_DEPENDENCIES],
747[AC_REQUIRE([AM_SET_DEPDIR])dnl
748AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
749AC_REQUIRE([AM_MAKE_INCLUDE])dnl
750AC_REQUIRE([AM_DEP_TRACK])dnl
751
752ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
753       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
754       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
755       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
756                   [depcc="$$1"   am_compiler_list=])
757
758AC_CACHE_CHECK([dependency style of $depcc],
759               [am_cv_$1_dependencies_compiler_type],
760[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
761  # We make a subdir and do the tests there.  Otherwise we can end up
762  # making bogus files that we don't know about and never remove.  For
763  # instance it was reported that on HP-UX the gcc test will end up
764  # making a dummy file named `D' -- because `-MD' means `put the output
765  # in D'.
766  mkdir conftest.dir
767  # Copy depcomp to subdir because otherwise we won't find it if we're
768  # using a relative directory.
769  cp "$am_depcomp" conftest.dir
770  cd conftest.dir
771
772  am_cv_$1_dependencies_compiler_type=none
773  if test "$am_compiler_list" = ""; then
774     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
775  fi
776  for depmode in $am_compiler_list; do
777    # We need to recreate these files for each test, as the compiler may
778    # overwrite some of them when testing with obscure command lines.
779    # This happens at least with the AIX C compiler.
780    echo '#include "conftest.h"' > conftest.c
781    echo 'int i;' > conftest.h
782    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
783
784    case $depmode in
785    nosideeffect)
786      # after this tag, mechanisms are not by side-effect, so they'll
787      # only be used when explicitly requested
788      if test "x$enable_dependency_tracking" = xyes; then
789	continue
790      else
791	break
792      fi
793      ;;
794    none) break ;;
795    esac
796    # We check with `-c' and `-o' for the sake of the "dashmstdout"
797    # mode.  It turns out that the SunPro C++ compiler does not properly
798    # handle `-M -o', and we need to detect this.
799    if depmode=$depmode \
800       source=conftest.c object=conftest.o \
801       depfile=conftest.Po tmpdepfile=conftest.TPo \
802       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
803       grep conftest.h conftest.Po > /dev/null 2>&1 &&
804       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
805      am_cv_$1_dependencies_compiler_type=$depmode
806      break
807    fi
808  done
809
810  cd ..
811  rm -rf conftest.dir
812else
813  am_cv_$1_dependencies_compiler_type=none
814fi
815])
816$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
817AC_SUBST([$1DEPMODE])
818])
819
820
821# AM_SET_DEPDIR
822# -------------
823# Choose a directory name for dependency files.
824# This macro is AC_REQUIREd in _AM_DEPENDENCIES
825AC_DEFUN([AM_SET_DEPDIR],
826[rm -f .deps 2>/dev/null
827mkdir .deps 2>/dev/null
828if test -d .deps; then
829  DEPDIR=.deps
830else
831  # MS-DOS does not allow filenames that begin with a dot.
832  DEPDIR=_deps
833fi
834rmdir .deps 2>/dev/null
835AC_SUBST(DEPDIR)
836])
837
838
839# AM_DEP_TRACK
840# ------------
841AC_DEFUN([AM_DEP_TRACK],
842[AC_ARG_ENABLE(dependency-tracking,
843[  --disable-dependency-tracking Speeds up one-time builds
844  --enable-dependency-tracking  Do not reject slow dependency extractors])
845if test "x$enable_dependency_tracking" != xno; then
846  am_depcomp="$ac_aux_dir/depcomp"
847  AMDEPBACKSLASH='\'
848fi
849AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
850pushdef([subst], defn([AC_SUBST]))
851subst(AMDEPBACKSLASH)
852popdef([subst])
853])
854
855# Generate code to set up dependency tracking.
856# This macro should only be invoked once -- use via AC_REQUIRE.
857# Usage:
858# AM_OUTPUT_DEPENDENCY_COMMANDS
859
860#
861# This code is only required when automatic dependency tracking
862# is enabled.  FIXME.  This creates each `.P' file that we will
863# need in order to bootstrap the dependency handling code.
864AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
865AC_OUTPUT_COMMANDS([
866test x"$AMDEP_TRUE" != x"" ||
867for mf in $CONFIG_FILES; do
868  case "$mf" in
869  Makefile) dirpart=.;;
870  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
871  *) continue;;
872  esac
873  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
874  # Extract the definition of DEP_FILES from the Makefile without
875  # running `make'.
876  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
877  test -z "$DEPDIR" && continue
878  # When using ansi2knr, U may be empty or an underscore; expand it
879  U=`sed -n -e '/^U = / s///p' < "$mf"`
880  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
881  # We invoke sed twice because it is the simplest approach to
882  # changing $(DEPDIR) to its actual value in the expansion.
883  for file in `sed -n -e '
884    /^DEP_FILES = .*\\\\$/ {
885      s/^DEP_FILES = //
886      :loop
887	s/\\\\$//
888	p
889	n
890	/\\\\$/ b loop
891      p
892    }
893    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
894       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
895    # Make sure the directory exists.
896    test -f "$dirpart/$file" && continue
897    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
898    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
899    # echo "creating $dirpart/$file"
900    echo '# dummy' > "$dirpart/$file"
901  done
902done
903], [AMDEP_TRUE="$AMDEP_TRUE"
904ac_aux_dir="$ac_aux_dir"])])
905
906# AM_MAKE_INCLUDE()
907# -----------------
908# Check to see how make treats includes.
909AC_DEFUN([AM_MAKE_INCLUDE],
910[am_make=${MAKE-make}
911cat > confinc << 'END'
912doit:
913	@echo done
914END
915# If we don't find an include directive, just comment out the code.
916AC_MSG_CHECKING([for style of include used by $am_make])
917am__include='#'
918am__quote=
919_am_result=none
920# First try GNU make style include.
921echo "include confinc" > confmf
922# We grep out `Entering directory' and `Leaving directory'
923# messages which can occur if `w' ends up in MAKEFLAGS.
924# In particular we don't look at `^make:' because GNU make might
925# be invoked under some other name (usually "gmake"), in which
926# case it prints its new name instead of `make'.
927if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
928   am__include=include
929   am__quote=
930   _am_result=GNU
931fi
932# Now try BSD make style include.
933if test "$am__include" = "#"; then
934   echo '.include "confinc"' > confmf
935   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
936      am__include=.include
937      am__quote='"'
938      _am_result=BSD
939   fi
940fi
941AC_SUBST(am__include)
942AC_SUBST(am__quote)
943AC_MSG_RESULT($_am_result)
944rm -f confinc confmf
945])
946
947# serial 3
948
949# AM_CONDITIONAL(NAME, SHELL-CONDITION)
950# -------------------------------------
951# Define a conditional.
952#
953# FIXME: Once using 2.50, use this:
954# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
955AC_DEFUN([AM_CONDITIONAL],
956[ifelse([$1], [TRUE],
957        [errprint(__file__:__line__: [$0: invalid condition: $1
958])dnl
959m4exit(1)])dnl
960ifelse([$1], [FALSE],
961       [errprint(__file__:__line__: [$0: invalid condition: $1
962])dnl
963m4exit(1)])dnl
964AC_SUBST([$1_TRUE])
965AC_SUBST([$1_FALSE])
966if $2; then
967  $1_TRUE=
968  $1_FALSE='#'
969else
970  $1_TRUE='#'
971  $1_FALSE=
972fi])
973
974