Index: trunk/dports/lang/gcc45/Portfile
===================================================================
--- trunk/dports/lang/gcc45/Portfile	(revision 68778)
+++ trunk/dports/lang/gcc45/Portfile	(revision 68780)
@@ -4,7 +4,7 @@
 
 name			gcc45
+epoch			1
 version			4.5.0
-revision                2
-epoch                   1
+revision		3
 platforms		darwin
 categories		lang
@@ -16,9 +16,10 @@
 
 homepage		http://gcc.gnu.org/
-master_sites    ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/ \
-                ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/ \
-                ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/ \
-                ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \
-                gnu:/gcc/gcc-${version}
+master_sites		ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/:gcc \
+			ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/:gcc \
+			ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/:gcc \
+			ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/:gcc \
+			gnu:/gcc/gcc-${version}:gcc \
+			ftp://sourceware.org/pub/java/:ecj
 
 set dcore		gcc-core-${version}.tar.bz2
@@ -27,5 +28,7 @@
 set djava		gcc-java-${version}.tar.bz2
 set dobjc		gcc-objc-${version}.tar.bz2
-distfiles		${dcore} ${dfort} ${dcxx} ${djava} ${dobjc}
+set ecj			ecj-4.5.jar
+distfiles		${dcore}:gcc ${dfort}:gcc ${dcxx}:gcc ${djava}:gcc ${dobjc}:gcc ${ecj}:ecj
+extract.only		${dcore} ${dfort} ${dcxx} ${djava} ${dobjc}
 
 checksums           gcc-core-${version}.tar.bz2 \
@@ -48,5 +51,9 @@
                     md5     8d8c01b6631b020cc6c167860fde2398 \
                     sha1    bca51ee80f3bc240b6dd84535d49423423eb457e \
-                    rmd160  9512ff932be7fa36d3f2c8b3ca3e41089ac5a6e8
+                    rmd160  9512ff932be7fa36d3f2c8b3ca3e41089ac5a6e8 \
+                    ${ecj} \
+                    md5     d7cd6a27c8801e66cbaa964a039ecfdb \
+                    sha1    58c1d79c64c8cd718550f32a932ccfde8d1e6449 \
+                    rmd160  d3f4da657f086b6423f74e93f001132f4855368a
 
 use_bzip2		yes
@@ -56,4 +63,7 @@
 
 depends_lib		port:gmp port:mpfr port:libiconv port:libmpc
+
+patchfiles		tls_configure_fix.diff
+patch.dir		${workpath}/gcc-${version}
 
 set major		4.5
@@ -67,4 +77,8 @@
     configure.objc_archflags
     configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
+}
+
+post-extract {
+	copy ${distpath}/${ecj} ${workpath}/gcc-${version}/ecj.jar
 }
 
@@ -123,4 +137,8 @@
 }
 
+platform darwin 10 {
+	configure.args-append --enable-fully-dynamic-string
+}
+
 livecheck.type  regex
 livecheck.url   http://gcc.gnu.org/gcc-4.5/
