[90720] trunk/dports/_resources/port1.0/group/crossgcc-1.0.tcl

g5pw at macports.org g5pw at macports.org
Tue Mar 13 11:42:09 PDT 2012


Revision: 90720
          http://trac.macports.org/changeset/90720
Author:   g5pw at macports.org
Date:     2012-03-13 11:42:08 -0700 (Tue, 13 Mar 2012)
Log Message:
-----------
Changes to the crossgcc portgroup:
- info and man directories (mainly GNU propaganda) removed _if present_.
- enable NLS, I think it should be on by default
- enable parallel building
- build and configure in the right directory.
- quite dirty fix to eliminate default CPATH, which, if present, gives a build error if unwind.h is present in /opt/local/include.

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/crossgcc-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/crossgcc-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/crossgcc-1.0.tcl	2012-03-13 18:41:26 UTC (rev 90719)
+++ trunk/dports/_resources/port1.0/group/crossgcc-1.0.tcl	2012-03-13 18:42:08 UTC (rev 90720)
@@ -66,22 +66,34 @@
         set dcxx        gcc-g++-${version}.tar.bz2
         set dobjc       gcc-objc-${version}.tar.bz2
         
-        master_sites    gnu:gcc/gcc-${version}/:gcc
+        master_sites    gnu:gcc/gcc-${version}/:gcc \
+						ftp://ftp.gnu.org/pub/gnu/gcc/gcc-${version}
+
         distfiles       ${dcore}:gcc \
                         ${dcxx}:gcc \
                         ${dobjc}:gcc
-        dist_subdir     gcc
-        use_bzip2 yes
-        worksrcdir      build
+        use_bzip2		yes
+		
+        worksrcdir      gcc-${version}
 
         depends_lib     port:${crossgcc.target}-binutils \
                         port:gmp \
                         port:mpfr \
                         port:libiconv \
                         port:libmpc
+						
+	depends_build	port:gettext
 
-        extract.only    ${dcore} ${dcxx} ${dobjc}
+        # I don't know why is this here, it looks redundant.
+        # macports should already extract all the distfiles!
+        #extract.only    ${dcore} ${dcxx} ${dobjc}
 
+        
+	# Build in a different directory, as advised in the README file.
+	post-extract {
+	    file mkdir "${workpath}/build"
+	}
+
         post-patch {
                 # Fix the info pages and related stuff.
                 #
@@ -89,7 +101,6 @@
                 # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
                 # name: name of the info page (e.g. as)
                 # suffix: suffix of the source page (texinfo or texi)
-            
                 # path makefile name suffix
                 set infopages {
                     gcc/doc/ gcc/Makefile.in cpp texi
@@ -97,12 +108,14 @@
                     gcc/doc/ gcc/Makefile.in gcc texi
                     gcc/doc/ gcc/Makefile.in gccint texi
                     gcc/doc/ gcc/Makefile.in gccinstall info
-                    libquadmath libquadmath/Makefile.in libquadmath info
+		    libquadmath libquadmath/Makefile.in libquadmath info
                 }
             
                 foreach { path makefile name suffix } $infopages {
-                    set src      ${workpath}/gcc-${version}/${path}/${name}.${suffix}
-                    set makefile ${workpath}/gcc-${version}/${makefile}
+                    set src      ${worksrcpath}/${path}/${name}.${suffix}
+                    set makefile ${worksrcpath}/${makefile}
+                    # If the makefile doesn't exists, skip it.
+                    if { ! [file exists ${makefile}] } {continue}
 
                     # Fix the source
                     reinplace "s|setfilename ${name}.info|setfilename ${crossgcc.target}-${name}.info|g" ${src}
@@ -110,8 +123,8 @@
                     reinplace "s|@file{${name}}|@file{${crossgcc.target}-${name}}|g" ${src}
 
                     # Rename the source
-                    file rename ${workpath}/gcc-${version}/${path}/${name}.${suffix} \
-                                ${workpath}/gcc-${version}/${path}/${crossgcc.target}-${name}.${suffix}
+                    file rename ${worksrcpath}/${path}/${name}.${suffix} \
+                                ${worksrcpath}/${path}/${crossgcc.target}-${name}.${suffix}
 
                     # Fix the Makefile
                     reinplace -E "s:\[\[:<:\]\]${name}\\.(info|pod|${suffix}):${crossgcc.target}-&:g" ${makefile}
@@ -122,7 +135,7 @@
                 }
 
                 # Do not install libiberty
-                reinplace {/^install:/s/ .*//} ${workpath}/gcc-${version}/libiberty/Makefile.in
+                reinplace {/^install:/s/ .*//} ${worksrcpath}/libiberty/Makefile.in
         }
 
         # the generated compiler doesn't accept -arch
@@ -131,18 +144,18 @@
         configure.objc_archflags
         configure.ld_archflags
 
-        pre-configure   {
-            file mkdir ${worksrcpath}
-        }
-
-        configure.cmd   ../gcc-${version}/configure
+	# We don't need system includes(this prevents xgcc to include system-wide
+	# unwind.h if it is present)!
+	compiler.cpath
+	
+	configure.dir   ${workpath}/build
+        configure.cmd   ${worksrcpath}/configure
         configure.args  --target=${crossgcc.target} \
                         --enable-languages="c,objc,c++,obj-c++" \
                         --infodir=${prefix}/share/info \
                         --mandir=${prefix}/share/man \
                         --datarootdir=${prefix}/share/${name} \
                         --with-system-zlib \
-                        --disable-nls \
                         --with-gmp=${prefix} \
                         --with-mpfr=${prefix} \
                         --with-mpc=${prefix} \
@@ -165,6 +178,10 @@
 
         universal_variant no
 
+	#GCC suports parallel building
+	use_parallel_build yes
+	build.dir               ${workpath}/build
+
         destroot.violate_mtree yes
 
         pre-destroot {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120313/27a90b86/attachment.html>


More information about the macports-changes mailing list