Blame m4/ld-output-def.m4

Packit Service 4684c1
# ld-output-def.m4 serial 2
Packit Service 4684c1
dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
Packit Service 4684c1
dnl This file is free software; the Free Software Foundation
Packit Service 4684c1
dnl gives unlimited permission to copy and/or distribute it,
Packit Service 4684c1
dnl with or without modifications, as long as this notice is preserved.
Packit Service 4684c1
Packit Service 4684c1
dnl From Simon Josefsson
Packit Service 4684c1
Packit Service 4684c1
# gl_LD_OUTPUT_DEF()
Packit Service 4684c1
# -------------
Packit Service 4684c1
# Check if linker supports -Wl,--output-def and define automake
Packit Service 4684c1
# conditional HAVE_LD_OUTPUT_DEF if it is.
Packit Service 4684c1
AC_DEFUN([gl_LD_OUTPUT_DEF],
Packit Service 4684c1
[
Packit Service 4684c1
  AC_CACHE_CHECK([if gcc/ld supports -Wl,--output-def],
Packit Service 4684c1
    [gl_cv_ld_output_def],
Packit Service 4684c1
    [if test "$enable_shared" = no; then
Packit Service 4684c1
       gl_cv_ld_output_def="not needed, shared libraries are disabled"
Packit Service 4684c1
     else
Packit Service 4684c1
       gl_ldflags_save=$LDFLAGS
Packit Service 4684c1
       LDFLAGS="-Wl,--output-def,conftest.def"
Packit Service 4684c1
       AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
Packit Service 4684c1
                   [gl_cv_ld_output_def=yes],
Packit Service 4684c1
                   [gl_cv_ld_output_def=no])
Packit Service 4684c1
       rm -f conftest.def
Packit Service 4684c1
       LDFLAGS="$gl_ldflags_save"
Packit Service 4684c1
     fi])
Packit Service 4684c1
  AM_CONDITIONAL([HAVE_LD_OUTPUT_DEF], test "x$gl_cv_ld_output_def" = "xyes")
Packit Service 4684c1
])