Fix libr.a for android

This commit is contained in:
pancake 2016-12-10 01:39:27 +01:00
parent 8d02b7fece
commit c041decf9b
4 changed files with 27 additions and 11 deletions

View File

@ -195,3 +195,5 @@ Beer in mind.
r2 -- leading options since 2006
dont feed the bugs! (except delicious stacktraces)!
feed the bugs!
r2 talks to you. tries to make you feel well.
now i'm like an evil engineer. MUAHAHAH

View File

@ -40,16 +40,25 @@ endif
# looks hacky :D
#AR=arm-linux-androideabi-ar
S=$
B=`
libr.a:
rm -rf .libr
mkdir .libr
for FILE in */libr_*.a ../shlr/*/*.a ; do \
mkdir -p .libr/$$FILE ; \
cp -f $$FILE .libr/$$FILE ; \
(cd .libr/$$FILE ; ${AR} x *.a ; rm -f *.a ) ; \
done
cd .libr ; ${AR} qv libr.a `find * -iname *.o`
F=${B}basename $$FILE${B} ; \
Q=${B}dirname $$FILE${B} ; \
D=${B}basename $$Q${B} ; \
mkdir -p .libr/$$D ; \
cp -f $$FILE .libr/$$D/$$F ; \
ls -l .libr/$$D/$$F ; \
(cd .libr/$$D && ${AR} x $$F || true ) ; \
done
echo lets ar
cd .libr ; ${AR} qv libr.a `find * -iname *.o 2> /dev/null`
echo lets m
mv .libr/libr.a libr.a
echo ranlibin
${RANLIB} libr.a
rm -rf .libr

View File

@ -8,35 +8,40 @@ ifeq (${NDK_ARCH},x86)
# mips
ARCH2=i686
RANLIB=${ARCH2}-linux-android-ranlib
CC_AR=${ARCH2}-linux-android-ar -r ${LIBAR}
AR=${ARCH2}-linux-android-ar
CC_AR=${AR} -r ${LIBAR}
endif
ifeq (${NDK_ARCH},mips)
# mips
ARCH2=mipsel
RANLIB=${ARCH2}-linux-android-ranlib
CC_AR=${ARCH2}-linux-android-ar -r ${LIBAR}
AR=${ARCH2}-linux-android-ar
CC_AR=${AR} -r ${LIBAR}
endif
ifeq (${NDK_ARCH},mips64)
# mips
ARCH2=mips64el
RANLIB=${ARCH2}-linux-android-ranlib
CC_AR=${ARCH2}-linux-android-ar -r ${LIBAR}
AR=${ARCH2}-linux-android-ar
CC_AR=${AR} -r ${LIBAR}
endif
ifeq (${NDK_ARCH},arm)
# arm32
ARCH=arm
RANLIB=${ARCH}-linux-androideabi-ranlib
CC_AR=${ARCH}-linux-androideabi-ar -r ${LIBAR}
AR=${ARCH}-linux-androideabi-ar
CC_AR=${AR} -r ${LIBAR}
endif
ifeq (${NDK_ARCH},aarch64)
# aarch64
ARCH=aarch64
RANLIB=${ARCH}-linux-android-ranlib
CC_AR=${ARCH}-linux-android-ar -r ${LIBAR}
AR=${ARCH}-linux-android-ar
CC_AR=${AR} -r ${LIBAR}
endif
ONELIB=0
OSTYPE=android

View File

@ -18,7 +18,7 @@ fi
[ -z "${MAKE}" ] && MAKE=make
rm -rf "${SRC}"
${MAKE} mrproper
${MAKE} mrproper 2>/dev/null
./configure --prefix="${PREFIX}" || exit 1
${MAKE} -j4 || exit 1
# TODO: run sys/install.sh