Index: trunk/dports/lang/gcc45/files/tls_configure_fix.diff
===================================================================
--- trunk/dports/lang/gcc45/files/tls_configure_fix.diff	(revision 68780)
+++ trunk/dports/lang/gcc45/files/tls_configure_fix.diff	(revision 68780)
@@ -0,0 +1,121 @@
+--- libgomp/configure.orig	2010-06-03 13:05:23.000000000 -0400
++++ libgomp/configure	2010-06-03 13:41:14.000000000 -0400
+@@ -15379,7 +15379,8 @@
+ /* end confdefs.h.  */
+ #include <pthread.h>
+ 		__thread int a;
+-		static int *a_in_other_thread;
++		int *a_in_other_thread;
++		int *a_in_main_thread;
+ 		static void *
+ 		thread_func (void *arg)
+ 		{
+@@ -15391,11 +15392,10 @@
+ {
+ pthread_t thread;
+ 		void *thread_retval;
+-		int *a_in_main_thread;
++		a_in_main_thread = &a;
+ 		if (pthread_create (&thread, (pthread_attr_t *)0,
+ 				    thread_func, (void *)0))
+ 		  return 0;
+-		a_in_main_thread = &a;
+ 		if (pthread_join (thread, &thread_retval))
+ 		  return 0;
+ 		return (a_in_other_thread == a_in_main_thread);
+--- libjava/configure.orig	2010-06-03 13:50:53.000000000 -0400
++++ libjava/configure	2010-06-03 13:51:44.000000000 -0400
+@@ -24341,7 +24341,8 @@
+ /* end confdefs.h.  */
+ #include <pthread.h>
+ 		__thread int a;
+-		static int *a_in_other_thread;
++		int *a_in_other_thread;
++		int *a_in_main_thread;
+ 		static void *
+ 		thread_func (void *arg)
+ 		{
+@@ -24353,11 +24354,10 @@
+ {
+ pthread_t thread;
+ 		void *thread_retval;
+-		int *a_in_main_thread;
++		a_in_main_thread = &a;
+ 		if (pthread_create (&thread, (pthread_attr_t *)0,
+ 				    thread_func, (void *)0))
+ 		  return 0;
+-		a_in_main_thread = &a;
+ 		if (pthread_join (thread, &thread_retval))
+ 		  return 0;
+ 		return (a_in_other_thread == a_in_main_thread);
+--- libstdc++-v3/configure.orig	2010-06-03 13:48:33.000000000 -0400
++++ libstdc++-v3/configure	2010-06-03 13:55:44.000000000 -0400
+@@ -25572,7 +25572,8 @@
+ /* end confdefs.h.  */
+ #include <pthread.h>
+ 		__thread int a;
+-		static int *a_in_other_thread;
++		int *a_in_other_thread;
++		int *a_in_main_thread;
+ 		static void *
+ 		thread_func (void *arg)
+ 		{
+@@ -25584,11 +25585,10 @@
+ {
+ pthread_t thread;
+ 		void *thread_retval;
+-		int *a_in_main_thread;
++		a_in_main_thread = &a;
+ 		if (pthread_create (&thread, (pthread_attr_t *)0,
+ 				    thread_func, (void *)0))
+ 		  return 0;
+-		a_in_main_thread = &a;
+ 		if (pthread_join (thread, &thread_retval))
+ 		  return 0;
+ 		return (a_in_other_thread == a_in_main_thread);
+@@ -44510,7 +44510,8 @@
+ /* end confdefs.h.  */
+ #include <pthread.h>
+ 		__thread int a;
+-		static int *a_in_other_thread;
++		int *a_in_other_thread;
++		int *a_in_main_thread;
+ 		static void *
+ 		thread_func (void *arg)
+ 		{
+@@ -44522,11 +44523,10 @@
+ {
+ pthread_t thread;
+ 		void *thread_retval;
+-		int *a_in_main_thread;
++		a_in_main_thread = &a;
+ 		if (pthread_create (&thread, (pthread_attr_t *)0,
+ 				    thread_func, (void *)0))
+ 		  return 0;
+-		a_in_main_thread = &a;
+ 		if (pthread_join (thread, &thread_retval))
+ 		  return 0;
+ 		return (a_in_other_thread == a_in_main_thread);
+@@ -50595,7 +50595,8 @@
+ /* end confdefs.h.  */
+ #include <pthread.h>
+ 		__thread int a;
+-		static int *a_in_other_thread;
++		int *a_in_other_thread;
++		int *a_in_main_thread;
+ 		static void *
+ 		thread_func (void *arg)
+ 		{
+@@ -50607,11 +50608,10 @@
+ {
+ pthread_t thread;
+ 		void *thread_retval;
+-		int *a_in_main_thread;
++		a_in_main_thread = &a;
+ 		if (pthread_create (&thread, (pthread_attr_t *)0,
+ 				    thread_func, (void *)0))
+ 		  return 0;
+-		a_in_main_thread = &a;
+ 		if (pthread_join (thread, &thread_retval))
+ 		  return 0;
+ 		return (a_in_other_thread == a_in_main_thread);
