intel / libva

Libva is an implementation for VA-API (Video Acceleration API)
http://intel.github.io/libva/
Other
663 stars 302 forks source link

How to build as static lib instead of dynamic? #831

Open dsync89 opened 3 months ago

dsync89 commented 3 months ago

I tried using the following, but it still built the .so files instead of .a.

echo "*** Building vaapi ***"
cd $BUILD_DIR/libva*
[ $rebuild -eq 1 -a -f Makefile ] && make distclean || true
mkdir -p build
cd build
meson --default-library=static .. --prefix=$TARGET_DIR --bindir="../bin/" --libdir="$TARGET_DIR/lib"
ninja
ninja install

output

$ ls target/lib
cmake          libdrm_amdgpu.a     libharfbuzz.la  libSDL2.a        libssl.a               libva.so.2.2200.0          libvorbisfile.a   libzimg.la
engines        libdrm_intel.a      libmp3lame.a    libSDL2.la       libswresample.a        libva-wayland.so           libvorbisfile.la  libz.so
libass.a       libdrm_nouveau.a    libmp3lame.la   libSDL2main.a    libswscale.a           libva-wayland.so.2         libvorbis.la      libz.so.1
libass.la      libdrm_radeon.a     libogg.a        libSDL2main.la   libva-drm.so           libva-wayland.so.2.2200.0  libvpx.a          libz.so.1.2.11
libavcodec.a   libfdk-aac.a        libogg.la       libSDL2_test.a   libva-drm.so.2         libva-x11.so               libwebp.a         openjpeg-2.1
libavdevice.a  libfdk-aac.la       libopenjp2.a    libSDL2_test.la  libva-drm.so.2.2200.0  libva-x11.so.2             libwebp.la        pkgconfig
libavfilter.a  libfribidi.a        libopus.a       libsoxr.a        libva-glx.so           libva-x11.so.2.2200.0      libx264.a
libavformat.a  libfribidi.la       libopus.la      libsoxr-lsr.a    libva-glx.so.2         libvidstab.a               libx265.a
libavutil.a    libharfbuzz.a       libpostproc.a   libspeex.a       libva-glx.so.2.2200.0  libvorbis.a                libyasm.a
libcrypto.a    libharfbuzz-icu.a   librist.a       libspeex.la      libva.so               libvorbisenc.a             libz.a
libdrm.a       libharfbuzz-icu.la  librtmp.a       libsrt.a         libva.so.2             libvorbisenc.la            libzimg.a
dsync89 commented 3 months ago

Solved by using autogen tool instead of meson.

echo "*** Building vaapi ***"
cd $BUILD_DIR/libva*
[ $rebuild -eq 1 -a -f Makefile ] && make distclean || true
./autogen.sh
./configure --prefix=$TARGET_DIR --disable-shared
make -j $jval
make install

output

$ ls
cmake          libdrm_amdgpu.a     libharfbuzz.la  libSDL2.a        libssl.a               libva-glx.so.2.2200.0      libva-x11.so.2.2200.0  libx264.a
engines        libdrm_intel.a      libmp3lame.a    libSDL2.la       libswresample.a        libva.la                   libvidstab.a           libx265.a
libass.a       libdrm_nouveau.a    libmp3lame.la   libSDL2main.a    libswscale.a           libva.so.2                 libvorbis.a            libyasm.a
libass.la      libdrm_radeon.a     libogg.a        libSDL2main.la   libva.a                libva.so.2.2200.0          libvorbisenc.a         libz.a
libavcodec.a   libfdk-aac.a        libogg.la       libSDL2_test.a   libva-drm.a            libva-wayland.a            libvorbisenc.la        libzimg.a
libavdevice.a  libfdk-aac.la       libopenjp2.a    libSDL2_test.la  libva-drm.la           libva-wayland.la           libvorbisfile.a        libzimg.la
libavfilter.a  libfribidi.a        libopus.a       libsoxr.a        libva-drm.so.2         libva-wayland.so.2         libvorbisfile.la       libz.so
libavformat.a  libfribidi.la       libopus.la      libsoxr-lsr.a    libva-drm.so.2.2200.0  libva-wayland.so.2.2200.0  libvorbis.la           libz.so.1
libavutil.a    libharfbuzz.a       libpostproc.a   libspeex.a       libva-glx.a            libva-x11.a                libvpx.a               libz.so.1.2.11
libcrypto.a    libharfbuzz-icu.a   librist.a       libspeex.la      libva-glx.la           libva-x11.la               libwebp.a              openjpeg-2.1
libdrm.a       libharfbuzz-icu.la  librtmp.a       libsrt.a         libva-glx.so.2         libva-x11.so.2             libwebp.la             pkgconfig