1212
1313VERSION=$1
1414ARCHIVE=curl.tar.gz
15- echo " Downloading curl ${VERSION} "
16- curl " https://curl.haxx.se/download/curl-${VERSION} .tar.gz" > " ${ARCHIVE} "
15+ if [ ! -f " ${ARCHIVE} " ]; then
16+ echo " Downloading curl ${VERSION} "
17+ curl " https://curl.haxx.se/download/curl-${VERSION} .tar.gz" > " ${ARCHIVE} "
18+ fi
1719
1820# ##########
1921# COMPILE #
@@ -22,7 +24,6 @@ curl "https://curl.haxx.se/download/curl-${VERSION}.tar.gz" > "${ARCHIVE}"
2224export OUTDIR=output
2325export BUILDDIR=build
2426export IPHONEOS_DEPLOYMENT_TARGET=" 9.3"
25- export CC=` xcrun -find -sdk iphoneos clang`
2627
2728function build() {
2829 ARCH=$1
@@ -36,10 +37,12 @@ function build() {
3637 tar -xzf " ../${ARCHIVE} " -C " ${WORKDIR} " --strip-components 1
3738 cd " ${WORKDIR} "
3839
39- export CFLAGS=" -arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot ${SDKDIR} -miphoneos-version-min=${IPHONEOS_DEPLOYMENT_TARGET} -fembed-bitcode"
40-
41- export LDFLAGS=" -arch ${ARCH} -isysroot ${SDKDIR} "
42-
40+ unset CFLAGS
41+ unset LDFLAGS
42+ CFLAGS=" -arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot ${SDKDIR} -I${SDKDIR} /usr/include -miphoneos-version-min=${IPHONEOS_DEPLOYMENT_TARGET} -fembed-bitcode"
43+ LDFLAGS=" -arch ${ARCH} -isysroot ${SDKDIR} "
44+ export CFLAGS
45+ export LDFLAGS
4346 ./configure --host=" ${HOST} -apple-darwin" \
4447 --disable-shared \
4548 --enable-static \
@@ -52,8 +55,7 @@ function build() {
5255 --disable-rtsp \
5356 --disable-ldap \
5457 --with-darwinssl > " ${LOG} " 2>&1
55-
56- make -j ` sysctl -n hw.logicalcpu_max` >> " ${LOG} " 2>&1
58+ make -j` sysctl -n hw.logicalcpu_max` >> " ${LOG} " 2>&1
5759 cp lib/.libs/libcurl.a ../../$OUTDIR /libcurl-${ARCH} .a
5860 cd ../
5961}
@@ -66,7 +68,6 @@ cd $BUILDDIR
6668build armv7 armv7 ` xcrun --sdk iphoneos --show-sdk-path`
6769build armv7s armv7s ` xcrun --sdk iphoneos --show-sdk-path`
6870build arm64 arm ` xcrun --sdk iphoneos --show-sdk-path`
69- build i386 i386 ` xcrun --sdk iphonesimulator --show-sdk-path`
7071build x86_64 x86_64 ` xcrun --sdk iphonesimulator --show-sdk-path`
7172
7273cd ../
@@ -76,7 +77,6 @@ rm ${ARCHIVE}
7677lipo -arch armv7 $OUTDIR /libcurl-armv7.a \
7778 -arch armv7s $OUTDIR /libcurl-armv7s.a \
7879 -arch arm64 $OUTDIR /libcurl-arm64.a \
79- -arch i386 $OUTDIR /libcurl-i386.a \
8080 -arch x86_64 $OUTDIR /libcurl-x86_64.a \
8181 -create -output $OUTDIR /libcurl_all.a
8282
0 commit comments