gcc44 and local ports directory

Jack Howarth howarth at bromo.med.uc.edu
Sat Sep 12 18:34:21 PDT 2009


  Can someone explain what I am doing wrong here? I find that
when I attempt to build...

# $Id: Portfile 57375 2009-09-10 08:16:41Z ryandesign at macports.org $

PortSystem 1.0

name                    gcc44
epoch                   2
version                 4.4.1
platforms               darwin
categories              lang
maintainers             mww
license                 GPLv3
description             The GNU compiler collection
long_description        The GNU compiler collection, including front ends for \
                        C, C++, Objective-C, Objective-C++, Java and Fortran95.

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}

set dcore               gcc-core-${version}.tar.bz2
set dfort               gcc-fortran-${version}.tar.bz2
set dcxx                gcc-g++-${version}.tar.bz2
set djava               gcc-java-${version}.tar.bz2
set dobjc               gcc-objc-${version}.tar.bz2
distfiles               ${dcore} ${dfort} ${dcxx} ${djava} ${dobjc}

checksums               ${dcore} sha1 7e18b5f49b77a78e0ccd31c82c6220c5756da754 \
                        ${dfort} sha1 65f729704eecffbcb115a3258c17919665066214 \
                        ${dcxx} sha1 921c8c18287cabc4c515b4a52c70e445160bd161 \
                        ${djava} sha1 65492e8e66569ba1cceec7fbc8a3e83dafa549f1 \
                        ${dobjc} sha1 f99d03177548c94184a8788c1d6eefecbd4b99bc

use_bzip2               yes

# gmp and mpfr are not universal
universal_variant       no

depends_lib             port:gmp port:mpfr port:libiconv

set major               4.4

patchfiles              gcc44-config.guess.diff
worksrcdir              build

# the generated compiler doesn't accept -arch
# if {[info exists build_arch] && ${os.platform} == "darwin"} {
#    if {(${os.arch} == "i386" && $build_arch == "i386") || (${os.arch} == "powerpc" && $build_arch == "ppc")} {
#        configure.env-append CFLAGS_FOR_TARGET="${configure.cflags}"
#    } elseif {(${os.arch} == "i386" && $build_arch == "x86_64") || (${os.arch} == "powerpc" && $build_arch == "ppc64")} {
#        configure.env-append CFLAGS_FOR_TARGET="${configure.cflags}"
#    } else {
#        pre-fetch {
#            return -code error "Cannot build $name for $build_arch"
#        }
#    }
#    configure.env-append CFLAGS_FOR_BUILD="${configure.cc_archflags} ${configure.cflags}"
#    configure.cc_archflags
#    configure.cxx_archflags
#    configure.objc_archflags
#}

pre-configure {
        file mkdir ${worksrcpath}
}

configure.cmd   ../gcc-${version}/configure
configure.args  --enable-languages=c,c++,objc,obj-c++,java,fortran \
                --libdir=${prefix}/lib/${name} \
                --includedir=${prefix}/include/${name} \
                --infodir=${prefix}/share/info \
                --mandir=${prefix}/share/man \
                --with-local-prefix=${prefix} \
                --with-system-zlib \
                --disable-nls \
                --program-suffix=-mp-${major} \
                --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
                --with-gmp=${prefix} \
                --with-mpfr=${prefix} 
# do NOT use MacPorts binutils -- they do not work
configure.env-append    AR_FOR_TARGET=/usr/bin/ar \
                        AS_FOR_TARGET=/usr/bin/as \
                        LD_FOR_TARGET=/usr/bin/ld \
                        NM_FOR_TARGET=/usr/bin/nm \
                        OBJDUMP_FOR_TARGET=/usr/bin/objdump \
                        RANLIB_FOR_TARGET=/usr/bin/ranlib \
                        STRIP_FOR_TARGET=/usr/bin/strip

build.target    bootstrap
use_parallel_build      yes

destroot.target install install-info-host

post-destroot {
        file delete -force ${destroot}${prefix}/share/man/man7 \
                ${destroot}${prefix}/share/info
        # install/copy ffitarget.h only if we have it
        if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
                file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
        }
        # install select file for gcc_select
        xinstall -m 755 -d ${destroot}${prefix}/etc/select/gcc
        xinstall -m 444 ${filespath}/mp-gcc44 ${destroot}${prefix}/etc/select/gcc/
}

#platform darwin 7 {
#       configure.cflags-append -force_cpusubtype_ALL
#       confgiure.env   BOOT_CFLAGS="-g -O2 -force_cpusubtype_ALL"
#       build.args-append       XCFLAGS=-force_cpusubtype_ALL
#}

platform powerpc {
        configure.args-append --disable-multilib
}

# odcctools currently do not compile for x64 - move to variant for the time being
variant odcctools \
        description "Use the odcctools instead of the system provided ones - does not work for x64 currently!" {
        depends_lib-append      port:odcctools
        patch {
                reinplace "s|/usr/bin/libtool|${prefix}/bin/odlibtool|g" \
                        ${workpath}/gcc-${version}/gcc/config/darwin.h
        }
        configure.args-append   --with-as=${prefix}/bin/odas \
                                --with-ld=${prefix}/bin/odld \
                                --with-ar=${prefix}/bin/odar
}

livecheck.type  regex
livecheck.url   http://gcc.gnu.org/gcc-4.4/
livecheck.regex GCC (4\\.4\\.\[0-9\])

out of my current ports directory, I keep getting....

DEBUG: setting option extract.args to /opt/local/var/macports/distfiles/gcc44/gcc-java-4.4.1.tar.bz2
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.6'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_howarth_ports_lang_gcc44/work" && /usr/bin/bzip2 -dc /opt/local/var/macports/distfiles/gcc44/gcc-java-4.4.1.tar.bz2 | /usr/bin/gnutar --no-same-owner -xf -'
--->  Extracting gcc-objc-4.4.1.tar.bz2
DEBUG: setting option extract.args to /opt/local/var/macports/distfiles/gcc44/gcc-objc-4.4.1.tar.bz2
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.6'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_howarth_ports_lang_gcc44/work" && /usr/bin/bzip2 -dc /opt/local/var/macports/distfiles/gcc44/gcc-objc-4.4.1.tar.bz2 | /usr/bin/gnutar --no-same-owner -xf -'
DEBUG: Executing org.macports.patch (gcc44)
--->  Applying patches to gcc44
Error: Target org.macports.patch returned: couldn't change working directory to "/opt/local/var/macports/build/_Users_howarth_ports_lang_gcc44/work/build": no such file or directory
DEBUG: Backtrace: couldn't change working directory to "/opt/local/var/macports/build/_Users_howarth_ports_lang_gcc44/work/build": no such file or directory
    while executing
"_cd [option worksrcpath]"
    (procedure "portpatch::patch_main" line 24)
    invoked from within
"$procedure $targetname"
Warning: the following items did not execute (for gcc44): org.macports.activate org.macports.patch org.macports.configure org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.

where....

[Macintosh-2:~/ports] howarth% ls /opt/local/var/macports/build/
_Users_howarth_ports_lang_gcc44							_opt_local_var_macports_sources_rsync.macports.org_release_ports_x11_lesstif

[Macintosh-2:var/macports/build] howarth% cd _Users_howarth_ports_lang_gcc44
[Macintosh-2:macports/build/_Users_howarth_ports_lang_gcc44] howarth% ls
work

[Macintosh-2:macports/build/_Users_howarth_ports_lang_gcc44] howarth% cd work
[Macintosh-2:build/_Users_howarth_ports_lang_gcc44/work] howarth% ls
gcc-4.4.1



More information about the macports-dev mailing list