Changeset 3abc777 for core


Ignore:
Timestamp:
Nov 19, 2017 4:58:51 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
14e9315
Parents:
3ba46f16
Message:

Debian: Fix builds for x32 (ticket #2076)
Incorporate patches 2 and 3 into build scripts

Location:
core/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/c/jbigi/build_jbigi.sh

    r3ba46f16 r3abc777  
    6969        fi
    7070        COMPILEFLAGS="-fPIC -Wall $CFLAGS"
    71         INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/$BUILD_OS -I/usr/local/include"
     71        # change the path that build_jbigi.sh expects to find the source files at.
     72        # formerly 0002-jbigi-soname.patch
     73        if [ "$DEBIANVERSION" ] ; then
     74            INCLUDES="-I. -I./jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/$BUILD_OS -I/usr/local/include"
     75        else
     76            INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/$BUILD_OS -I/usr/local/include"
     77        fi
    7278        LINKFLAGS="-shared -Wl,-soname,libjbigi.so"
    7379        LIBFILE="libjbigi.so";;
     
    8692fi
    8793
    88 [ $BITS -eq 32 -a "${UNAME#*86}" != "$UNAME" ] && COMPILEFLAGS="-m32 $COMPILEFLAGS" && LINKFLAGS="-m32 $LINKFLAGS"
    89 [ $BITS -eq 64 -a "${UNAME#*86}" != "$UNAME" ] && COMPILEFLAGS="-m64 $COMPILEFLAGS" && LINKFLAGS="-m64 $LINKFLAGS"
     94# Debian builds are presumed to be native, we don't need the -mxx flag unless cross-compile,
     95# and this breaks the x32 build
     96if [ -z "$DEBIANVERSION" ] ; then
     97    [ $BITS -eq 32 -a "${UNAME#*86}" != "$UNAME" ] && COMPILEFLAGS="-m32 $COMPILEFLAGS" && LINKFLAGS="-m32 $LINKFLAGS"
     98    [ $BITS -eq 64 -a "${UNAME#*86}" != "$UNAME" ] && COMPILEFLAGS="-m64 $COMPILEFLAGS" && LINKFLAGS="-m64 $LINKFLAGS"
     99fi
    90100
    91101echo "Compiling C code..."
    92 echo "Compile: \"$CC -c $COMPILEFLAGS $INCLUDES ../../jbigi/src/jbigi.c\""
    93 $CC -c $COMPILEFLAGS $INCLUDES ../../jbigi/src/jbigi.c || exit 1
     102# change the path that build_jbigi.sh expects to find the source files at.
     103# formerly 0002-jbigi-soname.patch
     104if [ "$DEBIANVERSION" ] ; then
     105    echo "Compile: \"$CC -c $COMPILEFLAGS $INCLUDES ./jbigi/src/jbigi.c\""
     106    $CC -c $COMPILEFLAGS $INCLUDES ./jbigi/src/jbigi.c || exit 1
     107else
     108    echo "Compile: \"$CC -c $COMPILEFLAGS $INCLUDES ../../jbigi/src/jbigi.c\""
     109    $CC -c $COMPILEFLAGS $INCLUDES ../../jbigi/src/jbigi.c || exit 1
     110fi
    94111echo "Link: \"$CC $LINKFLAGS $INCLUDES -o $LIBFILE jbigi.o $INCLUDELIBS $STATICLIBS $LIBPATH\""
    95112$CC $LINKFLAGS $INCLUDES -o $LIBFILE jbigi.o $INCLUDELIBS $STATICLIBS $LIBPATH || exit 1
  • core/c/jcpuid/build.sh

    r3ba46f16 r3abc777  
    5656
    5757
    58 if [ $BITS -eq 32 ]; then
    59   export ABI=32
    60   export CFLAGS="-m32 -mtune=i686 -march=i686"
    61   export LDFLAGS="-m32"
    62 elif [ $BITS -eq 64 ]; then
    63   export ABI=64
    64   export CFLAGS="-m64 -mtune=generic"
    65   export LDFLAGS="-m64"
    66 else
    67   printf "BITS value \"$BITS\" not valid, please select 32 or 64\n" >&2
    68   exit 1
     58# Debian builds are presumed to be native, we don't need the -mxx flag unless cross-compile,
     59# and this breaks the x32 build
     60if [ -z "$DEBIANVERSION" ] ; then
     61    if [ $BITS -eq 32 ]; then
     62      export ABI=32
     63      export CFLAGS="-m32 -mtune=i686 -march=i686"
     64      export LDFLAGS="-m32"
     65    elif [ $BITS -eq 64 ]; then
     66      export ABI=64
     67      export CFLAGS="-m64 -mtune=generic"
     68      export LDFLAGS="-m64"
     69    else
     70      printf "BITS value \"$BITS\" not valid, please select 32 or 64\n" >&2
     71      exit 1
     72    fi
    6973fi
    7074
     
    126130        fi
    127131
    128         LDFLAGS="${LDFLAGS} -shared -Wl,-soname,libjcpuid-${ARCH}-${UNIXTYPE}.so"
    129         if [ $KFREEBSD -eq 1 ]; then
    130             LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-kfreebsd.so"
     132        # rename jcpuid, formerly 0003-rename-jcpuid.patch
     133        if [ "$DEBIANVERSION" ] ; then
     134            LDFLAGS="${LDFLAGS} -shared -Wl,-soname,libjcpuid.so"
     135            LIBFILE="../jbigi/libjcpuid.so"
    131136        else
    132             LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-${UNIXTYPE}.so"
     137            LDFLAGS="${LDFLAGS} -shared -Wl,-soname,libjcpuid-${ARCH}-${UNIXTYPE}.so"
     138            if [ $KFREEBSD -eq 1 ]; then
     139                LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-kfreebsd.so"
     140            else
     141                LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-${UNIXTYPE}.so"
     142            fi
    133143        fi
    134144        CFLAGS="${CFLAGS} -fPIC -Wall"
Note: See TracChangeset for help on using the changeset viewer.