It might not work for everyone, but what I do on Solaris is as follows: 1.) Compile gcc with --prefix=/usr/local/gcc/gcc-x.y.z but do not add that directory to the path. 2.) Create a symbolic link from /usr/local/cc to /usr/local/gcc/gcc-x.y.z 3.) Add /usr/local/cc/bin to $PATH and /usr/local/cc/lib to $LD_LIBRARY_PATH
A quick little shell function called setcc lets me switch painlessly between any of my self-compiled gcc versions and the stock gcc-3.4.3 that Sun installs in /usr/sfw/bin. This works well because at no time is there more than one gcc to be found in my environment's PATH. At the moment, my /usr/local/gcc directory looks like this: # ls -l /usr/local/gcc total 6 drwxr-xr-x 9 root root 512 Aug 12 11:22 gcc-3.4.6 drwxr-xr-x 9 root root 512 Aug 11 18:02 gcc-4.1.2 drwxr-xr-x 9 root root 512 Aug 11 23:12 gcc-4.2.1 --PLB At 09:17 5.10.2007, Kern Sibbald wrote: >On Friday 05 October 2007 04:44, Dan Langille wrote: > > Is there an easy way to tell Bacula (specifically the regression > > tests) to use a different gcc than gcc? In short, I have installed > > gcc32 on FreeBSD 7.x and I want to compile Bacula with gcc32 instead > > of the base system gcc. > > > > I see lots of these: > > > > build/src/lib/Makefile:CC = gcc > > > > I could change them all.... just for testing... > >You could probably do that, but it might not work. Bacula uses g++ pretty >much everywhere. Most of Bacula's files are .c, but written in C++, so you >probably need to change CC to point to the right gcc *and* CXX to point to >the right g++. > >You could make the change in autoconf/Make.common.in or probably better in >autoconf/Make.common, which is where all the common defines are, if you >change Make.common.in, you must redo the ./configure. If you change >Make.common, you will not want to do a ./configure because it overwrites >Make.common, but instead you would do a "make Makefiles" rather than >the ./configure. > >Anyway, the above should allow you to change the value in one place and have >the normal build do the right thing. > >You may also be able to do: > >CC=gcc32; CXX=g++32; ./configure > >but I am not sure that will work. > >Kern > >------------------------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. >Still grepping through log files to find problems? Stop. >Now Search log events and configuration files using AJAX and a browser. >Download your FREE copy of Splunk now >> http://get.splunk.com/ >_______________________________________________ >Bacula-devel mailing list >[email protected] >https://lists.sourceforge.net/lists/listinfo/bacula-devel ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Bacula-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bacula-devel
