# $Id: Portfile 67785 2010-05-18 11:34:09Z jmr@macports.org $

PortSystem 1.0

name			gcc_select
version			0.1
revision		4
categories		sysutils
platforms		darwin
license		BSD
maintainers		mww
description		Switch the default compiler
long_description	gcc_select lets you switch the default compiler. \
			It symlinks the standard compiler executables \
			in the MacPorts prefix to the selected version.

homepage		http://svn.macports.org/repository/macports/contrib/select/
master_sites		${homepage}
distname		select-${version}
checksums		sha1 18e1f95c2ddd88210aa52eb696261859af2dc3a4

if {[info exists supported_archs]} {
    supported_archs noarch
} else {
    universal_variant no
}

configure.args		--mandir=${prefix}/share/man --name=gcc

post-destroot {
    xinstall -m 644 -W ${filespath} base \
			${destroot}${prefix}/etc/select/gcc
}

# install gcc33, gcc40 & select gcc40
platform darwin 8 powerpc {
	post-destroot {
		xinstall -m 644 -W ${filespath} gcc40 gcc33 \
			${destroot}${prefix}/etc/select/gcc
		system "${destroot}${prefix}/bin/${name} -i ${destroot} gcc40"
	}
}

# install & select gcc40
platform darwin 8 i386 {
	post-destroot {
		xinstall -m 644 -W ${filespath} gcc40 \
			${destroot}${prefix}/etc/select/gcc
		system "${destroot}${prefix}/bin/${name} -i ${destroot} gcc40"
	}
}

# install & select gcc40
platform darwin 9 {
	post-destroot {
		xinstall -m 644 -W ${filespath} gcc40 gcc42 llvm-gcc42 \
			${destroot}${prefix}/etc/select/gcc
		system "${destroot}${prefix}/bin/${name} -i ${destroot} gcc40"
	}
}

# install & select gcc42
platform darwin 10 {
	post-destroot {
		xinstall -m 644 -W ${filespath} gcc40 gcc42 llvm-gcc42 \
			${destroot}${prefix}/etc/select/gcc
		system "${destroot}${prefix}/bin/${name} -i ${destroot} gcc42"
	}
}

livecheck.type	none
