This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Add --with-mpfr-include, --with-mpfr-lib, --with-gmp-include and --with-gmp-lib


This patch adds four new configure flags, --with-mpfr-include,
--with-mpfr-lib, --with-gmp-include and --with-gmp-lib.  The purpose is to
help people on whose systems gmp and/or mpfr are installed in non-standard
locations.  Here non-standard is defined as anything where prefix/lib and
prefix/include does not work, which makes using the plain --with-gmp or
--with-mpfr impossible.

As noted here http://gcc.gnu.org/ml/gcc/2006-11/msg00640.html some
distributions with 32/64-bit multilibs sometimes use lib32 or lib64 in
their paths.

This patch adds the new flags and updates the documentation.  I also moved
the documentation for the existing flags from a fortran subsection into
the main flag doc area since gmp/mpfr are required for all languages now.

There is a similar patch here:
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01261.html

however it has a number of issues.  It removes the existing options which
will disappoint some users who rely on it.  Also it doesn't update the
manual.

Tested on sparc-sun-solaris2.10 by configuring with the various --with-*
flags and ensuring that the configure checks pass and that we can still
bootstrap and link the various frontends with gmp/mpfr.  I also ensured
that the docs were successfully built.

Okay for mainline?

Mark, would something like this that retains the "fortran-ness" of
gmp/mpfr in the docs be okay for 4.2?


		Thanks,
		--Kaveh


2006-11-17  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* configure.in: Add options --with-mpfr-include, --with-mpfr-lib,
	--with-gmp-include and --with-gmp-lib.  Update option docs.

	* configure: Regenerate.

gcc:
	* doc/install.texi: Move GMP/MPFR configure options from
	Fortran section to general section.  Add documentation for
	--with-mpfr-include, --with-mpfr-lib, --with-gmp-include and
	--with-gmp-lib.

diff -rup orig/egcc-SVN20061116/configure.in egcc-SVN20061116/configure.in
--- orig/egcc-SVN20061116/configure.in	2006-11-13 20:01:53.000000000 -0500
+++ egcc-SVN20061116/configure.in	2006-11-17 20:18:20.966560491 -0500
@@ -1054,7 +1054,9 @@ 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])
+AC_ARG_WITH(mpfr-dir, [  --with-mpfr-dir=PATH    Specify the source directory for the MPFR library.
+                          Useful if you built but don't want to install MPFR.
+                          This option requires you built a static MPFR library.])

 if test "x$with_mpfr_dir" != x; then
   gmpinc="-I$with_mpfr_dir"
@@ -1063,15 +1065,28 @@ else
   gmplibs="-lmpfr"
 fi

-AC_ARG_WITH(mpfr, [  --with-mpfr=PATH        Specify directory for installed MPFR library])
+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     Specify the source directory for the GMP library.
+                          Useful if you built but don't want to install GMP.
+                          This option requires you built a static GMP library.])

 if test "x$with_gmp_dir" != x; then
   gmpinc="$gmpinc -I$with_gmp_dir"
@@ -1085,12 +1100,23 @@ else
   gmplibs="$gmplibs -lgmp"
 fi

-AC_ARG_WITH(gmp, [  --with-gmp=PATH         Specify directory for installed GMP library])
+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" != 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-SVN20061116/gcc/doc/install.texi egcc-SVN20061116/gcc/doc/install.texi
--- orig/egcc-SVN20061116/gcc/doc/install.texi	2006-11-02 20:01:28.000000000 -0500
+++ egcc-SVN20061116/gcc/doc/install.texi	2006-11-17 20:47:05.055833878 -0500
@@ -295,6 +295,7 @@ 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.
+See also @option{--with-gmp-lib} and @option{--with-gmp-include}.

 @item MPFR Library version 2.2 (or later)

@@ -309,6 +310,7 @@ It is strongly recommended to upgrade to

 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.
+See also @option{--with-mpfr-lib} and @option{--with-mpfr-include}.

 @item @command{jar}, or InfoZIP (@command{zip} and @command{unzip})

@@ -1295,6 +1297,31 @@ 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-gmp-dir=@var{pathname}
+@itemx --with-mpfr=@var{pathname}
+@itemx --with-mpfr-include=@var{pathname}
+@itemx --with-mpfr-lib=@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
+GCC, you can explicitly specify the directory where they are installed
+(@samp{--with-gmp=gmpinstalldir}, @samp{--with-mpfr=mpfrinstalldir}).
+The @option{--with-gmp=gmpinstalldir} option is shorthand for
+@option{--with-gmp-lib=gmpinstalldir/lib} and
+@option{--with-gmp-include=gmpinstalldir/include}.  Likewise the
+@option{--with-mpfr=mpfrinstalldir} option is shorthand for
+@option{--with-mpfr-lib=mpfrinstalldir/lib} and
+@option{--with-mpfr-include=mpfrinstalldir/include}.  If these
+shorthand assumptions are not correct, you can use the explicit
+include and lib options directly.  If you compiled these libraries
+from source but don't want to install them, another alternative is to
+specify the directories where you built them using
+(@samp{--with-gmp-dir=gmpbuilddir},
+@samp{--with-mpfr-dir=mpfrbuilddir}).
+
 @end table

 @subheading Cross-Compiler-Specific Options
@@ -1376,25 +1403,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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]