Reworked rrd_graph_script()
[rrdtool.git] / config / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 # Do all the work for Automake.  This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
16
17 # serial 1
18
19 dnl Usage:
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
21
22 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AC_PROG_INSTALL])
24 PACKAGE=[$1]
25 AC_SUBST(PACKAGE)
26 VERSION=[$2]
27 AC_SUBST(VERSION)
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
31 fi
32 ifelse([$3],,
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
45
46 #
47 # Check to make sure that the build environment is sane.
48 #
49
50 AC_DEFUN(AM_SANITY_CHECK,
51 [AC_MSG_CHECKING([whether build environment is sane])
52 # Just in case
53 sleep 1
54 echo timestamp > conftestfile
55 # Do `set' in a subshell so we don't clobber the current shell's
56 # arguments.  Must try -L first in case configure is actually a
57 # symlink; some systems play weird games with the mod time of symlinks
58 # (eg FreeBSD returns the mod time of the symlink's containing
59 # directory).
60 if (
61    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62    if test "[$]*" = "X"; then
63       # -L didn't work.
64       set X `ls -t $srcdir/configure conftestfile`
65    fi
66    if test "[$]*" != "X $srcdir/configure conftestfile" \
67       && test "[$]*" != "X conftestfile $srcdir/configure"; then
68
69       # If neither matched, then we have a broken ls.  This can happen
70       # if, for instance, CONFIG_SHELL is bash and it inherits a
71       # broken ls alias from the environment.  This has actually
72       # happened.  Such a system could not be considered "sane".
73       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
74 alias in your environment])
75    fi
76
77    test "[$]2" = conftestfile
78    )
79 then
80    # Ok.
81    :
82 else
83    AC_MSG_ERROR([newly created file is older than distributed files!
84 Check your system clock])
85 fi
86 rm -f conftest*
87 AC_MSG_RESULT(yes)])
88
89 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90 dnl The program must properly implement --version.
91 AC_DEFUN(AM_MISSING_PROG,
92 [AC_MSG_CHECKING(for working $2)
93 # Run test in a subshell; some versions of sh will print an error if
94 # an executable is not found, even if stderr is redirected.
95 # Redirect stdin to placate older versions of autoconf.  Sigh.
96 if ($2 --version) < /dev/null > /dev/null 2>&1; then
97    $1=$2
98    AC_MSG_RESULT(found)
99 else
100    $1="$3/missing $2"
101    AC_MSG_RESULT(missing)
102 fi
103 AC_SUBST($1)])
104
105 # Like AC_CONFIG_HEADER, but automatically create stamp file.
106
107 AC_DEFUN(AM_CONFIG_HEADER,
108 [AC_PREREQ([2.12])
109 AC_CONFIG_HEADER([$1])
110 dnl When config.status generates a header, we must update the stamp-h file.
111 dnl This file resides in the same directory as the config header
112 dnl that is generated.  We must strip everything past the first ":",
113 dnl and everything past the last "/".
114 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
117 <<am_indx=1
118 for am_file in <<$1>>; do
119   case " <<$>>CONFIG_HEADERS " in
120   *" <<$>>am_file "*<<)>>
121     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
122     ;;
123   esac
124   am_indx=`expr "<<$>>am_indx" + 1`
125 done<<>>dnl>>)
126 changequote([,]))])
127
128 # Define a conditional.
129
130 AC_DEFUN(AM_CONDITIONAL,
131 [AC_SUBST($1_TRUE)
132 AC_SUBST($1_FALSE)
133 if $2; then
134   $1_TRUE=
135   $1_FALSE='#'
136 else
137   $1_TRUE='#'
138   $1_FALSE=
139 fi])
140
141
142 # serial 40 AC_PROG_LIBTOOL
143 AC_DEFUN(AC_PROG_LIBTOOL,
144 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
145
146 # Save cache, so that ltconfig can load it
147 AC_CACHE_SAVE
148
149 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
150 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
151 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
152 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
153 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
154 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
155 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
156 || AC_MSG_ERROR([libtool configure failed])
157
158 # Reload cache, that may have been modified by ltconfig
159 AC_CACHE_LOAD
160
161 # This can be used to rebuild libtool when needed
162 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
163
164 # Always use our own libtool.
165 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
166 AC_SUBST(LIBTOOL)dnl
167
168 # Redirect the config.log output again, so that the ltconfig log is not
169 # clobbered by the next message.
170 exec 5>>./config.log
171 ])
172
173 AC_DEFUN(AC_LIBTOOL_SETUP,
174 [AC_PREREQ(2.13)dnl
175 AC_REQUIRE([AC_ENABLE_SHARED])dnl
176 AC_REQUIRE([AC_ENABLE_STATIC])dnl
177 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
178 AC_REQUIRE([AC_CANONICAL_HOST])dnl
179 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
180 AC_REQUIRE([AC_PROG_RANLIB])dnl
181 AC_REQUIRE([AC_PROG_CC])dnl
182 AC_REQUIRE([AC_PROG_LD])dnl
183 AC_REQUIRE([AC_PROG_NM])dnl
184 AC_REQUIRE([AC_PROG_LN_S])dnl
185 dnl
186
187 case "$target" in
188 NONE) lt_target="$host" ;;
189 *) lt_target="$target" ;;
190 esac
191
192 # Check for any special flags to pass to ltconfig.
193 libtool_flags="--cache-file=$cache_file"
194 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
195 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
196 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
197 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
198 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
199 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
200 [libtool_flags="$libtool_flags --enable-dlopen"])
201 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
202 [libtool_flags="$libtool_flags --enable-win32-dll"])
203 AC_ARG_ENABLE(libtool-lock,
204   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
205 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
206 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
207
208 # Some flags need to be propagated to the compiler or linker for good
209 # libtool support.
210 case "$lt_target" in
211 *-*-irix6*)
212   # Find out which ABI we are using.
213   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
214   if AC_TRY_EVAL(ac_compile); then
215     case "`/usr/bin/file conftest.o`" in
216     *32-bit*)
217       LD="${LD-ld} -32"
218       ;;
219     *N32*)
220       LD="${LD-ld} -n32"
221       ;;
222     *64-bit*)
223       LD="${LD-ld} -64"
224       ;;
225     esac
226   fi
227   rm -rf conftest*
228   ;;
229
230 *-*-sco3.2v5*)
231   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
232   SAVE_CFLAGS="$CFLAGS"
233   CFLAGS="$CFLAGS -belf"
234   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
235     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
236   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
237     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
238     CFLAGS="$SAVE_CFLAGS"
239   fi
240   ;;
241
242 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
243 [*-*-cygwin* | *-*-mingw*)
244   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
245   AC_CHECK_TOOL(AS, as, false)
246   AC_CHECK_TOOL(OBJDUMP, objdump, false)
247   ;;
248 ])
249 esac
250 ])
251
252 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
253 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
254
255 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
256 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
257
258 # AC_ENABLE_SHARED - implement the --enable-shared flag
259 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
260 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
261 #   `yes'.
262 AC_DEFUN(AC_ENABLE_SHARED, [dnl
263 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
264 AC_ARG_ENABLE(shared,
265 changequote(<<, >>)dnl
266 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
267 changequote([, ])dnl
268 [p=${PACKAGE-default}
269 case "$enableval" in
270 yes) enable_shared=yes ;;
271 no) enable_shared=no ;;
272 *)
273   enable_shared=no
274   # Look at the argument we got.  We use all the common list separators.
275   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
276   for pkg in $enableval; do
277     if test "X$pkg" = "X$p"; then
278       enable_shared=yes
279     fi
280   done
281   IFS="$ac_save_ifs"
282   ;;
283 esac],
284 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
285 ])
286
287 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
288 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
289 AC_ENABLE_SHARED(no)])
290
291 # AC_ENABLE_STATIC - implement the --enable-static flag
292 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
293 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
294 #   `yes'.
295 AC_DEFUN(AC_ENABLE_STATIC, [dnl
296 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
297 AC_ARG_ENABLE(static,
298 changequote(<<, >>)dnl
299 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
300 changequote([, ])dnl
301 [p=${PACKAGE-default}
302 case "$enableval" in
303 yes) enable_static=yes ;;
304 no) enable_static=no ;;
305 *)
306   enable_static=no
307   # Look at the argument we got.  We use all the common list separators.
308   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
309   for pkg in $enableval; do
310     if test "X$pkg" = "X$p"; then
311       enable_static=yes
312     fi
313   done
314   IFS="$ac_save_ifs"
315   ;;
316 esac],
317 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
318 ])
319
320 # AC_DISABLE_STATIC - set the default static flag to --disable-static
321 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
322 AC_ENABLE_STATIC(no)])
323
324
325 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
326 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
327 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
328 #   `yes'.
329 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
330 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
331 AC_ARG_ENABLE(fast-install,
332 changequote(<<, >>)dnl
333 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
334 changequote([, ])dnl
335 [p=${PACKAGE-default}
336 case "$enableval" in
337 yes) enable_fast_install=yes ;;
338 no) enable_fast_install=no ;;
339 *)
340   enable_fast_install=no
341   # Look at the argument we got.  We use all the common list separators.
342   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
343   for pkg in $enableval; do
344     if test "X$pkg" = "X$p"; then
345       enable_fast_install=yes
346     fi
347   done
348   IFS="$ac_save_ifs"
349   ;;
350 esac],
351 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
352 ])
353
354 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
355 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
356 AC_ENABLE_FAST_INSTALL(no)])
357
358 # AC_PROG_LD - find the path to the GNU or non-GNU linker
359 AC_DEFUN(AC_PROG_LD,
360 [AC_ARG_WITH(gnu-ld,
361 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
362 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
363 AC_REQUIRE([AC_PROG_CC])dnl
364 AC_REQUIRE([AC_CANONICAL_HOST])dnl
365 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
366 ac_prog=ld
367 if test "$ac_cv_prog_gcc" = yes; then
368   # Check if gcc -print-prog-name=ld gives a path.
369   AC_MSG_CHECKING([for ld used by GCC])
370   ac_prog=`($CC -print-prog-name=ld) 2>&5`
371   case "$ac_prog" in
372     # Accept absolute paths.
373 changequote(,)dnl
374     [\\/]* | [A-Za-z]:[\\/]*)
375       re_direlt='/[^/][^/]*/\.\./'
376 changequote([,])dnl
377       # Canonicalize the path of ld
378       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
379       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
380         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
381       done
382       test -z "$LD" && LD="$ac_prog"
383       ;;
384   "")
385     # If it fails, then pretend we aren't using GCC.
386     ac_prog=ld
387     ;;
388   *)
389     # If it is relative, then search for the first ld in PATH.
390     with_gnu_ld=unknown
391     ;;
392   esac
393 elif test "$with_gnu_ld" = yes; then
394   AC_MSG_CHECKING([for GNU ld])
395 else
396   AC_MSG_CHECKING([for non-GNU ld])
397 fi
398 AC_CACHE_VAL(ac_cv_path_LD,
399 [if test -z "$LD"; then
400   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
401   for ac_dir in $PATH; do
402     test -z "$ac_dir" && ac_dir=.
403     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
404       ac_cv_path_LD="$ac_dir/$ac_prog"
405       # Check to see if the program is GNU ld.  I'd rather use --version,
406       # but apparently some GNU ld's only accept -v.
407       # Break only if it was the GNU/non-GNU ld that we prefer.
408       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
409         test "$with_gnu_ld" != no && break
410       else
411         test "$with_gnu_ld" != yes && break
412       fi
413     fi
414   done
415   IFS="$ac_save_ifs"
416 else
417   ac_cv_path_LD="$LD" # Let the user override the test with a path.
418 fi])
419 LD="$ac_cv_path_LD"
420 if test -n "$LD"; then
421   AC_MSG_RESULT($LD)
422 else
423   AC_MSG_RESULT(no)
424 fi
425 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
426 AC_PROG_LD_GNU
427 ])
428
429 AC_DEFUN(AC_PROG_LD_GNU,
430 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
431 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
432 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
433   ac_cv_prog_gnu_ld=yes
434 else
435   ac_cv_prog_gnu_ld=no
436 fi])
437 ])
438
439 # AC_PROG_NM - find the path to a BSD-compatible name lister
440 AC_DEFUN(AC_PROG_NM,
441 [AC_MSG_CHECKING([for BSD-compatible nm])
442 AC_CACHE_VAL(ac_cv_path_NM,
443 [if test -n "$NM"; then
444   # Let the user override the test.
445   ac_cv_path_NM="$NM"
446 else
447   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
448   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
449     test -z "$ac_dir" && ac_dir=.
450     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
451       # Check to see if the nm accepts a BSD-compat flag.
452       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
453       #   nm: unknown option "B" ignored
454       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
455         ac_cv_path_NM="$ac_dir/nm -B"
456         break
457       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
458         ac_cv_path_NM="$ac_dir/nm -p"
459         break
460       else
461         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
462         continue # so that we can try to find one that supports BSD flags
463       fi
464     fi
465   done
466   IFS="$ac_save_ifs"
467   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
468 fi])
469 NM="$ac_cv_path_NM"
470 AC_MSG_RESULT([$NM])
471 ])
472
473 # AC_CHECK_LIBM - check for math library
474 AC_DEFUN(AC_CHECK_LIBM,
475 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
476 LIBM=
477 case "$lt_target" in
478 *-*-beos* | *-*-cygwin*)
479   # These system don't have libm
480   ;;
481 *-ncr-sysv4.3*)
482   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
483   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
484   ;;
485 *)
486   AC_CHECK_LIB(m, main, LIBM="-lm")
487   ;;
488 esac
489 ])
490
491 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
492 # the libltdl convenience library, adds --enable-ltdl-convenience to
493 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
494 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
495 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
496 # '${top_builddir}/' (note the single quotes!) if your package is not
497 # flat, and, if you're not using automake, define top_builddir as
498 # appropriate in the Makefiles.
499 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
500   case "$enable_ltdl_convenience" in
501   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
502   "") enable_ltdl_convenience=yes
503       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
504   esac
505   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
506   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
507 ])
508
509 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
510 # the libltdl installable library, and adds --enable-ltdl-install to
511 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
512 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
513 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
514 # '${top_builddir}/' (note the single quotes!) if your package is not
515 # flat, and, if you're not using automake, define top_builddir as
516 # appropriate in the Makefiles.
517 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
518 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
519   AC_CHECK_LIB(ltdl, main,
520   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
521   [if test x"$enable_ltdl_install" = xno; then
522      AC_MSG_WARN([libltdl not installed, but installation disabled])
523    else
524      enable_ltdl_install=yes
525    fi
526   ])
527   if test x"$enable_ltdl_install" = x"yes"; then
528     ac_configure_args="$ac_configure_args --enable-ltdl-install"
529     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
530     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
531   else
532     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
533     LIBLTDL="-lltdl"
534     INCLTDL=
535   fi
536 ])
537
538 dnl old names
539 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
540 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
541 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
542 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
543 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
544 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
545 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
546
547 dnl This is just to silence aclocal about the macro not being used
548 ifelse([AC_DISABLE_FAST_INSTALL])dnl
549