# $Id: Portfile 90680 2012-03-12 02:52:42Z jmr@macports.org $

PortSystem 1.0
PortGroup select 1.0

name			gcc_select
version			0.1
revision		6
categories		sysutils
platforms		darwin
license		BSD
maintainers		mww
supported_archs		noarch
description		common files for selecting default gcc version
long_description	gcc_select installs files that allow 'port select' to \
			switch the default version of gcc. \
			It symlinks the standard compiler executables \
			in the MacPorts prefix to the selected version.

homepage		http://www.macports.org/
distfiles

use_configure           no
build                   {}
destroot {
    select::install gcc ${filespath}/base
    select::install gcc ${filespath}/none
}

# install gcc33, gcc40
platform darwin 8 powerpc {
	post-destroot {
	    select::install gcc ${filespath}/gcc33
		select::install gcc ${filespath}/gcc40
	}
}

# install gcc40
platform darwin 8 i386 {
	post-destroot {
		select::install gcc ${filespath}/gcc40
	}
}

# install gcc40, gcc42, llvm-gcc42
platform darwin 9 {
	post-destroot {
		select::install gcc ${filespath}/gcc40
		select::install gcc ${filespath}/gcc42
		# llvm-gcc-4.2 is not available in /usr/bin on Leopard
		copy ${filespath}/llvm-gcc42 ${workpath}/llvm-gcc42
		reinplace "s|/usr/bin|${developer_dir}/usr/bin|" ${workpath}/llvm-gcc42
		select::install gcc ${workpath}/llvm-gcc42
	}
}

# install gcc40, gcc42, llvm-gcc42
platform darwin 10 {
	post-destroot {
		select::install gcc ${filespath}/gcc40
		select::install gcc ${filespath}/gcc42
		select::install gcc ${filespath}/llvm-gcc42
	}
}

# install gcc42, llvm-gcc42
platform darwin 11 {
	post-destroot {
		select::install gcc ${filespath}/gcc42
		select::install gcc ${filespath}/llvm-gcc42
	}
}

livecheck.type	none
