From 92a3a0ccbdc7b5c2bec7b271822f9b09256a2df9 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Thu, 31 Aug 2017 15:14:08 -0400 Subject: [PATCH] Switch libjson-c back to upstream and fix some build issues with it. --- .gitmodules | 2 +- platform-darwin/External/libjson-c | 2 +- platform-darwin/Scripts/build_libjson-c-ios | 34 ++++++++++----------- platform-darwin/Scripts/build_libjson-c-osx | 20 ++++++------ platform-darwin/Scripts/build_libsodium-ios | 2 +- platform-darwin/Scripts/build_libsodium-osx | 14 ++++----- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.gitmodules b/.gitmodules index 82b42e3d..82b7f291 100644 --- a/.gitmodules +++ b/.gitmodules @@ -24,4 +24,4 @@ url = https://github.com/jedisct1/libsodium.git [submodule "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 diff --git a/platform-darwin/External/libjson-c b/platform-darwin/External/libjson-c index f5540399..95dff319 160000 --- a/platform-darwin/External/libjson-c +++ b/platform-darwin/External/libjson-c @@ -1 +1 @@ -Subproject commit f554039946f9036cb200b12fe09105b6db7bcc33 +Subproject commit 95dff31951c9388408d29e7ddf9a9edc4ec96dca diff --git a/platform-darwin/Scripts/build_libjson-c-ios b/platform-darwin/Scripts/build_libjson-c-ios index a3d34680..56d17c03 100755 --- a/platform-darwin/Scripts/build_libjson-c-ios +++ b/platform-darwin/Scripts/build_libjson-c-ios @@ -5,7 +5,7 @@ cd "${BASH_SOURCE%/*}/../External/libjson-c" [[ -d libjson-c-ios ]] && exit # 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}" mkdir -p "$prefix/lib" \ "${prefix_i386=$prefix/tmp/i386}" \ @@ -19,10 +19,10 @@ mkdir -p "$prefix/lib" \ ## ARCH: i386 export SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)" 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 LDFLAGS="-arch i386 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS" + 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 CPPFLAGS="$CFLAGS $CPPFLAGS" - [[ -e Makefile ]] && make -s clean + [[ -e Makefile ]] && make -s really-clean ./configure --host=i686-apple --disable-shared --prefix="$prefix_i386" make -j3 install ) @@ -30,10 +30,10 @@ mkdir -p "$prefix/lib" \ ## ARCH: x86_64 export SDKROOT="$(xcrun --show-sdk-path --sdk iphonesimulator)" 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 LDFLAGS="-arch x86_64 -isysroot $SDKROOT -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS" + 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 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" make -j3 install ) @@ -41,10 +41,10 @@ mkdir -p "$prefix/lib" \ ## ARCH: armv7 export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" 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 LDFLAGS="-mthumb -arch armv7 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS" + 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 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" make -j3 install ) @@ -52,10 +52,10 @@ mkdir -p "$prefix/lib" \ ## ARCH: armv7s export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" 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 LDFLAGS="-mthumb -arch armv7s -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS" + 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 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" make -j3 install ) @@ -63,10 +63,10 @@ mkdir -p "$prefix/lib" \ ## ARCH: arm64 export SDKROOT="$(xcrun --show-sdk-path --sdk iphoneos)" 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 LDFLAGS="-mthumb -arch arm64 -isysroot $SDKROOT -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET:-8.0} -flto $LDFLAGS" + 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 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" make -j3 install ) @@ -83,4 +83,4 @@ mv -f -- "$prefix_arm64/include" "$prefix/" # Cleanup rm -rf -- "$prefix/tmp" -make -s clean +make -s really-clean diff --git a/platform-darwin/Scripts/build_libjson-c-osx b/platform-darwin/Scripts/build_libjson-c-osx index 09e00f8b..79f2728d 100755 --- a/platform-darwin/Scripts/build_libjson-c-osx +++ b/platform-darwin/Scripts/build_libjson-c-osx @@ -5,23 +5,23 @@ cd "${BASH_SOURCE%/*}/../External/libjson-c" [[ -d libjson-c-osx ]] && exit # 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}" mkdir -p "$prefix" -# SDK: macOS -sdkPath="$(xcrun --show-sdk-path --sdk macosx)" -platformPath="$(xcrun --show-sdk-platform-path --sdk macosx)" +# Targets ( ## ARCH: x86_64 - export PATH="$platformPath/usr/bin:$platformPath/usr/sbin:$PATH" - export CFLAGS="-arch x86_64 -isysroot $sdkPath -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-"10.8"} -O2 -g -flto $CFLAGS" - export LDFLAGS="-arch x86_64 -isysroot $sdkPath -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-"10.8"} -flto $LDFLAGS" - [[ -e Makefile ]] && make -s clean #distclean + export SDKROOT="$(xcrun --show-sdk-path --sdk macosx)" + export 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 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" - make -j3 #check + make -j3 check make -j3 install ) # Cleanup -make -s clean #distclean +make -s really-clean diff --git a/platform-darwin/Scripts/build_libsodium-ios b/platform-darwin/Scripts/build_libsodium-ios index 9ac83030..026ce4dd 100755 --- a/platform-darwin/Scripts/build_libsodium-ios +++ b/platform-darwin/Scripts/build_libsodium-ios @@ -5,7 +5,7 @@ cd "${BASH_SOURCE%/*}/../External/libsodium" [[ -d libsodium-ios ]] && exit # 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}" mkdir -p "$prefix/lib" \ "${prefix_i386=$prefix/tmp/i386}" \ diff --git a/platform-darwin/Scripts/build_libsodium-osx b/platform-darwin/Scripts/build_libsodium-osx index 86a61e3d..2d62ab56 100755 --- a/platform-darwin/Scripts/build_libsodium-osx +++ b/platform-darwin/Scripts/build_libsodium-osx @@ -6,18 +6,18 @@ cd "${BASH_SOURCE%/*}/../External/libsodium" # Inspired by libsodium/dist-build/osx.sh # 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}" mkdir -p "$prefix" -# SDK: macOS -sdkPath="$(xcrun --show-sdk-path --sdk macosx)" -platformPath="$(xcrun --show-sdk-platform-path --sdk macosx)" +# Targets ( ## ARCH: x86_64 - export PATH="$platformPath/usr/bin:$platformPath/usr/sbin:$PATH" - export CFLAGS="-arch x86_64 -isysroot $sdkPath -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-"10.8"} -O2 -g -flto $CFLAGS" - export LDFLAGS="-arch x86_64 -isysroot $sdkPath -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET:-"10.8"} -flto $LDFLAGS" + export SDKROOT="$(xcrun --show-sdk-path --sdk macosx)" + export 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 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 ./configure --disable-shared --prefix="$prefix" make -j3 check