Skip to content

Commit a101685

Browse files
committed
rename option to copylibs and clean up
1 parent 7606331 commit a101685

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

distribute.sh

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export BIGLINK="$ROOT_PATH/src/tools/biglink"
6363
export PIP=$PIP_NAME
6464
export VIRTUALENV=$VIRTUALENV_NAME
6565

66-
export JELLYBEAN=0
66+
export COPYLIBS=0
6767

6868
MD5SUM=$(which md5sum)
6969
if [ "X$MD5SUM" == "X" ]; then
@@ -221,10 +221,6 @@ function push_arm() {
221221
export MAKE="make -j5"
222222
export READELF="$TOOLCHAIN_PREFIX-readelf"
223223

224-
#if [ "$JELLYBEAN" == "1" ]; then
225-
# export LIBLINK="$CC -shared $LDFLAGS"
226-
#fi
227-
228224
# Use ccache ?
229225
which ccache &>/dev/null
230226
if [ $? -eq 0 ]; then
@@ -255,12 +251,15 @@ function usage() {
255251
echo
256252
echo " -d directory Name of the distribution directory"
257253
echo " -h Show this help"
258-
echo " -j Create distribution for JB 4.3+"
259254
echo " -l Show a list of available modules"
260255
echo " -m 'mod1 mod2' Modules to include"
261256
echo " -f Restart from scratch (remove the current build)"
262257
echo " -x display expanded values (execute 'set -x')"
263258
echo
259+
echo "Advanced:"
260+
echo " -L Copy libraries instead of using biglink"
261+
echo " (may not work before Android 4.3)"
262+
echo
264263
echo "For developers:"
265264
echo " -u 'mod1 mod2' Modules to update (if already compiled)"
266265
echo
@@ -353,8 +352,13 @@ function run_prepare() {
353352
fi
354353
done
355354

356-
if [ "$JELLYBEAN" == "1" ]; then
357-
info "Distribution for Jelly Bean (4.3) or higher; biglink will be skipped"
355+
if [ "$COPYLIBS" == "1" ]; then
356+
info "Library files will be copied to the distribution (no biglink)"
357+
error "NOTICE: This option is still beta!"
358+
error "\tIf you encounter an error 'Failed to locate needed libraries!' and"
359+
error "\tthe libraries listed are not supposed to be provided by your app or"
360+
error "\tits dependencies, please submit a bug report at"
361+
error "\thttps://github.com/kivy/python-for-android/issues"
358362
fi
359363

360364
info "Distribution will be located at $DIST_PATH"
@@ -773,8 +777,10 @@ function run_distribute() {
773777
try cp -a python-install/lib private/
774778
try mkdir -p private/include/python2.7
775779

776-
if [ "$JELLYBEAN" == "1" ]; then
777-
try sh -c "cat libs/$ARCH/copylibs | xargs -d'\n' cp -t private/"
780+
if [ "$COPYLIBS" == "1" ]; then
781+
if [ -s "libs/$ARCH/copylibs" ]; then
782+
try sh -c "cat libs/$ARCH/copylibs | xargs -d'\n' cp -t private/"
783+
fi
778784
else
779785
try mv libs/$ARCH/libpymodules.so private/
780786
fi
@@ -804,7 +810,7 @@ function run_distribute() {
804810

805811
function run_biglink() {
806812
push_arm
807-
if [ "$JELLYBEAN" == "0" ]; then
813+
if [ "$COPYLIBS" == "0" ]; then
808814
try $BIGLINK $LIBS_PATH/libpymodules.so $LIBLINK_PATH
809815
else
810816
try $BIGLINK $LIBS_PATH/copylibs $LIBLINK_PATH
@@ -850,13 +856,13 @@ function arm_deduplicate() {
850856

851857

852858
# Do the build
853-
while getopts ":hjvlfxm:u:d:s" opt; do
859+
while getopts ":hCvlfxm:u:d:s" opt; do
854860
case $opt in
855861
h)
856862
usage
857863
;;
858-
j)
859-
JELLYBEAN=1
864+
C)
865+
COPYLIBS=1
860866
LIBLINK=${LIBLINK}-jb
861867
BIGLINK=${BIGLINK}-jb
862868
;;

src/tools/biglink-jb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ for directory in sys.argv[2:]:
103103
sofiles += found_sofiles
104104

105105
if needed_libs == start_needed_libs:
106-
raise RuntimeError('Failed to located needed libraries!\n\t' + '\n\t'.join(needed_libs))
106+
raise RuntimeError('Failed to locate needed libraries!\n\t' + '\n\t'.join(needed_libs))
107107

108108
output = sys.argv[1]
109109

0 commit comments

Comments
 (0)