2
0

Switch libjson-c back to upstream and fix some build issues with it.

This commit is contained in:
Maarten Billemont 2017-08-31 15:14:08 -04:00
parent ba24c2be34
commit 92a3a0ccbd
6 changed files with 37 additions and 37 deletions

2
.gitmodules vendored
View File

@ -24,4 +24,4 @@
url = https://github.com/jedisct1/libsodium.git url = https://github.com/jedisct1/libsodium.git
[submodule "platform-darwin/External/libjson-c"] [submodule "platform-darwin/External/libjson-c"]
path = platform-darwin/External/libjson-c path = platform-darwin/External/libjson-c
url = https://github.com/lhunath/json-c.git url = https://github.com/json-c/json-c.git

@ -1 +1 @@
Subproject commit f554039946f9036cb200b12fe09105b6db7bcc33 Subproject commit 95dff31951c9388408d29e7ddf9a9edc4ec96dca

View File

@ -5,7 +5,7 @@ cd "${BASH_SOURCE%/*}/../External/libjson-c"
[[ -d libjson-c-ios ]] && exit [[ -d libjson-c-ios ]] && exit
# Prepare # Prepare
autoreconf -Iautoconf-archive/m4 --verbose --install --symlink --force 2>&1 | sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /' autoreconf -Iautoconf-archive/m4 --verbose --install --symlink 2>&1 | 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}" \
@ -19,10 +19,10 @@ mkdir -p "$prefix/lib" \
## ARCH: i386 ## ARCH: i386
export SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)" export SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphonesimulator)/usr/bin:$PATH" export 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 $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} $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
[[ -e Makefile ]] && make -s clean [[ -e Makefile ]] && make -s really-clean
./configure --host=i686-apple --disable-shared --prefix="$prefix_i386" ./configure --host=i686-apple --disable-shared --prefix="$prefix_i386"
make -j3 install make -j3 install
) )
@ -30,10 +30,10 @@ mkdir -p "$prefix/lib" \
## ARCH: x86_64 ## ARCH: x86_64
export SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)" export SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphonesimulator)/usr/bin:$PATH" export 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 $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} $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
[[ -e Makefile ]] && make -s clean [[ -e Makefile ]] && make -s really-clean
./configure --host=x86_64-apple --disable-shared --prefix="$prefix_x86_64" ./configure --host=x86_64-apple --disable-shared --prefix="$prefix_x86_64"
make -j3 install make -j3 install
) )
@ -41,10 +41,10 @@ mkdir -p "$prefix/lib" \
## ARCH: armv7 ## ARCH: armv7
export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH" export 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 $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} $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
[[ -e Makefile ]] && make -s clean [[ -e Makefile ]] && make -s really-clean
./configure --host=x86_64-apple --target=arm-apple --disable-shared --prefix="$prefix_armv7" ./configure --host=x86_64-apple --target=arm-apple --disable-shared --prefix="$prefix_armv7"
make -j3 install make -j3 install
) )
@ -52,10 +52,10 @@ mkdir -p "$prefix/lib" \
## ARCH: armv7s ## ARCH: armv7s
export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH" export 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 $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} $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
[[ -e Makefile ]] && make -s clean [[ -e Makefile ]] && make -s really-clean
./configure --host=x86_64-apple --target=arm-apple --disable-shared --prefix="$prefix_armv7s" ./configure --host=x86_64-apple --target=arm-apple --disable-shared --prefix="$prefix_armv7s"
make -j3 install make -j3 install
) )
@ -63,10 +63,10 @@ mkdir -p "$prefix/lib" \
## ARCH: arm64 ## ARCH: arm64
export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)"
export PATH="$(xcrun --show-sdk-platform-path --sdk iphoneos)/usr/bin:$PATH" export 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 $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} $LDFLAGS"
export CPPFLAGS="$CFLAGS $CPPFLAGS" export CPPFLAGS="$CFLAGS $CPPFLAGS"
[[ -e Makefile ]] && make -s clean [[ -e Makefile ]] && make -s really-clean
./configure --host=x86_64-apple --target=arm-apple --disable-shared --prefix="$prefix_arm64" ./configure --host=x86_64-apple --target=arm-apple --disable-shared --prefix="$prefix_arm64"
make -j3 install make -j3 install
) )
@ -83,4 +83,4 @@ mv -f -- "$prefix_arm64/include" "$prefix/"
# Cleanup # Cleanup
rm -rf -- "$prefix/tmp" rm -rf -- "$prefix/tmp"
make -s clean make -s really-clean

