Modified: trunk/dports/devel/cctools/Portfile (91494 => 91495)
--- trunk/dports/devel/cctools/Portfile 2012-04-03 16:16:55 UTC (rev 91494)
+++ trunk/dports/devel/cctools/Portfile 2012-04-03 17:14:26 UTC (rev 91495)
@@ -3,9 +3,11 @@
PortSystem 1.0
name cctools
version 822
+revision 1
+set llvm_version 3.0
categories devel
platforms darwin
-maintainers mfeiri openmaintainer
+maintainers mfeiri jeremyhu openmaintainer
license {APSL-2.0 GPL-2+}
description Compiler Tools for Mac OS X and Darwin
long_description A set of essential tools to support development \
@@ -20,12 +22,13 @@
depends_lib port:cctools-headers
depends_build path:lib/libprunetrie.a:ld64
-patchfiles patch-misc_libtool.c.diff patch-misc_Makefile.diff patch-libmacho_Makefile.diff
+depends_run port:llvm-${llvm_version}
+patchfiles PR-11136237.patch
+
use_configure no
destroot.args DSTROOT=${destroot}${prefix} RC_ProjectSourceVersion=${version}
-
if {${os.major} < 9} {
pre-fetch {
ui_error "${name} requires Mac OS X 10.5 or later."
@@ -33,117 +36,90 @@
}
}
-platform darwin 9 {
- version 698.1
- distname cctools-${version}
- checksums rmd160 898c7b46869d4989c115420912fdd8d96ae923d3 \
- sha256 383f1c0c78a2b3efdfdf7ce01adb7e2f8ee9985164dba6ab1c0fae800a211cec
- patchfiles patch-misc_libtool.c.diff patch-ld_ld.c.diff
+post-patch {
+ # We don't want to build cctools ld. We want to use ld64
+ reinplace "/^SUBDIRS_32/s/ld//" ${worksrcpath}/Makefile
- build {}
+ # Use our chosen version of llvm-mc
+ reinplace "s:\"llvm-mc\":\"llvm-mc-mp-${llvm_version}\":" ${worksrcpath}/as/driver.c
- post-destroot {
+ foreach file [glob ${worksrcpath}/{*/,}Makefile] {
+ reinplace "s:/usr/local:${prefix}:g" ${file}
+ reinplace "s:/usr:${prefix}:g" ${file}
+ reinplace "s:${prefix}/efi:${prefix}:g" ${file}
+ reinplace "s:${prefix}/man:${prefix}/share/man:g" ${file}
+ }
+}
- foreach x "bin include lib libexec" {
- file delete -force ${destroot}${prefix}/${x}
- file rename -force ${destroot}${prefix}/usr/local/${x} ${destroot}${prefix}/
- }
+use_configure no
+use_parallel_build yes
- file delete -force ${destroot}${prefix}/share
- file rename -force ${destroot}${prefix}/usr/share ${destroot}${prefix}/
+build.target all
- file rename -force ${destroot}${prefix}/usr/local/efi/bin/mtoc ${destroot}${prefix}/bin/
- file rename -force ${destroot}${prefix}/usr/local/efi/share/man/man1/mtoc.1 ${destroot}${prefix}/share/man/man1/
+pre-build {
+ build.args-append \
+ TRIE=-DTRIE_SUPPORT \
+ USE_DEPENDENCY_FILE=NO \
+ BUILD_DYLIBS=NO \
+ LTO=-DLTO_SUPPORT \
+ CC="${configure.cc}" \
+ CXX="${configure.cxx}" \
+ RC_CFLAGS="[get_canonical_archflags] `llvm-config-mp-${llvm_version} --cflags`" \
+ LLVM_MC="llvm-mc-mp-${llvm_version}"
+}
- foreach x [glob ${destroot}${prefix}/usr/bin/*] {
- file rename -force ${x} ${destroot}${prefix}/bin/
- }
- foreach x [glob ${destroot}${prefix}/usr/local/man/man1/*] {
- file rename -force ${x} ${destroot}${prefix}/share/man/man1/
- }
- foreach x [glob ${destroot}${prefix}/usr/local/man/man3/*] {
- file rename -force ${x} ${destroot}${prefix}/share/man/man3/
- }
- foreach x [glob ${destroot}${prefix}/usr/libexec/gcc/darwin/*] {
- file rename -force ${x} ${destroot}${prefix}/libexec/gcc/darwin/
- }
-
- file delete -force ${destroot}${prefix}/usr
- file delete -force ${destroot}${prefix}/Developer
- }
+pre-destroot {
+ destroot.args-append \
+ TRIE=-DTRIE_SUPPORT \
+ USE_DEPENDENCY_FILE=NO \
+ BUILD_DYLIBS=NO \
+ LTO=-DLTO_SUPPORT \
+ CC="${configure.cc}" \
+ CXX="${configure.cxx}" \
+ RC_CFLAGS="[get_canonical_archflags] `llvm-config-mp-${llvm_version} --cflags`" \
+ LLVM_MC="llvm-mc-mp-${llvm_version}"
}
-platform darwin 10 {
- version 809
- distname cctools-${version}
- checksums rmd160 f433124035ac0ef403bdc6edec087bdedd0b4375 \
- sha256 03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad
+platform macosx {
+ build.args-append RC_OS="macos"
+ destroot.args-append RC_OS="macos"
- post-destroot {
-
- foreach x "bin include lib libexec" {
- file delete -force ${destroot}${prefix}/${x}
- file rename -force ${destroot}${prefix}/usr/local/${x} ${destroot}${prefix}/
- }
-
- file delete -force ${destroot}${prefix}/share
- file rename -force ${destroot}${prefix}/usr/share ${destroot}${prefix}/
-
- file rename -force ${destroot}${prefix}/usr/local/efi/bin/mtoc ${destroot}${prefix}/bin/
- file rename -force ${destroot}${prefix}/usr/local/efi/share/man/man1/mtoc.1 ${destroot}${prefix}/share/man/man1/
-
- foreach x [glob ${destroot}${prefix}/usr/bin/*] {
- file rename -force ${x} ${destroot}${prefix}/bin/
- }
- foreach x [glob ${destroot}${prefix}/usr/local/man/man1/*] {
- file rename -force ${x} ${destroot}${prefix}/share/man/man1/
- }
- foreach x [glob ${destroot}${prefix}/usr/local/man/man3/*] {
- file rename -force ${x} ${destroot}${prefix}/share/man/man3/
- }
- foreach x [glob ${destroot}${prefix}/usr/lib/system/*] {
- file rename -force ${x} ${destroot}${prefix}/lib/system/
- }
- foreach x [glob ${destroot}${prefix}/usr/libexec/as/*] {
- file rename -force ${x} ${destroot}${prefix}/libexec/as/
- }
-
- file delete -force ${destroot}${prefix}/usr
+ if {${os.major} < 10} {
+ # This doesn't build for me on Leopard. We should bump to at least version 795
+ # which was included in XCode 3.2.6 and supports Tiger and Leopard targets.
+ version 698.1
+ revision 1
+ distname cctools-${version}
+ checksums rmd160 898c7b46869d4989c115420912fdd8d96ae923d3 \
+ sha256 383f1c0c78a2b3efdfdf7ce01adb7e2f8ee9985164dba6ab1c0fae800a211cec
+ patchfiles patch-misc_libtool.c.diff patch-ld_ld.c.diff
+ } elseif {${os.major} == 10} {
+ version 809
+ revision 1
+ distname cctools-${version}
+ checksums rmd160 f433124035ac0ef403bdc6edec087bdedd0b4375 \
+ sha256 03ba62749b843b131c7304a044a98c6ffacd65b1399b921d69add0375f79d8ad
}
+
+ # This will be required if building newer cctools on older OS versions
+ #if {${os.major} < 10} {
+ # build.args-append \
+ # OLD_LIBKLD=YES
+ #
+ # destroot.args-append \
+ # OLD_LIBKLD=YES
+ #}
}
-platform darwin 11 {
- post-destroot {
-
- foreach x "bin include lib libexec" {
- file delete -force ${destroot}${prefix}/${x}
- file rename -force ${destroot}${prefix}/usr/local/${x} ${destroot}${prefix}/
- }
-
- file delete -force ${destroot}${prefix}/share
- file rename -force ${destroot}${prefix}/usr/share ${destroot}${prefix}/
-
- file rename -force ${destroot}${prefix}/usr/local/efi/bin/mtoc ${destroot}${prefix}/bin/
- file rename -force ${destroot}${prefix}/usr/local/efi/share/man/man1/mtoc.1 ${destroot}${prefix}/share/man/man1/
-
- foreach x [glob ${destroot}${prefix}/usr/bin/*] {
- file rename -force ${x} ${destroot}${prefix}/bin/
- }
- foreach x [glob ${destroot}${prefix}/usr/local/man/man1/*] {
- file rename -force ${x} ${destroot}${prefix}/share/man/man1/
- }
- foreach x [glob ${destroot}${prefix}/usr/local/man/man3/*] {
- file rename -force ${x} ${destroot}${prefix}/share/man/man3/
- }
- foreach x [glob ${destroot}${prefix}/usr/lib/system/*] {
- file rename -force ${x} ${destroot}${prefix}/lib/system/
- }
- foreach x [glob ${destroot}${prefix}/usr/libexec/as/*] {
- file rename -force ${x} ${destroot}${prefix}/libexec/as/
- }
-
- file delete -force ${destroot}${prefix}/usr
- }
+destroot.target install_tools
+destroot.args-append DSTROOT=${destroot}
+post-destroot {
+ file delete -force ${destroot}${prefix}/OpenSourceLicenses
+ file delete -force ${destroot}${prefix}/OpenSourceVersions
+ file delete -force ${destroot}${prefix}/RelNotes
+
+ # Provided by port:cctools-headers
+ file delete -force ${destroot}${prefix}/include
}
livecheck.type regex
Added: trunk/dports/devel/cctools/files/PR-11136237.patch (0 => 91495)
--- trunk/dports/devel/cctools/files/PR-11136237.patch (rev 0)
+++ trunk/dports/devel/cctools/files/PR-11136237.patch 2012-04-03 17:14:26 UTC (rev 91495)
@@ -0,0 +1,122 @@
+379 % cvs diff -p as/{notes,as.h,dwarf2dbg.h,arm.c} otool/{notes,print_objc2_32bit.c,print_objc2_64bit.c}
+Index: as/as.h
+===================================================================
+RCS file: /cvs/root/cctools/as/as.h,v
+retrieving revision 1.10
+diff -p -r1.10 as.h
+*** as/as.h 2 Jul 2010 01:14:33 -0000 1.10
+--- as/as.h 28 Mar 2012 23:38:13 -0000
+*************** extern cpu_subtype_t archflag_cpusubtype
+*** 179,185 ****
+ extern char *specific_archflag;
+
+ /* TRUE if the .subsections_via_symbols directive was seen */
+! int subsections_via_symbols;
+
+ /* -I path options for .includes */
+ struct directory_stack {
+--- 179,185 ----
+ extern char *specific_archflag;
+
+ /* TRUE if the .subsections_via_symbols directive was seen */
+! extern int subsections_via_symbols;
+
+ /* -I path options for .includes */
+ struct directory_stack {
+Index: as/dwarf2dbg.h
+===================================================================
+RCS file: /cvs/root/cctools/as/dwarf2dbg.h,v
+retrieving revision 1.3
+diff -p -r1.3 dwarf2dbg.h
+*** as/dwarf2dbg.h 2 Jul 2010 01:14:33 -0000 1.3
+--- as/dwarf2dbg.h 28 Mar 2012 23:38:13 -0000
+*************** extern void dwarf2_emit_label (symbolS *
+*** 115,121 ****
+ /* True when we're supposed to set the basic block mark whenever a label
+ is seen. Unless the target is doing Something Weird, just call
+ dwarf2_emit_label. */
+! bfd_boolean dwarf2_loc_mark_labels;
+
+ extern void dwarf2_finish (void);
+
+--- 115,121 ----
+ /* True when we're supposed to set the basic block mark whenever a label
+ is seen. Unless the target is doing Something Weird, just call
+ dwarf2_emit_label. */
+! extern bfd_boolean dwarf2_loc_mark_labels;
+
+ extern void dwarf2_finish (void);
+
+Index: as/arm.c
+===================================================================
+RCS file: /cvs/root/cctools/as/arm.c,v
+retrieving revision 1.83
+diff -p -r1.83 arm.c
+*** as/arm.c 15 Mar 2012 21:29:46 -0000 1.83
+--- as/arm.c 28 Mar 2012 23:38:13 -0000
+*************** typedef enum {
+*** 151,158 ****
+ # define N_(String) (String)
+
+ /* STUFF FROM gas/as.h */
+! #define COMMON
+! COMMON subsegT now_subseg;
+
+ /* STUFF FROM gas/config/tc-arm.h */
+ #define ARM_FLAG_THUMB (1 << 0) /* The symbol is a Thumb symbol rather than an Arm symbol. */
+--- 151,157 ----
+ # define N_(String) (String)
+
+ /* STUFF FROM gas/as.h */
+! extern subsegT now_subseg;
+
+ /* STUFF FROM gas/config/tc-arm.h */
+ #define ARM_FLAG_THUMB (1 << 0) /* The symbol is a Thumb symbol rather than an Arm symbol. */
+Index: otool/print_objc2_32bit.c
+===================================================================
+RCS file: /cvs/root/cctools/otool/print_objc2_32bit.c,v
+retrieving revision 1.7
+diff -p -r1.7 print_objc2_32bit.c
+*** otool/print_objc2_32bit.c 31 Jul 2009 00:57:06 -0000 1.7
+--- otool/print_objc2_32bit.c 28 Mar 2012 23:38:13 -0000
+*************** struct category_t {
+*** 259,265 ****
+ uint32_t protocols; /* struct protocol_list_t * (32-bit pointer) */
+ uint32_t instanceProperties; /* struct objc_property_list *
+ (32-bit pointer) */
+! } category_t;
+
+ static
+ void
+--- 259,265 ----
+ uint32_t protocols; /* struct protocol_list_t * (32-bit pointer) */
+ uint32_t instanceProperties; /* struct objc_property_list *
+ (32-bit pointer) */
+! };
+
+ static
+ void
+Index: otool/print_objc2_64bit.c
+===================================================================
+RCS file: /cvs/root/cctools/otool/print_objc2_64bit.c,v
+retrieving revision 1.9
+diff -p -r1.9 print_objc2_64bit.c
+*** otool/print_objc2_64bit.c 31 Jul 2009 00:57:06 -0000 1.9
+--- otool/print_objc2_64bit.c 28 Mar 2012 23:38:13 -0000
+*************** struct category_t {
+*** 262,268 ****
+ uint64_t protocols; /* struct protocol_list_t * (64-bit pointer) */
+ uint64_t instanceProperties; /* struct objc_property_list *
+ (64-bit pointer) */
+! } category_t;
+
+ static
+ void
+--- 262,268 ----
+ uint64_t protocols; /* struct protocol_list_t * (64-bit pointer) */
+ uint64_t instanceProperties; /* struct objc_property_list *
+ (64-bit pointer) */
+! };
+
+ static
+ void