From: Ivan Maidanski Date: Wed, 17 Aug 2011 17:39:25 +0000 (+0400) Subject: Do not pass -fPIC to Cygwin gcc. X-Git-Tag: libatomic_ops-7_3alpha2~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85c025e043d6433ecd88c411ae2edb65e11414be;p=libatomic_ops Do not pass -fPIC to Cygwin gcc. * configure.ac (PICFLAG): Set to -fPIC if GCC but not Gygwin. --- diff --git a/configure.ac b/configure.ac index 2a16a41..e51be8f 100644 --- a/configure.ac +++ b/configure.ac @@ -23,13 +23,20 @@ need_asm=false PICFLAG= AC_MSG_CHECKING(Determining PIC compiler flag) if test "$GCC" = yes; then - AC_MSG_RESULT(-fPIC) - PICFLAG=-fPIC case "$host" in *-*-solaris*) + AC_MSG_RESULT(-fPIC) + PICFLAG=-fPIC # Workaround: at least GCC 3.4.6 does not define this macro. CFLAGS="$CFLAGS -D__PIC__=1" ;; + *-*-cygwin*) + # Cygwin does not need -fPIC. + ;; + *) + AC_MSG_RESULT(-fPIC) + PICFLAG=-fPIC + ;; esac # Output all warnings. CFLAGS="$CFLAGS -Wall -Wextra" @@ -82,12 +89,12 @@ AC_SUBST(THREADDLLIBS) AM_CONDITIONAL(NEED_ASM, test x$need_asm = xtrue) AC_CONFIG_FILES([ - Makefile - doc/Makefile - src/Makefile - tests/Makefile - pkgconfig/atomic_ops.pc - pkgconfig/atomic_ops-uninstalled.pc ]) + Makefile + doc/Makefile + src/Makefile + tests/Makefile + pkgconfig/atomic_ops.pc + pkgconfig/atomic_ops-uninstalled.pc ]) AC_CONFIG_COMMANDS([default],[[]],[[ PICFLAG="${PICFLAG}"