From 10f5b5be91e52017b2264e10cb2a300589635be1 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Mon, 20 Jan 2014 23:13:25 +0100 Subject: i686 cross-compile fixes --- scripts/portable_package_static.sh | 13 +++++++++---- scripts/portable_postbuild.sh | 11 +++++++++-- scripts/static_build.sh | 7 ++++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/scripts/portable_package_static.sh b/scripts/portable_package_static.sh index b1066ec6..fa7f852f 100755 --- a/scripts/portable_package_static.sh +++ b/scripts/portable_package_static.sh @@ -1,11 +1,18 @@ -#!/bin/sh +#!/bin/bash ./scripts/portable_postbuild.sh # package for distribution VERSION=`cat PORTABLE_VERSION | perl -ne 'chomp and print'` BUILD=`cat PORTABLE_BUILD | perl -ne 'chomp and print'` -ARCH=`uname -m | perl -ne 'chomp and print'` +if [[ "$ARCH" == "i686" ]]; then + echo arch: $ARCH +elif [[ "$ARCH" == "x86_64" ]]; then + echo arch: $ARCH +else + echo unknown arch $ARCH + exit -1 +fi # main distro SRCDIR=deadbeef-$VERSION @@ -14,8 +21,6 @@ DOCDIR=$SRCDIR/doc PIXMAPDIR=$SRCDIR/pixmaps OUTNAME=deadbeef-static_${VERSION}-${BUILD}_${ARCH}.tar.bz2 -ARCH=`uname -m | perl -ne 'chomp and print'` - rm portable_out/build/$OUTNAME cd portable/$ARCH diff --git a/scripts/portable_postbuild.sh b/scripts/portable_postbuild.sh index 09937bf9..d0ecde41 100755 --- a/scripts/portable_postbuild.sh +++ b/scripts/portable_postbuild.sh @@ -1,7 +1,14 @@ -#!/bin/sh +#!/bin/bash VERSION=`cat PORTABLE_VERSION | perl -ne 'chomp and print'` OSTYPE=`uname -s` -ARCH=`uname -m | perl -ne 'chomp and print'` +if [[ "$ARCH" == "i686" ]]; then + echo arch: $ARCH +elif [[ "$ARCH" == "x86_64" ]]; then + echo arch: $ARCH +else + echo unknown arch $ARCH + exit -1 +fi OUTDIR=portable/$ARCH/deadbeef-$VERSION PLUGDIR=$OUTDIR/plugins DOCDIR=$OUTDIR/doc diff --git a/scripts/static_build.sh b/scripts/static_build.sh index b1cdfe0e..eecfd16c 100755 --- a/scripts/static_build.sh +++ b/scripts/static_build.sh @@ -4,8 +4,9 @@ ORIGIN=`pwd | perl -ne 'chomp and print'` AP=$ORIGIN/tools/apbuild #ARCH=`uname -m | perl -ne 'chomp and print'` if [[ "$ARCH" == "i686" ]]; then - export CFLAGS='-m32' - export LDFLAGS='-m32' + export CFLAGS="-m32 -I$ORIGIN/../deadbeef-deps/lib-x86-32/include/i386-linux-gnu" + export CXXFLAGS=$CFLAGS + export LDFLAGS="-m32 -L$ORIGIN/../deadbeef-deps/lib-x86-32/lib" export CONFIGURE_FLAGS="--build=i686-unknown-linux-gnu" export LD_LIBRARY_PATH="$ORIGIN/../deadbeef-deps/lib-x86-32/lib" export PKG_CONFIG_PATH="$ORIGIN/../deadbeef-deps/lib-x86-32/lib/pkgconfig" @@ -31,7 +32,7 @@ export CXX=$AP/apgcc ./autogen.sh || exit -1 -./configure CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS $CONFIGURE_FLAGS --enable-staticlink --disable-artwork-imlib2 --prefix=/opt/deadbeef || exit -1 +./configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" $CONFIGURE_FLAGS --enable-staticlink --disable-artwork-imlib2 --prefix=/opt/deadbeef || exit -1 sed -i 's/-lstdc++ -lm -lgcc_s -lc -lgcc_s/-lm -lc/g' libtool sed -i 's/hardcode_into_libs=yes/hardcode_into_libs=no/g' libtool make clean -- cgit v1.2.3