summaryrefslogtreecommitdiff
path: root/platform/ios/build_libs.sh
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-09-03 13:17:13 +0200
committerTor Andersson <tor.andersson@artifex.com>2013-09-08 08:21:19 -0500
commit3408b6a59145df4389f38ba75e095c39bc1c699e (patch)
tree37a8079e8697c8f4ed67e2c50f553c4788c882d4 /platform/ios/build_libs.sh
parentf9f374998eb8208d300bd71bde28fdcd155f5062 (diff)
downloadmupdf-3408b6a59145df4389f38ba75e095c39bc1c699e.tar.xz
ios: Clean up project file.
Strip stupid project build settings. Add proper "make generate" target that uses the 'macosx' sdkroot. Rewrite cross compile build script to be more future proof.
Diffstat (limited to 'platform/ios/build_libs.sh')
-rw-r--r--platform/ios/build_libs.sh34
1 files changed, 15 insertions, 19 deletions
diff --git a/platform/ios/build_libs.sh b/platform/ios/build_libs.sh
index 915145d9..d78a36cf 100644
--- a/platform/ios/build_libs.sh
+++ b/platform/ios/build_libs.sh
@@ -4,32 +4,28 @@
# cross compile MuPDF and third party libraries using the regular Makefile.
# Also see "iOS" section in Makerules.
-echo Generating cmap and font files
-echo "Apple broke Xcode external targets yet again, and I can't be bothered to fix it."
-echo "Run the 'make generate' command manually from now on!"
-echo "If you see an error while running GEN, you've forgotten."
-
-# make -C .. verbose=yes generate || exit 1
+if [ ! -e ../../generated/gen_cmap_korea.h ]
+then
+ echo 'ERROR: You are missing the generated files.'
+ echo 'ERROR: Please run "make generate" from the mupdf directory.'
+ exit 1
+fi
export OS=ios
export build=$(echo $CONFIGURATION | tr A-Z a-z)
-case $ARCHS in
- armv6) ARCHFLAGS="-arch armv6 -mno-thumb" ;;
- armv7) ARCHFLAGS="-arch armv7 -mthumb" ;;
- i386) ARCHFLAGS="-arch i386" ;;
- *) echo "Unknown architecture:" $ARCHS; exit 1 ;;
-esac
-
-export CFLAGS="$ARCHFLAGS -isysroot $SDKROOT"
-export LDFLAGS="$ARCHFLAGS -isysroot $SDKROOT"
+FLAGS=""
+for A in $ARCHS
+do
+ FLAGS="$FLAGS -arch $A"
+done
-OUT=build/$build-$OS-$ARCHS
+OUT=build/$build-$OS-$(echo $ARCHS | tr ' ' '-')
-echo Building libraries for $ARCHS.
-make -C ../.. OUT=$OUT third libs || exit 1
+echo Compiling libraries for $ARCHS.
+make -j4 -C ../.. OUT=$OUT XCFLAGS="$FLAGS" XLDFLAGS="$FLAGS" third libs || exit 1
-echo Assembling final library in $TARGET_BUILD_DIR/.
+echo Copying library to $TARGET_BUILD_DIR/.
mkdir -p "$TARGET_BUILD_DIR"
cp -f ../../$OUT/lib*.a $TARGET_BUILD_DIR
ranlib $TARGET_BUILD_DIR/lib*.a