This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[4.2 PATCH]: Add --with-{gmp,mpfr}-{lib,include}, remove --with-{gmp,mpfr}-dir
- From: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- To: mark at codesourcery dot com
- Cc: gcc-patches at gcc dot gnu dot org, gerald at pfeifer dot com, fortran at gcc dot gnu dot org
- Date: Sun, 26 Nov 2006 18:36:32 -0500 (EST)
- Subject: [4.2 PATCH]: Add --with-{gmp,mpfr}-{lib,include}, remove --with-{gmp,mpfr}-dir
This is the 4.2 version of the following patch:
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01708.html
The difference is that the documentation for the configure flags stays in
a fortran subsection of the manual, since on that branch gmp/mpfr are only
used in that frontend. Otherwise the configure.in bits apply cleanly from
the mainline version of the patch.
Tested on sparc-sun-solaris2.10, okay for 4.2?
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: 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-4.2-SVN20061124/configure.in egcc-4.2-SVN20061124/configure.in
--- orig/egcc-4.2-SVN20061124/configure.in 2006-11-19 20:09:32.000000000 -0500
+++ egcc-4.2-SVN20061124/configure.in 2006-11-26 17:58:52.412366940 -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-4.2-SVN20061124/gcc/doc/install.texi egcc-4.2-SVN20061124/gcc/doc/install.texi
--- orig/egcc-4.2-SVN20061124/gcc/doc/install.texi 2006-11-02 20:09:04.000000000 -0500
+++ egcc-4.2-SVN20061124/gcc/doc/install.texi 2006-11-26 18:04:09.154137207 -0500
@@ -294,7 +294,8 @@ systems' @command{tar} programs will als
Necessary to build the Fortran frontend. 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.
+the @option{--with-gmp} configure option. See also
+@option{--with-gmp-lib} and @option{--with-gmp-include}.
@item MPFR Library version 2.2 (or later)
@@ -305,8 +306,9 @@ to function with the buggy versions of M
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.
+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})
@@ -1381,15 +1383,24 @@ The following options apply to the build
@table @code
@item --with-gmp=@var{pathname}
+@itemx --with-gmp-include=@var{pathname}
+@itemx --with-gmp-lib=@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}).
+@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
+the Fortran front-end, 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