llvm.org GIT mirror llvm / 18f9907
Autodetect the availability of -export-dynamic in the linker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66156 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 10 years ago
4 changed file(s) with 62 addition(s) and 25 deletion(s). Raw diff Collapse all Expand all
202202 # What to pass as rpath flag to g++
203203 RPATH := @RPATH@
204204
205 # What to pass as -rdynamic flag to g++
206 RDYNAMIC := @RDYNAMIC@
207
205208 # These are options that can either be enabled here, or can be enabled on the
206209 # make command line (ie, make ENABLE_PROFILING=1):
207210
635635 AC_PATH_PROGS(OCAMLDOC, [ocamldoc])
636636 AC_PATH_PROGS(GAS, [gas as])
637637
638 dnl Determine if the linker supports the -R option.
638 dnl Determine whether the linker supports the -R option.
639639 AC_LINK_USE_R
640
641 dnl Determine whether the linker supports the -export-dynamic option.
642 AC_LINK_EXPORT_DYNAMIC
640643
641644 dnl Check for libtool and the library that has dlopen function (which must come
642645 dnl before the AC_PROG_LIBTOOL check in order to enable dlopening libraries with
10121015 AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings.])
10131016 fi
10141017
1015 dnl Determine if the compiler supports -fvisibility-inlines-hidden.
1018 dnl Determine whether the compiler supports -fvisibility-inlines-hidden.
10161019 AC_CXX_USE_VISIBILITY_INLINES_HIDDEN
10171020
10181021 dnl Determine linker rpath flag
1019 case $llvm_cv_os_type in
1020 SunOS) RPATH="-Wl,-R" ;;
1021 *) RPATH="-Wl,-rpath" ;;
1022 esac
1022 if test "$llvm_cv_link_use_r" = "yes" ; then
1023 RPATH="-Wl,-R"
1024 else
1025 RPATH="-Wl,-rpath"
1026 fi
10231027 AC_SUBST(RPATH)
1028
1029 dnl Determine linker rdynamic flag
1030 if test "$llvm_cv_link_use_export_dynamic" = "yes" ; then
1031 RDYNAMIC="-Wl,-export-dynamic"
1032 else
1033 RDYNAMIC=""
1034 fi
1035 AC_SUBST(RDYNAMIC)
10241036
10251037 dnl===-----------------------------------------------------------------------===
10261038 dnl===
0 #
1 # Determine if the system can handle the -R option being passed to the linker.
2 #
3 # This macro is specific to LLVM.
4 #
5 AC_DEFUN([AC_LINK_USE_R],
6 [AC_CACHE_CHECK([for compiler -Wl,-R option],[llvm_cv_link_use_r],
7 [ AC_LANG_PUSH([C])
8 oldcflags="$CFLAGS"
9 CFLAGS="$CFLAGS -Wl,-R."
10 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
11 [llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no])
12 CFLAGS="$oldcflags"
13 AC_LANG_POP([C])
14 ])
15 if test "$llvm_cv_link_use_r" = yes ; then
16 AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.])
17 fi
18 ])
19
20 #
21 # Determine if the system can handle the -R option being passed to the linker.
22 #
23 # This macro is specific to LLVM.
24 #
25 AC_DEFUN([AC_LINK_EXPORT_DYNAMIC],
26 [AC_CACHE_CHECK([for compiler -Wl,-export-dynamic option],
27 [llvm_cv_link_use_export_dynamic],
28 [ AC_LANG_PUSH([C])
29 oldcflags="$CFLAGS"
30 CFLAGS="$CFLAGS -Wl,-export-dynamic"
31 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
32 [llvm_cv_link_use_export_dynamic=yes],[llvm_cv_link_use_export_dynamic=no])
33 CFLAGS="$oldcflags"
34 AC_LANG_POP([C])
35 ])
36 if test "$llvm_cv_link_use_export_dynamic" = yes ; then
37 AC_DEFINE([HAVE_LINK_EXPORT_DYNAMIC],[1],[Define if you can use -Wl,-export-dynamic.])
38 fi
39 ])
40
+0
-19
autoconf/m4/link_use_r.m4 less more
None #
1 # Determine if the system can handle the -R option being passed to the linker.
2 #
3 # This macro is specific to LLVM.
4 #
5 AC_DEFUN([AC_LINK_USE_R],
6 [AC_CACHE_CHECK([for compiler -Wl,-R option],[llvm_cv_link_use_r],
7 [ AC_LANG_PUSH([C])
8 oldcflags="$CFLAGS"
9 CFLAGS="$CFLAGS -Wl,-R."
10 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
11 [llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no])
12 CFLAGS="$oldcflags"
13 AC_LANG_POP([C])
14 ])
15 if test "$llvm_cv_link_use_r" = yes ; then
16 AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.])
17 fi
18 ])