summaryrefslogtreecommitdiff
path: root/ios/build_ios_gslib.sh
blob: 07a99962e34069e97e3006a1e645a3a99f63485d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#

if [ $# -gt 1 ]; then
  echo "Usage: build_ios_gslib.sh [debug]"
  exit
fi

if [ $# -eq 1 ]; then
  if test x"$1" = x"debug"; then
    DEBUGSTR=debug
  fi
fi

startdir="$PWD"

cd ..

if [ ! -x ./configure ] ; then
  ./autogen.sh --help
fi

export CC="$(xcrun --sdk iphonesimulator --find cc)"
export CPP="$(xcrun --sdk iphonesimulator --find cpp)"
export RANLIB="$(xcrun --sdk iphonesimulator --find ranlib)"
export CFLAGS=" -isysroot $(xcrun --sdk iphonesimulator --show-sdk-path) -Wno-implicit-function-declaration -arch x86_64 -arch i386"

export BIGENDIAN=0
export CCAUX=/usr/bin/gcc
export CFLAGSAUX=" "

./configure --without-cal --without-x --with-arch_h=./ios/ios_arch-x86.h --host=x86_64-apple-darwin7 --build=x86_64-linux-gnu 2>&1 | tee conflog_x86.txt || exit 1

make -j4 BUILDDIRPREFIX=ios_x86- GS=libgs_x86 libgs$DEBUGSTR 2>&1 | tee buildlog_x86.txt || exit 1

mv Makefile Makefile.x86

export CC="$(xcrun --sdk iphoneos --find cc)"
export CPP="$(xcrun --sdk iphoneos --find cpp)"
export CFLAGS=" -isysroot $(xcrun --sdk iphoneos --show-sdk-path) -Wno-implicit-function-declaration -arch armv7 -arch armv7s -arch arm64"
export RANLIB="$(xcrun --sdk iphoneos --find ranlib)"

./configure --without-cal -without-x  --with-arch_h=./ios/ios_arch-arm.h --host=armv7-apple-darwin7 --build=x86_64-linux-gnu 2>&1 | tee conflog_arm.txt || exit 1

make -j4 BUILDDIRPREFIX=ios_arm- GS=libgs_arm libgs$DEBUGSTR 2>&1 | tee buildlog_arm.txt || exit 1

mv Makefile Makefile.arm

cd $startdir

export LIPO="$(xcrun --sdk iphoneos --find lipo)"

xcrun lipo -output libgs.a -create ../ios_x86-"$DEBUGSTR"bin/libgs_x86.a ../ios_arm-"$DEBUGSTR"bin/libgs_arm.a 2>&1 | tee buildlog_uni.txt || exit 1