diff --git a/configure.ac b/configure.ac index f5bc0336..e03fb57e 100644 --- a/configure.ac +++ b/configure.ac @@ -199,15 +199,15 @@ AC_CHECK_DEFINE([_FORTIFY_SOURCE], [], [ [CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"]) ]) -AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], - [CFLAGS="$CFLAGS -fvisibility=hidden"]) - -AX_CHECK_COMPILE_FLAG([-mfunction-return=thunk -mindirect-branch=thunk], - [CFLAGS="$CFLAGS -mfunction-return=thunk -mindirect-branch=thunk"], +AX_CHECK_COMPILE_FLAG([-mindirect-branch=thunk], + [CFLAGS="$CFLAGS -mindirect-branch=thunk"], [ AX_CHECK_COMPILE_FLAG([-mretpoline], [CFLAGS="$CFLAGS -mretpoline"]) ]) +AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], + [CFLAGS="$CFLAGS -fvisibility=hidden"]) + AS_CASE([$host_os], [cygwin*|mingw*|msys|pw32*|cegcc*], [ ], [ AX_CHECK_COMPILE_FLAG([-fPIC], [CFLAGS="$CFLAGS -fPIC"]) ])