diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 12:01:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 12:01:37 +0000 |
commit | de848d9e9146434817c65d74d1d0313e9d729462 (patch) | |
tree | dcbd0efb229b17f696f7195671f05b354b4f70fc /m4/ld-as-needed.m4 | |
parent | Initial commit. (diff) | |
download | pam-de848d9e9146434817c65d74d1d0313e9d729462.tar.xz pam-de848d9e9146434817c65d74d1d0313e9d729462.zip |
Adding upstream version 1.4.0.upstream/1.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/ld-as-needed.m4')
-rw-r--r-- | m4/ld-as-needed.m4 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/m4/ld-as-needed.m4 b/m4/ld-as-needed.m4 new file mode 100644 index 0000000..5ba6e0f --- /dev/null +++ b/m4/ld-as-needed.m4 @@ -0,0 +1,24 @@ +# ld-as-needed.m4 serial 2 + +# Test if ld supports --as-needed + +AC_DEFUN([PAM_LD_AS_NEEDED], + [ + AC_CACHE_CHECK(whether ld supports --as-needed, + pam_cv_ld_as_needed, [ 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,--as-needed 1>&AS_MESSAGE_LOG_FD]) + then + pam_cv_ld_as_needed=yes + LDFLAGS="$LDFLAGS -Wl,--as-needed" + else + pam_cv_ld_as_needed=no + fi + rm -f conftest*]) + AC_SUBST(pam_cv_ld_as_needed) + ] +) |