[vlc-commits] macOS build.sh: Enable -Werror=partial-availability for contribs

David Fuhrmann git at videolan.org
Wed Jul 26 21:16:17 CEST 2017


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Wed Jul 26 21:07:52 2017 +0200| [f87eeb29b6b0d34754e6c66309dd246f15294853] | committer: David Fuhrmann

macOS build.sh: Enable -Werror=partial-availability for contribs

Usually, contribs do not support runtime handling of partial
availability well. Turning this warning into an error has several
advantages:
- It fixes feature detection for custom build scripts: If a custom
build script includes the correct header, the check will now fail
to build and replacements will be enabled. This is the case for
ffmpeg, for instance.
- Even if configure check might not fail, the build will fail
for correctly annotated functions, once they are used in the code.
This makes it very visible if new partial symbols are added, so
that they can be fixed or disabled subsequently.

refs #18476

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

 extras/package/macosx/build.sh | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/extras/package/macosx/build.sh b/extras/package/macosx/build.sh
index 28a8ffe5b4..43cb0a9066 100755
--- a/extras/package/macosx/build.sh
+++ b/extras/package/macosx/build.sh
@@ -122,8 +122,9 @@ export ac_cv_func_mkostemps=no
 export ac_cv_func_ffsll=no
 export ac_cv_func_flsll=no
 export ac_cv_func_fdopendir=no
-export ac_cv_func_openat=no # Disables fstatat as well
-
+export ac_cv_func_openat=no
+export ac_cv_func_fstatat=no
+export ac_cv_func_readlinkat=no
 
 # libnetwork does not exist yet on 10.7 (used by libcddb)
 export ac_cv_lib_network_connect=no
@@ -148,6 +149,17 @@ let jobs=$core_count+1
 # vlc/contribs
 #
 
+# Usually, VLCs contrib libraries do not support partial availability at runtime.
+# Forcing those errors has two reasons:
+# - Some custom configure scripts include the right header for testing availability.
+#   Those configure checks fail (correctly) with those errors, and replacements are
+#   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"
+
 info "Building contribs"
 spushd "${vlcroot}/contrib"
 mkdir -p contrib-$TRIPLET && cd contrib-$TRIPLET
@@ -166,6 +178,10 @@ fi
 fi
 spopd
 
+unset CFLAGS
+unset CXXFLAGS
+unset OBJCFLAGS
+
 
 #
 # vlc/bootstrap



More information about the vlc-commits mailing list