Skip to content

Commit 190070d

Browse files
committed
Merge pull request #44 from andyque/v4
add rapidJson and remove flatbuffer
2 parents dd17f2e + 2a08689 commit 190070d

File tree

17 files changed

+198
-76
lines changed

17 files changed

+198
-76
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@
4343
/build/tizen.zip
4444
/build/log.txt
4545
/contrib/tarballs/LuaJIT-2.0.3/
46+
/contrib/tarballs/mozilla-release/

build/android.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ cfg_mips_toolchain_bin="${ANDROID_NDK}/toolchains/mipsel-linux-android-${cfg_def
3333

3434
#build arches and build libraries
3535
cfg_all_supported_arches=("arm" "armv7" "x86" "arm64" "mips")
36-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffers" "minizip" "tinyxml2" "cjson" "luasocket" "box2d")
36+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "minizip" "tinyxml2" "cjson" "luasocket" "box2d" "rapidjson")
3737
cfg_default_arches_all=("arm" "armv7" "x86")
38-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffers" "minizip" "tinyxml2" "cjson" "luasocket" "box2d")
38+
cfg_default_libraries_all=("png" "zlib" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "minizip" "tinyxml2" "cjson" "luasocket" "box2d" "rapidjson")
3939

4040

4141
#whether build fat library, use lipo -S create

build/build.sh

Lines changed: 86 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -384,56 +384,75 @@ do
384384
original_archive_name=$archive_name
385385
fi
386386

