Subject: Re: Use of GCC 3.4+ for everything
To: None <>
From: Dieter <>
List: port-amd64
Date: 08/21/2005 16:20:50
> I would like to force use of lang/gcc34 for everything
> (pkgsrc, src, xsrc) with a GFLAGS/CXXFLAGS containing mcpu=k8.
> my question is, can I/how to do so ?

One easy way is to use a wrapper program.

Create a small shell script called gcc, make sure it is in a
directory that is earlier in your $PATH than any other gcc.

	case "`uname -m`" in
	   sparc64)         CPU="ultrasparc" ;;
	   amd64)           CPU="athlon64" ;;
	/usr/pkg/gcc34/bin/gcc -O2 -mcpu=$CPU $@

This also provides an easy way to add extra warnings to help
catch code that assumes ILP32 such as -Wmissing-declarations
-Wmissing-prototypes -Wstrict-prototypes and so on.

You can have cc use the same compiler by creating a symlink.

This way you *always* get your desired compiler and compiler flags,
even when you compile a small test program with "gcc mytest.c"
and don't have a Makefile that handles CFLAGS and such.