OsmAnd/OsmAnd-java/collect_libs.sh

42 lines
1.5 KiB
Bash
Raw Normal View History

#!/bin/bash
SCRIPT_LOC="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_LOC="$SCRIPT_LOC/../.."
2013-08-08 06:20:57 +02:00
if [[ "$(uname -a)" =~ Linux ]]; then
if [[ -z "$OSMAND_BUILD_CPU_CORES_NUM" ]]; then
OSMAND_BUILD_CPU_CORES_NUM=`nproc`
fi
fi
if [[ "$(uname -a)" =~ Darwin ]]; then
if [[ -z "$OSMAND_BUILD_CPU_CORES_NUM" ]]; then
OSMAND_BUILD_CPU_CORES_NUM=`sysctl hw.ncpu | awk '{print $2}'`
fi
fi
function copyLibs {
if [ -d "$ROOT_LOC/binaries/$1/$2" ]; then
echo "Copy binaries $1 $2";
cp "$ROOT_LOC"/binaries/$1/$2/libOsmAndJNI.$4 bin/OsmAndJNI-$1-$3.lib
cp "$ROOT_LOC"/binaries/$1/$2/libOsmAndCoreUtils.$4 bin/OsmAndCoreUtils-$1-$3.lib
cp "$ROOT_LOC"/binaries/$1/$2/libOsmAndCore.$4 bin/OsmAndCore-$1-$3.lib
fi
}
function compile {
2013-08-08 06:20:57 +02:00
OSMAND_ANDROID_EXTERNAL_DEPENDENCIES=(expat freetype gdal giflib glm glsl-optimizer harfbuzz jpeg libpng protobuf qtbase-desktop skia)
"$ROOT_LOC/core/externals/configure.sh" ${OSMAND_ANDROID_EXTERNAL_DEPENDENCIES[*]}
"$ROOT_LOC/core/externals/build.sh" ${OSMAND_ANDROID_EXTERNAL_DEPENDENCIES[*]}
2013-08-07 22:19:18 +02:00
if [ ! -d "$ROOT_LOC/amd64-linux-gcc-release.makefile" ]; then
"$ROOT_LOC/build/amd64-linux-gcc.sh" release
fi
2013-08-08 06:20:57 +02:00
(cd "$ROOT_LOC/baked/amd64-linux-gcc-release.makefile" && make -j$OSMAND_BUILD_CPU_CORES_NUM OsmAndJNI)
2013-08-07 22:19:18 +02:00
if [ ! -d "$ROOT_LOC/baked/i686-linux-gcc-release.makefile" ]; then
"$ROOT_LOC/build/i686-linux-gcc.sh" release
fi
2013-08-08 06:20:57 +02:00
(cd "$ROOT_LOC/baked/i686-linux-gcc-release.makefile" && make -j$OSMAND_BUILD_CPU_CORES_NUM OsmAndJNI)
}
compile
copyLibs linux amd64 amd64 so
copyLibs linux i686 x86 so