summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2006-07-20 07:23:06 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2006-07-20 07:23:06 +0000
commit6bcad27bb1fbed6a1a83ee446ef22e3f0b994f41 (patch)
treed39a8e6067cd267f4c7e2f77c3ee5e46bbeb0caa
parent2f528ae079a35af19a4a334d7e0ef9929079a9f3 (diff)
downloadmpfr-6bcad27bb1fbed6a1a83ee446ef22e3f0b994f41.tar.gz
Improved linker flag settings on darwin.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4104 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--acinclude.m419
-rw-r--r--configure.in3
2 files changed, 20 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 47d839e8a..911c04917 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -552,6 +552,25 @@ case $host in
esac
])
+
+dnl MPFR_LD_SEARCH_PATHS_FIRST
+dnl --------------------------
+
+AC_DEFUN([MPFR_LD_SEARCH_PATHS_FIRST],
+[case "$LD $LDFLAGS" in
+ *-Wl,-search_paths_first*) ;;
+ *) AC_MSG_CHECKING([if the compiler understands -Wl,-search_paths_first])
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="-Wl,-search_paths_first $LDFLAGS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)]
+ LDFLAGS="$saved_LDFLAGS")
+ ;;
+ esac
+])
+
+
dnl GMP_C_ATTRIBUTE_MODE
dnl --------------------
dnl Introduced in gcc 2.2, but perhaps not in all Apple derived versions.
diff --git a/configure.in b/configure.in
index ef99a2273..d38cedd13 100644
--- a/configure.in
+++ b/configure.in
@@ -187,8 +187,7 @@ dnl in dynamic, and also for consistency, because the compiler will
dnl take the first gmp.h found in the include paths (so, we need to
dnl take a library that corresponds to this header file). This is a
dnl common problem with darwin.
- LDFLAGS="-Wl,-search_paths_first $LDFLAGS"
- ;;
+ MPFR_LD_SEARCH_PATHS_FIRST ;;
esac
AC_C_CONST