|
1 | 1 | current_dir=`pwd`
|
2 | 2 | library_name=png
|
3 |
| -./build.sh -l $library_name |
| 3 | +rm -rf $library_name |
| 4 | +# build for armv7 |
| 5 | +arch=armv7 |
| 6 | +./build.sh -a $arch -l $library_name |
4 | 7 | top_dir=$current_dir/../..
|
5 | 8 |
|
6 | 9 | cd $current_dir
|
7 | 10 | mkdir -p $library_name/prebuilt/
|
8 | 11 | mkdir -p $library_name/include/
|
9 | 12 |
|
10 |
| -cp $top_dir/contrib/arm-linux-gnueabi-armv7a/lib/lib${library_name}.a $library_name/prebuilt/tizen/arm/ |
11 |
| -cp $top_dir/contrib/arm-linux-gnueabi-armv7a/include/$library_name*.h $library_name/include/tizen/ |
| 13 | +cp $top_dir/contrib/install-ios-OS/$arch/lib/lib$library_name.a $library_name/prebuilt/lib$library_name-$arch.a |
| 14 | +cp -r $top_dir/contrib/install-ios-Os/$arch/include/png*.h $library_name/include/ |
12 | 15 |
|
13 | 16 | echo "cleaning up"
|
14 |
| -rm -rf $top_dir/contrib/arm-linux-gnueabi-armv7a/ |
15 |
| -rm -rf $top_dir/contrib/tizen-armv7-a |
| 17 | +rm -rf $top_dir/contrib/install-ios-OS |
| 18 | +rm -rf $top_dir/contrib/iPhoneOS-$arch |
| 19 | + |
| 20 | +# build for i386 |
| 21 | +arch=i386 |
| 22 | +./build.sh -s -a $arch -l $library_name |
| 23 | +top_dir=$current_dir/../.. |
| 24 | + |
| 25 | +cd $current_dir |
| 26 | +mkdir -p $library_name/prebuilt/ |
| 27 | +mkdir -p $library_name/include/ |
| 28 | + |
| 29 | +cp $top_dir/contrib/install-ios-Simulator/$arch/lib/lib${library_name}.a $library_name/prebuilt/lib$library_name-$arch.a |
| 30 | + |
| 31 | +echo "cleaning up" |
| 32 | +rm -rf $top_dir/contrib/install-ios-Simulator |
| 33 | +rm -rf $top_dir/contrib/iPhoneSimulator-$arch |
| 34 | + |
| 35 | +#build for x86_64 |
| 36 | +arch=x86_64 |
| 37 | +./build.sh -s -a $arch -l $library_name |
| 38 | +top_dir=$current_dir/../.. |
| 39 | + |
| 40 | +cd $current_dir |
| 41 | +mkdir -p $library_name/prebuilt/ |
| 42 | +mkdir -p $library_name/include/ |
| 43 | + |
| 44 | +cp $top_dir/contrib/install-ios-Simulator/$arch/lib/lib${library_name}.a $library_name/prebuilt/lib$library_name-$arch.a |
| 45 | + |
| 46 | +echo "cleaning up" |
| 47 | +rm -rf $top_dir/contrib/install-ios-Simulator/ |
| 48 | +rm -rf $top_dir/contrib/iPhoneSimulator-$arch |
| 49 | + |
| 50 | +#build for arm64 |
| 51 | +arch=arm64 |
| 52 | +./build.sh -a $arch -l $library_name |
| 53 | +top_dir=$current_dir/../.. |
| 54 | + |
| 55 | +cd $current_dir |
| 56 | +mkdir -p $library_name/prebuilt/ |
| 57 | +mkdir -p $library_name/include/ |
| 58 | + |
| 59 | +cp $top_dir/contrib/install-ios-OS/$arch/lib/lib${library_name}.a $library_name/prebuilt/lib$library_name-$arch.a |
| 60 | + |
| 61 | +echo "cleaning up" |
| 62 | +rm -rf $top_dir/contrib/install-ios-OS |
| 63 | +rm -rf $top_dir/contrib/iPhoneOS-$arch |
| 64 | + |
| 65 | + |
| 66 | +#strip & create fat library |
| 67 | +LIPO="xcrun -sdk iphoneos lipo" |
| 68 | +STRIP="xcrun -sdk iphoneos strip" |
| 69 | + |
| 70 | +$LIPO -create $library_name/prebuilt/lib$library_name-armv7.a \ |
| 71 | + $library_name/prebuilt/lib$library_name-i386.a \ |
| 72 | + $library_name/prebuilt/lib$library_name-arm64.a \ |
| 73 | + $library_name/prebuilt/lib$library_name-x86_64.a \ |
| 74 | + -output $library_name/prebuilt/libluajit.a |
| 75 | + |
| 76 | +# rm $library_name/prebuilt/lib$library_name-armv7.a |
| 77 | +# rm $library_name/prebuilt/lib$library_name-i386.a |
| 78 | +# rm $library_name/prebuilt/lib$library_name-arm64.a |
| 79 | +# rm $library_name/prebuilt/lib$library_name-x86_64.a |
| 80 | + |
| 81 | + |
| 82 | +#remove debugging info |
| 83 | +$STRIP -S $library_name/prebuilt/libluajit.a |
| 84 | +$LIPO -info $library_name/prebuilt/libluajit.a |
| 85 | + |
| 86 | + |
0 commit comments