Changeset 80247
- Timestamp:
- 07/07/11 12:54:18 (4 years ago)
- Location:
- trunk/dports/lang/apple-gcc42
- Files:
-
- 9 added
- 1 edited
-
Portfile (modified) (2 diffs)
-
files (added)
-
files/apple-gcc42 (added)
-
files/makeinfo.patch (added)
-
files/no-rm-system.patch (added)
-
files/prefix.patch (added)
-
files/suffix.patch (added)
-
files/system-libstdc++.patch (added)
-
files/werror-c-incpath.patch (added)
-
files/werror-local-alloc.patch (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dports/lang/apple-gcc42/Portfile
r80126 r80247 2 2 3 3 PortSystem 1.0 4 PortGroup select 1.0 4 5 5 6 name apple-gcc42 6 7 version 5666.3 8 revision 1 7 9 categories lang 8 10 platforms darwin 9 maintainers nomaintainer11 maintainers jeremyhu openmaintainer 10 12 description Apple's version of gcc 4.2 11 13 long_description Apple's version of the GNU compiler collection, \ 12 version 4.2. Supports C and Objective-C.14 version 4.2. Supports C, Objective-C, anc C++ 13 15 14 16 homepage http://opensource.apple.com/ … … 19 21 rmd160 a01d000f89c0e89dd0079dcd202bba7629ba78dc 20 22 21 post-extract { file mkdir ${workpath}/build } 23 depends_run port:gcc_select 22 24 23 set nprefix ${prefix}/lib/${name} 25 use_configure no 24 26 25 # try to avoid non-Apple programs at all costs (rather volatile build) 26 configure.dir ${workpath}/build 27 configure.cmd ${worksrcpath}/configure 28 configure.pre_args --prefix=${nprefix} 29 configure.ccache no 30 configure.distcc no 31 # C++ support breaks the build 32 configure.args --enable-languages=c,objc \ 33 --program-suffix=-apple-4.2 34 configure.cflags 35 configure.ldflags 36 configure.cppflags 37 configure.cc_archflags 38 configure.cxx_archflags 39 configure.objc_archflags 40 configure.ld_archflags 41 configure.env PATH="/bin:/usr/bin:/sbin:/usr/sbin" 27 select.group gcc 28 select.file ${filespath}/${name} 42 29 43 build.dir ${configure.dir} 30 set srcroot ${worksrcpath} 31 set objroot ${workpath}/objroot 32 set symroot ${workpath}/symroot 44 33 45 destroot.dir ${build.dir} 34 # system-libstdc++.patch : Adjust build system to use libstdc++ from / since we don't have it in MacPorts 35 # no-rm-system.patch : Comment out a rogue rm /usr/... in the build script 36 # prefix.patch : Fix hardcoded instances of /usr 37 # suffix.patch : Make binaries end in -apple-4.2 38 # makeinfo.patch : Fix version detection for makeinfo in configure scripts 39 # werror-*.patch : Fix compilation errors when building for x86_64 40 patchfiles \ 41 system-libstdc++.patch \ 42 no-rm-system.patch \ 43 prefix.patch \ 44 suffix.patch \ 45 makeinfo.patch \ 46 werror-c-incpath.patch \ 47 werror-local-alloc.patch 46 48 47 # STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac 48 # BOOT_CFLAGS="-O2 -g" : from Makefile.tpl 49 # -std=gnu89 : for building with compilers that default to c99 (clang) 50 # -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins 51 # exposed in libc headers for fortified string functions. 52 # Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS 53 # because STAGE1_CFLAGS is used with xgcc for libgcc 54 build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89" 49 post-patch { 50 # Install documentation in a MacPorts location 51 reinplace "/^HTMLDIR=/ s:=.*$:=\"${prefix}/share/doc/${name}/html\":" ${worksrcpath}/build_gcc 55 52 56 post-destroot { 57 file delete -force \ 58 ${destroot}${nprefix}/man ${destroot}${nprefix}/info 59 system "cd ${destroot}${prefix}/bin && ln -sf ${nprefix}/bin/gcc-apple-4.2 && ln -sf ${nprefix}/bin/cpp-apple-4.2" 53 # arch returns i386 even when we want x86_64 54 reinplace "/^BUILD=/ s:arch:echo ${build_arch}:" ${worksrcpath}/build_gcc 55 56 # Use our CC 57 # TODO: This seems insufficient as "gcc" is still being used 58 reinplace "/^unset CC/ s:^:#:" ${worksrcpath}/build_gcc 59 60 # ppc not tested, but it should hopefully work... 61 if {${build_arch} == "ppc"} { 62 reinplace "/^PPC_SYSROOT=/ s:=.*$:=/:" ${worksrcpath}/build_gcc 63 } elseif {[file exists ${developer_dir}/SDKs/MacOSX10.5.sdk]} { 64 reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.5.sdk:" ${worksrcpath}/build_gcc 65 } elseif {[file exists ${developer_dir}/SDKs/MacOSX10.4u.sdk]} { 66 reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.4u.sdk:" ${worksrcpath}/build_gcc 67 } elseif {[file exists ${developer_dir}/SDKs/MacOSX10.3.9.sdk]} { 68 reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.3.9.sdk:" ${worksrcpath}/build_gcc 69 } 60 70 } 71 72 # TODO: Use MacPorts dependencies 73 build.env \ 74 CC="${configure.cc}" \ 75 LIBRARY_PATH="/usr/lib" \ 76 CPATH="/usr/include" \ 77 PATH="/bin:/usr/bin:/sbin:/usr/sbin" 78 79 # MAKEINFO=${prefix}/bin/makeinfo 80 81 build.args-append \ 82 PREFIX="${prefix}" \ 83 SRCROOT="${srcroot}" \ 84 OBJROOT="${objroot}" \ 85 SYMROOT="${symroot}" \ 86 DSTROOT="${destroot}" \ 87 RC_NONARCH_CFLAGS="-pipe -std=gnu89" \ 88 RC_OS="macos" 89 90 if {[variant_isset universal]} { 91 build.args-append \ 92 RC_ARCHS="${universal_archs}" 93 } else { 94 build.args-append \ 95 RC_ARCHS="${build_arch}" 96 } 97 98 set build_targets {i386} 99 100 if {[file exists ${developer_dir}/SDKs/MacOSX10.3.9.sdk] || 101 [file exists ${developer_dir}/SDKs/MacOSX10.4u.sdk] || 102 [file exists ${developer_dir}/SDKs/MacOSX10.5.sdk] || 103 ${build_arch} == "ppc"} { 104 lappend build_targets ppc 105 } 106 107 # TODO: arm? 108 109 build.args-append \ 110 TARGETS="${build_targets}" 111 112 # Yes, use "install" ... the build system does make/install in one go 113 # TODO: split the build_gcc script into two to better match MacPorts 114 build.target install 115 destroot {} 61 116 62 117 livecheck.type regex
Note: See TracChangeset
for help on using the changeset viewer.

