From b9be5fbd45116c64a6dc8f3326c653b2f4e7a11d Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 4 Aug 2014 14:30:07 -0700 Subject: [PATCH] Do not pass -fPIC on Windows. Add msys as a host_os value to detect Windows as well. --- configure.ac | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index cc1b6e0c..91949944 100644 --- a/configure.ac +++ b/configure.ac @@ -70,13 +70,13 @@ AS_IF([test "x$EMSCRIPTEN" != "x"],[ AC_MSG_WARN([compiling to javascript - asm implementations disabled]) ]) -AS_CASE([$host], [x86_64-*-mingw* | x86_64-*-cygwin*], [enable_asm="no"]) +AS_CASE([$host], [x86_64-*-mingw*|x86_64-*-cygwin*|x86_64-*-msys], [enable_asm="no"]) AC_ARG_ENABLE(pie, [AS_HELP_STRING(--disable-pie,Do not produce position independent executables)], enable_pie=$enableval, enable_pie="maybe") -AS_CASE([$host_os], [mingw*], [enable_pie="no"]) +AS_CASE([$host_os], [mingw*|cygwin*|msys], [enable_pie="no"]) AC_ARG_ENABLE(blocking-random, [AS_HELP_STRING(--enable-blocking-random,Use /dev/random instead of /dev/urandom)], @@ -142,10 +142,12 @@ CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [CFLAGS="$CFLAGS -fvisibility=hidden"]) -AX_CHECK_COMPILE_FLAG([-fPIC], [ - AX_CHECK_LINK_FLAG([-fPIC], - [CFLAGS="$CFLAGS -fPIC"] - ) +AS_CASE([$host_os], [cygwin*|mingw*|msys|pw32*|cegcc*], [ ], [ + AX_CHECK_COMPILE_FLAG([-fPIC], [ + AX_CHECK_LINK_FLAG([-fPIC], + [CFLAGS="$CFLAGS -fPIC"] + ) + ]) ]) AS_IF([test "$enable_pie" != "no"],[ @@ -174,7 +176,7 @@ AC_ARG_ENABLE(soname-versions, ) AS_CASE([$host_os], - [cygwin* | mingw* | pw32* | cegcc*], [ + [cygwin*|mingw*|msys|pw32*|cegcc*], [ AX_CHECK_LINK_FLAG([-Wl,--dynamicbase], [LDFLAGS="$LDFLAGS -Wl,--dynamicbase"]) AX_CHECK_LINK_FLAG([-Wl,--nxcompat], [LDFLAGS="$LDFLAGS -Wl,--nxcompat"]) ]) @@ -182,7 +184,7 @@ AS_CASE([$host_os], AS_IF([test "x$enable_ssp" != "xno"],[ AS_CASE([$host_os], - [cygwin* | mingw* | pw32* | cegcc*], [ ], + [cygwin*|mingw*|msys|pw32*|cegcc*], [ ], [dragonfly*], [ AX_CHECK_COMPILE_FLAG([-fstack-protector], [ AX_CHECK_LINK_FLAG([-fstack-protector],