[x264-devel] [PATCH] configure: Add Cflags.private in pkgconfig for static linking

Biswapriyo Nath nathbappai at gmail.com
Wed Apr 20 13:32:51 UTC 2022


-------------- next part --------------
From f0edbdfc4f0fe467fbbe3f2934c2fae4523500b1 Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath <nathbappai at gmail.com>
Date: Wed, 20 Apr 2022 18:50:03 +0530
Subject: [PATCH] configure: Add Cflags.private in pkgconfig for static linking

This fixes static linking by undefining X264_API_IMPORTS. Otherwise,
x264 static library is built with dllimport keyword.

Signed-off-by: Biswapriyo Nath <nathbappai at gmail.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index e242e73..b4d43d1 100755
--- a/configure
+++ b/configure
@@ -1636,6 +1636,7 @@ Version: $(grep POINTVER < x264_config.h | sed -e 's/.* "//; s/".*//; s/ .*//')
 Libs: -L$libdir -lx264 $([ "$shared" = "yes" ] || echo $libpthread $libm $libdl)
 Libs.private: $([ "$shared" = "yes" ] && echo $libpthread $libm $libdl)
 Cflags: -I$includedir $([ "$shared" = "yes" ] && echo "-DX264_API_IMPORTS")
+Cflags.private: $([ "$shared" = "yes" ] && echo "-UX264_API_IMPORTS")
 EOF
 
 filters="crop select_every"
-- 
2.35.3



More information about the x264-devel mailing list