387-
#copy .a archive from install-platform folder
388-
cp $top_dir/contrib/$install_library_path/$arch/lib/lib$original_archive_name.a $local_library_install_path/lib$archive_name.a
389-
390-
#copy dependent .a archive
391-
parse_dependent_archive_list=${lib}_dependent_archive_list
392-
original_dependent_archive_list=${!parse_dependent_archive_list}
393-
if [ ! -z $original_dependent_archive_list ];then
394-
echo "Copying dependent archives..."
395-
original_dependent_archive_list=(${original_dependent_archive_list//,/ })
396-
397-
for dep_archive in ${original_dependent_archive_list[@]}
398-
do
399-
local_library_install_path=$cfg_platform_name/$original_arch_name/libs
400-
mkdir -p $local_library_install_path
401-
cp $top_dir/contrib/$install_library_path/$arch/lib/lib${dep_archive}.a $local_library_install_path/lib${dep_archive}.a
402-
403-
done
387+
#whether to copy the archive file or not
388+
parse_ignore_archive=${lib}_ignore_archive
389+
original_ignore_archive=${!parse_ignore_archive}
390+
if [ "${original_ignore_archive}" != "yes" ];then
391+
392+
#determine the lib folder name
393+
parse_original_lib_folder_name=${lib}_lib_files_folder
394+
original_lib_folder_name=${!parse_original_lib_folder_name}
395+
396+
if [ -z $original_lib_folder_name ];then
397+
original_lib_folder_name=lib
398+
fi
399+
400+
#copy .a archive from install-platform folder
401+
cp $top_dir/contrib/$install_library_path/$arch/${original_lib_folder_name}/lib$original_archive_name.a $local_library_install_path/lib$archive_name.a
402+
403+
#copy dependent .a archive
404+
parse_dependent_archive_list=${lib}_dependent_archive_list
405+
original_dependent_archive_list=${!parse_dependent_archive_list}
406+
if [ ! -z $original_dependent_archive_list ];then
407+
echo "Copying dependent archives..."
408+
original_dependent_archive_list=(${original_dependent_archive_list//,/ })
409+
410+
for dep_archive in ${original_dependent_archive_list[@]}
411+
do
412+
local_library_install_path=$cfg_platform_name/$original_arch_name/libs
413+
mkdir -p $local_library_install_path
414+
cp $top_dir/contrib/$install_library_path/$arch/${original_lib_folder_name}/lib${dep_archive}.a $local_library_install_path/lib${dep_archive}.a
415+
416+
done
417+
fi
418+
404419
fi
405420

406421

407422
echo "Copying needed header files..."
408-
#determine the real folder name
409-
parse_original_library_folder_name=${lib}_header_files_folder
410-
library_include_folder_name=${!parse_original_library_folder_name}
411-
if [ -z $library_include_folder_name ];then
412-
library_include_folder_name=$archive_name
413-
fi
414-
415-
416-
#copy header files for ios & mac
417-
if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
418-
if [ ! -d $top_dir/build/$cfg_platform_name/include/$library_include_folder_name ];then
419-
mkdir -p $top_dir/build/$cfg_platform_name/include/$library_include_folder_name
423+
parse_ignore_header_files=${lib}_ignore_header_files
424+
original_ignore_header_files=${!parse_ignore_header_files}
425+
if [ "${original_ignore_header_files}" != "yes" ];then
426+
#determine the real folder name
427+
parse_original_library_folder_name=${lib}_header_files_folder
428+
library_include_folder_name=${!parse_original_library_folder_name}
429+
if [ -z $library_include_folder_name ];then
430+
library_include_folder_name=$archive_name
431+
fi
432+
433+
434+
#copy header files for ios & mac
435+
if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
436+
if [ ! -d $top_dir/build/$cfg_platform_name/include/$library_include_folder_name ];then
437+
mkdir -p $top_dir/build/$cfg_platform_name/include/$library_include_folder_name
438+
fi
439+
fi
440+
441+
mkdir -p $cfg_platform_name/$original_arch_name/include/$library_include_folder_name
442+
copy_include_file_path=${lib}_header_files
443+
src_directory=$top_dir/contrib/$install_library_path/$arch/include/${!copy_include_file_path}
444+
echo $src_directory
445+
destination_header_path=$cfg_platform_name/$original_arch_name/include/$library_include_folder_name
446+
447+
if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
448+
destination_header_path=$cfg_platform_name/include/$library_include_folder_name
449+
fi
450+
451+
if [ -d "$src_directory" ];then
452+
cp -r $src_directory/* $destination_header_path
453+
else
454+
cp $src_directory $destination_header_path
420455
fi
421-
fi
422-
423-
mkdir -p $cfg_platform_name/$original_arch_name/include/$library_include_folder_name
424-
copy_include_file_path=${lib}_header_files
425-
src_directory=$top_dir/contrib/$install_library_path/$arch/include/${!copy_include_file_path}
426-
echo $src_directory
427-
destination_header_path=$cfg_platform_name/$original_arch_name/include/$library_include_folder_name
428-
429-
if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
430-
destination_header_path=$cfg_platform_name/include/$library_include_folder_name
431-
fi
432-
433-
if [ -d "$src_directory" ];then
434-
cp -r $src_directory/* $destination_header_path
435-
else
436-
cp $src_directory $destination_header_path
437456
fi
438457

439458

@@ -445,20 +464,22 @@ do
445464
done
446465

447466
# echo $cfg_build_fat_library
448-
if [ $cfg_build_fat_library = "yes" ];then
467+
if [ "${original_ignore_archive}" != "yes" ];then
468+
if [ $cfg_build_fat_library = "yes" ];then
449469

450-
create_fat_library $archive_name
470+
create_fat_library $archive_name
451471

452-
parse_dependent_archive_list=${lib}_dependent_archive_list
453-
original_dependent_archive_list=${!parse_dependent_archive_list}
454-
if [ ! -z $original_dependent_archive_list ];then
455-
echo "create fat library for dependent archives..."
456-
original_dependent_archive_list=(${original_dependent_archive_list//,/ })
472+
parse_dependent_archive_list=${lib}_dependent_archive_list
473+
original_dependent_archive_list=${!parse_dependent_archive_list}
474+
if [ ! -z $original_dependent_archive_list ];then
475+
echo "create fat library for dependent archives..."
476+
original_dependent_archive_list=(${original_dependent_archive_list//,/ })
457477

458-
for dep_archive in ${original_dependent_archive_list[@]}
459-
do
460-
create_fat_library $dep_archive
461-
done
478+
for dep_archive in ${original_dependent_archive_list[@]}
479+
do
480+
create_fat_library $dep_archive
481+
done
482+
fi
462483
fi
463484
fi
464485

@@ -473,4 +494,13 @@ if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
473494
done
474495
fi
475496

497+
#check ios & mac library architecture
498+
if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
499+
for file in `ls ${cfg_platform_name}/libs`
500+
do
501+
lipo -info ${cfg_platform_name}/libs/$file
502+
done
503+
fi
504+
505+
476506
echo "done!"

build/ios.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ cfg_armv7s_host_machine="arm-apple-darwin"
1414
cfg_arm64_host_machine="arm-apple-darwin"
1515

1616
cfg_all_supported_arches=("armv7" "armv7s" "i386" "arm64" "x86_64")
17-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffers" "minizip" "tinyxml2" "cjson" "luasocket" "box2d")
18-
cfg_default_arches_all=("armv7" "armv7s" "i386" "arm64" "x86_64")
19-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffers" "minizip" "tinyxml2" "cjson" "luasocket" "box2d")
17+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "minizip" "tinyxml2" "cjson" "luasocket" "box2d" "rapidjson")
18+
cfg_default_arches_all=("armv7" "i386" "arm64" "x86_64")
19+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "minizip" "tinyxml2" "cjson" "luasocket" "box2d" "rapidjson")
2020

2121

2222
cfg_build_fat_library=yes

build/linux.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ cfg_i386_host_machine="i386-linux-gnu"
1717

1818

1919
cfg_all_supported_arches=("i386" "x86_64")
20-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffers" "minizip" "tinyxml2" "cjson" "luasocket" "box2d" "glfw")
20+
cfg_all_supported_libraries=("png" "zlib" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "minizip" "tinyxml2" "cjson" "luasocket" "box2d" "glfw" "sqlite3" "glew" "rapidjson")
2121
cfg_default_arches_all=("x86_64")
22-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffers" "minizip" "tinyxml2" "cjson" "luasocket" "box2d" "glfw")
22+
cfg_default_libraries_all=("png" "zlib" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "minizip" "tinyxml2" "cjson" "luasocket" "box2d" "glfw" "sqlite3" "glew" "rapidjson")
2323

2424

2525
cfg_build_fat_library=no

build/mac.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ cfg_is_cross_compile=no
2020

2121
#build arches and build libraries
2222
cfg_all_supported_arches=("i386" "x86_64")
23-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffers" "minizip" "tinyxml2" "cjson" "luasocket" "box2d")
23+
cfg_all_supported_libraries=("png" "zlib" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "minizip" "tinyxml2" "cjson" "luasocket" "box2d" "rapidjson")
2424
cfg_default_arches_all=("x86_64")
25-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffers" "minizip" "tinyxml2" "cjson" "luasocket" "box2d")
25+
cfg_default_libraries_all=("png" "zlib" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "minizip" "tinyxml2" "cjson" "luasocket" "box2d" "rapidjson")
2626

2727

2828
#whether build fat library, use lipo -S create

build/main.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,30 @@ luasocket_header_files=luasocket
2626
box2d_header_files=Box2D
2727
ssl_header_files=openssl
2828
glfw_header_files=GLFW
29+
rapidjson_header_files=rapidjson
30+
sqlite3_header_files=sqlite*.h
31+
glew_header_files=GL
32+
33+
#don't copy archive files for header only libraries, eg. rapidjson
34+
rapidjson_ignore_archive=yes
35+
36+
#don't copy header files for some specific libraries
37+
lua_ignore_header_files=yes
2938

3039
#header files Folder
3140
box2d_header_files_folder=Box2D
3241
zlib_header_files_folder=zlib
42+
glew_header_files_folder=GL
43+
44+
#lib files folder
45+
glew_lib_files_folder=lib64
3346

3447
##archive prebuilt name
3548
luajit_original_name=luajit-5.1
3649
box2d_original_name=Box2D
3750
flatbuffers_original_name=flatbuffer
3851
glfw_original_name=glfw3
52+
glew_original_name=GLEW
3953

4054

4155
##archive_alias

build/tizen.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ cfg_armv7_toolchain_bin="${TIZEN_SDK}/tools/arm-linux-gnueabi-gcc-4.8/bin"
1919

2020
#build arches and build libraries
2121
cfg_all_supported_arches=("armv7")
22-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer" "minizip" "tinyxml" "cjson" "luasocket")
22+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer" "minizip" "tinyxml" "cjson" "luasocket" "rapidjson")
2323
cfg_default_arches_all=("armv7")
24-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer" "minizip" "tinyxml" "cjson" "luasocket")
24+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "edtaa3func" "xxhash" "xxtea" "convertutf" "flatbuffer" "minizip" "tinyxml" "cjson" "luasocket" "rapidjson")
2525

2626

2727
#whether build fat library, use lipo -S create

contrib/src/cjson/rules.mak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ cjson: libcjson-git.tar.xz .sum-cjson
1616
$(APPLY) $(SRC)/cjson/cmake-patch.patch
1717
$(MOVE)
1818

19-
# DEPS_cjson = lua $(DEPS_lua)
19+
DEPS_cjson = luajit $(DEPS_luajit)
2020

2121
.cjson: cjson toolchain.cmake
22-
cd $< && $(HOSTVARS) ${CMAKE} -DUSE_INTERNAL_FPCONV=1 -DLUA_INCLUDE_DIR=$(PREFIX)
22+
cd $< && $(HOSTVARS) ${CMAKE} -DUSE_INTERNAL_FPCONV=1 -DLUA_INCLUDE_DIR=$(PREFIX)/include/luajit-2.0
2323
cd $< && $(MAKE) VERBOSE=1 install
2424
touch $@

contrib/src/luajit/rules.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ $(TARBALLS)/luajit-$(LUAJIT_VERSION).tar.gz:
1010

1111
luajit: luajit-$(LUAJIT_VERSION).tar.gz .sum-luajit
1212
$(UNPACK)
13+
mv LuaJIT-2.0.3 $@-2.0.3
1314
ifeq ($(LUAJIT_VERSION),2.0.1)
1415
$(APPLY) $(SRC)/luajit/v2.0.1_hotfix1.patch
1516
endif

0 commit comments

Comments
 (0)