compiling glib20 in ports with gcc v4.6.2

b. f. bf1783 at
Mon Jul 25 04:14:20 UTC 2011

> .if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc46)
> CC=gcc46
> CXX=g++46
> CPP=cpp46
> CFLAGS+=-mssse3
> CPUTYPE?=core2
> LD=/usr/local/bin/ld
> .endif

Just use USE_GCC=4.6 with your cpu-specific additions to CFLAGS, and
the latest patch from PR ports/155201, it will be easier.  As it is,
you are missing all of the other devel/binutils utilities that are set
by USE_BINUTILS (which is implied by USE_GCC=4.6); the important
additions to the CFLAGS and LDFLAGS in that will point the
resulting binaries to the libraries in /usr/local/lib/gcc46, rather
than the older incompatible ones with identical names and major
version numbers in the base system; and the registering of lang/gcc46
as a runtime dependency in the package database.

Also, as you have seen, it is a known, long-standing problem with
ports that use devel/libtool, that they will often break if
devel/libtool is not built with the same compiler and toolchain as the
port.  A simple, although not very convenient, way to fix this is to
rebuild devel/libtool with appropriate compiler before building such
ports (although, in your case, you will have to ensure that
devel/libtool is not always built with USE_GCC=4.6, or you will break
your package accounting system with circular dependencies). A proper
solution is more complicated, involving either a
substantially-modified libtool, or separate per-compiler libtool
ports, or rebuilding a temporary libtool during the build of each port
that uses it.  Such a solution may be introduced into Ports as we
prepare for wider use of multiple compilers and toolchains, but for
now you will have to work around the problem.


More information about the freebsd-gnome mailing list