# $Id: Portfile 91697 2012-04-08 10:22:26Z ryandesign@macports.org $ PortSystem 1.0 name cctools # XCode 4.3 version 822 revision 1 set llvm_version 3.0 categories devel platforms darwin maintainers mfeiri jeremyhu openmaintainer license {APSL-2.0 GPL-2+} description Compiler Tools for Mac OS X and Darwin long_description A set of essential tools to support development \ on Mac OS X and Darwin. Conceptually similar \ similar to binutils on other platforms. homepage http://opensource.apple.com/source/${name}/ master_sites http://opensource.apple.com/tarballs/${name}/ checksums rmd160 1caf207acbf421cdc975926a392fc75dc1d2594c \ sha256 dfaa9bdbd023524d47429674f64d2d5ea393123dabf90868be0aa17f61f45289 depends_lib port:cctools-headers depends_build path:lib/libprunetrie.a:ld64 depends_run port:llvm-${llvm_version} patchfiles PR-11136237.patch if {${os.major} < 9 || ${os.arch} == "powerpc"} { # XCode 3.1.4 version 698.1 revision 1 distname cctools-${version} checksums rmd160 898c7b46869d4989c115420912fdd8d96ae923d3 \ sha256 383f1c0c78a2b3efdfdf7ce01adb7e2f8ee9985164dba6ab1c0fae800a211cec patchfiles patch-misc_libtool.c.diff PR-11136237-698.1.patch supported_archs i386 ppc } elseif {${os.major} == 9} { # XCode 3.2.6 version 795 distname cctools-${version} checksums rmd160 0932fa5a96b81e50528211abfec01a9b66790485 \ sha256 7fab7044b648e92a9fefd493a1bb6daa4246f24c5838d8b5c913a446e6bbd2ef supported_archs i386 x86_64 } elseif {${os.major} == 10} { # XCode 4.2 (but we should be able to run the XCode 4.3 version on SL) version 809 revision 1 distname cctools-${version} checksums rmd160 f433124035ac0ef403bdc6edec087bdedd0b4375 \ sha256 03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad supported_archs i386 x86_64 } use_configure no destroot.args DSTROOT=${destroot}${prefix} RC_ProjectSourceVersion=${version} post-patch { # We don't want to build cctools ld. We want to use ld64 reinplace "/^SUBDIRS_32/s/ld//" ${worksrcpath}/Makefile reinplace "/^COMMON_SUBDIRS/s/ ld / /" ${worksrcpath}/Makefile # Use our chosen version of llvm-mc reinplace "s:\"llvm-mc\":\"llvm-mc-mp-${llvm_version}\":" ${worksrcpath}/as/driver.c foreach file [glob ${worksrcpath}/{*/,}Makefile] { reinplace "s:/usr/local:${prefix}:g" ${file} reinplace "s:/usr:${prefix}:g" ${file} reinplace "s:${prefix}/efi:${prefix}:g" ${file} reinplace "s:${prefix}/man:${prefix}/share/man:g" ${file} if {${os.major} < 10} { reinplace "s:${prefix}/bin/mig:/usr/bin/mig:g" ${file} } } } use_configure no use_parallel_build yes build.target all pre-build { build.args-append \ TRIE=-DTRIE_SUPPORT \ USE_DEPENDENCY_FILE=NO \ BUILD_DYLIBS=NO \ LTO=-DLTO_SUPPORT \ CC="${configure.cc}" \ CXX="${configure.cxx}" \ RC_CFLAGS="[get_canonical_archflags] `llvm-config-mp-${llvm_version} --cflags`" \ LLVM_MC="llvm-mc-mp-${llvm_version}" } pre-destroot { destroot.args-append \ TRIE=-DTRIE_SUPPORT \ USE_DEPENDENCY_FILE=NO \ BUILD_DYLIBS=NO \ LTO=-DLTO_SUPPORT \ CC="${configure.cc}" \ CXX="${configure.cxx}" \ RC_CFLAGS="[get_canonical_archflags] `llvm-config-mp-${llvm_version} --cflags`" \ LLVM_MC="llvm-mc-mp-${llvm_version}" } platform macosx { build.args-append RC_OS="macos" destroot.args-append RC_OS="macos" } destroot.target install_tools destroot.args-append DSTROOT=${destroot} post-destroot { file delete -force ${destroot}${prefix}/OpenSourceLicenses file delete -force ${destroot}${prefix}/OpenSourceVersions file delete -force ${destroot}${prefix}/RelNotes if {${os.major} < 10} { file delete -force ${destroot}/Developer } # Provided by port:cctools-headers file delete -force ${destroot}${prefix}/include } livecheck.type regex livecheck.regex "${name}-(\[\\d.\]+)"