[27018] trunk/base/src/port1.0/portconfigure.tcl

source_changes at macosforge.org source_changes at macosforge.org
Sun Jul 15 15:06:34 PDT 2007


Revision: 27018
          http://trac.macosforge.org/projects/macports/changeset/27018
Author:   mww at macports.org
Date:     2007-07-15 15:06:34 -0700 (Sun, 15 Jul 2007)

Log Message:
-----------
add new commands for selecting compilers:
    * configure.cc, configure.cxx, .. work just like configure.cflags (no default values)
    * configure.compiler lets you select a whole compiler collection; this will preset most compiler variables (configure.cc, ..) with their compiler frontend of that compiler version (currently can do gcc-3.3, gcc-4.0, macports-gcc-[0-2])

Modified Paths:
--------------
    trunk/base/src/port1.0/portconfigure.tcl

Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl	2007-07-15 21:38:57 UTC (rev 27017)
+++ trunk/base/src/port1.0/portconfigure.tcl	2007-07-15 22:06:34 UTC (rev 27018)
@@ -3,6 +3,7 @@
 # $Id$
 #
 # Copyright (c) 2002 - 2003 Apple Computer, Inc.
+# Copyright (c) 2007 Markus W. Weissmann <mww at macports.org>
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -67,6 +68,16 @@
 default configure.universal_cxxflags	{"-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"}
 default configure.universal_ldflags		{"-arch i386 -arch ppc"}
 
+# Select a distinct compiler (C, C preprocessor, C++)
+options configure.cc configure.cxx configure.cpp configure.f77 configure.f90 configure.fc configure.compiler
+default configure.cc			{}
+default configure.cxx			{}
+default configure.cpp			{}
+default configure.f77			{}
+default configure.f90			{}
+default configure.fc			{}
+default configure.compiler		{}
+
 set_ui_prefix
 
 proc configure_start {args} {
@@ -79,6 +90,7 @@
     global [info globals]
     global worksrcpath use_configure use_autoconf use_automake use_xmkmf
     global configure.env configure.cflags configure.cppflags configure.cxxflags configure.ldflags
+    global configure.cc configure.cxx configure.cpp configure.compiler prefix
     
     if {[tbool use_automake]} {
 	# XXX depend on automake
@@ -93,6 +105,54 @@
 	    return -code error "[format [msgcat::mc "%s failure: %s"] autoconf $result]"
 	}
     }
+
+    # select a compiler collections
+    switch -exact ${configure.compiler} {
+        gcc-3.3 {
+            ui_debug "Using Mac OS X gcc 3.3"
+            set configure.cc "/usr/bin/gcc-3.3"
+            set configure.cxx "/usr/bin/g++-3.3"
+            set configure.cpp "/usr/bin/cpp-3.3" }
+        gcc-4.0 {
+            ui_debug "Using Mac OS X gcc 4.0"
+            set configure.cc "/usr/bin/gcc-4.0"
+            set configure.cxx "/usr/bin/g++-4.0"
+            set configure.cpp "/usr/bin/cpp-4.0" }
+        macports-gcc-4.0 {
+            ui_debug "Using MacPorts gcc 4.0"
+            set configure.cc "${prefix}/bin/gcc-mp-4.0"
+            set configure.cxx "${prefix}/bin/g++-mp-4.0"
+            set configure.cpp "${prefix}/bin/cpp-mp-4.0"
+            set configure.fc "${prefix}/bin/gfortran-mp-4.0"
+            set configure.f77 "${prefix}/bin/gfortran-mp-4.0"
+            set configure.f90 "${prefix}/bin/gfortran-mp-4.0" }
+        macports-gcc-4.1 {
+            ui_debug "Using MacPorts gcc 4.1"
+            set configure.cc "${prefix}/bin/gcc-mp-4.1"
+            set configure.cxx "${prefix}/bin/g++-mp-4.1"
+            set configure.cpp "${prefix}/bin/cpp-mp-4.1"
+            set configure.fc "${prefix}/bin/gfortran-mp-4.1"
+            set configure.f77 "${prefix}/bin/gfortran-mp-4.1"
+            set configure.f90 "${prefix}/bin/gfortran-mp-4.1" }
+        macports-gcc-4.2 {
+            ui_debug "Using MacPorts gcc 4.2"
+            set configure.cc "${prefix}/bin/gcc-mp-4.2"
+            set configure.cxx "${prefix}/bin/g++-mp-4.2"
+            set configure.cpp "${prefix}/bin/cpp-mp-4.2"
+            set configure.fc "${prefix}/bin/gfortran-mp-4.2"
+            set configure.f77 "${prefix}/bin/gfortran-mp-4.2"
+            set configure.f90 "${prefix}/bin/gfortran-mp-4.2" }
+        macports-gcc-4.3 {
+            ui_debug "Using MacPorts gcc 4.3"
+            set configure.cc "${prefix}/bin/gcc-mp-4.3"
+            set configure.cxx "${prefix}/bin/g++-mp-4.3"
+            set configure.cpp "${prefix}/bin/cpp-mp-4.3"
+            set configure.fc "${prefix}/bin/gfortran-mp-4.3"
+            set configure.f77 "${prefix}/bin/gfortran-mp-4.3"
+            set configure.f90 "${prefix}/bin/gfortran-mp-4.3" }
+        default {
+            ui_debug "No compiler collection selected explicitely" }
+    }
     
     if {[tbool use_xmkmf]} {
 		# XXX depend on xmkmf
@@ -108,6 +168,9 @@
     	parse_environment configure
 
     	# Append configure flags.
+		append_list_to_environment_value configure "CC" ${configure.cc}
+		append_list_to_environment_value configure "CPP" ${configure.cpp}
+		append_list_to_environment_value configure "CXX" ${configure.cxx}
 		append_list_to_environment_value configure "CFLAGS" ${configure.cflags}
 		append_list_to_environment_value configure "CPPFLAGS" ${configure.cppflags}
 		append_list_to_environment_value configure "CXXFLAGS" ${configure.cxxflags}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070715/cfe4da3d/attachment.html


More information about the macports-changes mailing list