2150 lines
76 KiB
Plaintext
2150 lines
76 KiB
Plaintext
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
|
|
|
|
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
|
dnl This file is free software; the Free Software Foundation
|
|
dnl gives unlimited permission to copy and/or distribute it,
|
|
dnl with or without modifications, as long as this notice is preserved.
|
|
|
|
dnl This program is distributed in the hope that it will be useful,
|
|
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
dnl PARTICULAR PURPOSE.
|
|
|
|
dnl @synopsis AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R
|
|
dnl
|
|
dnl Provides a test to determine the correct
|
|
dnl way to call gethostbyname_r:
|
|
dnl
|
|
dnl - defines HAVE_FUNC_GETHOSTBYNAME_R_6 if it needs 6 arguments (e.g linux)
|
|
dnl - defines HAVE_FUNC_GETHOSTBYNAME_R_5 if it needs 5 arguments (e.g. solaris)
|
|
dnl - defines HAVE_FUNC_GETHOSTBYNAME_R_3 if it needs 3 arguments (e.g. osf/1)
|
|
dnl
|
|
dnl If used in conjunction in gethostname.c the api demonstrated
|
|
dnl in test.c can be used regardless of which gethostbyname_r
|
|
dnl exists. These example files found at
|
|
dnl <http://www.csn.ul.ie/~caolan/publink/gethostbyname_r>.
|
|
dnl
|
|
dnl Based on David Arnold's autoconf suggestion in the threads faq.
|
|
dnl
|
|
dnl @author Caolan McNamara <caolan@skynet.ie>
|
|
dnl
|
|
AC_DEFUN(AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R,
|
|
[AC_CACHE_CHECK(for which type of gethostbyname_r, ac_cv_func_which_gethostname_r, [
|
|
AC_CHECK_FUNC(gethostbyname_r, [
|
|
AC_TRY_COMPILE([
|
|
# include <netdb.h>
|
|
], [
|
|
|
|
char *name;
|
|
struct hostent *he;
|
|
struct hostent_data data;
|
|
(void) gethostbyname_r(name, he, &data);
|
|
|
|
],ac_cv_func_which_gethostname_r=three,
|
|
[
|
|
dnl ac_cv_func_which_gethostname_r=no
|
|
AC_TRY_COMPILE([
|
|
# include <netdb.h>
|
|
], [
|
|
char *name;
|
|
struct hostent *he, *res;
|
|
char buffer[2048];
|
|
int buflen = 2048;
|
|
int h_errnop;
|
|
(void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
|
|
],ac_cv_func_which_gethostname_r=six,
|
|
|
|
[
|
|
dnl ac_cv_func_which_gethostname_r=no
|
|
AC_TRY_COMPILE([
|
|
# include <netdb.h>
|
|
], [
|
|
char *name;
|
|
struct hostent *he;
|
|
char buffer[2048];
|
|
int buflen = 2048;
|
|
int h_errnop;
|
|
(void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
|
|
],ac_cv_func_which_gethostname_r=five,ac_cv_func_which_gethostname_r=no)
|
|
|
|
]
|
|
|
|
)
|
|
]
|
|
)]
|
|
,ac_cv_func_which_gethostname_r=no)])
|
|
|
|
if test $ac_cv_func_which_gethostname_r = six; then
|
|
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_6)
|
|
elif test $ac_cv_func_which_gethostname_r = five; then
|
|
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_5)
|
|
elif test $ac_cv_func_which_gethostname_r = three; then
|
|
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_3)
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
dnl @synopsis TYPE_SOCKLEN_T
|
|
dnl
|
|
dnl Check whether sys/socket.h defines type socklen_t. Please note
|
|
dnl that some systems require sys/types.h to be included before
|
|
dnl sys/socket.h can be compiled.
|
|
dnl
|
|
dnl @author Lars Brinkhoff <lars@nocrew.org>
|
|
dnl
|
|
AC_DEFUN([TYPE_SOCKLEN_T],
|
|
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
|
|
[
|
|
AC_TRY_COMPILE(
|
|
[#include <sys/types.h>
|
|
#include <sys/socket.h>],
|
|
[socklen_t len = 42; return 0;],
|
|
ac_cv_type_socklen_t=yes,
|
|
ac_cv_type_socklen_t=no)
|
|
])
|
|
if test $ac_cv_type_socklen_t != yes; then
|
|
AC_DEFINE(socklen_t, int)
|
|
fi
|
|
])
|
|
|
|
#serial AM1
|
|
|
|
dnl From Bruno Haible.
|
|
|
|
AC_DEFUN([AM_LANGINFO_CODESET],
|
|
[
|
|
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
|
|
[AC_TRY_LINK([#include <langinfo.h>],
|
|
[char* cs = nl_langinfo(CODESET);],
|
|
am_cv_langinfo_codeset=yes,
|
|
am_cv_langinfo_codeset=no)
|
|
])
|
|
if test $am_cv_langinfo_codeset = yes; then
|
|
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
|
|
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
|
|
fi
|
|
])
|
|
# Macro to add for using GNU gettext.
|
|
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
|
#
|
|
# This file can be copied and used freely without restrictions. It can
|
|
# be used in projects which are not available under the GNU General Public
|
|
# License but which still want to provide support for the GNU gettext
|
|
# functionality.
|
|
# Please note that the actual code of GNU gettext is covered by the GNU
|
|
# General Public License and is *not* in the public domain.
|
|
|
|
# serial 10
|
|
|
|
dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
|
|
dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
|
|
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
|
|
dnl depending on --{enable,disable}-{shared,static} and on the presence of
|
|
dnl AM-DISABLE-SHARED). Otherwise, a static library
|
|
dnl $(top_builddir)/intl/libintl.a will be created.
|
|
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
|
|
dnl implementations (in libc or libintl) without the ngettext() function
|
|
dnl will be ignored.
|
|
dnl LIBDIR is used to find the intl libraries. If empty,
|
|
dnl the value `$(top_builddir)/intl/' is used.
|
|
dnl
|
|
dnl The result of the configuration is one of three cases:
|
|
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
|
|
dnl and used.
|
|
dnl Catalog format: GNU --> install in $(datadir)
|
|
dnl Catalog extension: .mo after installation, .gmo in source tree
|
|
dnl 2) GNU gettext has been found in the system's C library.
|
|
dnl Catalog format: GNU --> install in $(datadir)
|
|
dnl Catalog extension: .mo after installation, .gmo in source tree
|
|
dnl 3) No internationalization, always use English msgid.
|
|
dnl Catalog format: none
|
|
dnl Catalog extension: none
|
|
dnl The use of .gmo is historical (it was needed to avoid overwriting the
|
|
dnl GNU format catalogs when building on a platform with an X/Open gettext),
|
|
dnl but we keep it in order not to force irrelevant filename changes on the
|
|
dnl maintainers.
|
|
dnl
|
|
AC_DEFUN([AM_WITH_NLS],
|
|
[AC_MSG_CHECKING([whether NLS is requested])
|
|
dnl Default is enabled NLS
|
|
AC_ARG_ENABLE(nls,
|
|
[ --disable-nls do not use Native Language Support],
|
|
USE_NLS=$enableval, USE_NLS=yes)
|
|
AC_MSG_RESULT($USE_NLS)
|
|
AC_SUBST(USE_NLS)
|
|
|
|
BUILD_INCLUDED_LIBINTL=no
|
|
USE_INCLUDED_LIBINTL=no
|
|
INTLLIBS=
|
|
|
|
dnl If we use NLS figure out what method
|
|
if test "$USE_NLS" = "yes"; then
|
|
AC_DEFINE(ENABLE_NLS, 1,
|
|
[Define to 1 if translation of program messages to the user's native language
|
|
is requested.])
|
|
AC_MSG_CHECKING([whether included gettext is requested])
|
|
AC_ARG_WITH(included-gettext,
|
|
[ --with-included-gettext use the GNU gettext library included here],
|
|
nls_cv_force_use_gnu_gettext=$withval,
|
|
nls_cv_force_use_gnu_gettext=no)
|
|
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
|
|
|
|
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
|
|
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
|
|
dnl User does not insist on using GNU NLS library. Figure out what
|
|
dnl to use. If GNU gettext is available we use this. Else we have
|
|
dnl to fall back to GNU NLS library.
|
|
CATOBJEXT=NONE
|
|
|
|
dnl Add a version number to the cache macros.
|
|
define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
|
|
define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
|
|
|
|
AC_CHECK_HEADER(libintl.h,
|
|
[AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
|
|
[AC_TRY_LINK([#include <libintl.h>
|
|
extern int _nl_msg_cat_cntr;],
|
|
[bindtextdomain ("", "");
|
|
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
|
|
gt_cv_func_gnugettext_libc=yes,
|
|
gt_cv_func_gnugettext_libc=no)])
|
|
|
|
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
|
|
AC_CACHE_CHECK([for GNU gettext in libintl],
|
|
gt_cv_func_gnugettext_libintl,
|
|
[gt_save_LIBS="$LIBS"
|
|
LIBS="$LIBS -lintl $LIBICONV"
|
|
AC_TRY_LINK([#include <libintl.h>
|
|
extern int _nl_msg_cat_cntr;],
|
|
[bindtextdomain ("", "");
|
|
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
|
|
gt_cv_func_gnugettext_libintl=yes,
|
|
gt_cv_func_gnugettext_libintl=no)
|
|
LIBS="$gt_save_LIBS"])
|
|
fi
|
|
|
|
dnl If an already present or preinstalled GNU gettext() is found,
|
|
dnl use it. But if this macro is used in GNU gettext, and GNU
|
|
dnl gettext is already preinstalled in libintl, we update this
|
|
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
|
|
if test "$gt_cv_func_gnugettext_libc" = "yes" \
|
|
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \
|
|
&& test "$PACKAGE" != gettext; }; then
|
|
AC_DEFINE(HAVE_GETTEXT, 1,
|
|
[Define if the GNU gettext() function is already present or preinstalled.])
|
|
|
|
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
|
|
dnl If iconv() is in a separate libiconv library, then anyone
|
|
dnl linking with libintl{.a,.so} also needs to link with
|
|
dnl libiconv.
|
|
INTLLIBS="-lintl $LIBICONV"
|
|
fi
|
|
|
|
gt_save_LIBS="$LIBS"
|
|
LIBS="$LIBS $INTLLIBS"
|
|
AC_CHECK_FUNCS(dcgettext)
|
|
LIBS="$gt_save_LIBS"
|
|
|
|
dnl Search for GNU msgfmt in the PATH.
|
|
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
|
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
|
|
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
|
|
|
dnl Search for GNU xgettext in the PATH.
|
|
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
|
[$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
|
|
|
|
CATOBJEXT=.gmo
|
|
fi
|
|
])
|
|
|
|
if test "$CATOBJEXT" = "NONE"; then
|
|
dnl GNU gettext is not found in the C library.
|
|
dnl Fall back on GNU gettext library.
|
|
nls_cv_use_gnu_gettext=yes
|
|
fi
|
|
fi
|
|
|
|
if test "$nls_cv_use_gnu_gettext" = "yes"; then
|
|
dnl Mark actions used to generate GNU NLS library.
|
|
INTLOBJS="\$(GETTOBJS)"
|
|
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
|
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
|
|
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
|
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
|
[$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
|
|
AC_SUBST(MSGFMT)
|
|
BUILD_INCLUDED_LIBINTL=yes
|
|
USE_INCLUDED_LIBINTL=yes
|
|
CATOBJEXT=.gmo
|
|
INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
|
|
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
|
|
fi
|
|
|
|
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
|
|
dnl Test whether we really found GNU msgfmt.
|
|
if test "$GMSGFMT" != ":"; then
|
|
dnl If it is no GNU msgfmt we define it as : so that the
|
|
dnl Makefiles still can work.
|
|
if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
|
|
: ;
|
|
else
|
|
AC_MSG_RESULT(
|
|
[found msgfmt program is not GNU msgfmt; ignore it])
|
|
GMSGFMT=":"
|
|
fi
|
|
fi
|
|
|
|
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
|
|
dnl Test whether we really found GNU xgettext.
|
|
if test "$XGETTEXT" != ":"; then
|
|
dnl If it is no GNU xgettext we define it as : so that the
|
|
dnl Makefiles still can work.
|
|
if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
|
|
: ;
|
|
else
|
|
AC_MSG_RESULT(
|
|
[found xgettext program is not GNU xgettext; ignore it])
|
|
XGETTEXT=":"
|
|
fi
|
|
fi
|
|
|
|
dnl We need to process the po/ directory.
|
|
POSUB=po
|
|
fi
|
|
AC_OUTPUT_COMMANDS(
|
|
[for ac_file in $CONFIG_FILES; do
|
|
# Support "outfile[:infile[:infile...]]"
|
|
case "$ac_file" in
|
|
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
|
|
esac
|
|
# PO directories have a Makefile.in generated from Makefile.in.in.
|
|
case "$ac_file" in */Makefile.in)
|
|
# Adjust a relative srcdir.
|
|
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
|
|
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
|
|
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
|
|
# In autoconf-2.13 it is called $ac_given_srcdir.
|
|
# In autoconf-2.50 it is called $srcdir.
|
|
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
|
|
case "$ac_given_srcdir" in
|
|
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
|
|
/*) top_srcdir="$ac_given_srcdir" ;;
|
|
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
|
|
esac
|
|
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
|
|
rm -f "$ac_dir/POTFILES"
|
|
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
|
|
sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
|
|
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
|
|
sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
|
|
fi
|
|
;;
|
|
esac
|
|
done])
|
|
|
|
|
|
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
|
|
dnl to 'yes' because some of the testsuite requires it.
|
|
if test "$PACKAGE" = gettext; then
|
|
BUILD_INCLUDED_LIBINTL=yes
|
|
fi
|
|
|
|
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
|
|
dnl because plural.y uses bison specific features. It requires at least
|
|
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
|
|
dnl compile.
|
|
dnl bison is only needed for the maintainer (who touches plural.y). But in
|
|
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
|
|
dnl the rule in general Makefile. Now, some people carelessly touch the
|
|
dnl files or have a broken "make" program, hence the plural.c rule will
|
|
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
|
|
dnl present or too old.
|
|
AC_CHECK_PROGS([INTLBISON], [bison])
|
|
if test -z "$INTLBISON"; then
|
|
ac_verc_fail=yes
|
|
else
|
|
dnl Found it, now check the version.
|
|
AC_MSG_CHECKING([version of bison (only needed for developers)])
|
|
changequote(<<,>>)dnl
|
|
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
|
|
case $ac_prog_version in
|
|
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
|
|
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
|
|
changequote([,])dnl
|
|
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
|
|
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
|
|
esac
|
|
AC_MSG_RESULT([$ac_prog_version])
|
|
fi
|
|
if test $ac_verc_fail = yes; then
|
|
INTLBISON=:
|
|
fi
|
|
|
|
dnl These rules are solely for the distribution goal. While doing this
|
|
dnl we only have to keep exactly one list of the available catalogs
|
|
dnl in configure.in.
|
|
for lang in $ALL_LINGUAS; do
|
|
GMOFILES="$GMOFILES $lang.gmo"
|
|
POFILES="$POFILES $lang.po"
|
|
done
|
|
|
|
dnl Make all variables we use known to autoconf.
|
|
AC_SUBST(BUILD_INCLUDED_LIBINTL)
|
|
AC_SUBST(USE_INCLUDED_LIBINTL)
|
|
AC_SUBST(CATALOGS)
|
|
AC_SUBST(CATOBJEXT)
|
|
AC_SUBST(GMOFILES)
|
|
AC_SUBST(INTLLIBS)
|
|
AC_SUBST(INTLOBJS)
|
|
AC_SUBST(POFILES)
|
|
AC_SUBST(POSUB)
|
|
|
|
dnl For backward compatibility. Some configure.ins may be using this.
|
|
nls_cv_header_intl=
|
|
nls_cv_header_libgt=
|
|
|
|
dnl For backward compatibility. Some Makefiles may be using this.
|
|
DATADIRNAME=share
|
|
AC_SUBST(DATADIRNAME)
|
|
|
|
dnl For backward compatibility. Some Makefiles may be using this.
|
|
INSTOBJEXT=.mo
|
|
AC_SUBST(INSTOBJEXT)
|
|
|
|
dnl For backward compatibility. Some Makefiles may be using this.
|
|
GENCAT=gencat
|
|
AC_SUBST(GENCAT)
|
|
])
|
|
|
|
dnl Usage: Just like AM_WITH_NLS, which see.
|
|
AC_DEFUN([AM_GNU_GETTEXT],
|
|
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
|
AC_REQUIRE([AC_PROG_CC])dnl
|
|
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
|
AC_REQUIRE([AC_ISC_POSIX])dnl
|
|
AC_REQUIRE([AC_HEADER_STDC])dnl
|
|
AC_REQUIRE([AC_C_CONST])dnl
|
|
AC_REQUIRE([AC_C_INLINE])dnl
|
|
AC_REQUIRE([AC_TYPE_OFF_T])dnl
|
|
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
|
|
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
|
|
AC_REQUIRE([AC_FUNC_MMAP])dnl
|
|
AC_REQUIRE([jm_GLIBC21])dnl
|
|
|
|
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
|
|
stdlib.h string.h unistd.h sys/param.h])
|
|
AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
|
|
getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
|
|
strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
|
|
|
|
AM_ICONV
|
|
AM_LANGINFO_CODESET
|
|
AM_LC_MESSAGES
|
|
AM_WITH_NLS([$1],[$2],[$3])
|
|
|
|
if test "x$CATOBJEXT" != "x"; then
|
|
if test "x$ALL_LINGUAS" = "x"; then
|
|
LINGUAS=
|
|
else
|
|
AC_MSG_CHECKING(for catalogs to be installed)
|
|
NEW_LINGUAS=
|
|
for presentlang in $ALL_LINGUAS; do
|
|
useit=no
|
|
for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
|
|
# Use the presentlang catalog if desiredlang is
|
|
# a. equal to presentlang, or
|
|
# b. a variant of presentlang (because in this case,
|
|
# presentlang can be used as a fallback for messages
|
|
# which are not translated in the desiredlang catalog).
|
|
case "$desiredlang" in
|
|
"$presentlang"*) useit=yes;;
|
|
esac
|
|
done
|
|
if test $useit = yes; then
|
|
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
|
|
fi
|
|
done
|
|
LINGUAS=$NEW_LINGUAS
|
|
AC_MSG_RESULT($LINGUAS)
|
|
fi
|
|
|
|
dnl Construct list of names of catalog files to be constructed.
|
|
if test -n "$LINGUAS"; then
|
|
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
|
|
fi
|
|
fi
|
|
|
|
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
|
|
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
|
|
dnl Try to locate is.
|
|
MKINSTALLDIRS=
|
|
if test -n "$ac_aux_dir"; then
|
|
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
|
|
fi
|
|
if test -z "$MKINSTALLDIRS"; then
|
|
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
|
|
fi
|
|
AC_SUBST(MKINSTALLDIRS)
|
|
|
|
dnl Enable libtool support if the surrounding package wishes it.
|
|
INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
|
|
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
|
|
])
|
|
#serial 2
|
|
|
|
# Test for the GNU C Library, version 2.1 or newer.
|
|
# From Bruno Haible.
|
|
|
|
AC_DEFUN([jm_GLIBC21],
|
|
[
|
|
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
|
|
ac_cv_gnu_library_2_1,
|
|
[AC_EGREP_CPP([Lucky GNU user],
|
|
[
|
|
#include <features.h>
|
|
#ifdef __GNU_LIBRARY__
|
|
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
|
|
Lucky GNU user
|
|
#endif
|
|
#endif
|
|
],
|
|
ac_cv_gnu_library_2_1=yes,
|
|
ac_cv_gnu_library_2_1=no)
|
|
]
|
|
)
|
|
AC_SUBST(GLIBC21)
|
|
GLIBC21="$ac_cv_gnu_library_2_1"
|
|
]
|
|
)
|
|
#serial AM2
|
|
|
|
dnl From Bruno Haible.
|
|
|
|
AC_DEFUN([AM_ICONV],
|
|
[
|
|
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
|
|
dnl those with the standalone portable GNU libiconv installed).
|
|
|
|
AC_ARG_WITH([libiconv-prefix],
|
|
[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
|
|
for dir in `echo "$withval" | tr : ' '`; do
|
|
if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
|
|
if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
|
|
done
|
|
])
|
|
|
|
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
|
|
am_cv_func_iconv="no, consider installing GNU libiconv"
|
|
am_cv_lib_iconv=no
|
|
AC_TRY_LINK([#include <stdlib.h>
|
|
#include <iconv.h>],
|
|
[iconv_t cd = iconv_open("","");
|
|
iconv(cd,NULL,NULL,NULL,NULL);
|
|
iconv_close(cd);],
|
|
am_cv_func_iconv=yes)
|
|
if test "$am_cv_func_iconv" != yes; then
|
|
am_save_LIBS="$LIBS"
|
|
LIBS="$LIBS -liconv"
|
|
AC_TRY_LINK([#include <stdlib.h>
|
|
#include <iconv.h>],
|
|
[iconv_t cd = iconv_open("","");
|
|
iconv(cd,NULL,NULL,NULL,NULL);
|
|
iconv_close(cd);],
|
|
am_cv_lib_iconv=yes
|
|
am_cv_func_iconv=yes)
|
|
LIBS="$am_save_LIBS"
|
|
fi
|
|
])
|
|
if test "$am_cv_func_iconv" = yes; then
|
|
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
|
|
AC_MSG_CHECKING([for iconv declaration])
|
|
AC_CACHE_VAL(am_cv_proto_iconv, [
|
|
AC_TRY_COMPILE([
|
|
#include <stdlib.h>
|
|
#include <iconv.h>
|
|
extern
|
|
#ifdef __cplusplus
|
|
"C"
|
|
#endif
|
|
#if defined(__STDC__) || defined(__cplusplus)
|
|
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
|
|
#else
|
|
size_t iconv();
|
|
#endif
|
|
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
|
|
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
|
|
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
|
|
AC_MSG_RESULT([$]{ac_t:-
|
|
}[$]am_cv_proto_iconv)
|
|
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
|
|
[Define as const if the declaration of iconv() needs const.])
|
|
fi
|
|
LIBICONV=
|
|
if test "$am_cv_lib_iconv" = yes; then
|
|
LIBICONV="-liconv"
|
|
fi
|
|
AC_SUBST(LIBICONV)
|
|
])
|
|
#serial 1
|
|
# This test replaces the one in autoconf.
|
|
# Currently this macro should have the same name as the autoconf macro
|
|
# because gettext's gettext.m4 (distributed in the automake package)
|
|
# still uses it. Otherwise, the use in gettext.m4 makes autoheader
|
|
# give these diagnostics:
|
|
# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
|
|
# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
|
|
|
|
undefine([AC_ISC_POSIX])
|
|
|
|
AC_DEFUN([AC_ISC_POSIX],
|
|
[
|
|
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
|
|
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
|
|
]
|
|
)
|
|
# Check whether LC_MESSAGES is available in <locale.h>.
|
|
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
|
#
|
|
# This file can be copied and used freely without restrictions. It can
|
|
# be used in projects which are not available under the GNU General Public
|
|
# License but which still want to provide support for the GNU gettext
|
|
# functionality.
|
|
# Please note that the actual code of GNU gettext is covered by the GNU
|
|
# General Public License and is *not* in the public domain.
|
|
|
|
# serial 2
|
|
|
|
AC_DEFUN([AM_LC_MESSAGES],
|
|
[if test $ac_cv_header_locale_h = yes; then
|
|
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
|
|
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
|
|
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
|
|
if test $am_cv_val_LC_MESSAGES = yes; then
|
|
AC_DEFINE(HAVE_LC_MESSAGES, 1,
|
|
[Define if your <locale.h> file defines LC_MESSAGES.])
|
|
fi
|
|
fi])
|
|
# Search path for a program which passes the given test.
|
|
# Ulrich Drepper <drepper@cygnus.com>, 1996.
|
|
#
|
|
# This file can be copied and used freely without restrictions. It can
|
|
# be used in projects which are not available under the GNU General Public
|
|
# License but which still want to provide support for the GNU gettext
|
|
# functionality.
|
|
# Please note that the actual code of GNU gettext is covered by the GNU
|
|
# General Public License and is *not* in the public domain.
|
|
|
|
# serial 2
|
|
|
|
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
|
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
|
|
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
|
|
[# Extract the first word of "$2", so it can be a program name with args.
|
|
set dummy $2; ac_word=[$]2
|
|
AC_MSG_CHECKING([for $ac_word])
|
|
AC_CACHE_VAL(ac_cv_path_$1,
|
|
[case "[$]$1" in
|
|
/*)
|
|
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
|
|
;;
|
|
*)
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
|
for ac_dir in ifelse([$5], , $PATH, [$5]); do
|
|
test -z "$ac_dir" && ac_dir=.
|
|
if test -f $ac_dir/$ac_word; then
|
|
if [$3]; then
|
|
ac_cv_path_$1="$ac_dir/$ac_word"
|
|
break
|
|
fi
|
|
fi
|
|
done
|
|
IFS="$ac_save_ifs"
|
|
dnl If no 4th arg is given, leave the cache variable unset,
|
|
dnl so AC_PATH_PROGS will keep looking.
|
|
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
|
|
])dnl
|
|
;;
|
|
esac])dnl
|
|
$1="$ac_cv_path_$1"
|
|
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
|
|
AC_MSG_RESULT([$]$1)
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
fi
|
|
AC_SUBST($1)dnl
|
|
])
|
|
|
|
|
|
# serial 40 AC_PROG_LIBTOOL
|
|
AC_DEFUN(AC_PROG_LIBTOOL,
|
|
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
|
|
|
|
# Save cache, so that ltconfig can load it
|
|
AC_CACHE_SAVE
|
|
|
|
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
|
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
|
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
|
|
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
|
|
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
|
|
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
|
$libtool_flags $ac_aux_dir/ltmain.sh $lt_target \
|
|
|| AC_MSG_ERROR([libtool configure failed])
|
|
|
|
# Reload cache, that may have been modified by ltconfig
|
|
AC_CACHE_LOAD
|
|
|
|
# This can be used to rebuild libtool when needed
|
|
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
|
|
|
|
# Always use our own libtool.
|
|
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
|
AC_SUBST(LIBTOOL)dnl
|
|
|
|
# Redirect the config.log output again, so that the ltconfig log is not
|
|
# clobbered by the next message.
|
|
exec 5>>./config.log
|
|
])
|
|
|
|
AC_DEFUN(AC_LIBTOOL_SETUP,
|
|
[AC_PREREQ(2.13)dnl
|
|
AC_REQUIRE([AC_ENABLE_SHARED])dnl
|
|
AC_REQUIRE([AC_ENABLE_STATIC])dnl
|
|
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
|
|
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
|
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
|
AC_REQUIRE([AC_PROG_CC])dnl
|
|
AC_REQUIRE([AC_PROG_LD])dnl
|
|
AC_REQUIRE([AC_PROG_NM])dnl
|
|
AC_REQUIRE([AC_PROG_LN_S])dnl
|
|
dnl
|
|
|
|
case "$target" in
|
|
NONE) lt_target="$host" ;;
|
|
*) lt_target="$target" ;;
|
|
esac
|
|
|
|
# Check for any special flags to pass to ltconfig.
|
|
#
|
|
# the following will cause an existing older ltconfig to fail, so
|
|
# we ignore this at the expense of the cache file... Checking this
|
|
# will just take longer ... bummer!
|
|
#libtool_flags="--cache-file=$cache_file"
|
|
#
|
|
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
|
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
|
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
|
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
|
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
|
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
|
[libtool_flags="$libtool_flags --enable-dlopen"])
|
|
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
|
[libtool_flags="$libtool_flags --enable-win32-dll"])
|
|
AC_ARG_ENABLE(libtool-lock,
|
|
[ --disable-libtool-lock avoid locking (might break parallel builds)])
|
|
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
|
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
|
|
|
# Some flags need to be propagated to the compiler or linker for good
|
|
# libtool support.
|
|
case "$lt_target" in
|
|
*-*-irix6*)
|
|
# Find out which ABI we are using.
|
|
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
|
|
if AC_TRY_EVAL(ac_compile); then
|
|
case "`/usr/bin/file conftest.o`" in
|
|
*32-bit*)
|
|
LD="${LD-ld} -32"
|
|
;;
|
|
*N32*)
|
|
LD="${LD-ld} -n32"
|
|
;;
|
|
*64-bit*)
|
|
LD="${LD-ld} -64"
|
|
;;
|
|
esac
|
|
fi
|
|
rm -rf conftest*
|
|
;;
|
|
|
|
*-*-sco3.2v5*)
|
|
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
|
SAVE_CFLAGS="$CFLAGS"
|
|
CFLAGS="$CFLAGS -belf"
|
|
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
|
|
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
|
|
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
|
|
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
|
|
CFLAGS="$SAVE_CFLAGS"
|
|
fi
|
|
;;
|
|
|
|
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
|
[*-*-cygwin* | *-*-mingw*)
|
|
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
|
AC_CHECK_TOOL(AS, as, false)
|
|
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
|
;;
|
|
])
|
|
esac
|
|
])
|
|
|
|
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
|
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
|
|
|
|
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
|
|
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
|
|
|
|
# AC_ENABLE_SHARED - implement the --enable-shared flag
|
|
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
|
|
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
# `yes'.
|
|
AC_DEFUN(AC_ENABLE_SHARED, [dnl
|
|
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
AC_ARG_ENABLE(shared,
|
|
changequote(<<, >>)dnl
|
|
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
|
changequote([, ])dnl
|
|
[p=${PACKAGE-default}
|
|
case "$enableval" in
|
|
yes) enable_shared=yes ;;
|
|
no) enable_shared=no ;;
|
|
*)
|
|
enable_shared=no
|
|
# Look at the argument we got. We use all the common list separators.
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
for pkg in $enableval; do
|
|
if test "X$pkg" = "X$p"; then
|
|
enable_shared=yes
|
|
fi
|
|
done
|
|
IFS="$ac_save_ifs"
|
|
;;
|
|
esac],
|
|
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
|
|
])
|
|
|
|
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
|
|
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
AC_ENABLE_SHARED(no)])
|
|
|
|
# AC_ENABLE_STATIC - implement the --enable-static flag
|
|
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
|
|
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
# `yes'.
|
|
AC_DEFUN(AC_ENABLE_STATIC, [dnl
|
|
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
AC_ARG_ENABLE(static,
|
|
changequote(<<, >>)dnl
|
|
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
|
changequote([, ])dnl
|
|
[p=${PACKAGE-default}
|
|
case "$enableval" in
|
|
yes) enable_static=yes ;;
|
|
no) enable_static=no ;;
|
|
*)
|
|
enable_static=no
|
|
# Look at the argument we got. We use all the common list separators.
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
for pkg in $enableval; do
|
|
if test "X$pkg" = "X$p"; then
|
|
enable_static=yes
|
|
fi
|
|
done
|
|
IFS="$ac_save_ifs"
|
|
;;
|
|
esac],
|
|
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
|
|
])
|
|
|
|
# AC_DISABLE_STATIC - set the default static flag to --disable-static
|
|
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
AC_ENABLE_STATIC(no)])
|
|
|
|
|
|
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
|
|
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
|
|
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
# `yes'.
|
|
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
|
|
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
AC_ARG_ENABLE(fast-install,
|
|
changequote(<<, >>)dnl
|
|
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
|
changequote([, ])dnl
|
|
[p=${PACKAGE-default}
|
|
case "$enableval" in
|
|
yes) enable_fast_install=yes ;;
|
|
no) enable_fast_install=no ;;
|
|
*)
|
|
enable_fast_install=no
|
|
# Look at the argument we got. We use all the common list separators.
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
for pkg in $enableval; do
|
|
if test "X$pkg" = "X$p"; then
|
|
enable_fast_install=yes
|
|
fi
|
|
done
|
|
IFS="$ac_save_ifs"
|
|
;;
|
|
esac],
|
|
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
|
|
])
|
|
|
|
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
|
|
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
AC_ENABLE_FAST_INSTALL(no)])
|
|
|
|
# AC_PROG_LD - find the path to the GNU or non-GNU linker
|
|
AC_DEFUN(AC_PROG_LD,
|
|
[AC_ARG_WITH(gnu-ld,
|
|
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
|
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
|
AC_REQUIRE([AC_PROG_CC])dnl
|
|
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
|
ac_prog=ld
|
|
if test "$ac_cv_prog_gcc" = yes; then
|
|
# Check if gcc -print-prog-name=ld gives a path.
|
|
AC_MSG_CHECKING([for ld used by GCC])
|
|
ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
|
case "$ac_prog" in
|
|
# Accept absolute paths.
|
|
changequote(,)dnl
|
|
[\\/]* | [A-Za-z]:[\\/]*)
|
|
re_direlt='/[^/][^/]*/\.\./'
|
|
changequote([,])dnl
|
|
# Canonicalize the path of ld
|
|
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
|
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
|
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
|
done
|
|
test -z "$LD" && LD="$ac_prog"
|
|
;;
|
|
"")
|
|
# If it fails, then pretend we aren't using GCC.
|
|
ac_prog=ld
|
|
;;
|
|
*)
|
|
# If it is relative, then search for the first ld in PATH.
|
|
with_gnu_ld=unknown
|
|
;;
|
|
esac
|
|
elif test "$with_gnu_ld" = yes; then
|
|
AC_MSG_CHECKING([for GNU ld])
|
|
else
|
|
AC_MSG_CHECKING([for non-GNU ld])
|
|
fi
|
|
AC_CACHE_VAL(ac_cv_path_LD,
|
|
[if test -z "$LD"; then
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
|
for ac_dir in $PATH; do
|
|
test -z "$ac_dir" && ac_dir=.
|
|
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
|
ac_cv_path_LD="$ac_dir/$ac_prog"
|
|
# Check to see if the program is GNU ld. I'd rather use --version,
|
|
# but apparently some GNU ld's only accept -v.
|
|
# Break only if it was the GNU/non-GNU ld that we prefer.
|
|
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
|
test "$with_gnu_ld" != no && break
|
|
else
|
|
test "$with_gnu_ld" != yes && break
|
|
fi
|
|
fi
|
|
done
|
|
IFS="$ac_save_ifs"
|
|
else
|
|
ac_cv_path_LD="$LD" # Let the user override the test with a path.
|
|
fi])
|
|
LD="$ac_cv_path_LD"
|
|
if test -n "$LD"; then
|
|
AC_MSG_RESULT($LD)
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
fi
|
|
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
|
AC_PROG_LD_GNU
|
|
])
|
|
|
|
AC_DEFUN(AC_PROG_LD_GNU,
|
|
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
|
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
|
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
|
ac_cv_prog_gnu_ld=yes
|
|
else
|
|
ac_cv_prog_gnu_ld=no
|
|
fi])
|
|
])
|
|
|
|
# AC_PROG_NM - find the path to a BSD-compatible name lister
|
|
AC_DEFUN(AC_PROG_NM,
|
|
[AC_MSG_CHECKING([for BSD-compatible nm])
|
|
AC_CACHE_VAL(ac_cv_path_NM,
|
|
[if test -n "$NM"; then
|
|
# Let the user override the test.
|
|
ac_cv_path_NM="$NM"
|
|
else
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
|
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
|
|
test -z "$ac_dir" && ac_dir=.
|
|
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
|
|
# Check to see if the nm accepts a BSD-compat flag.
|
|
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
|
# nm: unknown option "B" ignored
|
|
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
|
ac_cv_path_NM="$ac_dir/nm -B"
|
|
break
|
|
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
|
ac_cv_path_NM="$ac_dir/nm -p"
|
|
break
|
|
else
|
|
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
|
|
continue # so that we can try to find one that supports BSD flags
|
|
fi
|
|
fi
|
|
done
|
|
IFS="$ac_save_ifs"
|
|
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
|
fi])
|
|
NM="$ac_cv_path_NM"
|
|
AC_MSG_RESULT([$NM])
|
|
])
|
|
|
|
# AC_CHECK_LIBM - check for math library
|
|
AC_DEFUN(AC_CHECK_LIBM,
|
|
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
LIBM=
|
|
case "$lt_target" in
|
|
*-*-beos* | *-*-cygwin*)
|
|
# These system don't have libm
|
|
;;
|
|
*-ncr-sysv4.3*)
|
|
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
|
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
|
|
;;
|
|
*)
|
|
AC_CHECK_LIB(m, main, LIBM="-lm")
|
|
;;
|
|
esac
|
|
])
|
|
|
|
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
|
# the libltdl convenience library and INCLTDL to the include flags for
|
|
# the libltdl header and adds --enable-ltdl-convenience to the
|
|
# configure arguments. Note that LIBLTDL and INCLTDL are not
|
|
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
|
|
# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
|
|
# with '${top_builddir}/' and INCLTDL will be prefixed with
|
|
# '${top_srcdir}/' (note the single quotes!). If your package is not
|
|
# flat and you're not using automake, define top_builddir and
|
|
# top_srcdir appropriately in the Makefiles.
|
|
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
case "$enable_ltdl_convenience" in
|
|
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
|
"") enable_ltdl_convenience=yes
|
|
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
|
esac
|
|
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
|
|
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
|
])
|
|
|
|
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
|
# the libltdl installable library and INCLTDL to the include flags for
|
|
# the libltdl header and adds --enable-ltdl-install to the configure
|
|
# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
|
|
# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
|
|
# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
|
|
# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
|
|
# with '${top_srcdir}/' (note the single quotes!). If your package is
|
|
# not flat and you're not using automake, define top_builddir and
|
|
# top_srcdir appropriately in the Makefiles.
|
|
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
|
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
AC_CHECK_LIB(ltdl, main,
|
|
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
|
[if test x"$enable_ltdl_install" = xno; then
|
|
AC_MSG_WARN([libltdl not installed, but installation disabled])
|
|
else
|
|
enable_ltdl_install=yes
|
|
fi
|
|
])
|
|
if test x"$enable_ltdl_install" = x"yes"; then
|
|
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
|
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
|
|
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
|
else
|
|
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
|
LIBLTDL="-lltdl"
|
|
INCLTDL=
|
|
fi
|
|
])
|
|
|
|
dnl old names
|
|
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
|
|
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
|
|
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
|
|
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
|
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
|
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
|
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
|
|
|
dnl This is just to silence aclocal about the macro not being used
|
|
ifelse([AC_DISABLE_FAST_INSTALL])dnl
|
|
|
|
# lib-prefix.m4 serial 4 (gettext-0.14.2)
|
|
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
|
|
dnl This file is free software; the Free Software Foundation
|
|
dnl gives unlimited permission to copy and/or distribute it,
|
|
dnl with or without modifications, as long as this notice is preserved.
|
|
|
|
dnl From Bruno Haible.
|
|
|
|
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
|
|
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
|
|
dnl require excessive bracketing.
|
|
ifdef([AC_HELP_STRING],
|
|
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
|
|
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
|
|
|
|
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
|
|
dnl to access previously installed libraries. The basic assumption is that
|
|
dnl a user will want packages to use other packages he previously installed
|
|
dnl with the same --prefix option.
|
|
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
|
|
dnl libraries, but is otherwise very convenient.
|
|
AC_DEFUN([AC_LIB_PREFIX],
|
|
[
|
|
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
|
|
AC_REQUIRE([AC_PROG_CC])
|
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
|
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
|
dnl By default, look in $includedir and $libdir.
|
|
use_additional=yes
|
|
AC_LIB_WITH_FINAL_PREFIX([
|
|
eval additional_includedir=\"$includedir\"
|
|
eval additional_libdir=\"$libdir\"
|
|
])
|
|
AC_LIB_ARG_WITH([lib-prefix],
|
|
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
|
|
--without-lib-prefix don't search for libraries in includedir and libdir],
|
|
[
|
|
if test "X$withval" = "Xno"; then
|
|
use_additional=no
|
|
else
|
|
if test "X$withval" = "X"; then
|
|
AC_LIB_WITH_FINAL_PREFIX([
|
|
eval additional_includedir=\"$includedir\"
|
|
eval additional_libdir=\"$libdir\"
|
|
])
|
|
else
|
|
additional_includedir="$withval/include"
|
|
additional_libdir="$withval/lib"
|
|
fi
|
|
fi
|
|
])
|
|
if test $use_additional = yes; then
|
|
dnl Potentially add $additional_includedir to $CPPFLAGS.
|
|
dnl But don't add it
|
|
dnl 1. if it's the standard /usr/include,
|
|
dnl 2. if it's already present in $CPPFLAGS,
|
|
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
|
|
dnl 4. if it doesn't exist as a directory.
|
|
if test "X$additional_includedir" != "X/usr/include"; then
|
|
haveit=
|
|
for x in $CPPFLAGS; do
|
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
if test "X$x" = "X-I$additional_includedir"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
if test "X$additional_includedir" = "X/usr/local/include"; then
|
|
if test -n "$GCC"; then
|
|
case $host_os in
|
|
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
|
esac
|
|
fi
|
|
fi
|
|
if test -z "$haveit"; then
|
|
if test -d "$additional_includedir"; then
|
|
dnl Really add $additional_includedir to $CPPFLAGS.
|
|
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
dnl Potentially add $additional_libdir to $LDFLAGS.
|
|
dnl But don't add it
|
|
dnl 1. if it's the standard /usr/lib,
|
|
dnl 2. if it's already present in $LDFLAGS,
|
|
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
|
|
dnl 4. if it doesn't exist as a directory.
|
|
if test "X$additional_libdir" != "X/usr/lib"; then
|
|
haveit=
|
|
for x in $LDFLAGS; do
|
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
if test "X$x" = "X-L$additional_libdir"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
if test "X$additional_libdir" = "X/usr/local/lib"; then
|
|
if test -n "$GCC"; then
|
|
case $host_os in
|
|
linux*) haveit=yes;;
|
|
esac
|
|
fi
|
|
fi
|
|
if test -z "$haveit"; then
|
|
if test -d "$additional_libdir"; then
|
|
dnl Really add $additional_libdir to $LDFLAGS.
|
|
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
])
|
|
|
|
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
|
|
dnl acl_final_exec_prefix, containing the values to which $prefix and
|
|
dnl $exec_prefix will expand at the end of the configure script.
|
|
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
|
|
[
|
|
dnl Unfortunately, prefix and exec_prefix get only finally determined
|
|
dnl at the end of configure.
|
|
if test "X$prefix" = "XNONE"; then
|
|
acl_final_prefix="$ac_default_prefix"
|
|
else
|
|
acl_final_prefix="$prefix"
|
|
fi
|
|
if test "X$exec_prefix" = "XNONE"; then
|
|
acl_final_exec_prefix='${prefix}'
|
|
else
|
|
acl_final_exec_prefix="$exec_prefix"
|
|
fi
|
|
acl_save_prefix="$prefix"
|
|
prefix="$acl_final_prefix"
|
|
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
|
|
prefix="$acl_save_prefix"
|
|
])
|
|
|
|
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
|
|
dnl variables prefix and exec_prefix bound to the values they will have
|
|
dnl at the end of the configure script.
|
|
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
|
|
[
|
|
acl_save_prefix="$prefix"
|
|
prefix="$acl_final_prefix"
|
|
acl_save_exec_prefix="$exec_prefix"
|
|
exec_prefix="$acl_final_exec_prefix"
|
|
$1
|
|
exec_prefix="$acl_save_exec_prefix"
|
|
prefix="$acl_save_prefix"
|
|
])
|
|
|
|
# lib-link.m4 serial 6 (gettext-0.14.3)
|
|
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
|
|
dnl This file is free software; the Free Software Foundation
|
|
dnl gives unlimited permission to copy and/or distribute it,
|
|
dnl with or without modifications, as long as this notice is preserved.
|
|
|
|
dnl From Bruno Haible.
|
|
|
|
AC_PREREQ(2.50)
|
|
|
|
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
|
|
dnl the libraries corresponding to explicit and implicit dependencies.
|
|
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
|
|
dnl augments the CPPFLAGS variable.
|
|
AC_DEFUN([AC_LIB_LINKFLAGS],
|
|
[
|
|
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
|
AC_REQUIRE([AC_LIB_RPATH])
|
|
define([Name],[translit([$1],[./-], [___])])
|
|
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
|
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
|
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
|
|
AC_LIB_LINKFLAGS_BODY([$1], [$2])
|
|
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
|
|
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
|
|
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
|
|
])
|
|
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
|
|
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
|
|
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
|
|
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
|
|
AC_SUBST([LIB]NAME)
|
|
AC_SUBST([LTLIB]NAME)
|
|
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
|
|
dnl results of this search when this library appears as a dependency.
|
|
HAVE_LIB[]NAME=yes
|
|
undefine([Name])
|
|
undefine([NAME])
|
|
])
|
|
|
|
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
|
|
dnl searches for libname and the libraries corresponding to explicit and
|
|
dnl implicit dependencies, together with the specified include files and
|
|
dnl the ability to compile and link the specified testcode. If found, it
|
|
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
|
|
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
|
|
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
|
|
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
|
|
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
|
[
|
|
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
|
AC_REQUIRE([AC_LIB_RPATH])
|
|
define([Name],[translit([$1],[./-], [___])])
|
|
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
|
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
|
|
|
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
|
|
dnl accordingly.
|
|
AC_LIB_LINKFLAGS_BODY([$1], [$2])
|
|
|
|
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
|
|
dnl because if the user has installed lib[]Name and not disabled its use
|
|
dnl via --without-lib[]Name-prefix, he wants to use it.
|
|
ac_save_CPPFLAGS="$CPPFLAGS"
|
|
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
|
|
|
|
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
|
|
ac_save_LIBS="$LIBS"
|
|
LIBS="$LIBS $LIB[]NAME"
|
|
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
|
|
LIBS="$ac_save_LIBS"
|
|
])
|
|
if test "$ac_cv_lib[]Name" = yes; then
|
|
HAVE_LIB[]NAME=yes
|
|
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
|
|
AC_MSG_CHECKING([how to link with lib[]$1])
|
|
AC_MSG_RESULT([$LIB[]NAME])
|
|
else
|
|
HAVE_LIB[]NAME=no
|
|
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
|
|
dnl $INC[]NAME either.
|
|
CPPFLAGS="$ac_save_CPPFLAGS"
|
|
LIB[]NAME=
|
|
LTLIB[]NAME=
|
|
fi
|
|
AC_SUBST([HAVE_LIB]NAME)
|
|
AC_SUBST([LIB]NAME)
|
|
AC_SUBST([LTLIB]NAME)
|
|
undefine([Name])
|
|
undefine([NAME])
|
|
])
|
|
|
|
dnl Determine the platform dependent parameters needed to use rpath:
|
|
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
|
|
dnl hardcode_direct, hardcode_minus_L.
|
|
AC_DEFUN([AC_LIB_RPATH],
|
|
[
|
|
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
|
|
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
|
|
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
|
|
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
|
|
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
|
|
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
|
|
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
|
|
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
|
|
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
|
|
. ./conftest.sh
|
|
rm -f ./conftest.sh
|
|
acl_cv_rpath=done
|
|
])
|
|
wl="$acl_cv_wl"
|
|
libext="$acl_cv_libext"
|
|
shlibext="$acl_cv_shlibext"
|
|
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
|
|
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
|
|
hardcode_direct="$acl_cv_hardcode_direct"
|
|
hardcode_minus_L="$acl_cv_hardcode_minus_L"
|
|
dnl Determine whether the user wants rpath handling at all.
|
|
AC_ARG_ENABLE(rpath,
|
|
[ --disable-rpath do not hardcode runtime library paths],
|
|
:, enable_rpath=yes)
|
|
])
|
|
|
|
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
|
|
dnl the libraries corresponding to explicit and implicit dependencies.
|
|
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
|
|
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
|
[
|
|
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
|
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
|
dnl By default, look in $includedir and $libdir.
|
|
use_additional=yes
|
|
AC_LIB_WITH_FINAL_PREFIX([
|
|
eval additional_includedir=\"$includedir\"
|
|
eval additional_libdir=\"$libdir\"
|
|
])
|
|
AC_LIB_ARG_WITH([lib$1-prefix],
|
|
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
|
|
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
|
|
[
|
|
if test "X$withval" = "Xno"; then
|
|
use_additional=no
|
|
else
|
|
if test "X$withval" = "X"; then
|
|
AC_LIB_WITH_FINAL_PREFIX([
|
|
eval additional_includedir=\"$includedir\"
|
|
eval additional_libdir=\"$libdir\"
|
|
])
|
|
else
|
|
additional_includedir="$withval/include"
|
|
additional_libdir="$withval/lib"
|
|
fi
|
|
fi
|
|
])
|
|
dnl Search the library and its dependencies in $additional_libdir and
|
|
dnl $LDFLAGS. Using breadth-first-seach.
|
|
LIB[]NAME=
|
|
LTLIB[]NAME=
|
|
INC[]NAME=
|
|
rpathdirs=
|
|
ltrpathdirs=
|
|
names_already_handled=
|
|
names_next_round='$1 $2'
|
|
while test -n "$names_next_round"; do
|
|
names_this_round="$names_next_round"
|
|
names_next_round=
|
|
for name in $names_this_round; do
|
|
already_handled=
|
|
for n in $names_already_handled; do
|
|
if test "$n" = "$name"; then
|
|
already_handled=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$already_handled"; then
|
|
names_already_handled="$names_already_handled $name"
|
|
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
|
|
dnl or AC_LIB_HAVE_LINKFLAGS call.
|
|
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
|
|
eval value=\"\$HAVE_LIB$uppername\"
|
|
if test -n "$value"; then
|
|
if test "$value" = yes; then
|
|
eval value=\"\$LIB$uppername\"
|
|
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
|
|
eval value=\"\$LTLIB$uppername\"
|
|
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
|
|
else
|
|
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
|
|
dnl that this library doesn't exist. So just drop it.
|
|
:
|
|
fi
|
|
else
|
|
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
|
|
dnl and the already constructed $LIBNAME/$LTLIBNAME.
|
|
found_dir=
|
|
found_la=
|
|
found_so=
|
|
found_a=
|
|
if test $use_additional = yes; then
|
|
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
|
|
found_dir="$additional_libdir"
|
|
found_so="$additional_libdir/lib$name.$shlibext"
|
|
if test -f "$additional_libdir/lib$name.la"; then
|
|
found_la="$additional_libdir/lib$name.la"
|
|
fi
|
|
else
|
|
if test -f "$additional_libdir/lib$name.$libext"; then
|
|
found_dir="$additional_libdir"
|
|
found_a="$additional_libdir/lib$name.$libext"
|
|
if test -f "$additional_libdir/lib$name.la"; then
|
|
found_la="$additional_libdir/lib$name.la"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
if test "X$found_dir" = "X"; then
|
|
for x in $LDFLAGS $LTLIB[]NAME; do
|
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
case "$x" in
|
|
-L*)
|
|
dir=`echo "X$x" | sed -e 's/^X-L//'`
|
|
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
|
|
found_dir="$dir"
|
|
found_so="$dir/lib$name.$shlibext"
|
|
if test -f "$dir/lib$name.la"; then
|
|
found_la="$dir/lib$name.la"
|
|
fi
|
|
else
|
|
if test -f "$dir/lib$name.$libext"; then
|
|
found_dir="$dir"
|
|
found_a="$dir/lib$name.$libext"
|
|
if test -f "$dir/lib$name.la"; then
|
|
found_la="$dir/lib$name.la"
|
|
fi
|
|
fi
|
|
fi
|
|
;;
|
|
esac
|
|
if test "X$found_dir" != "X"; then
|
|
break
|
|
fi
|
|
done
|
|
fi
|
|
if test "X$found_dir" != "X"; then
|
|
dnl Found the library.
|
|
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
|
|
if test "X$found_so" != "X"; then
|
|
dnl Linking with a shared library. We attempt to hardcode its
|
|
dnl directory into the executable's runpath, unless it's the
|
|
dnl standard /usr/lib.
|
|
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
|
|
dnl No hardcoding is needed.
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
|
else
|
|
dnl Use an explicit option to hardcode DIR into the resulting
|
|
dnl binary.
|
|
dnl Potentially add DIR to ltrpathdirs.
|
|
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
|
|
haveit=
|
|
for x in $ltrpathdirs; do
|
|
if test "X$x" = "X$found_dir"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
ltrpathdirs="$ltrpathdirs $found_dir"
|
|
fi
|
|
dnl The hardcoding into $LIBNAME is system dependent.
|
|
if test "$hardcode_direct" = yes; then
|
|
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
|
|
dnl resulting binary.
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
|
else
|
|
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
|
|
dnl Use an explicit option to hardcode DIR into the resulting
|
|
dnl binary.
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
|
dnl Potentially add DIR to rpathdirs.
|
|
dnl The rpathdirs will be appended to $LIBNAME at the end.
|
|
haveit=
|
|
for x in $rpathdirs; do
|
|
if test "X$x" = "X$found_dir"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
rpathdirs="$rpathdirs $found_dir"
|
|
fi
|
|
else
|
|
dnl Rely on "-L$found_dir".
|
|
dnl But don't add it if it's already contained in the LDFLAGS
|
|
dnl or the already constructed $LIBNAME
|
|
haveit=
|
|
for x in $LDFLAGS $LIB[]NAME; do
|
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
if test "X$x" = "X-L$found_dir"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
|
|
fi
|
|
if test "$hardcode_minus_L" != no; then
|
|
dnl FIXME: Not sure whether we should use
|
|
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
|
|
dnl here.
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
|
else
|
|
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
|
|
dnl here, because this doesn't fit in flags passed to the
|
|
dnl compiler. So give up. No hardcoding. This affects only
|
|
dnl very old systems.
|
|
dnl FIXME: Not sure whether we should use
|
|
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
|
|
dnl here.
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
else
|
|
if test "X$found_a" != "X"; then
|
|
dnl Linking with a static library.
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
|
|
else
|
|
dnl We shouldn't come here, but anyway it's good to have a
|
|
dnl fallback.
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
|
|
fi
|
|
fi
|
|
dnl Assume the include files are nearby.
|
|
additional_includedir=
|
|
case "$found_dir" in
|
|
*/lib | */lib/)
|
|
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
|
|
additional_includedir="$basedir/include"
|
|
;;
|
|
esac
|
|
if test "X$additional_includedir" != "X"; then
|
|
dnl Potentially add $additional_includedir to $INCNAME.
|
|
dnl But don't add it
|
|
dnl 1. if it's the standard /usr/include,
|
|
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
|
|
dnl 3. if it's already present in $CPPFLAGS or the already
|
|
dnl constructed $INCNAME,
|
|
dnl 4. if it doesn't exist as a directory.
|
|
if test "X$additional_includedir" != "X/usr/include"; then
|
|
haveit=
|
|
if test "X$additional_includedir" = "X/usr/local/include"; then
|
|
if test -n "$GCC"; then
|
|
case $host_os in
|
|
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
|
esac
|
|
fi
|
|
fi
|
|
if test -z "$haveit"; then
|
|
for x in $CPPFLAGS $INC[]NAME; do
|
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
if test "X$x" = "X-I$additional_includedir"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
if test -d "$additional_includedir"; then
|
|
dnl Really add $additional_includedir to $INCNAME.
|
|
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
dnl Look for dependencies.
|
|
if test -n "$found_la"; then
|
|
dnl Read the .la file. It defines the variables
|
|
dnl dlname, library_names, old_library, dependency_libs, current,
|
|
dnl age, revision, installed, dlopen, dlpreopen, libdir.
|
|
save_libdir="$libdir"
|
|
case "$found_la" in
|
|
*/* | *\\*) . "$found_la" ;;
|
|
*) . "./$found_la" ;;
|
|
esac
|
|
libdir="$save_libdir"
|
|
dnl We use only dependency_libs.
|
|
for dep in $dependency_libs; do
|
|
case "$dep" in
|
|
-L*)
|
|
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
|
|
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
|
|
dnl But don't add it
|
|
dnl 1. if it's the standard /usr/lib,
|
|
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
|
|
dnl 3. if it's already present in $LDFLAGS or the already
|
|
dnl constructed $LIBNAME,
|
|
dnl 4. if it doesn't exist as a directory.
|
|
if test "X$additional_libdir" != "X/usr/lib"; then
|
|
haveit=
|
|
if test "X$additional_libdir" = "X/usr/local/lib"; then
|
|
if test -n "$GCC"; then
|
|
case $host_os in
|
|
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
|
esac
|
|
fi
|
|
fi
|
|
if test -z "$haveit"; then
|
|
haveit=
|
|
for x in $LDFLAGS $LIB[]NAME; do
|
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
if test "X$x" = "X-L$additional_libdir"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
if test -d "$additional_libdir"; then
|
|
dnl Really add $additional_libdir to $LIBNAME.
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
|
|
fi
|
|
fi
|
|
haveit=
|
|
for x in $LDFLAGS $LTLIB[]NAME; do
|
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
if test "X$x" = "X-L$additional_libdir"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
if test -d "$additional_libdir"; then
|
|
dnl Really add $additional_libdir to $LTLIBNAME.
|
|
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
;;
|
|
-R*)
|
|
dir=`echo "X$dep" | sed -e 's/^X-R//'`
|
|
if test "$enable_rpath" != no; then
|
|
dnl Potentially add DIR to rpathdirs.
|
|
dnl The rpathdirs will be appended to $LIBNAME at the end.
|
|
haveit=
|
|
for x in $rpathdirs; do
|
|
if test "X$x" = "X$dir"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
rpathdirs="$rpathdirs $dir"
|
|
fi
|
|
dnl Potentially add DIR to ltrpathdirs.
|
|
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
|
|
haveit=
|
|
for x in $ltrpathdirs; do
|
|
if test "X$x" = "X$dir"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
ltrpathdirs="$ltrpathdirs $dir"
|
|
fi
|
|
fi
|
|
;;
|
|
-l*)
|
|
dnl Handle this in the next round.
|
|
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
|
|
;;
|
|
*.la)
|
|
dnl Handle this in the next round. Throw away the .la's
|
|
dnl directory; it is already contained in a preceding -L
|
|
dnl option.
|
|
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
|
|
;;
|
|
*)
|
|
dnl Most likely an immediate library name.
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
|
|
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
|
|
;;
|
|
esac
|
|
done
|
|
fi
|
|
else
|
|
dnl Didn't find the library; assume it is in the system directories
|
|
dnl known to the linker and runtime loader. (All the system
|
|
dnl directories known to the linker should also be known to the
|
|
dnl runtime loader, otherwise the system is severely misconfigured.)
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
|
|
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
|
|
fi
|
|
fi
|
|
fi
|
|
done
|
|
done
|
|
if test "X$rpathdirs" != "X"; then
|
|
if test -n "$hardcode_libdir_separator"; then
|
|
dnl Weird platform: only the last -rpath option counts, the user must
|
|
dnl pass all path elements in one option. We can arrange that for a
|
|
dnl single library, but not when more than one $LIBNAMEs are used.
|
|
alldirs=
|
|
for found_dir in $rpathdirs; do
|
|
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
|
|
done
|
|
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
|
|
acl_save_libdir="$libdir"
|
|
libdir="$alldirs"
|
|
eval flag=\"$hardcode_libdir_flag_spec\"
|
|
libdir="$acl_save_libdir"
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
|
|
else
|
|
dnl The -rpath options are cumulative.
|
|
for found_dir in $rpathdirs; do
|
|
acl_save_libdir="$libdir"
|
|
libdir="$found_dir"
|
|
eval flag=\"$hardcode_libdir_flag_spec\"
|
|
libdir="$acl_save_libdir"
|
|
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
|
|
done
|
|
fi
|
|
fi
|
|
if test "X$ltrpathdirs" != "X"; then
|
|
dnl When using libtool, the option that works for both libraries and
|
|
dnl executables is -R. The -R options are cumulative.
|
|
for found_dir in $ltrpathdirs; do
|
|
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
|
|
done
|
|
fi
|
|
])
|
|
|
|
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
|
|
dnl unless already present in VAR.
|
|
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
|
|
dnl contains two or three consecutive elements that belong together.
|
|
AC_DEFUN([AC_LIB_APPENDTOVAR],
|
|
[
|
|
for element in [$2]; do
|
|
haveit=
|
|
for x in $[$1]; do
|
|
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
|
if test "X$x" = "X$element"; then
|
|
haveit=yes
|
|
break
|
|
fi
|
|
done
|
|
if test -z "$haveit"; then
|
|
[$1]="${[$1]}${[$1]:+ }$element"
|
|
fi
|
|
done
|
|
])
|
|
|
|
# lib-ld.m4 serial 3 (gettext-0.13)
|
|
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
|
|
dnl This file is free software; the Free Software Foundation
|
|
dnl gives unlimited permission to copy and/or distribute it,
|
|
dnl with or without modifications, as long as this notice is preserved.
|
|
|
|
dnl Subroutines of libtool.m4,
|
|
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
|
|
dnl with libtool.m4.
|
|
|
|
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
|
|
AC_DEFUN([AC_LIB_PROG_LD_GNU],
|
|
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
|
|
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
|
case `$LD -v 2>&1 </dev/null` in
|
|
*GNU* | *'with BFD'*)
|
|
acl_cv_prog_gnu_ld=yes ;;
|
|
*)
|
|
acl_cv_prog_gnu_ld=no ;;
|
|
esac])
|
|
with_gnu_ld=$acl_cv_prog_gnu_ld
|
|
])
|
|
|
|
dnl From libtool-1.4. Sets the variable LD.
|
|
AC_DEFUN([AC_LIB_PROG_LD],
|
|
[AC_ARG_WITH(gnu-ld,
|
|
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
|
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
|
AC_REQUIRE([AC_PROG_CC])dnl
|
|
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
# Prepare PATH_SEPARATOR.
|
|
# The user is always right.
|
|
if test "${PATH_SEPARATOR+set}" != set; then
|
|
echo "#! /bin/sh" >conf$$.sh
|
|
echo "exit 0" >>conf$$.sh
|
|
chmod +x conf$$.sh
|
|
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
|
|
PATH_SEPARATOR=';'
|
|
else
|
|
PATH_SEPARATOR=:
|
|
fi
|
|
rm -f conf$$.sh
|
|
fi
|
|
ac_prog=ld
|
|
if test "$GCC" = yes; then
|
|
# Check if gcc -print-prog-name=ld gives a path.
|
|
AC_MSG_CHECKING([for ld used by GCC])
|
|
case $host in
|
|
*-*-mingw*)
|
|
# gcc leaves a trailing carriage return which upsets mingw
|
|
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
|
|
*)
|
|
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
|
|
esac
|
|
case $ac_prog in
|
|
# Accept absolute paths.
|
|
[[\\/]* | [A-Za-z]:[\\/]*)]
|
|
[re_direlt='/[^/][^/]*/\.\./']
|
|
# Canonicalize the path of ld
|
|
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
|
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
|
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
|
done
|
|
test -z "$LD" && LD="$ac_prog"
|
|
;;
|
|
"")
|
|
# If it fails, then pretend we aren't using GCC.
|
|
ac_prog=ld
|
|
;;
|
|
*)
|
|
# If it is relative, then search for the first ld in PATH.
|
|
with_gnu_ld=unknown
|
|
;;
|
|
esac
|
|
elif test "$with_gnu_ld" = yes; then
|
|
AC_MSG_CHECKING([for GNU ld])
|
|
else
|
|
AC_MSG_CHECKING([for non-GNU ld])
|
|
fi
|
|
AC_CACHE_VAL(acl_cv_path_LD,
|
|
[if test -z "$LD"; then
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
|
for ac_dir in $PATH; do
|
|
test -z "$ac_dir" && ac_dir=.
|
|
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
|
acl_cv_path_LD="$ac_dir/$ac_prog"
|
|
# Check to see if the program is GNU ld. I'd rather use --version,
|
|
# but apparently some GNU ld's only accept -v.
|
|
# Break only if it was the GNU/non-GNU ld that we prefer.
|
|
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
|
|
*GNU* | *'with BFD'*)
|
|
test "$with_gnu_ld" != no && break ;;
|
|
*)
|
|
test "$with_gnu_ld" != yes && break ;;
|
|
esac
|
|
fi
|
|
done
|
|
IFS="$ac_save_ifs"
|
|
else
|
|
acl_cv_path_LD="$LD" # Let the user override the test with a path.
|
|
fi])
|
|
LD="$acl_cv_path_LD"
|
|
if test -n "$LD"; then
|
|
AC_MSG_RESULT($LD)
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
fi
|
|
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
|
AC_LIB_PROG_LD_GNU
|
|
])
|
|
|
|
# Do all the work for Automake. This macro actually does too much --
|
|
# some checks are only needed if your package does certain things.
|
|
# But this isn't really a big deal.
|
|
|
|
# serial 1
|
|
|
|
dnl Usage:
|
|
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
|
|
|
AC_DEFUN([AM_INIT_AUTOMAKE],
|
|
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
|
AC_REQUIRE([AC_PROG_INSTALL])
|
|
PACKAGE=[$1]
|
|
AC_SUBST(PACKAGE)
|
|
VERSION=[$2]
|
|
AC_SUBST(VERSION)
|
|
dnl test to see if srcdir already configured
|
|
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
|
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
|
fi
|
|
ifelse([$3],,
|
|
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
|
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
|
AC_REQUIRE([AM_SANITY_CHECK])
|
|
AC_REQUIRE([AC_ARG_PROGRAM])
|
|
dnl FIXME This is truly gross.
|
|
missing_dir=`cd $ac_aux_dir && pwd`
|
|
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
|
|
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
|
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
|
|
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
|
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
|
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
|
|
|
# Copyright 2002 Free Software Foundation, Inc.
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
# any later version.
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
# AM_AUTOMAKE_VERSION(VERSION)
|
|
# ----------------------------
|
|
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
|
# generated from the m4 files accompanying Automake X.Y.
|
|
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
|
|
|
|
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
|
# -------------------------------
|
|
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
|
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
|
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
|
[AM_AUTOMAKE_VERSION([1.4-p6])])
|
|
|
|
#
|
|
# Check to make sure that the build environment is sane.
|
|
#
|
|
|
|
AC_DEFUN([AM_SANITY_CHECK],
|
|
[AC_MSG_CHECKING([whether build environment is sane])
|
|
# Just in case
|
|
sleep 1
|
|
echo timestamp > conftestfile
|
|
# Do `set' in a subshell so we don't clobber the current shell's
|
|
# arguments. Must try -L first in case configure is actually a
|
|
# symlink; some systems play weird games with the mod time of symlinks
|
|
# (eg FreeBSD returns the mod time of the symlink's containing
|
|
# directory).
|
|
if (
|
|
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
|
if test "[$]*" = "X"; then
|
|
# -L didn't work.
|
|
set X `ls -t $srcdir/configure conftestfile`
|
|
fi
|
|
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
|
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
|
|
|
# If neither matched, then we have a broken ls. This can happen
|
|
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
|
# broken ls alias from the environment. This has actually
|
|
# happened. Such a system could not be considered "sane".
|
|
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
|
alias in your environment])
|
|
fi
|
|
|
|
test "[$]2" = conftestfile
|
|
)
|
|
then
|
|
# Ok.
|
|
:
|
|
else
|
|
AC_MSG_ERROR([newly created file is older than distributed files!
|
|
Check your system clock])
|
|
fi
|
|
rm -f conftest*
|
|
AC_MSG_RESULT(yes)])
|
|
|
|
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
|
dnl The program must properly implement --version.
|
|
AC_DEFUN([AM_MISSING_PROG],
|
|
[AC_MSG_CHECKING(for working $2)
|
|
# Run test in a subshell; some versions of sh will print an error if
|
|
# an executable is not found, even if stderr is redirected.
|
|
# Redirect stdin to placate older versions of autoconf. Sigh.
|
|
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
|
$1=$2
|
|
AC_MSG_RESULT(found)
|
|
else
|
|
$1="$3/missing $2"
|
|
AC_MSG_RESULT(missing)
|
|
fi
|
|
AC_SUBST($1)])
|
|
|
|
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
|
|
|
AC_DEFUN([AM_CONFIG_HEADER],
|
|
[AC_PREREQ([2.12])
|
|
AC_CONFIG_HEADER([$1])
|
|
dnl When config.status generates a header, we must update the stamp-h file.
|
|
dnl This file resides in the same directory as the config header
|
|
dnl that is generated. We must strip everything past the first ":",
|
|
dnl and everything past the last "/".
|
|
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
|
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
|
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
|
<<am_indx=1
|
|
for am_file in <<$1>>; do
|
|
case " <<$>>CONFIG_HEADERS " in
|
|
*" <<$>>am_file "*<<)>>
|
|
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
|
;;
|
|
esac
|
|
am_indx=`expr "<<$>>am_indx" + 1`
|
|
done<<>>dnl>>)
|
|
changequote([,]))])
|
|
|
|
|
|
# serial 1
|
|
|
|
# @defmac AC_PROG_CC_STDC
|
|
# @maindex PROG_CC_STDC
|
|
# @ovindex CC
|
|
# If the C compiler in not in ANSI C mode by default, try to add an option
|
|
# to output variable @code{CC} to make it so. This macro tries various
|
|
# options that select ANSI C on some system or another. It considers the
|
|
# compiler to be in ANSI C mode if it handles function prototypes correctly.
|
|
#
|
|
# If you use this macro, you should check after calling it whether the C
|
|
# compiler has been set to accept ANSI C; if not, the shell variable
|
|
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
|
|
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
|
|
# program @code{ansi2knr}, which comes with Ghostscript.
|
|
# @end defmac
|
|
|
|
AC_DEFUN([AM_PROG_CC_STDC],
|
|
[AC_REQUIRE([AC_PROG_CC])
|
|
AC_BEFORE([$0], [AC_C_INLINE])
|
|
AC_BEFORE([$0], [AC_C_CONST])
|
|
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
|
|
dnl a magic option to avoid problems with ANSI preprocessor commands
|
|
dnl like #elif.
|
|
dnl FIXME: can't do this because then AC_AIX won't work due to a
|
|
dnl circular dependency.
|
|
dnl AC_BEFORE([$0], [AC_PROG_CPP])
|
|
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
|
|
AC_CACHE_VAL(am_cv_prog_cc_stdc,
|
|
[am_cv_prog_cc_stdc=no
|
|
ac_save_CC="$CC"
|
|
# Don't try gcc -ansi; that turns off useful extensions and
|
|
# breaks some systems' header files.
|
|
# AIX -qlanglvl=ansi
|
|
# Ultrix and OSF/1 -std1
|
|
# HP-UX -Aa -D_HPUX_SOURCE
|
|
# SVR4 -Xc -D__EXTENSIONS__
|
|
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
|
|
do
|
|
CC="$ac_save_CC $ac_arg"
|
|
AC_TRY_COMPILE(
|
|
[#include <stdarg.h>
|
|
#include <stdio.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
|
|
struct buf { int x; };
|
|
FILE * (*rcsopen) (struct buf *, struct stat *, int);
|
|
static char *e (p, i)
|
|
char **p;
|
|
int i;
|
|
{
|
|
return p[i];
|
|
}
|
|
static char *f (char * (*g) (char **, int), char **p, ...)
|
|
{
|
|
char *s;
|
|
va_list v;
|
|
va_start (v,p);
|
|
s = g (p, va_arg (v,int));
|
|
va_end (v);
|
|
return s;
|
|
}
|
|
int test (int i, double x);
|
|
struct s1 {int (*f) (int a);};
|
|
struct s2 {int (*f) (double a);};
|
|
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
|
|
int argc;
|
|
char **argv;
|
|
], [
|
|
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
|
|
],
|
|
[am_cv_prog_cc_stdc="$ac_arg"; break])
|
|
done
|
|
CC="$ac_save_CC"
|
|
])
|
|
if test -z "$am_cv_prog_cc_stdc"; then
|
|
AC_MSG_RESULT([none needed])
|
|
else
|
|
AC_MSG_RESULT($am_cv_prog_cc_stdc)
|
|
fi
|
|
case "x$am_cv_prog_cc_stdc" in
|
|
x|xno) ;;
|
|
*) CC="$CC $am_cv_prog_cc_stdc" ;;
|
|
esac
|
|
])
|
|
|