contrib: move macOS compilation flags to the script where they belong and generalize...
authorFelix Paul Kühne <felix@feepk.net>
Wed, 24 Jan 2018 20:38:53 +0000 (21:38 +0100)
committerFelix Paul Kühne <felix@feepk.net>
Fri, 2 Feb 2018 13:47:49 +0000 (14:47 +0100)
contrib/src/main.mak
extras/package/macosx/build.sh

index 0398a5a..e6da70c 100644 (file)
@@ -113,10 +113,7 @@ endif
 endif
 
 ifdef HAVE_MACOSX
-MIN_OSX_VERSION=10.7
-EXTRA_CFLAGS += -isysroot $(MACOSX_SDK) -mmacosx-version-min=$(MIN_OSX_VERSION) -DMACOSX_DEPLOYMENT_TARGET=$(MIN_OSX_VERSION)
 EXTRA_CXXFLAGS += -stdlib=libc++
-EXTRA_LDFLAGS += -Wl,-syslibroot,$(MACOSX_SDK) -mmacosx-version-min=$(MIN_OSX_VERSION) -isysroot $(MACOSX_SDK) -DMACOSX_DEPLOYMENT_TARGET=$(MIN_OSX_VERSION)
 ifeq ($(ARCH),x86_64)
 EXTRA_CFLAGS += -m64
 EXTRA_LDFLAGS += -m64
@@ -132,18 +129,10 @@ endif
 CCAS=$(CC) -c
 
 ifdef HAVE_IOS
-CC=xcrun clang
-CXX=xcrun clang++
 ifdef HAVE_NEON
 AS=perl $(abspath ../../extras/tools/build/bin/gas-preprocessor.pl) $(CC)
 CCAS=gas-preprocessor.pl $(CC) -c
-else
-CCAS=$(CC) -c
 endif
-AR=xcrun ar
-LD=xcrun ld
-STRIP=xcrun strip
-RANLIB=xcrun ranlib
 EXTRA_CFLAGS += $(CFLAGS)
 endif
 
@@ -346,7 +335,7 @@ UPDATE_AUTOCONFIG = for dir in $(AUTOMAKE_DATA_DIRS); do \
                fi; \
        done
 
-ifdef HAVE_IOS
+ifdef HAVE_DARWIN_OS
 AUTORECONF = AUTOPOINT=true autoreconf
 else
 AUTORECONF = autoreconf
index d996e1f..8158bc7 100755 (executable)
@@ -1,6 +1,5 @@
 #!/bin/sh
 set -e
-set -x
 
 info()
 {
@@ -193,9 +192,16 @@ spopd
 #   enabled. (e.g. ffmpeg)
 # - This will fail the build if a partially available symbol is added later on
 #   in contribs and not mentioned in the list of symbols above.
-export CFLAGS="-Werror=partial-availability"
-export CXXFLAGS="-Werror=partial-availability"
-export OBJCFLAGS="-Werror=partial-availability"
+CFLAGS="-Werror=partial-availability "
+CXXFLAGS="-Werror=partial-availability "
+OBJCFLAGS="-Werror=partial-availability "
+
+CFLAGS+="-isysroot "$SDKROOT" -mmacosx-version-min="$MINIMAL_OSX_VERSION" -DMACOSX_DEPLOYMENT_TARGET="$MINIMAL_OSX_VERSION
+LDFLAGS+="-Wl,-syslibroot,"$SDKROOT" -mmacosx-version-min="$MINIMAL_OSX_VERSION" -isysroot "$SDKROOT" -DMACOSX_DEPLOYMENT_TARGET="$MINIMAL_OSX_VERSION
+
+export CFLAGS=${CFLAGS}
+export CXXFLAGS=${CXXFLAGS}
+export LDFLAGS=${LDFLAGS}
 
 info "Building contribs"
 spushd "${vlcroot}/contrib"