aboutsummaryrefslogtreecommitdiffstats
path: root/autoconf/m4
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-03-05 08:20:21 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-03-05 08:20:21 +0000
commit18f99072a61429cc6aec9bd3dc611867819d962b (patch)
tree6dcfde0fba6f2f8201c13ee1a9307f963d3aee88 /autoconf/m4
parent323c58d862cca19e45d07996a5abacd0667f264d (diff)
downloadexternal_llvm-18f99072a61429cc6aec9bd3dc611867819d962b.zip
external_llvm-18f99072a61429cc6aec9bd3dc611867819d962b.tar.gz
external_llvm-18f99072a61429cc6aec9bd3dc611867819d962b.tar.bz2
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
Diffstat (limited to 'autoconf/m4')
-rw-r--r--autoconf/m4/link_options.m441
-rw-r--r--autoconf/m4/link_use_r.m419
2 files changed, 41 insertions, 19 deletions
diff --git a/autoconf/m4/link_options.m4 b/autoconf/m4/link_options.m4
new file mode 100644
index 0000000..66036de
--- /dev/null
+++ b/autoconf/m4/link_options.m4
@@ -0,0 +1,41 @@
+#
+# Determine if the system can handle the -R option being passed to the linker.
+#
+# This macro is specific to LLVM.
+#
+AC_DEFUN([AC_LINK_USE_R],
+[AC_CACHE_CHECK([for compiler -Wl,-R<path> option],[llvm_cv_link_use_r],
+[ AC_LANG_PUSH([C])
+ oldcflags="$CFLAGS"
+ CFLAGS="$CFLAGS -Wl,-R."
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
+ [llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no])
+ CFLAGS="$oldcflags"
+ AC_LANG_POP([C])
+])
+if test "$llvm_cv_link_use_r" = yes ; then
+ 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.])
+ fi
+])
+
+#
+# Determine if the system can handle the -R option being passed to the linker.
+#
+# This macro is specific to LLVM.
+#
+AC_DEFUN([AC_LINK_EXPORT_DYNAMIC],
+[AC_CACHE_CHECK([for compiler -Wl,-export-dynamic option],
+ [llvm_cv_link_use_export_dynamic],
+[ AC_LANG_PUSH([C])
+ oldcflags="$CFLAGS"
+ CFLAGS="$CFLAGS -Wl,-export-dynamic"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
+ [llvm_cv_link_use_export_dynamic=yes],[llvm_cv_link_use_export_dynamic=no])
+ CFLAGS="$oldcflags"
+ AC_LANG_POP([C])
+])
+if test "$llvm_cv_link_use_export_dynamic" = yes ; then
+ AC_DEFINE([HAVE_LINK_EXPORT_DYNAMIC],[1],[Define if you can use -Wl,-export-dynamic.])
+ fi
+])
+
diff --git a/autoconf/m4/link_use_r.m4 b/autoconf/m4/link_use_r.m4
deleted file mode 100644
index 30c964e..0000000
--- a/autoconf/m4/link_use_r.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Determine if the system can handle the -R option being passed to the linker.
-#
-# This macro is specific to LLVM.
-#
-AC_DEFUN([AC_LINK_USE_R],
-[AC_CACHE_CHECK([for compiler -Wl,-R<path> option],[llvm_cv_link_use_r],
-[ AC_LANG_PUSH([C])
- oldcflags="$CFLAGS"
- CFLAGS="$CFLAGS -Wl,-R."
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
- [llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no])
- CFLAGS="$oldcflags"
- AC_LANG_POP([C])
-])
-if test "$llvm_cv_link_use_r" = yes ; then
- 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.])
- fi
-])