| 1 |
# ld-output-def.m4 |
| 2 |
# serial 3 |
| 3 |
dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. |
| 4 |
dnl This file is free software; the Free Software Foundation |
| 5 |
dnl gives unlimited permission to copy and/or distribute it, |
| 6 |
dnl with or without modifications, as long as this notice is preserved. |
| 7 |
|
| 8 |
dnl From Simon Josefsson |
| 9 |
|
| 10 |
# gl_LD_OUTPUT_DEF() |
| 11 |
# ------------- |
| 12 |
# Check if linker supports -Wl,--output-def and define automake |
| 13 |
# conditional HAVE_LD_OUTPUT_DEF if it is. |
| 14 |
AC_DEFUN([gl_LD_OUTPUT_DEF], |
| 15 |
[ |
| 16 |
AC_CACHE_CHECK([if gcc/ld supports -Wl,--output-def], |
| 17 |
[gl_cv_ld_output_def], |
| 18 |
[if test "$enable_shared" = no; then |
| 19 |
gl_cv_ld_output_def="not needed, shared libraries are disabled" |
| 20 |
else |
| 21 |
gl_ldflags_save=$LDFLAGS |
| 22 |
LDFLAGS="-Wl,--output-def,conftest.def" |
| 23 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]])], |
| 24 |
[gl_cv_ld_output_def=yes], |
| 25 |
[gl_cv_ld_output_def=no]) |
| 26 |
rm -f conftest.def |
| 27 |
LDFLAGS="$gl_ldflags_save" |
| 28 |
fi]) |
| 29 |
AM_CONDITIONAL([HAVE_LD_OUTPUT_DEF], test "x$gl_cv_ld_output_def" = "xyes") |
| 30 |
]) |