This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[PATCH (take 2)]: Add --with-{gmp,mpfr}-{lib,include}, remove --with-{gmp,mpfr}-dir
- From: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: mark at codesourcery dot com, gerald at pfeifer dot com, fortran at gcc dot gnu dot org
- Date: Sat, 25 Nov 2006 11:00:57 -0500 (EST)
- Subject: [PATCH (take 2)]: Add --with-{gmp,mpfr}-{lib,include}, remove --with-{gmp,mpfr}-dir
This patch is a second iteration where I add new configure flags
--with-mpfr-include, --with-mpfr-lib, --with-gmp-include and
--with-gmp-lib, originally posted here:
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01310.html
I've incorporated Gerald's doc feedback from here:
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01350.html
I also combine this with the removal of the --with-mpfr-dir and
--with-gmp-dir flags as discussed here:
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01510.html
Patch bootstrapped on mainline, no regressions. I also checked that
specifying the removed flags produces an explicit error message if
they're still used. And I checked that the new flags are able to find
gmp/mpfr in the right places and pass the top level configure checks
for these libraries.
This patch works on mainline. A 4.2 version is forthcoming, but it
will leave the flags documented in the fortran subsection since
gmp/mpfr is only used for that frontend on the branch.
Is this okay for mainline?
Thanks,
--Kaveh
2006-11-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in (--with-mpfr-dir, --with-gmp-dir): Remove flags.
(--with-mpfr-include, --with-mpfr-lib, --with-gmp-include,
--with-gmp-lib): New flags.
* configure: Regenerate.
gcc:
* doc/install.texi: Move GMP/MPFR configure options from Fortran
section to general section. Remove documentation for
--with-mpfr-dir and --with-gmp-dir, add documentation for
--with-mpfr-include, --with-mpfr-lib, --with-gmp-include and
--with-gmp-lib.
diff -rup orig/egcc-SVN20061120/configure.in egcc-SVN20061120/configure.in
--- orig/egcc-SVN20061120/configure.in 2006-11-18 09:10:46.000000000 -0500
+++ egcc-SVN20061120/configure.in 2006-11-21 14:06:11.180658505 -0500
@@ -1049,54 +1049,57 @@ ACX_PROG_GNAT
ACX_PROG_CMP_IGNORE_INITIAL
# Check for GMP and MPFR
-gmplibs=
+gmplibs="-lmpfr"
gmpinc=
have_gmp=yes
# Specify a location for mpfr
# check for this first so it ends up on the link line before gmp.
-AC_ARG_WITH(mpfr-dir, [ --with-mpfr-dir=PATH Specify source directory for MPFR library])
-
-if test "x$with_mpfr_dir" != x; then
- gmpinc="-I$with_mpfr_dir"
- if test -f "$with_mpfr_dir/.libs/libmpfr.a"; then
- gmplibs="$with_mpfr_dir/.libs/libmpfr.a"
- elif test -f "$with_mpfr_dir/_libs/libmpfr.a"; then
- gmplibs="$with_mpfr_dir/_libs/libmpfr.a"
- else
- gmplibs="$with_mpfr_dir/libmpfr.a"
- fi
-else
- gmplibs="-lmpfr"
-fi
-
-AC_ARG_WITH(mpfr, [ --with-mpfr=PATH Specify directory for installed MPFR library])
+AC_ARG_WITH(mpfr-dir, [ --with-mpfr-dir=PATH This option has been REMOVED],
+ AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed.
+Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH]))
+
+AC_ARG_WITH(mpfr, [ --with-mpfr=PATH Specify prefix directory for installed MPFR package
+ Equivalent to --with-mpfr-include=PATH/include
+ plus --with-mpfr-lib=PATH/lib])
+AC_ARG_WITH(mpfr_include, [ --with-mpfr-include=PATH
+ Specify directory for installed MPFR include files])
+AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH Specify the directory for the installed MPFR library])
if test "x$with_mpfr" != x; then
gmplibs="-L$with_mpfr/lib $gmplibs"
gmpinc="-I$with_mpfr/include"
fi
+if test "x$with_mpfr_include" != x; then
+ gmpinc="-I$with_mpfr_include"
+fi
+if test "x$with_mpfr_lib" != x; then
+ gmplibs="-L$with_mpfr_lib $gmplibs"
+fi
# Specify a location for gmp
-AC_ARG_WITH(gmp-dir, [ --with-gmp-dir=PATH Specify source directory for GMP library])
+AC_ARG_WITH(gmp-dir, [ --with-gmp-dir=PATH This option has been REMOVED],
+ AC_MSG_ERROR([The --with-gmp-dir=PATH option has been removed.
+Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH]))
+
+gmplibs="$gmplibs -lgmp"
+
+AC_ARG_WITH(gmp, [ --with-gmp=PATH Specify prefix directory for the installed GMP package
+ Equivalent to --with-gmp-include=PATH/include
+ plus --with-gmp-lib=PATH/lib])
+AC_ARG_WITH(gmp_include, [ --with-gmp-include=PATH Specify directory for installed GMP include files])
+AC_ARG_WITH(gmp_lib, [ --with-gmp-lib=PATH Specify the directory for the installed GMP library])
-if test "x$with_gmp_dir" != x; then
- gmpinc="$gmpinc -I$with_gmp_dir"
- if test -f "$with_gmp_dir/.libs/libgmp.a"; then
- gmplibs="$gmplibs $with_gmp_dir/.libs/libgmp.a"
- elif test -f "$with_gmp_dir/_libs/libgmp.a"; then
- gmplibs="$gmplibs $with_gmp_dir/_libs/libgmp.a"
- fi
- # One of the later tests will catch the error if neither library is present.
-else
- gmplibs="$gmplibs -lgmp"
-fi
-
-AC_ARG_WITH(gmp, [ --with-gmp=PATH Specify directory for installed GMP library])
if test "x$with_gmp" != x; then
gmplibs="-L$with_gmp/lib $gmplibs"
gmpinc="-I$with_gmp/include $gmpinc"
fi
+if test "x$with_gmp_include" != x; then
+ gmpinc="-I$with_gmp_include $gmpinc"
+fi
+if test "x$with_gmp_lib" != x; then
+ gmplibs="-L$with_gmp_lib $gmplibs"
+fi
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $gmpinc"
diff -rup orig/egcc-SVN20061120/gcc/doc/install.texi egcc-SVN20061120/gcc/doc/install.texi
--- orig/egcc-SVN20061120/gcc/doc/install.texi 2006-11-17 20:01:33.000000000 -0500
+++ egcc-SVN20061120/gcc/doc/install.texi 2006-11-21 14:33:05.479025381 -0500
@@ -294,7 +294,8 @@ systems' @command{tar} programs will als
Necessary to build GCC. If you do not have it installed in your
library search path, you will have to configure with the
-@option{--with-gmp} or @option{--with-gmp-dir} configure option.
+@option{--with-gmp} configure option. See also
+@option{--with-gmp-lib} and @option{--with-gmp-include}.
@item MPFR Library version 2.2 (or later)
@@ -302,13 +303,14 @@ Necessary to build GCC. It can be downl
@uref{http://www.mpfr.org/}. If you're using version 2.2.0, You
should also apply revision 16 (or later) of the cumulative patch from
@uref{http://www.mpfr.org/mpfr-current/}. The version of MPFR that is
-bundled with GMP 4.1.x contains numerous bugs. Although GNU Fortran
-will appear to function with the buggy versions of MPFR, there are a
-few GNU Fortran bugs that will not be fixed when using this version.
-It is strongly recommended to upgrade to at least MPFR version 2.2.
-
-The @option{--with-mpfr} or @option{--with-mpfr-dir} configure option should
-be used if your MPFR Library is not installed in your library search path.
+bundled with GMP 4.1.x contains numerous bugs. Although GCC will
+appear to function with the buggy versions of MPFR, there are a few
+bugs that will not be fixed when using this version. It is strongly
+recommended to upgrade to the recommended version of MPFR.
+
+The @option{--with-mpfr} configure option should be used if your MPFR
+Library is not installed in your default library search path. See
+also @option{--with-mpfr-lib} and @option{--with-mpfr-include}.
@item @command{jar}, or InfoZIP (@command{zip} and @command{unzip})
@@ -1295,6 +1297,26 @@ When neither of these configure options
128-bit @code{long double} when built against GNU C Library 2.4 and later,
64-bit @code{long double} otherwise.
+@item --with-gmp=@var{pathname}
+@itemx --with-gmp-include=@var{pathname}
+@itemx --with-gmp-lib=@var{pathname}
+@itemx --with-mpfr=@var{pathname}
+@itemx --with-mpfr-include=@var{pathname}
+@itemx --with-mpfr-lib=@var{pathname}
+If you do not have GMP (the GNU Multiple Precision library) and the
+MPFR Libraries installed in a standard location and you want to build
+GCC, you can explicitly specify the directory where they are installed
+(@samp{--with-gmp=@var{gmpinstalldir}},
+@samp{--with-mpfr=@var{mpfrinstalldir}}). The
+@option{--with-gmp=@var{gmpinstalldir}} option is shorthand for
+@option{--with-gmp-lib=@var{gmpinstalldir}/lib} and
+@option{--with-gmp-include=@var{gmpinstalldir}/include}. Likewise the
+@option{--with-mpfr=@var{mpfrinstalldir}} option is shorthand for
+@option{--with-mpfr-lib=@var{mpfrinstalldir}/lib} and
+@option{--with-mpfr-include=@var{mpfrinstalldir}/include}. If these
+shorthand assumptions are not correct, you can use the explicit
+include and lib options directly.
+
@end table
@subheading Cross-Compiler-Specific Options
@@ -1376,25 +1398,6 @@ When you use this option, you should ens
tools.
@end table
-@subheading Fortran-Specific Options
-
-The following options apply to the build of the Fortran front end.
-
-@table @code
-
-@item --with-gmp=@var{pathname}
-@itemx --with-mpfr=@var{pathname}
-@itemx --with-gmp-dir=@var{pathname}
-@itemx --with-mpfr-dir=@var{pathname}
-If you don't have GMP (the GNU Multiple Precision library) and the MPFR
-Libraries installed in a standard location and you want to build the Fortran
-front-end, you can explicitly specify the directory where they are installed
-(@samp{--with-gmp=gmpinstalldir}, @samp{--with-mpfr=mpfrinstalldir}) or where
-you built them without installing (@samp{--with-gmp-dir=gmpbuilddir},
-@samp{--with-mpfr-dir=gmpbuilddir}).
-
-@end table
-
@subheading Java-Specific Options
The following option applies to the build of the Java front end.