[41429] trunk/dports/cross/m68k-rtems-gcc

pguyot at kallisys.net pguyot at kallisys.net
Sun Nov 2 04:33:28 PST 2008


Revision: 41429
          http://trac.macports.org/changeset/41429
Author:   pguyot at kallisys.net
Date:     2008-11-02 04:33:28 -0800 (Sun, 02 Nov 2008)
Log Message:
-----------
cross/m68k-rtems-gcc: update to 4.2.3

Modified Paths:
--------------
    trunk/dports/cross/m68k-rtems-gcc/Portfile

Added Paths:
-----------
    trunk/dports/cross/m68k-rtems-gcc/files/patch-newlib-libc-configure.diff

Removed Paths:
-------------
    trunk/dports/cross/m68k-rtems-gcc/files/patch-gcc-Makefile.in
    trunk/dports/cross/m68k-rtems-gcc/files/patch-gcc-f-Make-lang.in

Modified: trunk/dports/cross/m68k-rtems-gcc/Portfile
===================================================================
--- trunk/dports/cross/m68k-rtems-gcc/Portfile	2008-11-02 12:28:12 UTC (rev 41428)
+++ trunk/dports/cross/m68k-rtems-gcc/Portfile	2008-11-02 12:33:28 UTC (rev 41429)
@@ -1,13 +1,15 @@
 # $Id$
 
 PortSystem			1.0
+
 name            	m68k-rtems-gcc
-version         	3.2.3
-revision			1
+version         	4.2.3
 
 # Parameters for this port.
-set newlibversion	1.11.0
+set newlibversion	1.16.0
 set crossgcc-target m68k-rtems
+set rtemsversion	4.9
+set default-languages --enable-languages="c,c++,objc"
 
 description     	gcc cross-compilers for m68k-rtems, with newlib runtime library.
 long_description	gnu compilers collection (c, c++, fortran and objc) for \
@@ -16,22 +18,35 @@
 homepage			http://gcc.gnu.org/
 platforms       	darwin
 categories      	cross devel
-maintainers     	pguyot at kallisys.net
+maintainers     	pguyot at kallisys.net openmaintainer
 master_sites		gnu:gcc/gcc-${version}/:gcc \
 					ftp://sources.redhat.com/pub/newlib/:newlib \
 					ftp://ftp.mirror.ac.uk/sites/sources.redhat.com/pub/newlib/:newlib \
-					ftp://ftp.rtems.com/pub/rtems/snapshots/c_tools/source/:rtems \
-					http://rtems.thehousleys.net/:rtems
-distfiles			gcc-${version}.tar.gz:gcc \
+					ftp://ftp.rtems.com/pub/rtems/SOURCES/${rtemsversion}/:rtems \
+					freebsd::rtems
+distfiles			gcc-${version}.tar.bz2:gcc \
 					newlib-${newlibversion}.tar.gz:newlib \
-					gcc-${version}-rtems-20030507a.diff:rtems \
-					newlib-${newlibversion}-rtems-20030605.diff:rtems
+					gcc-core-${version}-rtems4.9-20080205.diff:rtems \
+					newlib-${newlibversion}-rtems4.9-20080302.diff:rtems
 extract.only		gcc-${version}.tar.gz newlib-${newlibversion}.tar.gz
 worksrcdir			gcc-${version}
