local min=$5
shift 5
+ rm -rf "libjpeg.${arch}"
rm -rf "libvncserver.${arch}"
+
if ! isysroot=$(xcodebuild -sdk "${sdk}" -version Path); then
return
fi
+ mkdir "libjpeg.${arch}"
mkdir "libvncserver.${arch}"
flags=()
flags+=(-mthumb)
fi
+ cpp="$*"
+
+ function configure() {
+ code=$1
+ shift
+ CC="clang -arch ${arch}" CXX="clang++ -arch ${arch}" CFLAGS="${flags[*]}" CPPFLAGS="${flags[*]} ${cpp}" ../"${code}"/configure --host="${host}" --disable-shared "$@"
+ }
+
+ cd "libjpeg.${arch}"
+ configure jpeg-9a
+ make
+ cd ..
+
+ flags+=(-I"${PWD}/jpeg-9a")
+
+ jpeg=${PWD}/libjpeg.${arch}
+ flags+=(-I"${jpeg}")
+
cd "libvncserver.${arch}"
- CC="clang -arch ${arch}" CXX="clang++ -arch ${arch}" CFLAGS="${flags[*]}" CPPFLAGS="${flags[*]} $*" ../libvncserver/configure --host="${host}" --disable-shared
+ configure libvncserver JPEG_LDFLAGS="-L${jpeg}/.libs -ljpeg"
make
cd ..
}
ADDITIONAL_LDFLAGS += -Xarch_armv6 -Llibvncserver.armv6/libvncserver/.libs
ADDITIONAL_LDFLAGS += -Xarch_arm64 -Llibvncserver.arm64/libvncserver/.libs
-ADDITIONAL_LDFLAGS += -lvncserver -lz
+ADDITIONAL_LDFLAGS += -lvncserver
+
+ADDITIONAL_LDFLAGS += -Xarch_armv6 -Llibjpeg.armv6/.libs
+ADDITIONAL_LDFLAGS += -Xarch_arm64 -Llibjpeg.arm64/.libs
+ADDITIONAL_LDFLAGS += -ljpeg
+
+ADDITIONAL_LDFLAGS += -lz
ADDITIONAL_LDFLAGS += -F/System/Library/PrivateFrameworks
ADDITIONAL_LDFLAGS += -weak_reference_mismatches weak