View File

@ -5,23 +5,23 @@ cd "${BASH_SOURCE%/*}/../External/libjson-c"
[[ -d libjson-c-osx ]] && exit [[ -d libjson-c-osx ]] && exit
# Prepare # Prepare
autoreconf -Iautoconf-archive/m4 --verbose --install --symlink --force 2>&1 | sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /' autoreconf -Iautoconf-archive/m4 --verbose --install --symlink 2>&1 | 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"
# SDK: macOS # Targets
sdkPath="$(xcrun --show-sdk-path --sdk macosx)"
platformPath="$(xcrun --show-sdk-platform-path --sdk macosx)"
( (
## ARCH: x86_64 ## ARCH: x86_64
export PATH="$platformPath/usr/bin:$platformPath/usr/sbin:$PATH" export SDKROOT="$(xcrun --show-sdk-path --sdk macosx)"
export CFLAGS="-arch x86_64 -isysroot $sdkPath -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-"10.8"} -O2 -g -flto $CFLAGS" export PATH="$(xcrun --show-sdk-platform-path --sdk macosx)/usr/bin:$PATH"
export LDFLAGS="-arch x86_64 -isysroot $sdkPath -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-"10.8"} -flto $LDFLAGS" export CFLAGS="-arch x86_64 -isysroot $SDKROOT -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-10.8} -O2 -g $CFLAGS" # -flto
[[ -e Makefile ]] && make -s clean #distclean export LDFLAGS="-arch x86_64 -isysroot $SDKROOT -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-10.8} $LDFLAGS" # -flto
export CPPFLAGS="$CFLAGS $CPPFLAGS"
[[ -e Makefile ]] && make -s really-clean
./configure --disable-shared --prefix="$prefix" ./configure --disable-shared --prefix="$prefix"
make -j3 #check make -j3 check
make -j3 install make -j3 install
) )
# Cleanup # Cleanup
make -s clean #distclean make -s really-clean

View File

@ -5,7 +5,7 @@ cd "${BASH_SOURCE%/*}/../External/libsodium"
[[ -d libsodium-ios ]] && exit [[ -d libsodium-ios ]] && exit
# Prepare # Prepare
autoreconf --verbose --install --symlink --force 2>&1 | sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /' autoreconf --verbose --install --symlink 2>&1 | 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}" \

View File

@ -6,18 +6,18 @@ cd "${BASH_SOURCE%/*}/../External/libsodium"
# Inspired by libsodium/dist-build/osx.sh # Inspired by libsodium/dist-build/osx.sh
# Prepare # Prepare
autoreconf --verbose --install --symlink --force 2>&1 | sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /' autoreconf --verbose --install --symlink 2>&1 | sed 's/^\([^:]*\):[0-9]\{1,\}: /\1: /'
rm -rf "${prefix=$PWD/libsodium-osx}" rm -rf "${prefix=$PWD/libsodium-osx}"
mkdir -p "$prefix" mkdir -p "$prefix"
# SDK: macOS # Targets
sdkPath="$(xcrun --show-sdk-path --sdk macosx)"
platformPath="$(xcrun --show-sdk-platform-path --sdk macosx)"
( (
## ARCH: x86_64 ## ARCH: x86_64
export PATH="$platformPath/usr/bin:$platformPath/usr/sbin:$PATH" export SDKROOT="$(xcrun --show-sdk-path --sdk macosx)"
export CFLAGS="-arch x86_64 -isysroot $sdkPath -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-"10.8"} -O2 -g -flto $CFLAGS" export PATH="$(xcrun --show-sdk-platform-path --sdk macosx)/usr/bin:$PATH"
export LDFLAGS="-arch x86_64 -isysroot $sdkPath -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-"10.8"} -flto $LDFLAGS" 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 CPPFLAGS="$CFLAGS $CPPFLAGS"
[[ -e Makefile ]] && make -s distclean [[ -e Makefile ]] && make -s distclean
./configure --disable-shared --prefix="$prefix" ./configure --disable-shared --prefix="$prefix"
make -j3 check make -j3 check