This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

RE: moving an installation of gcc


Hello!

Yes, you can move the GCC distribution around without having to retouch hard
coded paths.  All it takes is a little good housekeeping.  

The attached makefile is an example.  (I use it to test GCC 2.95.2 and GCC
2.95.3 and, to share the compiler with others.)  The makefile sets up your
path correctly to use the compiler, find the header files, and link with
compiler libraries. 

I have also included a simple "Hello World" program for testing.  Here's
what you need to do...  First, edit the GCC_VERSION variable and the
GCC_BASE variable to point to the directory where your version of GCC is
installed.  Then, place the Makefile and the hello.c file in any directory
and type "make".  You should be able to exercise your compiler without a
problem.  

The whole key is the GCC_EXEC_PREFIX variable. With the -B option you are
telling gcc to ignore its search path(s) from the installation and use your
own (new location) search path(s).

Nathan 

p.s. The libc.so problem is not addressed here, but I have fixed it before
with a little compile time regex added to the makefile.

-----Original Message-----
From: Kevin Heatwole [mailto:kdh@ocsystems.com]
Sent: Thursday, June 21, 2001 7:21 AM
To: crossgcc@sources.redhat.com
Subject: moving an installation of gcc
Importance: High


This is probably a dumb question, but I have built a gcc cross on AIX 
for LinuxPPC.  When I built it, it installed in the directory I 
specified (-prefix).

What I'd like to do is to bundle this build such that I can 
distribute it to our customers in such a way that they don't have to 
install it in the same directory.

Can I just tar up the build and untar it on my customer's machine (in 
another location) or do I need to run an install script to fix up any 
hard coded paths?

Or, can I build it such that the prefix is an environment variable so 
the user could put it anywhere and just set the environment variable 
before using the tools?

I hope someone on this list knows the answer to this off the top of 
their head.  If not, I'll dig around or just look at the 
installation.  I know I had to edit the libc.so file to include the 
paths of the libc.so.6 and libc_notshared.a libraries when I copied 
the lib directory from my target into the host build, so there are at 
least some hardcoded paths in the installation.

Thanks,

Kevin
-- 

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to
crossgcc-unsubscribe@sourceware.cygnus.com

hello.c

Makefile

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

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