]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - aclocal.m4
SH: ____longjmp_chk for GNU/Linux with sigaltstack support.
[thirdparty/glibc.git] / aclocal.m4
index d2d08bad5bf980323450b2975866549bb3472b1e..e89993237f669229005d403ad75dbc5cbf751ea0 100644 (file)
@@ -3,20 +3,31 @@ dnl which appears in configure.in before the sysdep configure scripts are run.
 dnl Each sysdep configure.in does GLIBC_PROVIDES first, to avoid any
 dnl AC_REQUIREs or AC_BEFOREs duplicating their code.
 dnl
-define([AC_FD_MSG],6)dnl Autoconf lossage.
-define([AC_FD_CC],5)dnl Autoconf lossage.
-AC_DEFUN([GLIBC_PROVIDES], [dnl
+define([GLIBC_PROVIDES], [dnl
+AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_PROVIDE([AC_CONFIG_SUBDIRS])dnl
+AC_PROVIDE([_AS_ECHO_N_PREPARE])dnl
+AC_PROVIDE([_AS_ECHO_PREPARE])dnl
+AC_PROVIDE([_AS_CR_PREPARE])dnl
+AC_PROVIDE([_AS_TR_SH_PREPARE])dnl
 AC_PROVIDE([AC_PROG_INSTALL])dnl
-AC_PROVIDE([AC_PROG_RANLIB])dnl
 AC_PROVIDE([AC_PROG_CC])dnl
 AC_PROVIDE([AC_PROG_CPP])dnl
-define([AC_LANG], [C])dnl
+AC_PROVIDE([_AS_PATH_SEPARATOR_PREPARE])dnl
+AC_PROVIDE([_AS_TEST_PREPARE])dnl
+define([AS_MESSAGE_LOG_FD],5)dnl
+define([AS_MESSAGE_FD],6)dnl
+dnl Ripped out of AS_INIT, which does more cruft we do not want.
+m4_wrap([m4_divert_pop([BODY])[]])
+m4_divert_push([BODY])[]dnl
+dnl End of ripped out of AS_INIT.
 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+define([_AC_LANG], [C])dnl
 ])dnl
 dnl
 dnl Check for a symbol
 dnl
-AC_DEFUN(AC_CHECK_SYMBOL, [dnl
+AC_DEFUN([AC_CHECK_SYMBOL], [dnl
 AC_MSG_CHECKING(for $1)
 AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
 AC_TRY_LINK(,
@@ -36,7 +47,7 @@ dnl
 dnl Locate a program and check that its version is acceptable.
 dnl AC_PROG_CHECK_VER(var, namelist, version-switch,
 dnl                  [version-extract-regexp], version-glob [, do-if-fail])
-AC_DEFUN(AC_CHECK_PROG_VER,
+AC_DEFUN([AC_CHECK_PROG_VER],
 [AC_CHECK_PROGS([$1], [$2])
 if test -z "[$]$1"; then
   ac_verc_fail=yes
@@ -45,7 +56,7 @@ else
   AC_MSG_CHECKING([version of [$]$1])
 changequote(<<,>>)dnl
   ac_prog_version=`<<$>>$1 $3 2>&1 ifelse(<<$4>>,,,
-                   <<| sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'>>)`
+                  <<| sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'>>)`
   case $ac_prog_version in
     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
     <<$5>>)
@@ -63,42 +74,10 @@ fi])
 ])
 
 dnl These modifications are to allow for an empty cross compiler tree.
-dnl In the situation that cross-linking is impossible, the variable
-dnl `cross_linkable' will be substituted with "yes".
-dnl The vercheck macros are expected to have been called already.
-AC_DEFUN(AC_PROG_CC_LOCAL,
-[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-
-AC_PROG_CC_WORKS_LOCAL
-AC_PROG_CC_GNU
-if test $ac_cv_prog_gcc != yes; then
-  AC_MSG_ERROR([GNU libc must be compiled using GNU CC])
-fi
+define([_AC_COMPILER_EXEEXT], [EXEEXT=
 ])
 
-AC_DEFUN(AC_PROG_CC_WORKS_LOCAL,
-[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works])
-AC_CACHE_VAL(ac_cv_prog_cc_works,
-[AC_LANG_SAVE
-AC_LANG_C
-AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
-AC_LANG_RESTORE])
-AC_MSG_RESULT($ac_cv_prog_cc_works)
-if test $ac_cv_prog_cc_works = no; then
- cross_linkable=no
- ac_cv_prog_cc_cross=yes
-dnl AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.])
-else
- cross_linkable=yes
-fi
-AC_CACHE_CHECK(
-[whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler],
-ac_cv_prog_cc_cross, [:])
-AC_SUBST(cross_linkable)
-cross_compiling=$ac_cv_prog_cc_cross
-])
-
-AC_DEFUN(LIBC_PROG_FOO_GNU,
+AC_DEFUN([LIBC_PROG_FOO_GNU],
 [# Most GNU programs take a -v and spit out some text including
 # the word 'GNU'.  Some try to read stdin, so give them /dev/null.
 if $1 -o conftest -v </dev/null 2>&1 | grep GNU > /dev/null 2>&1; then
@@ -108,7 +87,7 @@ else
 fi
 rm -fr contest*])
 
-AC_DEFUN(LIBC_PROG_BINUTILS,
+AC_DEFUN([LIBC_PROG_BINUTILS],
 [# Was a --with-binutils option given?
 if test -n "$path_binutils"; then
     # Make absolute; ensure a single trailing slash.
@@ -119,17 +98,10 @@ AS=`$CC -print-prog-name=as`
 LD=`$CC -print-prog-name=ld`
 AR=`$CC -print-prog-name=ar`
 AC_SUBST(AR)
-
-# ranlib has to be treated a bit differently since it might not exist at all.
-ac_ranlib=`$CC -print-prog-name=ranlib`
-if test "x$ac_ranlib" = xranlib; then
-# This extra check has to happen since gcc simply echos the parameter in
-# case it cannot find the value in its own directories.
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-else
-  RANLIB=$ac_ranlib
-fi
-AC_SUBST(RANLIB)
+OBJDUMP=`$CC -print-prog-name=objdump`
+AC_SUBST(OBJDUMP)
+OBJCOPY=`$CC -print-prog-name=objcopy`
+AC_SUBST(OBJCOPY)
 
 # Determine whether we are using GNU binutils.
 AC_CACHE_CHECK(whether $AS is GNU as, libc_cv_prog_as_gnu,
@@ -141,3 +113,37 @@ AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu,
 [LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)])
 gnu_ld=$libc_cv_prog_ld_gnu
 ])
+
+dnl Run a static link test with -nostdlib -nostartfiles.
+dnl LIBC_TRY_LINK_STATIC([code], [action-if-true], [action-if-false])
+AC_DEFUN([LIBC_TRY_LINK_STATIC],
+[cat > conftest.c <<EOF
+int _start (void) { return 0; }
+int __start (void) { return 0; }
+$1
+EOF
+AS_IF([AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest
+                      conftest.c -static -nostartfiles -nostdlib
+                      1>&AS_MESSAGE_LOG_FD])],
+      [$2], [$3])
+rm -f conftest*])
+
+dnl Test a compiler option or options with an empty input file.
+dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false])
+AC_DEFUN([LIBC_TRY_CC_OPTION],
+[AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
+       [$2], [$3])])
+
+dnl Find and source sysdeps/*/preconfigure.
+dnl LIBC_PRECONFIGURE([$srcdir], [for])
+AC_DEFUN([LIBC_PRECONFIGURE], [dnl
+if frags=`ls -d $1/sysdeps/*/preconfigure 2> /dev/null`
+then
+  AC_MSG_CHECKING($2 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])