OsmAnd/OsmAnd-java/collect_legacy_libs.sh

36 lines
911 B
Bash
Raw Normal View History

2014-06-23 21:52:23 +02:00
#!/bin/bash
set -e
SCRIPT_LOC="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2014-12-21 23:39:14 +01:00
CORE_LOC="$SCRIPT_LOC/../../core-legacy"
2014-06-23 21:52:23 +02:00
if [[ "$(uname -a)" =~ Linux ]]; then
if [[ -z "$OSMAND_BUILD_CPU_CORES_NUM" ]]; then
OSMAND_BUILD_CPU_CORES_NUM=`nproc`
fi
fi
function copyLibs {
if [ -d "$CORE_LOC/binaries/$1/$2" ]; then
echo "Copy binaries $1 $2";
2018-06-16 02:47:57 +02:00
mkdir -p "$SCRIPT_LOC"/src/main/resources/
2018-06-16 02:47:33 +02:00
cp "$CORE_LOC"/binaries/$1/$2/Release/libosmand.so "$SCRIPT_LOC"/src/main/resources/osmand-$1-$3.lib
2014-06-23 21:52:23 +02:00
fi
}
function compile {
2014-06-23 22:04:21 +02:00
"$CORE_LOC/externals/configure.sh"
2018-07-23 21:34:59 +02:00
ARCH=$1
if [ ! -d "$CORE_LOC/targets/$ARCH-linux-gcc-$ARCH-linux-gcc-release.baked" ]; then
"$CORE_LOC/targets/$ARCH-linux-gcc.sh" release
2014-06-23 21:52:23 +02:00
fi
2018-07-23 21:34:59 +02:00
(cd "$CORE_LOC/targets/$ARCH-linux-gcc-$ARCH-linux-gcc-release.baked" && make -j$OSMAND_BUILD_CPU_CORES_NUM)
2014-06-23 21:52:23 +02:00
}
2018-07-23 21:34:59 +02:00
compile amd64
2018-07-23 22:25:49 +02:00
#compile i686
2014-06-23 21:52:23 +02:00
copyLibs linux amd64 amd64 so
2018-07-23 22:25:49 +02:00
#copyLibs linux i686 x86 so