1214571Sdimdnl Copyright (C) 2007 Free Software Foundation, Inc.
2214571Sdimdnl This file is free software, distributed under the terms of the GNU
3214571Sdimdnl General Public License.  As a special exception to the GNU General
4214571Sdimdnl Public License, this file may be distributed as part of a program
5214571Sdimdnl that contains a configuration script generated by Autoconf, under
6214571Sdimdnl the same distribution terms as the rest of that program.
7214571Sdim
8214571Sdimdnl Set SYMBOLIC_LDFLAGS to -Bsymbolic-functions for GNU linker if it
9214571Sdimdnl is supported.
10214571SdimAC_DEFUN([ACX_PROG_LD_GNU_SYMBOLIC],
11214571Sdim[AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions],
12214571Sdimacl_cv_prog_gnu_ld_symbolic, [
13214571Sdimacl_cv_prog_gnu_ld_symbolic=no
14214571SdimAC_REQUIRE([AC_LIB_PROG_LD_GNU])
15214571Sdimif test x"$with_gnu_ld" = x"yes"; then
16214571Sdim  if $LD --help 2>&1 </dev/null | grep Bsymbolic-functions 1>&5; then
17214571Sdim    acl_cv_prog_gnu_ld_symbolic=yes
18214571Sdim  fi
19214571Sdimfi])
20214571Sdimif test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
21214571Sdim  SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions"
22214571Sdimelse
23214571Sdim  SYMBOLIC_LDFLAGS=''
24214571Sdimfi
25214571Sdim])
26214571Sdim
27214571Sdimdnl Set DYNAMIC_LIST_CPP_NEW_LDFLAGS to --dynamic-list-cpp-new for GNU
28214571Sdimdnl linker if it is supported.
29214571SdimAC_DEFUN([ACX_PROG_LD_GNU_DYNAMIC_LIST_CPP_NEW],
30214571Sdim[AC_CACHE_CHECK([if the GNU linker ($LD) supports --dynamic-list-cpp-new],
31214571Sdimacl_cv_prog_gnu_ld_dynamic_list_cpp_new, [
32214571Sdimacl_cv_prog_gnu_ld_dynamic_list_cpp_new=no
33214571SdimAC_REQUIRE([ACX_PROG_LD_GNU_SYMBOLIC])
34214571Sdimif test x"$with_gnu_ld" = x"yes" -a \
35214571Sdim	x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
36214571Sdim  if $LD --help 2>&1 </dev/null | grep dynamic-list-cpp-new 1>&5; then
37214571Sdim    acl_cv_prog_gnu_ld_dynamic_list_cpp_new=yes
38214571Sdim  fi
39214571Sdimfi])
40214571Sdimif test x"$acl_cv_prog_gnu_ld_dynamic_list_cpp_new" = x"yes"; then
41214571Sdim   DYNAMIC_LIST_CPP_NEW_LDFLAGS="$SYMBOLIC_LDFLAGS -Wl,--dynamic-list-cpp-new"
42214571Sdimelse
43214571Sdim   DYNAMIC_LIST_CPP_NEW_LDFLAGS=''
44214571Sdimfi
45214571Sdim])
46