diff -Naurd mpfr-2.2.0-p13/acinclude.m4 mpfr-2.2.0-p14/acinclude.m4
--- mpfr-2.2.0-p13/acinclude.m4	2005-09-02 14:32:14.000000000 +0000
+++ mpfr-2.2.0-p14/acinclude.m4	2005-09-02 14:32:14.000000000 +0000
@@ -551,3 +551,21 @@
     ;;
 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
+])
diff -Naurd mpfr-2.2.0-p13/configure mpfr-2.2.0-p14/configure
--- mpfr-2.2.0-p13/configure	2006-07-21 13:56:45.000000000 +0000
+++ mpfr-2.2.0-p14/configure	2006-07-25 21:33:01.000000000 +0000
@@ -4120,6 +4120,81 @@
 	;;
 esac
 
+case $host in
+  *-apple-darwin*)
+    case "$LD $LDFLAGS" in
+  *-Wl,-search_paths_first*) ;;
+  *) { echo "$as_me:$LINENO: checking if the compiler understands -Wl,-search_paths_first" >&5
+echo $ECHO_N "checking if the compiler understands -Wl,-search_paths_first... $ECHO_C" >&6; }
+     saved_LDFLAGS="$LDFLAGS"
+     LDFLAGS="-Wl,-search_paths_first $LDFLAGS"
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        LDFLAGS="$saved_LDFLAGS"
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+     ;;
+ esac
+ ;;
+esac
+
 echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
 if test "${ac_cv_c_const+set}" = set; then
diff -Naurd mpfr-2.2.0-p13/configure.in mpfr-2.2.0-p14/configure.in
--- mpfr-2.2.0-p13/configure.in	2005-09-17 10:27:28.000000000 +0000
+++ mpfr-2.2.0-p14/configure.in	2005-09-17 10:27:28.000000000 +0000
@@ -177,6 +177,20 @@
 	;;
 esac
 
+dnl $OS_TYPE is not defined on darwin, so we use $host
+case $host in
+  *-apple-darwin*)
+dnl This allows to take the first GMP library in the library paths,
+dnl whether it is dynamic or static. This behavior is more sensible,
+dnl in particular because it is the only way to link with a version
+dnl only available in static form when another version is available
+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.
+    MPFR_LD_SEARCH_PATHS_FIRST ;;
+esac
+
 AC_C_CONST
 AC_C_VOLATILE
 MPFR_CONFIGS
