source: trunk/dports/lang/apple-gcc40/Portfile

Last change on this file was 107760, checked in by jeremyhu@…, 4 years ago

apple-gcc40: Drop support with Mavericks

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1# $Id: Portfile 107760 2013-07-05 09:02:37Z ryandesign@macports.org $
2
3PortSystem 1.0
4
5name                    apple-gcc40
6version                 5494
7categories              lang
8platforms               darwin
9license                 GPL-2
10maintainers             nomaintainer
11description             Apple's version of gcc 4.0
12long_description        Apple's version of the GNU compiler collection, \
13                        version 4.0. Supports C and Objective-C only.
14
15homepage                http://opensource.apple.com/
16master_sites            http://opensource.apple.com/tarballs/gcc_40
17distname                gcc_40-${version}
18
19checksums           sha1    07574623e23103cb4024410ca48481fbb5da322e \
20                    rmd160  d7a5d15d312b9d7295564cf3862ec63296e769a3 \
21                    sha256  86b9c1d48c30042ba23d181a58ceeb3afb850b595206d976f78c985baea4b5ad
22
23platform darwin {
24    if {${os.major} >= 13} {
25        depends_lib
26        depends_run
27        pre-fetch {
28            ui_error "$name is not supported on Mavericks or later."
29            error "unsupported platform"
30        }
31    }
32}
33
34post-extract { file mkdir ${workpath}/build }
35
36set nprefix ${prefix}/lib/${name}
37
38# try to avoid non-Apple programs at all costs (rather volatile build)
39configure.dir           ${workpath}/build
40configure.cmd           ${worksrcpath}/configure
41configure.pre_args      --prefix=${nprefix}
42# C++ breaks!
43configure.args          --enable-languages=c,objc \
44                        --program-suffix=-apple-4.0
45configure.cflags
46configure.ldflags
47configure.cppflags
48configure.env           PATH="/bin:/usr/bin:/sbin:/usr/sbin"
49
50patchfiles                      patch-c-incpath.c.diff
51
52platform darwin 8 {
53        patchfiles              patch-config-darwin.h
54}
55
56build.dir               ${configure.dir}
57
58destroot.dir            ${build.dir}
59
60# STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
61# BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
62# -std=gnu89 : for building with compilers that default to c99 (clang)
63# -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins
64#                       exposed in libc headers for fortified string functions.
65#                       Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS
66#                       because STAGE1_CFLAGS is used with xgcc for libgcc
67build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0 -std=gnu89" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89"
68
69post-patch {
70        reinplace "s/-DIN_GCC/-DIN_GCC -std=gnu89/" ${worksrcpath}/gcc/Makefile.in
71}
72
73post-destroot {
74        file delete -force \
75                ${destroot}${nprefix}/man ${destroot}${nprefix}/info
76        system "cd ${destroot}${prefix}/bin && ln -sf ${nprefix}/bin/gcc-apple-4.0 && ln -sf ${nprefix}/bin/cpp-apple-4.0"
77}
78
79# It's difficult to distinguish between Apple's gcc-4.0 and gcc-4.2 releases
80livecheck.type  none
Note: See TracBrowser for help on using the repository browser.