Skip to content

Commit

Permalink
Force true static link for libva-win32
Browse files Browse the repository at this point in the history
  • Loading branch information
BtbN committed Sep 19, 2023
1 parent 86871ad commit fe9763a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions scripts.d/50-vaapi/50-libva.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@ ffbuild_dockerbuild() {
echo "#include <xcb/xcbext.h>" >> va/x11/va_dri3.c
echo "xcb_extension_t xcb_dri3_id;" >> va/x11/va_dri3.c

# Allow to actually toggle static linking
sed -i "s/shared_library/library/g" va/meson.build

mkdir mybuild && cd mybuild

local myconf=(
--prefix="$FFBUILD_PREFIX"
--buildtype=release
--default-library=shared
-Denable_docs=false
)

if [[ $TARGET == linux64 ]]; then
myconf+=(
--cross-file=/cross.meson
--default-library=shared
--sysconfdir="/etc"
-Ddriverdir="/usr/lib/x86_64-linux-gnu/dri"
-Ddisable_drm=false
Expand All @@ -43,6 +46,7 @@ ffbuild_dockerbuild() {
elif [[ $TARGET == win* ]]; then
myconf+=(
--cross-file=/cross.meson
--default-library=static
-Dwith_win32=yes
)
else
Expand All @@ -64,15 +68,6 @@ ffbuild_dockerbuild() {
rm "$FFBUILD_PREFIX"/lib/libva{,-drm,-x11}.so*

echo "Libs: -ldl" >> "$FFBUILD_PREFIX"/lib/pkgconfig/libva.pc
elif [[ $TARGET == win* ]]; then
"$FFBUILD_CROSS_PREFIX"gendef - "$FFBUILD_PREFIX"/bin/libva.dll > libva.def
"$FFBUILD_CROSS_PREFIX"gendef - "$FFBUILD_PREFIX"/bin/libva_win32.dll > libva_win32.def
"$FFBUILD_CROSS_PREFIX"dlltool --input-def libva.def --output-delaylib "$FFBUILD_PREFIX"/lib/libva.a
"$FFBUILD_CROSS_PREFIX"dlltool --input-def libva_win32.def --output-delaylib "$FFBUILD_PREFIX"/lib/libva_win32.a
rm "$FFBUILD_PREFIX"/bin/libva*.dll "$FFBUILD_PREFIX"/lib/libva*.dll.a
else
echo "Unknown target"
return -1
fi
}

Expand Down

0 comments on commit fe9763a

Please sign in to comment.