summaryrefslogtreecommitdiffstats
path: root/m4/ld-O1.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 12:01:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 12:01:37 +0000
commitde848d9e9146434817c65d74d1d0313e9d729462 (patch)
treedcbd0efb229b17f696f7195671f05b354b4f70fc /m4/ld-O1.m4
parentInitial commit. (diff)
downloadpam-upstream.tar.xz
pam-upstream.zip
Adding upstream version 1.4.0.upstream/1.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--m4/ld-O1.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/m4/ld-O1.m4 b/m4/ld-O1.m4
new file mode 100644
index 0000000..f67b959
--- /dev/null
+++ b/m4/ld-O1.m4
@@ -0,0 +1,24 @@
+# ld-O1.m4 serial 3
+
+# Test if ld supports -O1
+
+AC_DEFUN([PAM_LD_O1],
+ [
+ AC_CACHE_CHECK(whether ld supports -O1,
+ pam_cv_ld_O1, [ dnl
+ cat > conftest.c <<EOF
+int main (void) { return 0; }
+EOF
+ if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+ -o conftest.o conftest.c
+ -Wl,-O1 1>&AS_MESSAGE_LOG_FD])
+ then
+ pam_cv_ld_O1=yes
+ LDFLAGS="$LDFLAGS -Wl,-O1"
+ else
+ pam_cv_ld_O1=no
+ fi
+ rm -f conftest*])
+ AC_SUBST(pam_cv_ld_O1)
+ ]
+)