You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.0 KiB

  1. # ld-output-def.m4 serial 2
  2. dnl Copyright (C) 2008-2013 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.
  6. dnl From Simon Josefsson
  7. # gl_LD_OUTPUT_DEF()
  8. # -------------
  9. # Check if linker supports -Wl,--output-def and define automake
  10. # conditional HAVE_LD_OUTPUT_DEF if it is.
  11. AC_DEFUN([gl_LD_OUTPUT_DEF],
  12. [
  13. AC_CACHE_CHECK([if gcc/ld supports -Wl,--output-def],
  14. [gl_cv_ld_output_def],
  15. [if test "$enable_shared" = no; then
  16. gl_cv_ld_output_def="not needed, shared libraries are disabled"
  17. else
  18. gl_ldflags_save=$LDFLAGS
  19. LDFLAGS="-Wl,--output-def,conftest.def"
  20. AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
  21. [gl_cv_ld_output_def=yes],
  22. [gl_cv_ld_output_def=no])
  23. rm -f conftest.def
  24. LDFLAGS="$gl_ldflags_save"
  25. fi])
  26. AM_CONDITIONAL([HAVE_LD_OUTPUT_DEF], test "x$gl_cv_ld_output_def" = "xyes")
  27. ])