This is the mail archive of the gcc@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]

Re: Un-hardcoding install location


On Wed, Jul 05, 2000 at 08:52:04AM -0400, Jason McCampbell wrote:
> Hi All,
> 
> I am looking for a verison of GCC that does not compile in it's installation
> directory.  Does anyone know if such a version exists somewhere?  Perhaps
> even part of the standard release tham I'm not aware of?
> 
> Assuming not, are there any current projects or specs in this area?  If I
> were to do the work myself is there any interest in the community for such a
> feature?
> 
> Any feedback would be appreciated.

Assuming you use a fully featured make, such as GNU make, GCC has supported
building in a separate directory from where you install the sources for a long
time now (IIRC, it has always supported it in the 12 years I have been
associated with the project).  We even document it in the fine manual:

Compilation in a Separate Directory
===================================

   If you wish to build the object files and executables in a directory
other than the one containing the source files, here is what you must
do differently:

  1. Make sure you have a version of Make that supports the `VPATH'
     feature.  (GNU Make supports it, as do Make versions on most BSD
     systems.)

  2. If you have ever run `configure' in the source directory, you must
     undo the configuration.  Do this by running:

          make distclean

  3. Go to the directory in which you want to build the compiler before
     running `configure':

          mkdir gcc-sun3
          cd gcc-sun3

     On systems that do not support symbolic links, this directory must
     be on the same file system as the source code directory.

  4. Specify where to find `configure' when you run it:

          ../gcc/configure ...

     This also tells `configure' where to find the compiler sources;
     `configure' takes the directory from the file name that was used to
     invoke it.  But if you want to be sure, you can specify the source
     directory with the `--srcdir' option, like this:

          ../gcc/configure --srcdir=../gcc OTHER OPTIONS

     The directory you specify with `--srcdir' need not be the same as
     the one that `configure' is found in.

   Now, you can run `make' in that directory.  You need not repeat the
configuration steps shown above, when ordinary source files change.  You
must, however, run `configure' again when the configuration files
change, if your system does not support symbolic links.

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

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