Revision
91464
Author
jeremyhu@macports.org
Date
2012-04-02 11:00:59 -0700 (Mon, 02 Apr 2012)

Log Message

llvm-gcc-4.2: Build fix for Tiger and Leopard

Modified Paths

Diff

Modified: trunk/dports/lang/llvm-gcc42/Portfile (91463 => 91464)


--- trunk/dports/lang/llvm-gcc42/Portfile	2012-04-02 17:57:09 UTC (rev 91463)
+++ trunk/dports/lang/llvm-gcc42/Portfile	2012-04-02 18:00:59 UTC (rev 91464)
@@ -8,7 +8,7 @@
 categories              lang
 platforms               darwin
 license                 GPL-2+
-maintainers             erickt mfeiri
+maintainers             erickt mfeiri jeremyhu
 description             llvm-gcc42 is a gcc compiler frontend for llvm
 long_description        llvm-gcc42 integrates the LLVM optimizers and code \
                         generator with the GCC 4.2 parser. This allows LLVM to \
@@ -67,6 +67,13 @@
     configure.compiler llvm-gcc-4.2
 }
 
+# gcc-4.0 produces a bad x86_64 slice, and Leopard's gcc-4.2 doesn't build this properly,
+# so use MacPorts-provided apple-gcc-4.2 to build us on 10.[45]
+if {${configure.compiler} == "gcc-4.0" || ${configure.compiler} == "gcc-4.2"} {
+    depends_build-append port:apple-gcc42
+    configure.compiler apple-gcc-4.2
+}
+
 # STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
 # BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
 # -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins