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