summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-06-20 02:28:31 +0200
committerThomas Schwinge <thomas@codesourcery.com>2012-06-20 02:28:31 +0200
commit0138137f1ccea480fe31cea3b63a81f96daeeaa7 (patch)
treeffd88f1e805cd98152828c1598fc3255b3d22a9e /aclocal.m4
parent27fbc2008d4df23885d10f0877caf62ae2c22bb4 (diff)
parentdc665715841aea049480d9f75ace426419db1f8e (diff)
Merge branch 'baseline' into refs/top-bases/tschwinge/Roger_Whittaker
Conflicts: configure configure.in hurd/Makefile nptl/sysdeps/pthread/bits/libc-lock.h sysdeps/i386/configure sysdeps/powerpc/powerpc32/configure sysdeps/powerpc/powerpc64/configure sysdeps/unix/sysv/linux/configure sysdeps/unix/sysv/linux/configure.in
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m434
1 files changed, 34 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index bee24a8f23..44fd3d9c29 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -114,3 +114,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])