ld-symbolic.m4 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. dnl Copyright (C) 2007 Free Software Foundation, Inc.
  2. dnl This file is free software, distributed under the terms of the GNU
  3. dnl General Public License. As a special exception to the GNU General
  4. dnl Public License, this file may be distributed as part of a program
  5. dnl that contains a configuration script generated by Autoconf, under
  6. dnl the same distribution terms as the rest of that program.
  7. dnl Set SYMBOLIC_LDFLAGS to -Bsymbolic-functions for GNU linker if it
  8. dnl is supported.
  9. AC_DEFUN([ACX_PROG_LD_GNU_SYMBOLIC],
  10. [AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions],
  11. acl_cv_prog_gnu_ld_symbolic, [
  12. acl_cv_prog_gnu_ld_symbolic=no
  13. AC_REQUIRE([AC_LIB_PROG_LD_GNU])
  14. if test x"$with_gnu_ld" = x"yes"; then
  15. if $LD --help 2>&1 </dev/null | grep Bsymbolic-functions 1>&5; then
  16. acl_cv_prog_gnu_ld_symbolic=yes
  17. fi
  18. fi])
  19. if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
  20. SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions"
  21. else
  22. SYMBOLIC_LDFLAGS=''
  23. fi
  24. ])
  25. dnl Set DYNAMIC_LIST_CPP_NEW_LDFLAGS to --dynamic-list-cpp-new for GNU
  26. dnl linker if it is supported.
  27. AC_DEFUN([ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW],
  28. [AC_CACHE_CHECK([if the GNU linker ($LD) supports --dynamic-list-cpp-new],
  29. acl_cv_prog_gnu_ld_dynamic_list_cpp_new, [
  30. acl_cv_prog_gnu_ld_dynamic_list_cpp_new=no
  31. AC_REQUIRE([ACX_PROG_LD_GNU_SYMBOLIC])
  32. if test x"$with_gnu_ld" = x"yes" -a \
  33. x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
  34. if $LD --help 2>&1 </dev/null | grep dynamic-list-cpp-new 1>&5; then
  35. acl_cv_prog_gnu_ld_dynamic_list_cpp_new=yes
  36. fi
  37. fi])
  38. if test x"$acl_cv_prog_gnu_ld_dynamic_list_cpp_new" = x"yes"; then
  39. DYNAMIC_LIST_CPP_NEW_LDFLAGS="$SYMBOLIC_LDFLAGS -Wl,--dynamic-list-cpp-new"
  40. else
  41. DYNAMIC_LIST_CPP_NEW_LDFLAGS=''
  42. fi
  43. ])