summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in305
1 files changed, 154 insertions, 151 deletions
diff --git a/configure.in b/configure.in
index dfbf3f1420..f6e7443393 100644
--- a/configure.in
+++ b/configure.in
@@ -13,18 +13,6 @@ fi
# This will get text that should go into config.make.
config_vars=
-# Check for a --with-gmp argument and set gmp-srcdir in config.make.
-AC_ARG_WITH([gmp],
- AC_HELP_STRING([--with-gmp=DIRECTORY],
- [find GMP source code in DIRECTORY (not needed)]),
- [
-case "$with_gmp" in
-yes) AC_MSG_ERROR([--with-gmp requires an argument; use --with-gmp=DIRECTORY]) ;;
-''|no) ;;
-*) config_vars="$config_vars
-gmp-srcdir = $withval" ;;
-esac
-])
# Check for a --with-gd argument and set libgd-LDFLAGS in config.make.
AC_ARG_WITH([gd],
AC_HELP_STRING([--with-gd=DIR],
@@ -186,15 +174,9 @@ fi
dnl Generic infrastructure for drop-in additions to libc.
AC_ARG_ENABLE([add-ons],
AC_HELP_STRING([--enable-add-ons@<:@=DIRS...@:>@],
- [configure and build add-ons in DIR1,DIR2,... search for add-ons if no parameter given]),
- [case "$enableval" in
- yes) add_ons=`cd $srcdir && echo */configure | sed -e 's!/configure!!g'`
- add_ons_automatic=yes
- test "$add_ons" = "*" && add_ons= ;;
- *) add_ons=`echo "$enableval" | sed 's/,/ /g'`
- add_ons_automatic=no ;;
- esac],
- [add_ons= add_ons_automatic=no])
+ [configure and build add-ons in DIR1,DIR2,...
+ search for add-ons if no parameter given]),
+ , [enable_add_ons=yes])
dnl Let the user avoid using TLS. Don't know why but...
AC_ARG_WITH([tls],
@@ -344,7 +326,7 @@ AC_ARG_WITH([cpu],
])
-# An add-on can set this when it the tuple to disable the sanity check below.
+# An add-on can set this when it wants to disable the sanity check below.
libc_config_ok=no
dnl Having this here, though empty, makes sure that if add-ons' fragments
@@ -352,6 +334,18 @@ dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then
dnl our AC_OUTPUT will actually use it.
AC_CONFIG_SUBDIRS()
+case "$enable_add_ons" in
+''|no) add_ons= ;;
+yes|'*')
+ add_ons=`cd $srcdir && ls -d 2> /dev/null */configure */sysdeps |
+ sed 's@/[[^/]]*$@@' | sort | uniq`
+ add_ons_automatic=yes
+ ;;
+*) add_ons=`echo "$enable_add_ons" | sed 's/,/ /g'`
+ add_ons_automatic=no ;;
+esac
+
+configured_add_ons=
add_ons_sfx=
add_ons_pfx=
if test x"$add_ons" != x; then
@@ -373,11 +367,6 @@ if test x"$add_ons" != x; then
*** \`localedata' add-on.])
;;
esac
-
- # Test whether such a subdir really exists.
- test -d $srcdir/$f || {
- AC_MSG_ERROR(add-on directory \"$f\" does not exist)
- }
done
# Now source each add-on's configure fragment.
@@ -387,23 +376,81 @@ if test x"$add_ons" != x; then
# whether it goes into the list to be actually used in the build.
use_add_ons=
for libc_add_on in $add_ons; do
- libc_add_on_frag=$srcdir/$libc_add_on/configure
- if test -r $libc_add_on_frag; then
- AC_MSG_RESULT(running configure fragment for add-on $libc_add_on)
- . $libc_add_on_frag
- else
- AC_MSG_WARN(add-on fragment $libc_add_on_frag missing)
+ # Test whether such a directory really exists.
+ # It can be absolute, or relative to $srcdir, or relative to the build dir.
+ case "$libc_add_on" in
+ /*)
+ libc_add_on_srcdir=$libc_add_on
+ ;;
+ *)
+ test -d "$srcdir/$libc_add_on" || {
+ if test -d "$libc_add_on"; then
+ libc_add_on="`pwd`/$libc_add_on"
+ else
+ AC_MSG_ERROR(add-on directory \"$libc_add_on\" does not exist)
+ fi
+ }
+ libc_add_on_srcdir=$srcdir/$libc_add_on
+ ;;
+ esac
+
+ libc_add_on_frag=$libc_add_on_srcdir/configure
+ libc_add_on_canonical=
+ if test -r "$libc_add_on_frag"; then
+ AC_MSG_NOTICE(running configure fragment for add-on $libc_add_on)
+ libc_add_on_canonical=unknown
+ libc_add_on_subdirs=
+ . "$libc_add_on_frag"
+ test -z "$libc_add_on" || {
+ configured_add_ons="$configured_add_ons $libc_add_on"
+ if test "x$libc_add_on_canonical" = xunknown; then
+ AC_MSG_ERROR(fragment must set \$libc_add_on_canonical)
+ fi
+ for d in $libc_add_on_subdirs; do
+ case "$libc_add_on" in
+ /*) subdir_srcdir="$libc_add_on" ;;
+ *) subdir_srcdir="\$(..)$libc_add_on" ;;
+ esac
+ case "$d" in
+ .)
+ d="${libc_add_on_canonical:-$libc_add_on}"
+ ;;
+ /*)
+ subdir_srcdir="$d"
+ ;;
+ *)
+ subdir_srcdir="$subdir_srcdir/$d"
+ ;;
+ esac
+ d=`echo "$d" | sed 's@/*$@@;s@^.*/@@'`
+ add_on_subdirs="$add_on_subdirs $d"
+ test "$subdir_srcdir" = "\$(..)$d" || config_vars="$config_vars
+$d-srcdir = $subdir_srcdir"
+ done
+ }
fi
if test -n "$libc_add_on"; then
+ if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
+ then
+ AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments)
+ for frag in $frags; do
+ name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'`
+ echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
+ . "$frag"
+ done
+ AC_MSG_RESULT()
+ fi
use_add_ons="$use_add_ons $libc_add_on"
add_ons_pfx="$add_ons_pfx $libc_add_on/"
- add_ons_sfx="$add_ons_sfx /$libc_add_on"
+ test -z "$libc_add_on_canonical" ||
+ add_ons_sfx="$add_ons_sfx /$libc_add_on_canonical"
fi
done
# Use echo to strip excess whitespace.
add_ons="`echo $use_add_ons`"
fi
AC_SUBST(add_ons)
+AC_SUBST(add_on_subdirs)
###
@@ -440,41 +487,10 @@ a29k | am29000) base_machine=a29k machine=a29k ;;
alpha*) base_machine=alpha machine=alpha/$machine ;;
c3[012]) base_machine=cx0 machine=cx0/c30 ;;
c4[04]) base_machine=cx0 machine=cx0/c40 ;;
-hppa*64*) base_machine=hppa machine=hppa/hppa64 ;;
-hppa*) base_machine=hppa machine=hppa/hppa1.1 ;;
i[34567]86) base_machine=i386 machine=i386/$machine ;;
ia64) base_machine=ia64 machine=ia64 ;;
-m680?0) base_machine=m68k machine=m68k/$machine ;;
-m68k) base_machine=m68k machine=m68k/m68020 ;;
m88???) base_machine=m88k machine=m88k/$machine ;;
m88k) base_machine=m88k machine=m88k/m88100 ;;
-mips64*) base_machine=mips64
- case "$CC $CFLAGS $CPPFLAGS " in
- *" -mabi=n32 "*) mips_cc_abi=n32 ;;
- *" -mabi=64 "*|*" -mabi=n64 "*) mips_cc_abi=64 ;;
- *" -mabi=32 "*|*" -mabi=o32 "*) mips_cc_abi=32 ;;
- *) mips_cc_abi=default ;;
- esac
- case $config_os in
- *abin32*) mips_config_abi=n32 ;;
- *abi64*|*abin64*) mips_config_abi=64 ;;
- *abi32*|*abio32*) mips_config_abi=32 ;;
- *) mips_config_abi=$mips_cc_abi ;;
- esac
- case $mips_config_abi in
- default) machine=mips/mips64/n32 mips_config_abi=n32 ;;
- n32) machine=mips/mips64/n32 ;;
- 64) machine=mips/mips64/n64 ;;
- 32) machine=mips/mips32/kern64 ;;
- esac
- machine=$machine/$config_machine
- if test $mips_config_abi != $mips_cc_abi; then
- # This won't make it to config.make, but we want to
- # set this in case configure tests depend on it.
- CPPFLAGS="$CPPFLAGS -mabi=$mips_config_abi"
- fi
- ;;
-mips*) base_machine=mips machine=mips/mips32/$machine ;;
powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;;
powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;;
s390) base_machine=s390 machine=s390/s390-32 ;;
@@ -488,7 +504,7 @@ sparcv8 | supersparc | hypersparc)
sparcv8plus | sparcv8plusa | sparcv9)
base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
sparcv8plusb | sparcv9b)
- base_machine=sparc machine=sparc/sparc32/sparcv9b ;;
+ base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
sparc64)
base_machine=sparc machine=sparc/sparc64 ;;
sparc64b)
@@ -579,8 +595,8 @@ dnl We are done with glob and regexp uses of [ and ]; return to autoconf.
changequote([,])dnl
# Find what sysdep directories exist.
+sysnames_add_ons=
sysnames=
-IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for b in $base ''; do
for m0 in $mach ''; do
for v in /$vendor ''; do
@@ -590,17 +606,27 @@ for b in $base ''; do
for m in $mach ''; do
for d in $add_ons_pfx ''; do
for a in $add_ons_sfx ''; do
- if test "$m0$m0sub$b$v$o$m$msub"; then
+ if test -n "$m0$m0sub$b$v$o$m$msub"; then
+ try_srcdir="${srcdir}/"
+ case "$d" in
+ /*) try_srcdir= ;;
+ esac
try="${d}sysdeps$m0$m0sub$b$v$o$m$msub$a"
test -n "$enable_debug_configure" &&
echo "$0 [DEBUG]: try $try" >&2
- if test -d $srcdir/$try; then
+ if test -d "$try_srcdir$try"; then
sysnames="$sysnames $try"
{ test -n "$o" || test -n "$b"; } && os_used=t
{ test -n "$m" || test -n "$m0"; } && machine_used=t
case x${m0:-$m} in
x*/$submachine) submachine_used=t ;;
esac
+ if test -n "$d"; then
+ case "$sysnames_add_ons" in
+ *" $d "*) ;;
+ *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
+ esac
+ fi
fi
fi
done
@@ -610,19 +636,6 @@ for b in $base ''; do
done
done
done
-for d in $add_ons_pfx ''; do
- for a in $add_ons_sfx ''; do
- if test -n "$d" && test "$d" != "$a"; then
- try="${d}sysdeps/generic${a}"
- test -n "$enable_debug_configure" &&
- echo "$0 DEBUG: try $try" >&2
- if test -d $srcdir/$try; then
- sysnames="$sysnames $try"
- fi
- fi
- done
-done
-IFS="$ac_save_ifs"
if test -z "$os_used" && test "$os" != none; then
AC_MSG_ERROR(Operating system $os is not supported.)
@@ -703,6 +716,10 @@ while test $# -gt 0; do
then
implied="$implied $try"
found=yes
+ case "$sysnames_add_ons" in
+ *" $d "*) ;;
+ *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
+ esac
fi
done
if test $found = no; then
@@ -742,6 +759,61 @@ AC_SUBST(sysnames)
# The other names were emitted during the scan.
AC_MSG_RESULT($default_sysnames)
+# Collect the list of add-ons that supply partial sysdeps trees.
+sysdeps_add_ons=
+for add_on in $add_ons; do
+ case "$add_on" in
+ /*) xsrcdir= ;;
+ *) xsrcdir="$srcdir/" ;;
+ esac
+
+ test -d "$xsrcdir$add_on/sysdeps" || {
+ case "$configured_add_ons " in
+ *" $add_on "*) ;;
+ *|'')
+ AC_MSG_ERROR(add-on $add_on has no configure fragment or sysdeps tree)
+ ;;
+ esac
+ continue
+ }
+
+ sysdeps_add_ons="$sysdeps_add_ons $add_on"
+ case "$sysnames_add_ons" in
+ *" $add_on/ "*) ;;
+ *|'')
+ AC_MSG_WARN(add-on $add_on contributed no sysdeps directories)
+ continue ;;
+ esac
+
+ found=no
+ for d in $sysnames; do
+ case "$d" in
+ $add_on/sysdeps/*) ;;
+ *) continue ;;
+ esac
+ (cd "$xsrcdir$d" && for f in *[[!~]]; do
+ case "$f" in
+ sys|bits)
+ for ff in $f/*.h; do
+ test -d "$ff" || { test -e "$ff" && exit 88; }
+ done
+ ;;
+ *)
+ test -d "$f" || { test -e "$f" && exit 88; }
+ ;;
+ esac
+ done)
+ if test $? -eq 88; then
+ found=yes
+ break
+ fi
+ done
+ if test $found = no; then
+ AC_MSG_WARN(add-on $add_on contributed no useful sysdeps directories)
+ fi
+done
+AC_SUBST(sysdeps_add_ons)
+
### Locate tools.
@@ -1753,71 +1825,6 @@ if test "$libc_cv_c_asmcr0_bug" != 'no'; then
fi
fi
-AC_CACHE_CHECK(for DWARF2 unwind info support, libc_cv_gcc_dwarf2_unwind_info,
-[cat > conftest.c <<EOF
-#line $LINENO "configure"
-static char *__EH_FRAME_BEGIN__;
-_start ()
-{
-#ifdef CHECK__register_frame
- __register_frame (__EH_FRAME_BEGIN__);
- __deregister_frame (__EH_FRAME_BEGIN__);
-#endif
-#ifdef CHECK__register_frame_info
- __register_frame_info (__EH_FRAME_BEGIN__);
- __deregister_frame_info (__EH_FRAME_BEGIN__);
-#endif
-}
-int __eh_pc;
-__throw () {}
-/* FIXME: this is fragile. */
-malloc () {}
-strcmp () {}
-strlen () {}
-memcpy () {}
-memset () {}
-free () {}
-abort () {}
-__bzero () {}
-dl_iterate_phdr () {}
-EOF
-libc_unwind_check="${CC-cc} $CFLAGS $CPPFLAGS -DCHECK__register_frame_info \
- $LDFLAGS \
- -nostdlib -nostartfiles -o conftest conftest.c \
- -lgcc"
-# Some platforms' specs put -lgcc first. The second one doesn't hurt.
-if AC_TRY_COMMAND([$libc_unwind_check >&AS_MESSAGE_LOG_FD]) ||
- AC_TRY_COMMAND([$libc_unwind_check -lgcc_eh -lgcc >&AS_MESSAGE_LOG_FD])
-then
- if $libc_unwind_check -v 2>&1 >/dev/null \
- | grep -- --eh-frame-hdr 2>&1 >/dev/null; then
- libc_cv_gcc_dwarf2_unwind_info=no_registry_needed
- else
- libc_cv_gcc_dwarf2_unwind_info=static
- fi
-else
- libc_cv_gcc_dwarf2_unwind_info=no
-fi
-if test $libc_cv_gcc_dwarf2_unwind_info = no; then
- if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -DCHECK__register_frame
- $LDFLAGS -nostdlib -nostartfiles
- -o conftest conftest.c -lgcc >&AS_MESSAGE_LOG_FD]); then
- libc_cv_gcc_dwarf2_unwind_info=yes
- else
- libc_cv_gcc_dwarf2_unwind_info=no
- fi
-fi
-rm -f conftest*])
-case $libc_cv_gcc_dwarf2_unwind_info in
-yes)
- AC_DEFINE(HAVE_DWARF2_UNWIND_INFO)
- ;;
-static)
- AC_DEFINE(HAVE_DWARF2_UNWIND_INFO)
- AC_DEFINE(HAVE_DWARF2_UNWIND_INFO_STATIC)
- ;;
-esac
-
dnl Check whether compiler understands __builtin_expect.
AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
[cat > conftest.c <<EOF
@@ -2118,10 +2125,6 @@ if test $shared = default; then
shared=$elf
fi
-if test x"$libc_cv_idn" = xyes; then
- AC_DEFINE(HAVE_LIBIDN)
-fi
-
AC_CACHE_CHECK([whether -fPIC is default], pic_default,
[pic_default=yes
cat > conftest.c <<EOF