[vlc-commits] Revert "contrib: move macOS compilation flags to the script where they belong and generalize Darwin OS environment manipulations"

David Fuhrmann git at videolan.org
Thu Feb 8 21:13:37 CET 2018


vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Thu Feb  8 21:12:36 2018 +0100| [7821ebf808a3952a7089c28fc8a4568ea2a1a2f3] | committer: David Fuhrmann

Revert "contrib: move macOS compilation flags to the script where they belong and generalize Darwin OS environment manipulations"

This breaks macOS compilation.
This reverts commit 625bc3ced2120b50efa35fa8c2e4fac8270f85f2.

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=7821ebf808a3952a7089c28fc8a4568ea2a1a2f3
---

 contrib/src/main.mak           | 13 ++++++++++++-
 extras/package/macosx/build.sh | 14 ++++----------
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index e6da70cc27..0398a5ad1a 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -113,7 +113,10 @@ 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
@@ -129,10 +132,18 @@ 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
 
@@ -335,7 +346,7 @@ UPDATE_AUTOCONFIG = for dir in $(AUTOMAKE_DATA_DIRS); do \
 		fi; \
 	done
 
-ifdef HAVE_DARWIN_OS
+ifdef HAVE_IOS
 AUTORECONF = AUTOPOINT=true autoreconf
 else
 AUTORECONF = autoreconf
diff --git a/extras/package/macosx/build.sh b/extras/package/macosx/build.sh
index 146dd7aeb7..72c2320d73 100755
--- a/extras/package/macosx/build.sh
+++ b/extras/package/macosx/build.sh
@@ -1,5 +1,6 @@
 #!/bin/sh
 set -e
+set -x
 
 info()
 {
@@ -192,16 +193,9 @@ 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.
-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}
+export CFLAGS="-Werror=partial-availability"
+export CXXFLAGS="-Werror=partial-availability"
+export OBJCFLAGS="-Werror=partial-availability"
 
 info "Building contribs"
 spushd "${vlcroot}/contrib"



More information about the vlc-commits mailing list