[vlc-commits] package/win32: build.sh: add options to do build for Winstore
Steve Lhomme
git at videolan.org
Thu Jun 18 14:54:33 CEST 2020
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon May 18 15:16:14 2020 +0200| [aa6ead67a7ecb69bdfcd325a7ec3ba6f3ee79f76] | committer: Steve Lhomme
package/win32: build.sh: add options to do build for Winstore
This is mostly a port of this build script to our build script:
https://code.videolan.org/videolan/vlc-winrt/-/blob/master/libvlc/compile.sh
The Winstore build tweaks are only enabled with the Universal Runtime flag.
There are less disabled modules.
(cherry picked from commit e94843611e4d609074cd5a4c633f1d6f6be9f5f8) (rebased)
rebased:
- this branch has --enable-realrtsp in the configure options
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=aa6ead67a7ecb69bdfcd325a7ec3ba6f3ee79f76
---
extras/package/win32/build.sh | 67 ++++++++++++++++++++++++++++++++++++++-
extras/package/win32/configure.sh | 2 --
2 files changed, 66 insertions(+), 3 deletions(-)
diff --git a/extras/package/win32/build.sh b/extras/package/win32/build.sh
index dc3cc85593..459be16288 100755
--- a/extras/package/win32/build.sh
+++ b/extras/package/win32/build.sh
@@ -30,12 +30,13 @@ OPTIONS:
-d Create PDB files during the build
-x Add extra checks when compiling
-u Use the Universal C Runtime (instead of msvcrt)
+ -w Restrict to Windows Store APIs
-z Build without GUI (libvlc only)
EOF
}
ARCH="x86_64"
-while getopts "hra:pcli:sb:dxuz" OPTION
+while getopts "hra:pcli:sb:dxuwz" OPTION
do
case $OPTION in
h)
@@ -76,6 +77,9 @@ do
u)
BUILD_UCRT="yes"
;;
+ w)
+ WINSTORE="yes"
+ ;;
z)
DISABLEGUI="yes"
;;
@@ -142,7 +146,34 @@ cd ../../
CONTRIB_PREFIX=$TRIPLET
if [ ! -z "$BUILD_UCRT" ]; then
+ if [ ! -z "$WINSTORE" ]; then
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-disc --disable-srt --disable-sdl --disable-SDL_image --disable-caca"
+ # modplug uses GlobalAlloc/Free and lstrcpyA/wsprintfA/lstrcpynA
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-modplug"
+ # x265 uses too many forbidden APIs
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-x265"
+ # aribb25 uses ANSI strings in WIDE APIs
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-aribb25"
+ # gettext uses sys/socket.h improperly
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-gettext"
+ # fontconfig uses GetWindowsDirectory and SHGetFolderPath
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-fontconfig"
+ # asdcplib uses some fordbidden SetErrorModes, GetModuleFileName in fileio.cpp
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-asdcplib"
+ # projectM is openGL based
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-projectM"
+ # gpg-error doesn't know minwg32uwp
+ # CONTRIBFLAGS="$CONTRIBFLAGS --disable-gpg-error"
+ # x264 build system claims it needs MSVC to build for WinRT
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-x264"
+
+ # libdsm is not enabled by default
+ CONTRIBFLAGS="$CONTRIBFLAGS --enable-libdsm"
+
+ CONTRIB_PREFIX="${CONTRIB_PREFIX}uwp"
+ else
CONTRIB_PREFIX="${CONTRIB_PREFIX}ucrt"
+ fi
fi
export USE_FFMPEG=1
@@ -160,7 +191,18 @@ if [ ! -z "$BUILD_UCRT" ]; then
WIDL=${TRIPLET}-widl
CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -D_UCRT"
+ if [ ! -z "$WINSTORE" ]; then
+ SHORTARCH="$SHORTARCH-uwp"
+ CPPFLAGS="$CPPFLAGS -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_UNICODE -DUNICODE"
+
+ # WinstoreCompat: hopefully can go away someday
+ LDFLAGS="$LDFLAGS -lwindowsapp -lwinstorecompat"
+ CFLAGS="$CFLAGS -Wl,-lwindowsapp,-lwinstorecompat"
+ CXXFLAGS="$CXXFLAGS -Wl,-lwindowsapp,-lwinstorecompat"
+ CPPFLAGS="$CPPFLAGS -DWINSTORECOMPAT"
+ else
SHORTARCH="$SHORTARCH-ucrt"
+ fi
LDFLAGS="$LDFLAGS -lucrtbase -lucrt"
if [ ! "$COMPILING_WITH_CLANG" -gt 0 ]; then
@@ -168,6 +210,13 @@ if [ ! -z "$BUILD_UCRT" ]; then
CFLAGS="$CFLAGS -mcrtdll=ucrtbase -mcrtdll=ucrt"
CXXFLAGS="$CXXFLAGS -mcrtdll=ucrtbase -mcrtdll=ucrt"
LDFLAGS="$LDFLAGS -mcrtdll=ucrtbase -mcrtdll=ucrt"
+
+ if [ ! -z "$WINSTORE" ]; then
+ # trick to provide these libraries before -ladvapi32 -lshell32 -luser32 -lkernel32
+ CFLAGS="$CFLAGS -mcrtdll=windowsapp -mcrtdll=winstorecompat"
+ CXXFLAGS="$CXXFLAGS -mcrtdll=windowsapp -mcrtdll=winstorecompat"
+ LDFLAGS="$LDFLAGS -mcrtdll=windowsapp -mcrtdll=winstorecompat"
+ fi
else
CFLAGS="$CFLAGS -Wl,-lucrtbase,-lucrt"
CXXFLAGS="$CXXFLAGS -Wl,-lucrtbase,-lucrt"
@@ -196,6 +245,10 @@ fi
if [ ! -z "$DISABLEGUI" ]; then
CONTRIBFLAGS="$CONTRIBFLAGS --disable-qt --disable-qtsvg --disable-qtdeclarative --disable-qtgraphicaleffects --disable-qtquickcontrols2"
fi
+if [ ! -z "$WINSTORE" ]; then
+ # we don't use a special toolchain to trigger the detection in contribs so force it manually
+ export HAVE_WINSTORE=1
+fi
${SCRIPT_PATH}/../../../contrib/bootstrap --host=$TRIPLET --prefix=../$CONTRIB_PREFIX $CONTRIBFLAGS
# Rebuild the contribs or use the prebuilt ones
@@ -261,6 +314,18 @@ if [ ! -z "$DISABLEGUI" ]; then
else
CONFIGFLAGS="$CONFIGFLAGS --enable-qt --enable-skins2"
fi
+if [ ! -z "$WINSTORE" ]; then
+ CONFIGFLAGS="$CONFIGFLAGS --enable-winstore-app"
+ # uses CreateFile to access files/drives outside of the app
+ CONFIGFLAGS="$CONFIGFLAGS --disable-vcd"
+ # OpenGL is not supported in UWP
+ CONFIGFLAGS="$CONFIGFLAGS --disable-gl"
+ # other modules that were disabled in the old UWP builds
+ CONFIGFLAGS="$CONFIGFLAGS --disable-crystalhd --disable-dxva2"
+
+else
+ CONFIGFLAGS="$CONFIGFLAGS --enable-dvdread --enable-caca"
+fi
${SCRIPT_PATH}/configure.sh --host=$TRIPLET --with-contrib=../contrib/$CONTRIB_PREFIX $CONFIGFLAGS
diff --git a/extras/package/win32/configure.sh b/extras/package/win32/configure.sh
index 076e014ba4..455ff18dd3 100755
--- a/extras/package/win32/configure.sh
+++ b/extras/package/win32/configure.sh
@@ -13,10 +13,8 @@ OPTIONS="
--enable-schroedinger
--enable-realrtsp
--enable-live555
- --enable-dvdread
--enable-shout
--enable-goom
- --enable-caca
--enable-sse --enable-mmx
--enable-libcddb
--enable-zvbi --disable-telx
More information about the vlc-commits
mailing list