Skip to content

Commit

Permalink
Merge pull request ekumenlabs#26 from Intermodalics/fix-build-library…
Browse files Browse the repository at this point in the history
…-with-toolchain-sh

build_library_with_toolchain.sh: always set --host to the target platform
  • Loading branch information
meyerj authored Nov 28, 2018
2 parents 28cc893 + 163efdb commit 8908990
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 35 deletions.
27 changes: 17 additions & 10 deletions build_library_with_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,29 @@ if [ ! -d toolchain/ ]; then
fi
export PATH=$PATH:$2/toolchain/bin

# Set --host: The system where built programs and libraries will run.
# (https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html)
build=`uname -m`-linux
host=$(basename $2/toolchain/*-linux-android)

# General options to pass to ./configure script
configure_options="--prefix=$CMAKE_PREFIX_PATH --disable-shared --enable-static --build=${build} --host=${host}"

# Overwrite/extend for specific packages
if [ $1 == 'poco' ]; then
./configure --config=Android_static --no-samples --no-tests
configure_options="--config=Android_static --no-samples --no-tests"
export ANDROID_ABI=$abi
elif [ $1 == 'curl' ]; then
./configure --prefix=$CMAKE_PREFIX_PATH --disable-shared --enable-static --without-ssl --host=arm-linux-androideabi --disable-tftp --disable-sspi --disable-ipv6 --disable-ldaps --disable-ldap --disable-telnet --disable-pop3 --disable-ftp --disable-imap --disable-smtp --disable-pop3 --disable-rtsp --disable-ares --without-ca-bundle --disable-warnings --disable-manual --without-nss --without-random
else
./configure --prefix=$CMAKE_PREFIX_PATH --enable-shared=no --enable-static
configure_options="$configure_options --without-ssl --disable-tftp --disable-sspi --disable-ipv6 --disable-ldaps --disable-ldap --disable-telnet --disable-pop3 --disable-ftp --disable-imap --disable-smtp --disable-pop3 --disable-rtsp --disable-ares --without-ca-bundle --disable-warnings --disable-manual --without-nss --without-random"
elif [ $1 == 'libxml2' ]; then
configure_options="$configure_options --without-python"
fi

make -s -j$PARALLEL_JOBS -l$PARALLEL_JOBS
# Configure and build
./configure ${configure_options}
make -j$PARALLEL_JOBS -l$PARALLEL_JOBS V=1

# Install
if [ $1 == 'poco' ]; then
mkdir -p $CMAKE_PREFIX_PATH/lib
cd $CMAKE_PREFIX_PATH/lib
Expand All @@ -49,8 +61,3 @@ if [ $1 == 'poco' ]; then
else
make install
fi

#if [ $1 == 'curl' ]; then
# sed -i 's/#define CURL_SIZEOF_LONG 8/#define CURL_SIZEOF_LONG 4/g' $CMAKE_PREFIX_PATH/include/curl/curlbuild.h
# sed -i 's/#define CURL_SIZEOF_CURL_OFF_T 8/#define CURL_SIZEOF_CURL_OFF_T 4/g' $CMAKE_PREFIX_PATH/include/curl/curlbuild.h
#fi
15 changes: 6 additions & 9 deletions do_everything.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ export RBA_TOOLCHAIN=$ANDROID_NDK/build/cmake/android.toolchain.cmake
[ -d $prefix/libs/tinyxml2 ] || run_cmd get_library tinyxml2 $prefix/libs
[ -d $prefix/libs/console_bridge ] || run_cmd get_library console_bridge $prefix/libs
[ -d $prefix/libs/lz4-r124 ] || run_cmd get_library lz4 $prefix/libs
[ -d $prefix/libs/curl-7.39.0 ] || run_cmd get_library curl $prefix/libs
[ -d $prefix/libs/curl-7.47.0 ] || run_cmd get_library curl $prefix/libs
[ -d $prefix/libs/urdfdom/ ] || run_cmd get_library urdfdom $prefix/libs
[ -d $prefix/libs/urdfdom_headers ] || run_cmd get_library urdfdom_headers $prefix/libs
[ -d $prefix/libs/libiconv-1.14 ] || run_cmd get_library libiconv $prefix/libs
[ -d $prefix/libs/libxml2-2.9.1 ] || run_cmd get_library libxml2 $prefix/libs
[ -d $prefix/libs/libiconv-1.15 ] || run_cmd get_library libiconv $prefix/libs
[ -d $prefix/libs/libxml2-2.9.7 ] || run_cmd get_library libxml2 $prefix/libs
[ -d $prefix/libs/collada_dom ] || run_cmd get_library collada_dom $prefix/libs
[ -d $prefix/libs/eigen-3.3.5 ] || run_cmd get_library eigen $prefix/libs
[ -d $prefix/libs/assimp-3.1.1 ] || run_cmd get_library assimp $prefix/libs
Expand Down Expand Up @@ -168,9 +168,6 @@ if [[ $skip -ne 1 ]] ; then
# Patch urdfdom - Build as static lib
apply_patch $my_loc/patches/urdfdom.patch

# Patch libiconv - Remove 'gets' error
apply_patch $my_loc/patches/libiconv.patch

# Patch qhull - Don't install shared libraries
# TODO: Remove shared libraries to avoid hack in parse_libs.py
# apply_patch /opt/roscpp_android/patches/qhull.patch
Expand Down Expand Up @@ -335,11 +332,11 @@ echo
[ -f $prefix/target/lib/libtinyxml2.a ] || run_cmd build_library tinyxml2 $prefix/libs/tinyxml2
[ -f $prefix/target/lib/libconsole_bridge.a ] || run_cmd build_library console_bridge $prefix/libs/console_bridge
[ -f $prefix/target/lib/liblz4.a ] || run_cmd build_library lz4 $prefix/libs/lz4-r124/cmake_unofficial
[ -f $prefix/target/lib/libcurl.a ] || run_cmd build_library_with_toolchain curl $prefix/libs/curl-7.39.0
[ -f $prefix/target/lib/libcurl.a ] || run_cmd build_library_with_toolchain curl $prefix/libs/curl-7.47.0
[ -f $prefix/target/include/urdf_model/model.h ] || run_cmd build_library urdfdom_headers $prefix/libs/urdfdom_headers
[ -f $prefix/target/lib/liburdfdom_model.a ] || run_cmd build_library urdfdom $prefix/libs/urdfdom
[ -f $prefix/target/lib/libiconv.a ] || run_cmd build_library_with_toolchain libiconv $prefix/libs/libiconv-1.14
[ -f $prefix/target/lib/libxml2.a ] || run_cmd build_library_with_toolchain libxml2 $prefix/libs/libxml2-2.9.1
[ -f $prefix/target/lib/libiconv.a ] || run_cmd build_library_with_toolchain libiconv $prefix/libs/libiconv-1.15
[ -f $prefix/target/lib/libxml2.a ] || run_cmd build_library_with_toolchain libxml2 $prefix/libs/libxml2-2.9.7
[ -f $prefix/target/lib/libcollada-dom2.4-dp.a ] || run_cmd build_library collada_dom $prefix/libs/collada_dom
[ -f $prefix/target/lib/libassimp.a ] || run_cmd build_library assimp $prefix/libs/assimp-3.1.1
[ -f $prefix/target/lib/libeigen.a ] || run_cmd build_library eigen $prefix/libs/eigen-3.3.5
Expand Down
6 changes: 3 additions & 3 deletions get_library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ elif [ $1 == 'console_bridge' ]; then
COMP='git'
HASH='0.3.2'
elif [ $1 == 'curl' ]; then
URL=http://curl.haxx.se/download/curl-7.39.0.tar.bz2
URL=http://curl.haxx.se/download/curl-7.47.0.tar.bz2
COMP='bz2'
elif [ $1 == 'eigen' ]; then
URL=https://bitbucket.org/eigen/eigen/get/3.3.5.tar.gz
Expand All @@ -52,13 +52,13 @@ elif [ $1 == 'libccd' ]; then
URL=https://github.com/danfis/libccd/archive/v2.0.tar.gz
COMP='gz'
elif [ $1 == 'libiconv' ]; then
URL=http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
URL=http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
COMP='gz'
elif [ $1 == 'log4cxx' ]; then
URL=http://mirrors.sonic.net/apache/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
COMP='gz'
elif [ $1 == 'libxml2' ]; then
URL=ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz
URL=ftp://xmlsoft.org/libxml2/libxml2-2.9.7.tar.gz
COMP='gz'
elif [ $1 == 'lz4' ]; then
URL=https://github.com/Cyan4973/lz4/archive/r124.tar.gz
Expand Down
13 changes: 0 additions & 13 deletions patches/libiconv.patch

This file was deleted.

0 comments on commit 8908990

Please sign in to comment.