contrib: postproc: Don't add -fPIC when targeting windows
authorMartin Storsjö <martin@martin.st>
Wed, 13 Dec 2017 15:00:41 +0000 (17:00 +0200)
committerMartin Storsjö <martin@martin.st>
Sun, 25 Feb 2018 22:06:26 +0000 (00:06 +0200)
This roughly matches 3965d404ccd from libav/ffmpeg. With GCC,
adding -fPIC when building for windows (x86_64) results in a warning,
while it is an error with clang.

contrib/src/postproc/rules.mak
contrib/src/postproc/win-pic.patch [new file with mode: 0644]

index 87d405f..62d2fbc 100644 (file)
@@ -119,6 +119,7 @@ $(TARBALLS)/postproc-$(POSTPROC_VERSION).tar.xz:
 
 postproc: postproc-$(POSTPROC_VERSION).tar.xz .sum-postproc
        $(UNPACK)
+       $(APPLY) $(SRC)/postproc/win-pic.patch
        $(MOVE)
 
 .postproc: postproc
diff --git a/contrib/src/postproc/win-pic.patch b/contrib/src/postproc/win-pic.patch
new file mode 100644 (file)
index 0000000..2ce0e93
--- /dev/null
@@ -0,0 +1,22 @@
+diff -urN postproc-orig/configure postproc/configure
+--- postproc-orig/configure    2012-08-21 23:27:39.000000000 +0300
++++ postproc/configure 2018-02-25 23:57:21.100768782 +0200
+@@ -2418,9 +2418,15 @@
+ enable_pic() {
+     enable pic
+-    add_cppflags -DPIC
+-    add_cflags   -fPIC
+-    add_asflags  -fPIC
++    case "$target_os" in
++    mingw*|cygwin*|win*)
++        ;;
++    *)
++        add_cppflags -DPIC
++        add_cflags   -fPIC
++        add_asflags  -fPIC
++        ;;
++    esac
+ }
+ enabled pic && enable_pic