-checksums			gcc-${version}.tar.gz md5 e951123b2dfd2288c3e9337024dc9e4c \
-					newlib-${newlibversion}.tar.gz md5 74de7de0c9624cd757df63f2ed17a9b4 \
-					gcc-${version}-rtems-20030507a.diff md5 d4adda8ccba7ad57ee36b7720eadf19c \
-					newlib-${newlibversion}-rtems-20030605.diff md5 b1dfdabd92e241d835964c6ef86aa3c9
+checksums			gcc-${version}.tar.bz2 \
+                    md5     ef2a4d9991b3644115456ea05b2b8163 \
+                    sha1    80b0df13fc9e311868022a3e86e673177397a917 \
+                    rmd160  70b589b79b97967857f2ec70ff8b2017c84c464d \
+					newlib-${newlibversion}.tar.gz \
+                    md5     bf8f1f9e3ca83d732c00a79a6ef29bc4 \
+                    sha1    841edec33d19a9e549984982fb92445ee967e265 \
+                    rmd160  fa40ff43e858da3093c9f3b5b203724b9b327696 \
+					gcc-core-${version}-rtems4.9-20080205.diff \
+                    md5     d5a6a8c5973024476f0df6356b5e0424 \
+                    sha1    20d0ada57ad44d9f060e60e26acee57e46137ad6 \
+                    rmd160  c87a5703959dc319fad8e8b4804b8d4803cddc99 \
+					newlib-${newlibversion}-rtems4.9-20080302.diff \
+                    md5     a227456d0850e24a839634096b879c30 \
+                    sha1    4f8cd12ada4865b271eb4d4c7d80b520fb8d2bc6 \
+                    rmd160  81c76c584a6c76c9ea706bf9f0f2ba149303b289
+patchfiles			patch-newlib-libc-configure.diff
 
 # All cross ports violate the mtree layout.
 destroot.violate_mtree	yes
@@ -39,73 +54,73 @@
 # Download everything to gcc/
 dist_subdir			gcc
 
-# Patches for info's dir.
-patchfiles			patch-gcc-Makefile.in \
-					patch-gcc-f-Make-lang.in
-
 depends_lib			bin:${crossgcc-target}-ar:${crossgcc-target}-binutils \
 					bin:${crossgcc-target}-as:${crossgcc-target}-binutils \
 					bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
 					bin:${crossgcc-target}-nm:${crossgcc-target}-binutils \
-					bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils \
-					lib:libintl:gettext
+					bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils
+depends_build		bin:msgfmt:gettext
 
-# Link newlib to gcc, so gcc will find its include files and this will also build newlib.
+# gcc is .bz2, newlib is .gz.
+# let's extract only gcc with DP infrastructure, we'll do newlib manually.
+use_bzip2			yes
+extract.only		gcc-${version}.tar.bz2
+
+# Extract newlib and create a symlink of newlib/newlib in gcc directory.
 post-extract	{
-	system "ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}"
+	system "cd ${workpath} && gzip -dc ${distpath}/newlib-${newlibversion}.tar.gz | tar -xf -"
+	system "ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}/"
 }
 
+# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
+# program names as gcc's name (add -${version} with ${version} being the version of gcc).
+# But it won't work because binutils binaries don't have the ${version} suffix, and even if they
+# had, they would actually have the binutils' version suffix (and not gcc's version).
+# So let's tell gcc's Makefile not to do that mistake.
+
+set environment [list AR_FOR_TARGET=${crossgcc-target}-ar \
+				AS_FOR_TARGET=${crossgcc-target}-as \
+				LD_FOR_TARGET=${crossgcc-target}-ld \
+				NM_FOR_TARGET=${crossgcc-target}-nm \
+				RANLIB_FOR_TARGET=${crossgcc-target}-ranlib]
+
 # Build in a different directory, as advised in the README file.
-pre-configure   { system "cd ${workpath} && mkdir -p build"}
+pre-configure   {
+	file mkdir "${workpath}/build"
+}
 configure.dir   ${workpath}/build
 configure.cmd   ${workpath}/gcc-${version}/configure
 configure.cc	"cc -no-cpp-precomp"
+configure.env	${environment}
 configure.args  --infodir='${prefix}/share/info' \
 				--mandir='${prefix}/share/man' \
 				--target=${crossgcc-target} \
 				--program-prefix=${crossgcc-target}- \
 				--program-suffix=-${version} \
+				--with-included-gettext \
 				--enable-obsolete \
