diff options
Diffstat (limited to 'libc/aclocal.m4')
-rw-r--r-- | libc/aclocal.m4 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libc/aclocal.m4 b/libc/aclocal.m4 index c20ccf9b6..ef977fde3 100644 --- a/libc/aclocal.m4 +++ b/libc/aclocal.m4 @@ -116,6 +116,20 @@ AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu, 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*]) + # These two macros are taken from GCC's config/acx.m4. dnl Support the --with-pkgversion configure option. dnl ACX_PKGVERSION(default-pkgversion) |