2
0

Improved checks for external build scripts.

This commit is contained in:
Maarten Billemont 2018-02-10 20:51:50 -05:00
parent 9db855c7fb
commit 43e1a9d539
4 changed files with 44 additions and 28 deletions

View File

@ -1,11 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
hash automake || { echo >&2 "Missing automake."; exit 1; }
hash autoreconf || { echo >&2 "Missing autoconf."; exit 1; }
hash libtool || hash glibtool || { echo >&2 "Missing libtool."; exit 1; }
cd "${BASH_SOURCE%/*}/../External/libjson-c" cd "${BASH_SOURCE%/*}/../External/libjson-c"
[[ -e "${prefix=$PWD/libjson-c-ios}/lib/libjson-c.a" ]] && exit [[ -e "${prefix=$PWD/libjson-c-ios}/lib/libjson-c.a" ]] && exit
# Prepare # Prepare
autoreconf -Iautoconf-archive/m4 --verbose --install --symlink 2>&1 | sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /' autoreconf -Iautoconf-archive/m4 --verbose --install --symlink 2> >(sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /')
rm -rf "${prefix=$PWD/libjson-c-ios}" rm -rf "${prefix=$PWD/libjson-c-ios}"
mkdir -p "$prefix/lib" \ mkdir -p "$prefix/lib" \
"${prefix_i386=$prefix/tmp/i386}" \ "${prefix_i386=$prefix/tmp/i386}" \
@ -17,8 +21,8 @@ mkdir -p "$prefix/lib" \
# Targets # Targets
( (
## ARCH: i386 ## ARCH: i386
export SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)" SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphonesimulator)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk iphonesimulator)/usr/bin:$PATH"
export CFLAGS="-arch i386 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g $CFLAGS" export CFLAGS="-arch i386 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g $CFLAGS"
export LDFLAGS="-arch i386 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} $LDFLAGS" export LDFLAGS="-arch i386 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
@ -28,8 +32,8 @@ mkdir -p "$prefix/lib" \
) )
( (
## ARCH: x86_64 ## ARCH: x86_64
export SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)" SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphonesimulator)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk iphonesimulator)/usr/bin:$PATH"
export CFLAGS="-arch x86_64 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g $CFLAGS" export CFLAGS="-arch x86_64 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g $CFLAGS"
export LDFLAGS="-arch x86_64 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} $LDFLAGS" export LDFLAGS="-arch x86_64 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
@ -39,8 +43,8 @@ mkdir -p "$prefix/lib" \
) )
( (
## ARCH: armv7 ## ARCH: armv7
export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH"
export CFLAGS="-mthumb -arch armv7 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g $CFLAGS" export CFLAGS="-mthumb -arch armv7 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g $CFLAGS"
export LDFLAGS="-mthumb -arch armv7 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} $LDFLAGS" export LDFLAGS="-mthumb -arch armv7 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
@ -50,8 +54,8 @@ mkdir -p "$prefix/lib" \
) )
( (
## ARCH: armv7s ## ARCH: armv7s
export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH"
export CFLAGS="-mthumb -arch armv7s -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g $CFLAGS" export CFLAGS="-mthumb -arch armv7s -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g $CFLAGS"
export LDFLAGS="-mthumb -arch armv7s -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} $LDFLAGS" export LDFLAGS="-mthumb -arch armv7s -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
@ -61,8 +65,8 @@ mkdir -p "$prefix/lib" \
) )
( (
## ARCH: arm64 ## ARCH: arm64
export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH"
export CFLAGS="-mthumb -arch arm64 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g $CFLAGS" export CFLAGS="-mthumb -arch arm64 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g $CFLAGS"
export LDFLAGS="-mthumb -arch arm64 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} $LDFLAGS" export LDFLAGS="-mthumb -arch arm64 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"

View File

@ -1,19 +1,23 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
hash automake || { echo >&2 "Missing automake."; exit 1; }
hash autoreconf || { echo >&2 "Missing autoconf."; exit 1; }
hash libtool || hash glibtool || { echo >&2 "Missing libtool."; exit 1; }
cd "${BASH_SOURCE%/*}/../External/libjson-c" cd "${BASH_SOURCE%/*}/../External/libjson-c"
[[ -e "${prefix=$PWD/libjson-c-osx}/lib/libjson-c.a" ]] && exit [[ -e "${prefix=$PWD/libjson-c-osx}/lib/libjson-c.a" ]] && exit
# Prepare # Prepare
autoreconf -Iautoconf-archive/m4 --verbose --install --symlink 2>&1 | sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /' autoreconf -Iautoconf-archive/m4 --verbose --install --symlink 2> >(sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /')
rm -rf "${prefix=$PWD/libjson-c-osx}" rm -rf "${prefix=$PWD/libjson-c-osx}"
mkdir -p "$prefix" mkdir -p "$prefix"
# Targets # Targets
( (
## ARCH: x86_64 ## ARCH: x86_64
export SDKROOT="$(xcrun --show-sdk-path --sdk macosx)" SDKROOT="$(xcrun --show-sdk-path --sdk macosx)"
export PATH="$(xcrun --show-sdk-platform-path --sdk macosx)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk macosx)/usr/bin:$PATH"
export CFLAGS="-arch x86_64 -isysroot $SDKROOT -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-10.8} -O2 -g $CFLAGS" # -flto export CFLAGS="-arch x86_64 -isysroot $SDKROOT -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-10.8} -O2 -g $CFLAGS" # -flto
export LDFLAGS="-arch x86_64 -isysroot $SDKROOT -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-10.8} $LDFLAGS" # -flto export LDFLAGS="-arch x86_64 -isysroot $SDKROOT -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-10.8} $LDFLAGS" # -flto
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"

View File

@ -1,11 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
hash automake || { echo >&2 "Missing automake."; exit 1; }
hash autoreconf || { echo >&2 "Missing autoconf."; exit 1; }
hash libtool || hash glibtool || { echo >&2 "Missing libtool."; exit 1; }
cd "${BASH_SOURCE%/*}/../External/libsodium" cd "${BASH_SOURCE%/*}/../External/libsodium"
[[ -e "${prefix=$PWD/libsodium-ios}/lib/libsodium.a" ]] && exit [[ -e "${prefix=$PWD/libsodium-ios}/lib/libsodium.a" ]] && exit
# Prepare # Prepare
autoreconf --verbose --install --symlink 2>&1 | sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /' autoreconf --verbose --install --symlink 2> >(sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /')
rm -rf "${prefix=$PWD/libsodium-ios}" rm -rf "${prefix=$PWD/libsodium-ios}"
mkdir -p "$prefix/lib" \ mkdir -p "$prefix/lib" \
"${prefix_i386=$prefix/tmp/i386}" \ "${prefix_i386=$prefix/tmp/i386}" \
@ -17,8 +21,8 @@ mkdir -p "$prefix/lib" \
# Targets # Targets
( (
## ARCH: i386 ## ARCH: i386
export SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)" SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphonesimulator)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk iphonesimulator)/usr/bin:$PATH"
export CFLAGS="-arch i386 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g -flto $CFLAGS" export CFLAGS="-arch i386 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g -flto $CFLAGS"
export LDFLAGS="-arch i386 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS" export LDFLAGS="-arch i386 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
@ -28,8 +32,8 @@ mkdir -p "$prefix/lib" \
) )
( (
## ARCH: x86_64 ## ARCH: x86_64
export SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)" SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphonesimulator)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk iphonesimulator)/usr/bin:$PATH"
export CFLAGS="-arch x86_64 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g -flto $CFLAGS" export CFLAGS="-arch x86_64 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g -flto $CFLAGS"
export LDFLAGS="-arch x86_64 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS" export LDFLAGS="-arch x86_64 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
@ -39,8 +43,8 @@ mkdir -p "$prefix/lib" \
) )
( (
## ARCH: armv7 ## ARCH: armv7
export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH"
export CFLAGS="-mthumb -arch armv7 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g -flto $CFLAGS" export CFLAGS="-mthumb -arch armv7 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g -flto $CFLAGS"
export LDFLAGS="-mthumb -arch armv7 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS" export LDFLAGS="-mthumb -arch armv7 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
@ -50,8 +54,8 @@ mkdir -p "$prefix/lib" \
) )
( (
## ARCH: armv7s ## ARCH: armv7s
export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH"
export CFLAGS="-mthumb -arch armv7s -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g -flto $CFLAGS" export CFLAGS="-mthumb -arch armv7s -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g -flto $CFLAGS"
export LDFLAGS="-mthumb -arch armv7s -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS" export LDFLAGS="-mthumb -arch armv7s -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
@ -61,8 +65,8 @@ mkdir -p "$prefix/lib" \
) )
( (
## ARCH: arm64 ## ARCH: arm64
export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH"
export CFLAGS="-mthumb -arch arm64 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g -flto $CFLAGS" export CFLAGS="-mthumb -arch arm64 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -O2 -g -flto $CFLAGS"
export LDFLAGS="-mthumb -arch arm64 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS" export LDFLAGS="-mthumb -arch arm64 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"

View File

@ -1,20 +1,24 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
hash automake || { echo >&2 "Missing automake."; exit 1; }
hash autoreconf || { echo >&2 "Missing autoconf."; exit 1; }
hash libtool || hash glibtool || { echo >&2 "Missing libtool."; exit 1; }
cd "${BASH_SOURCE%/*}/../External/libsodium" cd "${BASH_SOURCE%/*}/../External/libsodium"
[[ -e "${prefix=$PWD/libsodium-osx}/lib/libsodium.a" ]] && exit [[ -e "${prefix=$PWD/libsodium-osx}/lib/libsodium.a" ]] && exit
# Inspired by libsodium/dist-build/osx.sh # Inspired by libsodium/dist-build/osx.sh
# Prepare # Prepare
autoreconf --verbose --install --symlink 2>&1 | sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /' autoreconf --verbose --install --symlink 2> >(sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /')
rm -rf "${prefix=$PWD/libsodium-osx}" rm -rf "${prefix=$PWD/libsodium-osx}"
mkdir -p "$prefix" mkdir -p "$prefix"
# Targets # Targets
( (
## ARCH: x86_64 ## ARCH: x86_64
export SDKROOT="$(xcrun --show-sdk-path --sdk macosx)" SDKROOT="$(xcrun --show-sdk-path --sdk macosx)"
export PATH="$(xcrun --show-sdk-platform-path --sdk macosx)/usr/bin:$PATH" PATH="$(xcrun --show-sdk-platform-path --sdk macosx)/usr/bin:$PATH"
export CFLAGS="-arch x86_64 -isysroot $SDKROOT -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-10.8} -O2 -g -flto $CFLAGS" export CFLAGS="-arch x86_64 -isysroot $SDKROOT -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-10.8} -O2 -g -flto $CFLAGS"
export LDFLAGS="-arch x86_64 -isysroot $SDKROOT -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-10.8} -flto $LDFLAGS" export LDFLAGS="-arch x86_64 -isysroot $SDKROOT -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-10.8} -flto $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"