-				--enable-languages="c,c++,f77,objc" \
-				--without-included-gettext \
-				--with-gnu-as --with-gnu-ld \
 				--with-newlib \
-				--with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/
+				--with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \
+				${default-languages}
+
 build.dir       ${workpath}/build
-destroot.args	\
-	--with-gxx-include-dir=${destroot}/${prefix}/${crossgcc-target}/include/c++/${version}/
 
-# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
-# program names as gcc's name (add -${version} with ${version} being the version of gcc).
-# But it won't work because binutils binaries don't have the ${version} suffix, and even if they
-# had, they would actually have the binutils' version suffix (and not gcc's version).
-# So let's tell gcc's Makefile not to do that mistake.
+build.args		${environment}
+destroot.args	${environment}
 
-build.args		AR_FOR_TARGET=${crossgcc-target}-ar \
-				AS_FOR_TARGET=${crossgcc-target}-as \
-				LD_FOR_TARGET=${crossgcc-target}-ld \
-				NM_FOR_TARGET=${crossgcc-target}-nm \
-				RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
-
-destroot.args	AR_FOR_TARGET=${crossgcc-target}-ar \
-				AS_FOR_TARGET=${crossgcc-target}-as \
-				LD_FOR_TARGET=${crossgcc-target}-ld \
-				NM_FOR_TARGET=${crossgcc-target}-nm \
-				RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
-
 pre-patch {
 	# Additional patches for rtems.
 	system "cd ${workpath}/gcc-${version} && \
-		patch -p1 < ${distpath}/gcc-${version}-rtems-20030507a.diff"
+		patch -p1 < ${distpath}/gcc-core-${version}-rtems4.9-20080205.diff"
 	system "cd ${workpath}/newlib-${newlibversion} && \
-		patch -p1 < ${distpath}/newlib-${newlibversion}-rtems-20030605.diff"
+		patch -p1 < ${distpath}/newlib-${newlibversion}-rtems4.9-20080302.diff"
 }
 
 post-patch {
 	namespace eval crossgcc {}
 
 	# Fix the info pages and related stuff.
-	#	
+	#
 	# path: path to the doc directory (e.g. gas/doc/)
 	# makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
 	# name: name of the info page (e.g. as)
@@ -120,25 +135,39 @@
 			${worksrcpath}/${path}/${name}.${suffix}
 		reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
 			${worksrcpath}/${path}/${name}.${suffix}
-		
+
 		# Fix the Makefile
-		reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \
+		reinplace "s| ${name}.info| ${crossgcc-target}-${name}.info|g" \
 			${worksrcpath}/${makefile}
-		reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
+		reinplace "s|/${name}.info|/${crossgcc-target}-${name}.info|g" \
 			${worksrcpath}/${makefile}
-		
+		reinplace "s|^${name}.info|${crossgcc-target}-${name}.info|g" \
+			${worksrcpath}/${makefile}
+		reinplace "s| ${name}.pod| ${crossgcc-target}-${name}.pod|g" \
+			${worksrcpath}/${makefile}
+		reinplace "s|/${name}.pod|/${crossgcc-target}-${name}.pod|g" \
+			${worksrcpath}/${makefile}
+		reinplace "s|^${name}.pod|${crossgcc-target}-${name}.pod|g" \
+			${worksrcpath}/${makefile}
+		reinplace "s| ${name}.${suffix}| ${crossgcc-target}-${name}.${suffix}|g" \
+			${worksrcpath}/${makefile}
+		reinplace "s|/${name}.${suffix}|/${crossgcc-target}-${name}.${suffix}|g" \
+			${worksrcpath}/${makefile}
+		reinplace "s|^${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
+			${worksrcpath}/${makefile}
+
 		# Rename the source
 		file rename ${worksrcpath}/${path}/${name}.${suffix} \
 			${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
-		
+
 		# Fix install-info's dir.
 		# (note: this may be effectless if there was no info dir to be fixed)
-		reinplace "s|__TARGET|${crossgcc-target}|g" \
+		reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-gcc-dir|g" \
 			"${worksrcpath}/${makefile}"
 	}
 
 	# Fix the gettext files and related stuff.
-	#	
+	#
 	# module: name of the module (e.g. gas)
 	proc crossgcc::fixgettext { module } {
 		global crossgcc-target worksrcpath
@@ -170,20 +199,50 @@
 	crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
 
 	# gcc/f/g77.texi
-	crossgcc::fixinfo gcc/f/ gcc/f/Make-lang.in g77 texi
+	crossgcc::fixinfo gcc/fortran/ gcc/fortran/Make-lang.in gfortran texi
 
+	# gcc/java/gcj.texi
+	crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
+
+	# gcc/doc/gccinstall.info
+	crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccinstall info
+
 	# gettext stuff.
 	crossgcc::fixgettext gcc
+	crossgcc::fixgettext libcpp
 }
 
+pre-destroot {
+	# gcc needs the cross directory structure to be present
+	# in order to fill it during installation.
+	file mkdir "${destroot}/${prefix}/${crossgcc-target}/bin"
+	file mkdir "${destroot}/${prefix}/${crossgcc-target}/lib"
+}
+
 post-destroot {
+	namespace eval crossgcc {}
+
+	# Rename a man page if it exists.
+	#
+	# section: section of the man page (e.g. 1)
+	# manpage: name of the man page (e.g. cpp)
+	proc crossgcc::rename_man_page { section manpage } {
+		global crossgcc-target destroot prefix
+
+		set manpage_path "${destroot}/${prefix}/share/man/man${section}/${manpage}.${section}"
+		if { [ file exists ${manpage_path} ] } {
+			file rename ${manpage_path} \
+				"${destroot}/${prefix}/share/man/man${section}/${crossgcc-target}-${manpage}.${section}"
+		}
+	}
+
 	# Stuff I don't want (either because they're in the system
 	# or because they would conflict with other FSF ports)
 	# (it's easier for maintainability purposes to fix things here)
 
 	# aliases for locales (should be on the system)
 	file delete "${destroot}/${prefix}/share/locale/locale.alias"
-	
+
 	# FSF propaganda (should already be there or would conflict)
 	file delete -force "${destroot}/${prefix}/share/man/man7"
 
@@ -192,13 +251,27 @@
 
 	# aliases for charsets (should already be there)
 	file delete "${destroot}/${prefix}/lib/charset.alias"
-	
+
+	# Remove man pages for tools that are not built as part of cross-gcc
+	file delete "${destroot}/${prefix}/share/man/man1/rmic.1"
+	file delete "${destroot}/${prefix}/share/man/man1/rmiregistry.1"
+	file delete "${destroot}/${prefix}/share/man/man1/jv-convert.1"
+	file delete "${destroot}/${prefix}/share/man/man1/gij.1"
+
 	# For some reason, some man pages are not prefixed while they should have been
 	# (to avoid conflicting).
-	file rename "${destroot}/${prefix}/share/man/man1/cpp.1" \
-		"${destroot}/${prefix}/share/man/man1/${crossgcc-target}-cpp.1"
-	file rename "${destroot}/${prefix}/share/man/man1/gcov.1" \
-		"${destroot}/${prefix}/share/man/man1/${crossgcc-target}-gcov.1"
+	crossgcc::rename_man_page 1 cpp
+	crossgcc::rename_man_page 1 gcjh
+	crossgcc::rename_man_page 1 gcov
+	crossgcc::rename_man_page 1 jcf-dump
+	crossgcc::rename_man_page 1 jv-scan
+
+	# There is a bug in gcc/Makefile::install-driver
+	# For cross compilers, $(GCC_INSTALL_NAME) is equal to
+	# $(target_noncanonical)-gcc-$(version)
+	# and hence the driver isn't installed.
+	xinstall -c "${workpath}/build/gcc/xgcc" \
+		"${destroot}/${prefix}/bin/${crossgcc-target}-gcc-${version}"
 }
 
 livecheck.check	regex

Deleted: trunk/dports/cross/m68k-rtems-gcc/files/patch-gcc-Makefile.in
===================================================================
--- trunk/dports/cross/m68k-rtems-gcc/files/patch-gcc-Makefile.in	2008-11-02 12:28:12 UTC (rev 41428)
+++ trunk/dports/cross/m68k-rtems-gcc/files/patch-gcc-Makefile.in	2008-11-02 12:33:28 UTC (rev 41429)
@@ -1,11 +0,0 @@
---- gcc/Makefile.in.old	Sun Jan 11 09:33:27 2004
-+++ gcc/Makefile.in	Sun Jan 11 09:38:14 2004
-@@ -2666,7 +2666,7 @@
- 	  if [ -f $(DESTDIR)$(infodir)/dir ] ; then \
- 	    for f in cpp.info gcc.info gccint.info cppinternals.info; do \
- 		if [ -f $(DESTDIR)$(infodir)/$$f ]; then \
--		  install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/$$f; \
-+		  install-info --dir-file=$(DESTDIR)$(infodir)/__TARGET-gcc-dir $(DESTDIR)$(infodir)/$$f; \
- 		else true; fi; \
- 	    done; \
- 	  else true; fi; \

Deleted: trunk/dports/cross/m68k-rtems-gcc/files/patch-gcc-f-Make-lang.in
===================================================================
--- trunk/dports/cross/m68k-rtems-gcc/files/patch-gcc-f-Make-lang.in	2008-11-02 12:28:12 UTC (rev 41428)
+++ trunk/dports/cross/m68k-rtems-gcc/files/patch-gcc-f-Make-lang.in	2008-11-02 12:33:28 UTC (rev 41429)
@@ -1,13 +0,0 @@
---- gcc/f/Make-lang.in.old	Sun Jan 11 10:19:52 2004
-+++ gcc/f/Make-lang.in	Sun Jan 11 10:20:09 2004
-@@ -278,8 +278,8 @@
- 	else true; fi
- 	@if [ -f $(srcdir)/f/g77.info ] ; then \
- 	  if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
--	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/g77.info"; \
--	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/g77.info || : ; \
-+	    echo " install-info --dir-file=$(DESTDIR)$(infodir)/__TARGET-gcc-dir $(DESTDIR)$(infodir)/g77.info"; \
-+	    install-info --dir-file=$(DESTDIR)$(infodir)/__TARGET-gcc-dir $(DESTDIR)$(infodir)/g77.info || : ; \
- 	  else : ; fi; \
- 	else : ; fi
- 

Copied: trunk/dports/cross/m68k-rtems-gcc/files/patch-newlib-libc-configure.diff (from rev 41417, trunk/dports/cross/i386-rtems-gcc/files/patch-newlib-libc-configure.diff)
===================================================================
--- trunk/dports/cross/m68k-rtems-gcc/files/patch-newlib-libc-configure.diff	                        (rev 0)
+++ trunk/dports/cross/m68k-rtems-gcc/files/patch-newlib-libc-configure.diff	2008-11-02 12:33:28 UTC (rev 41429)
@@ -0,0 +1,11 @@
+--- newlib/libc/configure.orig	2007-04-30 10:23:34.000000000 +0900
++++ newlib/libc/configure	2007-04-30 10:24:07.000000000 +0900
+@@ -1238,7 +1238,7 @@
+       ac_cache_corrupted=: ;;
+     ,);;
+     *)
+-      if test "x$ac_old_val" != "x$ac_new_val"; then
++      if test "x${ac_old_val%% }" != "x${ac_new_val%% }"; then
+ 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+ echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081102/ac848097/attachment.html>


More information about the macports-changes mailing list