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.
8 dnl From Simon Josefsson
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],
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"
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])
27 LDFLAGS="$gl_ldflags_save"
29 AM_CONDITIONAL([HAVE_LD_OUTPUT_DEF], test "x$gl_cv_ld_output_def" = "xyes")