[1/4] configure: Don't add -fPIC to cflags for target_os=win32

Message ID 1507796950-7328-1-git-send-email-martin@martin.st
State Committed
Commit f951837ce58e8588b175fb53a76fd453a81528ec
Headers show

Commit Message

Martin Storsjö Oct. 12, 2017, 8:29 a.m.
We skipped adding it to cflags for mingw/cygwin configurations
where the compiler either complains loudly or even errors out;
do the same for target_os=win32, for the case when building with
clang in msvc mode.

This wasn't needed for the actual msvc before, since msvc uses
msvc_common_flags to filter out this flag from cflags.
When building with clang in msvc mode, no such filter is used.

This fixes building shared libraries with clang in msvc mode.
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Diego Biurrun Oct. 12, 2017, 5:02 p.m. | #1
On Thu, Oct 12, 2017 at 11:29:07AM +0300, Martin Storsjö wrote:
> We skipped adding it to cflags for mingw/cygwin configurations
> where the compiler either complains loudly or even errors out;
> do the same for target_os=win32, for the case when building with
> clang in msvc mode.
> 
> This wasn't needed for the actual msvc before, since msvc uses
> msvc_common_flags to filter out this flag from cflags.
> When building with clang in msvc mode, no such filter is used.
> 
> This fixes building shared libraries with clang in msvc mode.
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM

Diego

Patch

diff --git a/configure b/configure
index 960c1ed..0d28b3b 100755
--- a/configure
+++ b/configure
@@ -4258,7 +4258,7 @@  enable_weak_pic() {
     enable pic
     add_cppflags -DPIC
     case "$target_os" in
-    mingw*|cygwin*)
+    mingw*|cygwin*|win*)
         ;;
     *)
         add_cflags -fPIC