[vlc-commits] package/win32: build.sh: add options to do build with Universal Runtime
Steve Lhomme
git at videolan.org
Thu Jun 18 14:54:32 CEST 2020
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon May 18 14:47:08 2020 +0200| [cffab4d8030a98a9149c39769047e7b7727ca189] | committer: Steve Lhomme
package/win32: build.sh: add options to do build with Universal Runtime
(cherry picked from commit 04b91ecc79ea2c935282d1cd3f144c1e0fc63785) (rebased)
rebased:
- the make call for tools in placed elsewhere in this branch
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=cffab4d8030a98a9149c39769047e7b7727ca189
---
extras/package/win32/build.sh | 41 +++++++++++++++++++++++++++++++++++++----
1 file changed, 37 insertions(+), 4 deletions(-)
diff --git a/extras/package/win32/build.sh b/extras/package/win32/build.sh
index 595a28d2ba..dc3cc85593 100755
--- a/extras/package/win32/build.sh
+++ b/extras/package/win32/build.sh
@@ -29,12 +29,13 @@ OPTIONS:
-b <url> Enable breakpad support and send crash reports to this URL
-d Create PDB files during the build
-x Add extra checks when compiling
+ -u Use the Universal C Runtime (instead of msvcrt)
-z Build without GUI (libvlc only)
EOF
}
ARCH="x86_64"
-while getopts "hra:pcli:sb:dxz" OPTION
+while getopts "hra:pcli:sb:dxuz" OPTION
do
case $OPTION in
h)
@@ -72,6 +73,9 @@ do
x)
EXTRA_CHECKS="yes"
;;
+ u)
+ BUILD_UCRT="yes"
+ ;;
z)
DISABLEGUI="yes"
;;
@@ -136,8 +140,13 @@ fi
make -j$JOBS
cd ../../
+CONTRIB_PREFIX=$TRIPLET
+if [ ! -z "$BUILD_UCRT" ]; then
+ CONTRIB_PREFIX="${CONTRIB_PREFIX}ucrt"
+fi
+
export USE_FFMPEG=1
-export PATH="$PWD/contrib/$TRIPLET/bin":"$PATH"
+export PATH="$PWD/contrib/$CONTRIB_PREFIX/bin":"$PATH"
if [ "$INTERACTIVE" = "yes" ]; then
if [ "x$SHELL" != "x" ]; then
@@ -147,6 +156,30 @@ else
fi
fi
+if [ ! -z "$BUILD_UCRT" ]; then
+ WIDL=${TRIPLET}-widl
+ CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -D_UCRT"
+
+ SHORTARCH="$SHORTARCH-ucrt"
+
+ LDFLAGS="$LDFLAGS -lucrtbase -lucrt"
+ if [ ! "$COMPILING_WITH_CLANG" -gt 0 ]; then
+ # tell gcc to replace msvcrt with ucrtbase+ucrt
+ CFLAGS="$CFLAGS -mcrtdll=ucrtbase -mcrtdll=ucrt"
+ CXXFLAGS="$CXXFLAGS -mcrtdll=ucrtbase -mcrtdll=ucrt"
+ LDFLAGS="$LDFLAGS -mcrtdll=ucrtbase -mcrtdll=ucrt"
+ else
+ CFLAGS="$CFLAGS -Wl,-lucrtbase,-lucrt"
+ CXXFLAGS="$CXXFLAGS -Wl,-lucrtbase,-lucrt"
+ fi
+ CFLAGS="$CPPFLAGS $CFLAGS"
+ CXXFLAGS="$CPPFLAGS $CXXFLAGS"
+
+ # the values are not passed to the makefiles/configures
+ export LDFLAGS
+ export CPPFLAGS
+fi
+
info "Building contribs"
echo $PATH
@@ -163,7 +196,7 @@ fi
if [ ! -z "$DISABLEGUI" ]; then
CONTRIBFLAGS="$CONTRIBFLAGS --disable-qt --disable-qtsvg --disable-qtdeclarative --disable-qtgraphicaleffects --disable-qtquickcontrols2"
fi
-${SCRIPT_PATH}/../../../contrib/bootstrap --host=$TRIPLET $CONTRIBFLAGS
+${SCRIPT_PATH}/../../../contrib/bootstrap --host=$TRIPLET --prefix=../$CONTRIB_PREFIX $CONTRIBFLAGS
# Rebuild the contribs or use the prebuilt ones
if [ "$PREBUILT" != "yes" ]; then
@@ -229,7 +262,7 @@ else
CONFIGFLAGS="$CONFIGFLAGS --enable-qt --enable-skins2"
fi
-${SCRIPT_PATH}/configure.sh --host=$TRIPLET --with-contrib=../contrib/$TRIPLET $CONFIGFLAGS
+${SCRIPT_PATH}/configure.sh --host=$TRIPLET --with-contrib=../contrib/$CONTRIB_PREFIX $CONFIGFLAGS
info "Compiling"
make -j$JOBS
More information about the vlc-commits
mailing list