diff options
Diffstat (limited to 'current/gcc/gcc-multilib.SlackBuild')
-rwxr-xr-x | current/gcc/gcc-multilib.SlackBuild | 68 |
1 files changed, 55 insertions, 13 deletions
diff --git a/current/gcc/gcc-multilib.SlackBuild b/current/gcc/gcc-multilib.SlackBuild index 0475574..9154baf 100755 --- a/current/gcc/gcc-multilib.SlackBuild +++ b/current/gcc/gcc-multilib.SlackBuild @@ -23,6 +23,8 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +# Modified 2011 by Eric Hameleers <alien at slackware.com> for OpenJDK. + # Some notes, Fri May 16 12:31:32 PDT 2003: # # Why i486 and not i386? Because the shared C++ libraries in gcc-3.2.x will @@ -55,44 +57,60 @@ LANGS=${LANGS:-'c,c++,ada,fortran,go,java,lto,objc'} echo "Building these compilers: $LANGS"; sleep 5 # Automatically determine the architecture we're building on: +export MARCH=$( uname -m ) if [ -z "$ARCH" ]; then - case "$( uname -m )" in - i?86) export ARCH=i486 ;; - arm*) export ARCH=arm ;; + case "$MARCH" in + i?86) export ARCH=i486 ;; + armv7hl) export ARCH=$MARCH ;; + arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: - *) export ARCH=$( uname -m ) ;; + *) export ARCH=$MARCH ;; esac fi -TARGET=$ARCH-slackware-linux - if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" LIBDIRSUFFIX="" + LIB_ARCH=i386 elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" + LIB_ARCH=i386 elif [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" + LIB_ARCH=i386 elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686" LIBDIRSUFFIX="" + LIB_ARCH=i386 elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" LIBDIRSUFFIX="" + LIB_ARCH=s390 elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" + LIB_ARCH=amd64 +elif [ "$ARCH" = "armv7hl" ]; then + SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16" + LIBDIRSUFFIX="" + LIB_ARCH=armv7hl else SLKCFLAGS="-O2" LIBDIRSUFFIX="" + LIB_ARCH=$ARCH fi +case "ARCH" in + arm*) TARGET=$ARCH-slackware-linux-gnueabi ;; + *) TARGET=$ARCH-slackware-linux ;; +esac + CWD=$(pwd) # Temporary build location. This should *NOT* be a directory # path a non-root user could create later... -TMP=/gcc-$(mcookie) +TMP=${TMP:-"/gcc-$(mcookie)"} # This is the main DESTDIR target: PKG1=$TMP/package-gcc @@ -129,6 +147,11 @@ tar xvf $CWD/gcc-$VERSION.tar.?z* # This can be retrieved from ftp://sourceware.org/pub/java cp $CWD/ecj-4.5.jar gcc-$VERSION/ecj.jar +# Use an antlr runtime to compile javadoc. +# The runtime can be obtained from: +#https://oss.sonatype.org/content/repositories/releases/org/antlr/antlr-runtime/ +ANTLJAR=$(echo $CWD/antlr-*.jar | tail -1) + # install docs ( cd gcc-$VERSION # Smite the fixincludes: @@ -324,7 +347,7 @@ cp $CWD/ecj-4.5.jar gcc-$VERSION/ecj.jar --libdir=/usr/lib$LIBDIRSUFFIX \ --mandir=/usr/man \ --infodir=/usr/info \ - --build=$ARCH-slackware-linux + --build=$TARGET make $NUMJOBS || exit 1 make install DESTDIR=$PKG5 || exit 1 mkdir -p $PKG5/usr/doc/fastjar-$FASTJARVER @@ -411,6 +434,14 @@ cp $CWD/ecj-4.5.jar gcc-$VERSION/ecj.jar --enable-lto \ --with-gnu-ld \ --verbose \ + --enable-java-home \ + --with-java-home=/usr/lib$LIBDIRSUFFIX/jvm/jre \ + --with-jvm-root-dir=/usr/lib$LIBDIRSUFFIX/jvm \ + --with-jvm-jar-dir=/usr/lib$LIBDIRSUFFIX/jvm/jvm-exports \ + --with-arch-directory=$LIB_ARCH \ + --with-antlr-jar=$ANTLJAR \ + --enable-java-awt=gtk \ + --disable-gtktest \ $GCC_ARCHOPTS \ --target=${TARGET} \ --build=${TARGET} \ @@ -451,15 +482,15 @@ cp $CWD/ecj-4.5.jar gcc-$VERSION/ecj.jar rm -f $PKG1/usr/lib*/*gdb.py # Be sure the "specs" file is installed. -if [ ! -r $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/${ARCH}-slackware-linux/${VERSION}/specs ]; then - cat stage1-gcc/specs > $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/${ARCH}-slackware-linux/${VERSION}/specs +if [ ! -r $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${VERSION}/specs ]; then + cat stage1-gcc/specs > $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${VERSION}/specs fi ## Make our 64bit gcc look for 32bit gcc binaries in ./32 subdirectory: # (this edit only needed if gcc was compiled with disable-multilib) #if [ "$ARCH" = "x86_64" ]; then # sed -i 's#;.\(:../lib !m64 m32;\)$#;32\1#' \ -# $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/${ARCH}-slackware-linux/${VERSION}/specs +# $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${VERSION}/specs #fi # make ada.install-common DESTDIR=$PKG1 @@ -699,6 +730,15 @@ rm -f $PKG1/usr/lib/libiberty.a # catch-all mv $PKG1/usr/man/man1/rebuild-gcj-db.1.gz usr/man/man1 mkdir -p usr/share mv $PKG1/usr/share/java usr/share + # The ecj wrapper script: + cat $CWD/ecj.sh | sed -e "s,@JAVADIR@,/usr/share/java," > usr/bin/ecj + chmod 755 usr/bin/ecj + # The JAVA_HOME compatibility links. + # Caution: non-multilib arch-independent stuff! No lib64 here. + mkdir -p usr/lib$LIBDIRSUFFIX + mv $PKG1/usr/lib$LIBDIRSUFFIX/jvm* usr/lib$LIBDIRSUFFIX + # And add the missing javac symlink: + ln -s ../../../bin/ecj usr/lib$LIBDIRSUFFIX/jvm/bin/javac ) # gcc-objc: @@ -726,9 +766,11 @@ rm -f $PKG1/usr/lib/libiberty.a # catch-all # gcc-go: ( cd $PKG8 mkdir -p usr/bin - mv $PKG1/usr/bin/gccgo* usr/bin + mv $PKG1/usr/bin/*gccgo* usr/bin + mkdir -p usr/libexec/gcc/$TARGET/$VERSION + mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/go1 usr/libexec/gcc/$TARGET/$VERSION/go1 mkdir -p usr/info - mv $PKG1/usr/info/gccgo.info.gz + mv $PKG1/usr/info/gccgo.info.gz usr/info mkdir -p usr/lib${LIBDIRSUFFIX} mv $PKG1/usr/lib${LIBDIRSUFFIX}/go usr/lib${LIBDIRSUFFIX} mv $PKG1/usr/lib${LIBDIRSUFFIX}/{libgo.la,libgo.so.0.*,libgobegin.a} usr/lib${LIBDIRSUFFIX} || exit 1 |