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