Ignore:
Timestamp:
Jan 11, 2013, 10:40:41 PM (7 years ago)
Author:
jeremyhu@…
Message:

llvm-gcc42: Update to Apple version 2336.11

Location:
trunk/dports/lang/llvm-gcc42
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/lang/llvm-gcc42/Portfile

    r100676 r101497  
    22
    33PortSystem 1.0
     4PortGroup select 1.0
    45
    56name                    llvm-gcc42
    6 version                 2.9
    7 revision                4
     7version                 2336.11
     8set gcc_version         4.2.1
    89categories              lang
    910platforms               darwin
     
    1718                        compatibility with version 4.2 of GCC.
    1819
    19 homepage                http://llvm.org/
    20 master_sites            ${homepage}releases/${version}/
     20homepage                http://opensource.apple.com/
     21master_sites            http://opensource.apple.com/tarballs/llvmgcc42/
    2122
    22 distname                llvm-gcc-4.2-${version}.source
    23 extract.suffix          .tgz
     23distname                llvmgcc42-${version}
    2424
    25 checksums               md5     1a3951880d17f676d36b9edfdea8a727 \
    26                         sha1    6576576750c9b2afb42838851d51be0b91b12f3e \
    27                         rmd160  2f4329a5437b214595b66dc4e005ef1f9fea55a2
     25checksums               md5     046629f7b3ce59bcb32b5116d29c27cd \
     26                        sha1    97b82b328780d1b4f261301dc084bb256172ee2a \
     27                        rmd160  90e496dc075ebd3daa088f818e52e7ecbb4a182e
    2828
    29 universal_variant       no
     29depends_lib             port:ld64 port:cctools
     30depends_run             port:gcc_select
     31depends_skip_archcheck  ld64 cctools
    3032
    31 depends_lib             port:llvm-${version} port:gmp port:mpfr port:libiconv
     33use_configure no
     34variant universal {}
    3235
    33 worksrcdir              build
     36supported_archs i386 x86_64
     37
     38select.group    gcc
     39select.file     ${filespath}/mp-llvm-gcc42
     40
     41set srcroot ${worksrcpath}
     42set objroot ${workpath}/objroot
     43set symroot ${workpath}/symroot
     44
     45# werror-*.patch                 : Fix compilation errors when building for x86_64
     46# incpath.patch                  : Don't prepend the -isysroot option argument to the compiler's own search paths
     47# driverdriver-num_infiles.patch : Fix linking with no input files (ie all static archives passed with -l...)
     48# driverdriver-armcheck.patch    : Build fix for the driverdriver when arm support is not available (eg: Tiger)
     49
     50patchfiles-append \
     51        werror-local-alloc.patch \
     52        incpath.patch \
     53        driverdriver-num_infiles.patch \
     54        driverdriver-armcheck.patch
    3455
    3556post-extract {
    36     file mkdir ${worksrcpath}
     57    file copy -force ${filespath}/build_gcc ${worksrcpath}
    3758}
    3859
    39 # the generated compiler doesn't accept -arch
    40 configure.cc_archflags
    41 configure.cxx_archflags
    42 configure.objc_archflags
    43 configure.ld_archflags
     60post-patch {
     61    # Install documentation in a MacPorts location
     62    #reinplace "/^HTMLDIR=/ s:=.*$:=\"${prefix}/share/doc/${name}/html\":" ${worksrcpath}/build_gcc
    4463
    45 configure.cmd           ../${distname}/configure
    46 configure.args          --enable-llvm=${prefix}/libexec/llvm-${version} \
    47                         --enable-languages=c,c++,objc,obj-c++,fortran \
    48                         --libdir=${prefix}/lib/${name} \
    49                         --includedir=${prefix}/include/${name} \
    50                         --infodir=${prefix}/share/info \
    51                         --mandir=${prefix}/share/man \
    52                         --with-local-prefix=${prefix} \
    53                         --with-system-zlib \
    54                         --disable-nls \
    55                         --program-prefix=llvm- \
    56                         --program-suffix=-4.2 \
    57                         --with-gmp=${prefix} \
    58                         --with-mpfr=${prefix} \
    59                         --with-build-time-tools=/usr/bin
     64    # arch returns i386 even when we want x86_64
     65    reinplace "/^BUILD=/ s:arch:echo ${build_arch}:" ${worksrcpath}/build_gcc
    6066
    61 build.target            bootstrap
     67    # This is set to isysroot/Developer/SDKs/MacOSX10.5.sdk mmacosx-version-min=10.5
     68    # which is not always right.  Our CFLAGS should take care of this instead
     69    reinplace "/^MULTILIB_EXTRA_OPTS/d" ${worksrcpath}/gcc/config/rs6000/t-darwin
    6270
    63 destroot.target         install install-info-host
     71    # Brand our compiler
     72    reinplace "/VERSUFFIX/s/)\"/) (MacPorts ${name} ${version}_${revision}${portvariants})\"/" \
     73        ${worksrcpath}/gcc/version.c
     74    reinplace "/bug_report_url/s|http:.*>|https://trac.macports.org/newticket>|" \
     75        ${worksrcpath}/gcc/version.c
    6476
    65 # gcc-4.2 doesn't build with -std=gnu99 (clang's default), so do this for now
    66 if {${configure.compiler} == "clang"} {
    67     configure.compiler llvm-gcc-4.2
    68 }
    69 
    70 # gcc-4.0 produces a bad x86_64 slice, and Leopard's gcc-4.2 doesn't build this properly,
    71 # so use MacPorts-provided apple-gcc-4.2 to build us on 10.[45]
    72 if {${configure.compiler} == "gcc-4.0" ||
    73     (${configure.compiler} == "gcc-4.2" && ${os.major} < 10)} {
    74     depends_build-append port:apple-gcc42
    75     configure.compiler apple-gcc-4.2
    76 }
    77 
    78 # STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac
    79 # BOOT_CFLAGS="-O2 -g" : from Makefile.tpl
    80 # -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins
    81 #                       exposed in libc headers for fortified string functions.
    82 #                       Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS
    83 #                       because STAGE1_CFLAGS is used with xgcc for libgcc
    84 build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0"
    85 
    86 post-destroot {
    87         system "cd ${destroot}${prefix}/bin/ && ln -s llvm-gcc-4.2 llvm-gcc"
    88         system "cd ${destroot}${prefix}/bin/ && ln -s llvm-g++-4.2 llvm-g++"
    89 
    90         file delete -force ${destroot}${prefix}/share/man/man7 \
    91             ${destroot}${prefix}/share/info
    92 
    93         # install/copy ffitarget.h only if we have it
    94         if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
    95             file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
    96         }
    97         xinstall -m 755 -d ${destroot}${prefix}/etc/select/gcc
    98         xinstall -m 444 ${filespath}/mp-llvm-gcc42 ${destroot}${prefix}/etc/select/gcc/
    99 }
    100 
    101 platform darwin {
    102     depends_run-append  port:ld64
    103 
    104     post-extract {
    105         system "rm -rf ${worksrcpath}/libstdc++-v3"
     77    if {${build_arch} == "ppc"} {
     78        reinplace "/^PPC_SYSROOT=/ s:=.*$:=/:" ${worksrcpath}/build_gcc
     79    } elseif {[file exists ${developer_dir}/SDKs/MacOSX10.5.sdk]} {
     80        reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.5.sdk:" ${worksrcpath}/build_gcc
     81    } elseif {[file exists ${developer_dir}/SDKs/MacOSX10.4u.sdk]} {
     82        reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.4u.sdk:" ${worksrcpath}/build_gcc
     83    } elseif {[file exists ${developer_dir}/SDKs/MacOSX10.3.9.sdk]} {
     84        reinplace "/^PPC_SYSROOT=/ s:=.*$:=${developer_dir}/SDKs/MacOSX10.3.9.sdk:" ${worksrcpath}/build_gcc
    10685    }
    10786
    108     post-patch {
    109         if {${os.major} < 9} {
    110             reinplace "/vproc.h/d" ${workpath}/${distname}/gcc/libgcov.c
    111         }
     87    if {${os.major} < 9} {
     88        reinplace "/vproc.h/d" ${worksrcpath}/gcc/libgcov.c
    11289    }
    11390
    114     if {${build_arch} == "i386" } {
    115         configure.pre_args-append --host=i686-apple-darwin${os.major}
    116     } else {
    117         configure.pre_args-append --host=${build_arch}-apple-darwin${os.major}
    118     }
    119 
    120     if {${os.major} < 10} {
    121         configure.args-append --with-gxx-include-dir=/usr/include/c++/4.0.0
    122     } else {
    123         configure.args-append --with-gxx-include-dir=/usr/include/c++/4.2.1
    124     }
    125 
    126     configure.args-append --with-slibdir=/usr/lib
    127 
    128     post-destroot {
    129         if {${build_arch} == "i386" } {
    130             file mkdir ${destroot}${prefix}/lib/${name}/gcc/i686-apple-darwin${os.major}/4.2.1
    131             ln -s ../../../../bin/ld ${destroot}${prefix}/lib/${name}/gcc/i686-apple-darwin${os.major}/4.2.1/ld
    132 
    133             # http://trac.macports.org/ticket/35770
    134             delete  ${destroot}${prefix}/lib/${name}/gcc/i686-apple-darwin${os.major}/4.2.1/libstdc++.dylib
    135             ln -s /usr/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/gcc/i686-apple-darwin${os.major}/4.2.1/libstdc++.dylib
    136         } else {
    137             file mkdir ${destroot}${prefix}/lib/${name}/gcc/${build_arch}-apple-darwin${os.major}/4.2.1
    138             ln -s ../../../../bin/ld ${destroot}${prefix}/lib/${name}/gcc/${build_arch}-apple-darwin${os.major}/4.2.1/ld
    139 
    140             # http://trac.macports.org/ticket/35770
    141             delete  ${destroot}${prefix}/lib/${name}/gcc/${build_arch}-apple-darwin${os.major}/4.2.1/libstdc++.dylib
    142             ln -s /usr/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/gcc/${build_arch}-apple-darwin${os.major}/4.2.1/libstdc++.dylib
    143         }
    144 
    145         # dont install slibs outside of ${prefix}
    146         foreach f [glob -nocomplain ${destroot}/usr/lib/*] {
    147             file rename $f ${destroot}${prefix}/lib/${name}/
    148         }
     91    # Disable -Werror for our bootstrap gcc
     92    if {[string match "*clang*" ${configure.compiler}]} {
     93        reinplace "s:--enable-werror : :" ${worksrcpath}/build_gcc
    14994    }
    15095}
    15196
    152 livecheck.type  regex
    153 livecheck.url   ${homepage}releases/
    154 livecheck.regex {'(\d+\.\d+)'}
     97compiler.cpath /usr/include
     98compiler.library_path /usr/lib
     99
     100# TODO: Better use of MacPorts dependencies
     101build.env \
     102    LANGUAGES="c,c++,objc,obj-c++" \
     103    LIBRARY_PATH="/usr/lib" \
     104    CPATH="/usr/include" \
     105    PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
     106    LANGUAGES="c,c++,objc,obj-c++" \
     107    AR_FOR_TARGET=${prefix}/bin/ar \
     108    AS_FOR_TARGET=${prefix}/bin/as \
     109    LD_FOR_TARGET=${prefix}/bin/ld \
     110    NM_FOR_TARGET=${prefix}/bin/nm \
     111    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
     112    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
     113    STRIP_FOR_TARGET=${prefix}/bin/strip \
     114    DSYMUTIL_FOR_HOST=${prefix}/bin/dsymutil \
     115    RANLIB_FOR_HOST=${prefix}/bin/ranlib \
     116    STRIP_FOR_HOST=${prefix}/bin/strip \
     117    OTOOL=${prefix}/bin/otool \
     118    OTOOL64=${prefix}/bin/otool
     119
     120build.args-append \
     121    CC="${configure.cc} -pipe -std=gnu89" \
     122    CXX="${configure.cxx} -pipe" \
     123    PREFIX="${prefix}" \
     124    SRCROOT="${srcroot}" \
     125    OBJROOT="${objroot}" \
     126    SYMROOT="${symroot}" \
     127    DSTROOT="${destroot}" \
     128    RC_NONARCH_CFLAGS="-pipe -std=gnu89" \
     129    RC_OS="macos" \
     130    RC_ARCHS="[get_canonical_archs]" \
     131    RC_ProjectSourceVersion="[lindex [split ${version} .] 0]" \
     132    RC_ProjectSourceSubversion="[lindex [split ${version} .] 1]"
     133
     134set build_targets {}
     135
     136if {${os.major} > 8 || ${os.arch} == "i386"} {
     137    lappend build_targets i386
     138}
     139
     140# Support for PPC was dropped in Darwin 11 (Mac OS X 10.7)
     141if {${os.major} < 11} {
     142    if {[file exists ${developer_dir}/SDKs/MacOSX10.3.9.sdk] ||
     143            [file exists ${developer_dir}/SDKs/MacOSX10.4u.sdk] ||
     144            [file exists ${developer_dir}/SDKs/MacOSX10.5.sdk] ||
     145            ${build_arch} == "ppc"} {
     146        lappend build_targets ppc
     147    }
     148}
     149
     150build.args-append \
     151    TARGETS="${build_targets}"
     152
     153# Yes, use "install" ... the build system does make/install in one go
     154# TODO: split the build_gcc script into two to better match MacPorts
     155build.target install
     156destroot {}
     157post-destroot {
     158    if {[string match "*i386*" ${build_targets}]} {
     159        delete ${destroot}${prefix}/libexec/${name}/gcc/i686-apple-darwin${os.major}/${gcc_version}/as
     160        ln -s ../../../../../bin/as ${destroot}${prefix}/libexec/${name}/gcc/i686-apple-darwin${os.major}/${gcc_version}/as
     161        delete ${destroot}${prefix}/libexec/${name}/gcc/i686-apple-darwin${os.major}/${gcc_version}/ld
     162        ln -s ../../../../../bin/ld ${destroot}${prefix}/libexec/${name}/gcc/i686-apple-darwin${os.major}/${gcc_version}/ld
     163        delete ${destroot}${prefix}/libexec/${name}/gcc/i686-apple-darwin${os.major}/${gcc_version}/dsymutil
     164
     165        # http://trac.macports.org/ticket/35770
     166        delete  ${destroot}${prefix}/lib/${name}/gcc/i686-apple-darwin${os.major}/${gcc_version}/libstdc++.dylib
     167        ln -s /usr/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/gcc/i686-apple-darwin${os.major}/${gcc_version}/libstdc++.dylib
     168    }
     169
     170    if {[string match "*ppc*" ${build_targets}]} {
     171        delete ${destroot}${prefix}/libexec/${name}/gcc/powerpc-apple-darwin${os.major}/${gcc_version}/as
     172        ln -s ../../../../../bin/as ${destroot}${prefix}/libexec/${name}/gcc/powerpc-apple-darwin${os.major}/${gcc_version}/as
     173        delete ${destroot}${prefix}/libexec/${name}/gcc/powerpc-apple-darwin${os.major}/${gcc_version}/ld
     174        ln -s ../../../../../bin/ld ${destroot}${prefix}/libexec/${name}/gcc/powerpc-apple-darwin${os.major}/${gcc_version}/ld
     175        delete ${destroot}${prefix}/libexec/${name}/gcc/powerpc-apple-darwin${os.major}/${gcc_version}/dsymutil
     176
     177        # http://trac.macports.org/ticket/35770
     178        delete  ${destroot}${prefix}/lib/${name}/gcc/powerpc-apple-darwin${os.major}/${gcc_version}/libstdc++.dylib
     179        ln -s /usr/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/gcc/powerpc-apple-darwin${os.major}/${gcc_version}/libstdc++.dylib
     180    }
     181}
     182
     183livecheck.type          regex
     184livecheck.url           [lindex ${master_sites} 0]
     185livecheck.regex         llvmgcc42-(\\d+(?:\\.\\d+)*)\\.tar
  • trunk/dports/lang/llvm-gcc42/files/build_gcc

    r101496 r101497  
    179179
    180180# LLVM LOCAL begin
    181 # If the user has CC set in their environment unset it now
    182 unset CC
     181RANLIB=${RANLIB_FOR_HOST-ranlib}
     182STRIP=${STRIP_FOR_HOST-strip}
     183DSYMUTIL=${DSYMUTIL_FOR_HOST-dsymutil}
    183184# LLVM LOCAL end
    184185
     
    198199rm -rf $SRC_DIR/libstdc++-v3 || exit 1
    199200# Clean out old specs files
    200 rm -f /usr/lib/gcc/*/4.0.0/specs
     201#rm -f /usr/lib/gcc/*/4.0.0/specs
    201202
    202203# These are the configure and build flags that are used.
     
    212213  --mandir=\${prefix}/share/man \
    213214  --enable-languages=$LANGUAGES \
     215  --libexecdir=$DEST_ROOT/libexec/llvm-gcc42 \
     216  --libdir=$DEST_ROOT/lib/llvm-gcc42 \
     217  --includedir=$DEST_ROOT/include/llvm-gcc42 \
    214218  --program-prefix=llvm- \
    215   --program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \
     219  --program-suffix=-$MAJ_VERS \
     220  --with-system-zlib \
     221  --disable-nls \
    216222  --with-slibdir=/usr/lib \
    217223  --build=$BUILD-apple-darwin$DARWIN_VERS"
     
    244250  if [ $lang = "c++" -o $lang = "obj-c++" ]; then
    245251    BUILD_CXX=1
     252    break
     253  fi
     254done
     255
     256BUILD_JAVA=0
     257for lang in `echo $LANGUAGES | sed 's/,/ /g'`; do
     258  if [ $lang = "java" ]; then
     259    BUILD_JAVA=1
     260    break
     261  fi
     262done
     263
     264BUILD_FORTRAN=0
     265for lang in `echo $LANGUAGES | sed 's/,/ /g'`; do
     266  if [ $lang = "fortran" ]; then
     267    BUILD_FORTRAN=1
    246268    break
    247269  fi
     
    289311unset RC_DEBUG_OPTIONS
    290312make $MAKEFLAGS CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
    291 make $MAKEFLAGS html CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
     313# The version check for makeinfo is broken in all the configure scripts,
     314# and building documentation which is already available online isn't worth
     315# the effort in fixing it
     316#make $MAKEFLAGS html CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
    292317make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$BUILD install-gcc install-target \
    293318  CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
     
    301326# LLVM LOCAL begin Support for non /usr $DEST_ROOT
    302327D=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin
    303 ln -f $D/llvm-gcc $D/gcc || exit 1
     328ln -f $D/llvm-gcc-$MAJ_VERS $D/gcc || exit 1
    304329ln -f $D/gcc $D/$BUILD-apple-darwin$DARWIN_VERS-gcc || exit 1
    305330PATH=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin:$PATH
    306331# LLVM LOCAL end Support for non /usr $DEST_ROOT
     332
     333# Set CC to our bootstrap CC
     334export CC=$D/gcc
    307335
    308336# The cross-tools' build process expects to find certain programs
     
    406434  DT=$DIR/dst-$BUILD-$t
    407435  # LLVM LOCAL Support for non /usr $DEST_ROOT
    408   D=`echo $DT/$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
     436  D=`echo $DT/$DEST_ROOT/lib/llvm-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
    409437  mv $D/static/libgcc.a $D/libgcc_static.a || exit 1
    410438  mv $D/kext/libgcc.a $D/libcc_kext.a || exit 1
     
    442470          T_CONFIGFLAGS="$T_CONFIGFLAGS $NON_ARM_CONFIGFLAGS"
    443471        fi
     472
     473        # http://trac.macports.org/ticket/31603
     474        if [ $h = "i686" ] && [ $BUILD = "x86_64" ] ; then
     475          T_CONFIGFLAGS="$T_CONFIGFLAGS --build=$h-apple-darwin$DARWIN_VERS"
     476        fi
     477
    444478        $SRC_DIR/configure $T_CONFIGFLAGS || exit 1
    445479        # APPLE LOCAL end ARM ARM_CONFIGFLAGS
     
    505539
    506540# libexec
    507 cd $DIR/dst-$BUILD-$BUILD$DEST_ROOT/libexec/gcc/$BUILD-apple-darwin$DARWIN_VERS/$VERS \
     541cd $DIR/dst-$BUILD-$BUILD$DEST_ROOT/libexec/llvm-gcc42/gcc/$BUILD-apple-darwin$DARWIN_VERS/$VERS \
    508542  || exit 1
    509543LIBEXEC_FILES=`find . -type f -print || exit 1`
     
    511545cd $DEST_DIR || exit 1
    512546for t in $TARGETS ; do
    513   DL=$DEST_ROOT/libexec/gcc/$t-apple-darwin$DARWIN_VERS/$VERS
     547  DL=$DEST_ROOT/libexec/llvm-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS
    514548  for d in $LIBEXEC_DIRS ; do
    515549    mkdir -p .$DL/$d || exit 1
     
    532566# bin
    533567# The native drivers ('native' is different in different architectures).
    534 # LLVM LOCAL begin
     568BIN_FILES=`ls $DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin | grep '^[^-]*-apple-[0-9.]*$' \
     569  | grep -v gccbug | grep -v gcov || exit 1`
    535570mkdir .$DEST_ROOT/bin
    536 cpp_files=`ls $DIR/dst-*$DEST_ROOT/bin/{llvm-cpp,cpp-$MAJ_VERS} 2>/dev/null`
    537 lipo -output .$DEST_ROOT/bin/llvm-cpp-$MAJ_VERS -create $cpp_files || exit 1
    538 # LLVM LOCAL end
    539 
     571for f in $BIN_FILES ; do
     572  lipo -output .$DEST_ROOT/bin/$f -create $DIR/dst-*$DEST_ROOT/bin/$f || exit 1
     573done
    540574# gcov, which is special only because it gets built multiple times and lipo
    541575# will complain if we try to add two architectures into the same output.
    542576TARG0=`echo $TARGETS | cut -d ' ' -f 1`
    543 lipo -output .$DEST_ROOT/bin/gcov-$MAJ_VERS -create \
     577lipo -output .$DEST_ROOT/bin/llvm-gcov-$MAJ_VERS -create \
    544578  $DIR/dst-*-$TARG0$DEST_ROOT/bin/*gcov* || exit 1
    545579# The fully-named drivers, which have the same target on every host.
     
    547581# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT
    548582  lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS -create \
    549     $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS || exit 1
     583    $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$MAJ_VERS || exit 1
     584  lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-cpp-$MAJ_VERS -create \
     585    $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-cpp-$MAJ_VERS || exit 1
    550586# LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT
    551587  lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS -create \
    552     $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-*g++* || exit 1
     588    $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++* || exit 1
    553589done
    554590
    555591# lib
    556 mkdir -p .$DEST_ROOT/lib/gcc || exit 1
     592mkdir -p .$DEST_ROOT/lib/llvm-gcc42/gcc || exit 1
    557593for t in $TARGETS ; do
    558594  # LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT
    559   cp -Rp $DIR/dst-$BUILD-$t/$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS \
    560     .$DEST_ROOT/lib/gcc || exit 1
     595  cp -Rp $DIR/dst-$BUILD-$t/$DEST_ROOT/lib/llvm-gcc42/gcc/$t-apple-darwin$DARWIN_VERS \
     596    .$DEST_ROOT/lib/llvm-gcc42/gcc || exit 1
    561597done
    562598
     
    570606    for h in $LIBGOMP_HOSTS ; do
    571607        if [ $h = $t ] ; then
    572             cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/libgomp.a \
    573                 .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
    574             cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/libgomp.spec \
    575                 .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
     608            cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/llvm-gcc42/libgomp.a \
     609                .$DEST_ROOT/lib/llvm-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
     610            cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/llvm-gcc42/libgomp.spec \
     611                .$DEST_ROOT/lib/llvm-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
    576612            if [ $h = 'powerpc' ] ; then
    577                 cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/ppc64/libgomp.a \
    578                     .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/
    579                 cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/ppc64/libgomp.spec \
    580                     .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/
     613                cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/llvm-gcc42/ppc64/libgomp.a \
     614                    .$DEST_ROOT/lib/llvm-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/
     615                cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/llvm-gcc42/ppc64/libgomp.spec \
     616                    .$DEST_ROOT/lib/llvm-gcc42/v$t-apple-darwin$DARWIN_VERS/$VERS/ppc64/
    581617            elif [ $h = 'i686' ] ; then
    582                 cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/x86_64/libgomp.a \
    583                     .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ || exit 1
    584                 cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/x86_64/libgomp.spec \
    585                     .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ || exit 1
     618                cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/llvm-gcc42/x86_64/libgomp.a \
     619                    .$DEST_ROOT/lib/llvm-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ || exit 1
     620                cp -p $DIR/dst-$h-$t$DEST_ROOT/lib/llvm-gcc42/x86_64/libgomp.spec \
     621                    .$DEST_ROOT/lib/llvm-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/x86_64/ || exit 1
    586622            fi
    587623        fi
     
    594630
    595631# include
    596 HEADERPATH=$DEST_ROOT/include/gcc/darwin/$MAJ_VERS
     632HEADERPATH=$DEST_ROOT/include/gcc/darwin/llvm-gcc42
    597633mkdir -p .$HEADERPATH || exit 1
    598634
     
    609645    cp -R $h $DEST_DIR$HEADERPATH/$h || exit 1
    610646    for t in $TARGETS ; do
    611       THEADERPATH=$DEST_DIR$DEST_ROOT/lib/gcc/${t}-apple-darwin$DARWIN_VERS/$VERS/include
     647      THEADERPATH=$DEST_DIR$DEST_ROOT/lib/llvm-gcc42/gcc/${t}-apple-darwin$DARWIN_VERS/$VERS/include
    612648      [ -f $THEADERPATH/$h ] || \
    613         ln -s ../../../../../include/gcc/darwin/$MAJ_VERS/$h $THEADERPATH/$h || \
     649        ln -s ../../../../../include/gcc/darwin/llvm-gcc42/$h $THEADERPATH/$h || \
    614650        exit 1
    615651    done
     
    621657if [ $BUILD_CXX -eq 1 ]; then
    622658  # LLVM LOCAL
    623   ln -f $MDIR/llvm-g++.1 $MDIR/llvm-c++.1 || exit 1
     659  ln -f $MDIR/llvm-g++-4.2.1 $MDIR/llvm-c++-4.2.1 || exit 1
    624660fi
    625661for t in $TARGETS ; do
    626662  # LLVM LOCAL begin
    627   ln -f $MDIR/llvm-gcc.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-gcc.1 \
     663  ln -f $MDIR/llvm-gcc-4.2.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-gcc-4.2.1 \
    628664      || exit 1
    629665  if [ $BUILD_CXX -eq 1 ]; then
    630     ln -f $MDIR/llvm-g++.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-g++.1 \
     666    ln -f $MDIR/llvm-g++-4.2.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-g++-4.2.1 \
    631667        || exit 1
    632668  fi
     
    635671
    636672# LLVM LOCAL begin
    637 if [ "x$RC_ProjectName" = "xllvmgcc42_Embedded" ]; then
    638 MAN1_DIR=${DEST_DIR}${ARM_PLATFORM}/Developer/usr/share/man/man1
    639 else
    640 MAN1_DIR=$DEST_DIR$DEST_ROOT/../share/man/man1
    641 fi
    642 mkdir -p ${MAN1_DIR}
    643 for i in gcc.1 g++.1 cpp.1 gcov.1 ; do
    644     cp $DIR/obj-$BUILD-$BUILD/gcc/doc/$i ${MAN1_DIR}/$i
    645 done
    646 cp $ORIG_SRC_DIR/gcc/doc/llvm-gcc.1 ${MAN1_DIR}/llvm-gcc.1
    647 # llvm-g++ manpage is a dup of llvm-gcc manpage
    648 cp $ORIG_SRC_DIR/gcc/doc/llvm-gcc.1 ${MAN1_DIR}/llvm-g++.1
    649 # Compress manpages
    650 gzip -f $MDIR/* ${MAN1_DIR}/*
    651 # LLVM LOCAL end
     673#if [ "x$RC_ProjectName" = "xllvmgcc42_Embedded" ]; then
     674#MAN1_DIR=${DEST_DIR}${ARM_PLATFORM}/Developer/usr/share/man/man1
     675#else
     676#MAN1_DIR=$DEST_DIR$DEST_ROOT/../share/man/man1
     677#fi
     678#mkdir -p ${MAN1_DIR}
     679#for i in gcc.1 g++.1 cpp.1 gcov.1 ; do
     680#    cp $DIR/obj-$BUILD-$BUILD/gcc/doc/$i ${MAN1_DIR}/$i
     681#done
     682#cp $ORIG_SRC_DIR/gcc/doc/llvm-gcc.1 ${MAN1_DIR}/llvm-gcc.1
     683## llvm-g++ manpage is a dup of llvm-gcc manpage
     684#cp $ORIG_SRC_DIR/gcc/doc/llvm-gcc.1 ${MAN1_DIR}/llvm-g++.1
     685## Compress manpages
     686#gzip -f $MDIR/* ${MAN1_DIR}/*
     687## LLVM LOCAL end
    652688
    653689# Build driver-driver using fully-named drivers
    654690for h in $HOSTS ; do
    655691    # LLVM LOCAL begin
    656     $h-apple-darwin$DARWIN_VERS-gcc \
     692    $DIR/dst-$BUILD-$h$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS \
    657693        $ORIG_SRC_DIR/driverdriver.c                               \
    658694        -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS\""                                    \
     
    664700        -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-gcc-$MAJ_VERS || exit 1
    665701
     702    $DIR/dst-$BUILD-$h$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS \
     703        $ORIG_SRC_DIR/driverdriver.c                               \
     704        -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-cpp-$MAJ_VERS\""                                    \
     705        -DIL="\"$DEST_ROOT/bin/\"" -I  $ORIG_SRC_DIR/include                   \
     706        -I  $ORIG_SRC_DIR/gcc -I  $ORIG_SRC_DIR/gcc/config                     \
     707        -liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/                           \
     708        -L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/                    \
     709        -L$DIR/obj-$h-$BUILD/libiberty/                                        \
     710        -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-cpp-$MAJ_VERS || exit 1   
     711
    666712    if [ $BUILD_CXX -eq 1 ]; then
    667         $h-apple-darwin$DARWIN_VERS-gcc \
     713            $DIR/dst-$BUILD-$h$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS \
    668714            $ORIG_SRC_DIR/driverdriver.c                               \
    669715            -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS\""                                    \
     
    675721            -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-g++-$MAJ_VERS || exit 1
    676722    fi
     723
     724    if [ $BUILD_JAVA -eq 1 ]; then
     725            $DIR/dst-$BUILD-$h$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS \
     726            $ORIG_SRC_DIR/driverdriver.c                               \
     727            -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-gcj-$MAJ_VERS\""                                    \
     728            -DIL="\"$DEST_ROOT/bin/\"" -I  $ORIG_SRC_DIR/include                   \
     729            -I  $ORIG_SRC_DIR/gcc -I  $ORIG_SRC_DIR/gcc/config                     \
     730            -liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/                           \
     731            -L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/                    \
     732            -L$DIR/obj-$h-$BUILD/libiberty/                                        \
     733            -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-gcj-$MAJ_VERS || exit 1
     734    fi
     735
     736    if [ $BUILD_FORTRAN -eq 1 ]; then
     737            $DIR/dst-$BUILD-$h$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS \
     738            $ORIG_SRC_DIR/driverdriver.c                               \
     739            -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-gfortran-$MAJ_VERS\""                                    \
     740            -DIL="\"$DEST_ROOT/bin/\"" -I  $ORIG_SRC_DIR/include                   \
     741            -I  $ORIG_SRC_DIR/gcc -I  $ORIG_SRC_DIR/gcc/config                     \
     742            -liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/                           \
     743            -L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/                    \
     744            -L$DIR/obj-$h-$BUILD/libiberty/                                        \
     745            -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-gfortran-$MAJ_VERS || exit 1
     746    fi
    677747    # LLVM LOCAL end
    678748done
     
    682752  $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-gcc-$MAJ_VERS || exit 1
    683753rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-gcc-$MAJ_VERS || exit 1
     754
     755lipo -output $DEST_DIR/$DEST_ROOT/bin/llvm-cpp-$MAJ_VERS -create \
     756  $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-cpp-$MAJ_VERS || exit 1
     757rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-cpp-$MAJ_VERS || exit 1
    684758
    685759if [ $BUILD_CXX -eq 1 ]; then
     
    689763    rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-g++-$MAJ_VERS || exit 1
    690764fi
     765
     766if [ $BUILD_JAVA -eq 1 ]; then
     767   lipo -output $DEST_DIR/$DEST_ROOT/bin/llvm-gcj-$MAJ_VERS -create \
     768        $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcj-$MAJ_VERS || exit 1
     769   rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcj-$MAJ_VERS || exit 1
     770fi
     771
     772if [ $BUILD_FORTRAN -eq 1 ]; then
     773   lipo -output $DEST_DIR/$DEST_ROOT/bin/llvm-gfortran-$MAJ_VERS -create \
     774        $DEST_DIR/$DEST_ROOT/bin/tmp-*-gfortran-$MAJ_VERS || exit 1
     775   rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-gfortran-$MAJ_VERS || exit 1
     776fi
    691777# LLVM LOCAL end
    692778
     
    701787# Generate .dSYM files
    702788find $DEST_DIR -perm -0111 \! -name fixinc.sh \
    703     \! -name mkheaders -type f -print | xargs -n 1 -P ${SYSCTL} dsymutil
     789    \! -name mkheaders -type f -print | xargs -n 1 ${DSYMUTIL}
    704790
    705791# Save .dSYM files and .a archives
     
    720806        \! -name fixinc.sh \! -name mkheaders \! -name libstdc++.dylib \
    721807        -type f -print \
    722         | xargs strip || exit 1
     808        | xargs ${STRIP} || exit 1
    723809    # LLVM LOCAL begin - Strip with -Sx instead of -SX
     810        # Ignore errors from this next one due to possible issues on Tiger
    724811    find $DEST_DIR \! -path '*DWARF*' \( -name \*.a -or -name \*.dylib \) \
    725812        \! -name libgcc_s.10.*.dylib \! -name libstdc++.dylib -type f \
    726813        -print \
    727         | xargs strip -SX || exit 1
     814        | xargs ${STRIP} -SX
    728815    # LLVM LOCAL end - Strip with -Sx instead of -SX
    729816    find $DEST_DIR \! -path '*DWARF*' -name \*.a -type f -print \
    730         | xargs ranlib || exit 1
     817        | xargs ${RANLIB} || exit 1
    731818    # LLVM LOCAL end - don't strip dSYM objects
    732819fi
     
    736823
    737824# LLVM_BIN_DIR - This is the place where llvm-gcc/llvm-g++ symlinks get installed.
    738 LLVM_BIN_DIR=$DEST_ROOT/../bin
    739 
    740 mkdir -p $DEST_DIR$LLVM_BIN_DIR
    741 cd $DEST_DIR$LLVM_BIN_DIR
    742 ln -s -f ../llvm-gcc-$MAJ_VERS/bin/llvm-gcc-$MAJ_VERS llvm-gcc-$MAJ_VERS || exit 1
    743 ln -s -f ../llvm-gcc-$MAJ_VERS/bin/llvm-g++-$MAJ_VERS llvm-g++-$MAJ_VERS || exit 1
    744 ln -s -f ../llvm-gcc-$MAJ_VERS/bin/llvm-cpp-$MAJ_VERS llvm-cpp-$MAJ_VERS || exit 1
    745 ln -s -f ../llvm-gcc-$MAJ_VERS/bin/llvm-gcc-$MAJ_VERS llvm-gcc || exit 1
    746 ln -s -f ../llvm-gcc-$MAJ_VERS/bin/llvm-g++-$MAJ_VERS llvm-g++ || exit 1
     825#LLVM_BIN_DIR=$DEST_ROOT/../bin
     826#
     827#mkdir -p $DEST_DIR$LLVM_BIN_DIR
     828#cd $DEST_DIR$LLVM_BIN_DIR
     829#ln -s -f ../llvm-gcc-$MAJ_VERS/bin/llvm-gcc-$MAJ_VERS llvm-gcc-$MAJ_VERS || exit 1
     830#ln -s -f ../llvm-gcc-$MAJ_VERS/bin/llvm-g++-$MAJ_VERS llvm-g++-$MAJ_VERS || exit 1
     831#ln -s -f ../llvm-gcc-$MAJ_VERS/bin/llvm-cpp-$MAJ_VERS llvm-cpp-$MAJ_VERS || exit 1
     832#ln -s -f ../llvm-gcc-$MAJ_VERS/bin/llvm-gcc-$MAJ_VERS llvm-gcc || exit 1
     833#ln -s -f ../llvm-gcc-$MAJ_VERS/bin/llvm-g++-$MAJ_VERS llvm-g++ || exit 1
    747834
    748835# FIXME: This is a hack to get things working.
    749 for t in $TARGETS ; do
    750     ln -s -f ../llvm-gcc-$MAJ_VERS/bin/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS $t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS || exit 1
    751     ln -s -f ../llvm-gcc-$MAJ_VERS/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS $t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS || exit 1
    752 done
    753 
    754 # Copy one of the libllvmgcc.dylib's up to libexec/gcc.
    755 cp $DEST_DIR/$DEST_ROOT/libexec/gcc/$BUILD-apple-darwin$DARWIN_VERS/$VERS/libllvmgcc.dylib \
    756     $DEST_DIR/$DEST_ROOT/libexec/gcc/
     836#for t in $TARGETS ; do
     837#    ln -s -f ../llvm-gcc-$MAJ_VERS/bin/$t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS $t-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS || exit 1
     838#    ln -s -f ../llvm-gcc-$MAJ_VERS/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS $t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS || exit 1
     839#done
     840
     841# Copy one of the libllvmgcc.dylib's up to libexec/llvm-gcc42.
     842#cp $DEST_DIR/$DEST_ROOT/libexec/llvm-gcc42/gcc/$BUILD-apple-darwin$DARWIN_VERS/$VERS/libllvmgcc.dylib \
     843#    $DEST_DIR/$DEST_ROOT/libexec/llvm-gcc42/gcc/ || exit 1
    757844
    758845# Replace the installed ones with symlinks to the common one.
    759 for t in $TARGETS ; do
    760     cd $DEST_DIR/$DEST_ROOT/libexec/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/
    761     rm libllvmgcc.dylib
    762     ln -s ../../libllvmgcc.dylib
    763 done
     846#for t in $TARGETS ; do
     847#    cd $DEST_DIR/$DEST_ROOT/libexec/llvm-gcc42/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ || exit 1
     848#    rm libllvmgcc.dylib || exit 1
     849#    ln -s ../../libllvmgcc.dylib || exit 1
     850#done
    764851
    765852# Remove unwind.h from the install directory for > 10.6
  • trunk/dports/lang/llvm-gcc42/files/mp-llvm-gcc42

    r70476 r101497  
    44bin/llvm-g++-4.2
    55-
    6 bin/llvm-gcov-4.2
    7 bin/llvm-gfortran-4.2
     6-
     7-
Note: See TracChangeset for help on using the changeset viewer.