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