Skip to content

Commit 123b204

Browse files
committed
refactor Android abi name and make luajit build successfully
1 parent dc12ea2 commit 123b204

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

build/android.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ cfg_default_build_arches="all"
44
cfg_default_build_mode="release"
55
cfg_default_build_libraries="all"
66
#specific default values
7-
cfg_default_build_api=19
8-
cfg_default_gcc_version=4.8
7+
cfg_default_build_api=21
8+
cfg_default_gcc_version=4.9
99
cfg_arm_alias_folder_name="armeabi"
1010
cfg_armv7_alias_folder_name="armeabi-v7a"
1111
cfg_arm64_alias_folder_name="armeabi-v8a"

build/build.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,13 @@ do
302302

303303
echo "build $arch for $lib in $cfg_platform_name"
304304

305-
MY_TARGET_ARCH=$arch
305+
parse_arch_folder_name=cfg_${arch}_alias_folder_name
306+
original_arch_name=${!parse_arch_folder_name}
307+
if [ -z $original_arch_name ];then
308+
original_arch_name=$arch
309+
fi
310+
311+
MY_TARGET_ARCH=$original_arch_name
306312
export MY_TARGET_ARCH
307313

308314
if [ ${cfg_is_cross_compile} = "yes" ];then
@@ -338,22 +344,15 @@ do
338344
--host=${!my_target_host} \
339345
--prefix=${PREFIX}
340346

341-
make fetch
342-
make list
343-
make
344347

345348
echo "MY_TARGET_ARCH := ${MY_TARGET_ARCH}" >> config.mak
346349
echo "OPTIM := ${OPTIM}" >> config.mak
350+
351+
make
347352

348353
cd -
349-
350-
parse_arch_folder_name=cfg_${arch}_alias_folder_name
351-
original_arch_folder_name=${!parse_arch_folder_name}
352-
if [ -z $original_arch_folder_name ];then
353-
original_arch_folder_name=$arch
354-
fi
355354

356-
local_library_install_path=$cfg_platform_name/$archive_name/prebuilt/$original_arch_folder_name
355+
local_library_install_path=$cfg_platform_name/$archive_name/prebuilt/$original_arch_name
357356
if [ ! -d $local_library_install_path ]; then
358357
echo "create folder for library with specify arch. $local_library_install_path"
359358
mkdir -p $local_library_install_path
@@ -378,7 +377,7 @@ do
378377

379378
for dep_archive in ${original_dependent_archive_list[@]}
380379
do
381-
local_library_install_path=$cfg_platform_name/${dep_archive}/prebuilt/$original_arch_folder_name
380+
local_library_install_path=$cfg_platform_name/${dep_archive}/prebuilt/$original_arch_name
382381
mkdir -p $local_library_install_path
383382
cp $top_dir/contrib/$install_library_path/$arch/lib/lib${dep_archive}.a $local_library_install_path/lib${dep_archive}.a
384383

build/main.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ cfg_all_valid_platforms=(ios mac android linux win32 tizen)
44

55
#copy libraries header files
66
png_header_files=png*.h
7-
luajit_header_files=luajit-2.0/
7+
luajit_header_files=luajit-2.0
88
lua_header_files=l*.h*
9-
curl_header_files=curl/
10-
freetyp2_header_files=freetype2/
9+
curl_header_files=curl
10+
freetype_header_files=freetype2
1111
jpeg_header_files=j*.h
1212
tiff_header_files=tif*.h
13-
webp_header_files=webp/
13+
webp_header_files=webp
1414
websockets_header_files=libwebsockets.h
1515
zlib_header_files=z*.h
16+
chipmunk_header_files=chipmunk
1617

1718

1819
##archive prebuilt name

contrib/bootstrap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,14 @@ check_android_sdk()
227227
## FIXME: the android toolchain path is hardcoded, only MACOSX will work.
228228
if [ ${ANDROID_ABI} = "x86" ]; then
229229
toolchain_path_prefix=x86
230-
elif [ ${ANDROID_ABI} = "arm64" ];then
230+
elif [ ${ANDROID_ABI} = "armeabi-v8a" ];then
231231
toolchain_path_prefix=aarch64-linux-android
232232
else
233233
toolchain_path_prefix=arm-linux-androideabi
234234
fi
235235

236236
# check whether sysroot is exists
237-
if [ $ANDROID_ABI = "arm64" ]; then
237+
if [ $ANDROID_ABI = "armeabi-v8a" ]; then
238238
if [ ! -d ${ANDROID_NDK}/platforms/${ANDROID_API}/arch-arm64 ];then
239239
echo "${ANDROID_NDK} ${ANDROID_API} doesn't support build arm64 architecture!"
240240
exit $?
@@ -248,19 +248,19 @@ check_android_sdk()
248248
fi
249249

250250

251-
if [ ${ANDROID_ABI} = "armv7" ]; then
251+
if [ ${ANDROID_ABI} = "armeabi-v7a" ]; then
252252
add_make_enabled "HAVE_NEON"
253253
add_make_enabled "HAVE_ARMV7A"
254254
add_make "EXTRA_CFLAGS := -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -fomit-frame-pointer -fno-strict-aliasing -DANDROID -Wa,--noexecstack -Wformat "
255255
add_make "EXTRA_LDFLAGS := -march=armv7-a -Wl,--fix-cortex-a8"
256256
fi
257257

258-
if [ ${ANDROID_ABI} = "arm" -a -z "${NO_ARMV6}" ];then
258+
if [ ${ANDROID_ABI} = "armeabi" -a -z "${NO_ARMV6}" ];then
259259
add_make_enabled "HAVE_ARMV6"
260260
add_make "EXTRA_CFLAGS := -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -mthumb -fomit-frame-pointer -fno-strict-aliasing -DANDROID -Wa,--noexecstack -Wformat "
261261
fi
262262

263-
if [ ${ANDROID_ABI} = "arm64" ]; then
263+
if [ ${ANDROID_ABI} = "armeabi-v8a" ]; then
264264
add_make_enabled "HAVE_NEON"
265265
add_make_enabled "HAVE_ARMV8A"
266266
add_make "EXTRA_CFLAGS := -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes"

contrib/src/luajit/rules.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ endif
3838

3939
.luajit: luajit
4040
ifdef HAVE_ANDROID
41-
cd $< && $(MAKE) HOST_CC="gcc -m32 $(OPTIM)" CROSS=$(HOST)- TARGET_SYS=Linux TARGET_FLAGS="${MY_TARGET_ARCH} ${NDKF}" TARGET_LDFLAGS=$(LUAJIT_LDFLAGS)
41+
cd $< && $(MAKE) HOST_CC="gcc -m32 $(OPTIM)" CROSS=$(HOST)- TARGET_SYS=Linux TARGET_FLAGS="${NDKF} ${EXTRA_CFLAGS}" TARGET_LDFLAGS=$(LUAJIT_LDFLAGS)
4242
endif
4343
ifdef HAVE_MACOSX
4444
cd $< && $(HOSTVARS_PIC) $(MAKE) HOST_CC="$(CC)" HOST_CFLAGS="$(CFLAGS)"

0 commit comments

Comments
 (0)