dnl ** figure out how to invoke cpp directly (gcc -E is no good)
AC_PROG_CPP
-dnl ** does the C compiler support the following options?
-case $TargetOS_CPP in
-mingw32)
- FPTOOLS_CC_FLAG(-mno-cygwin,CC_SUPPORTS_MNO_CYGWIN)
-
- EXTRA_CC_OPTS="$CC_SUPPORTS_MNO_CYGWIN"
- SRC_CC_OPTS="-O $EXTRA_CC_OPTS"
- CPPFLAGS="$EXTRA_CC_OPTS $CPPFLAGS"
- AC_SUBST(SRC_CC_OPTS)
- ;;
-*) ;;
-esac
+dnl ** Without optimization some INLINE trickery fails for GHCi
+SRC_CC_OPTS="-O"
+
+dnl ** Try to add -mno-cygwin to the C compiler options for mingw32 targets
+if test x"$TargetOS_CPP" = x"mingw32"; then
+ FPTOOLS_CC_FLAG(-mno-cygwin,CC_SUPPORTS_MNO_CYGWIN)
+ SRC_CC_OPTS="$CC_SUPPORTS_MNO_CYGWIN $SRC_CC_OPTS"
+ CPPFLAGS="$CC_SUPPORTS_MNO_CYGWIN $CPPFLAGS"
+fi
+AC_SUBST(SRC_CC_OPTS)
dnl ** figure out how to do context diffs
FPTOOLS_PROG_DIFF
])
AC_SUBST(HaveRtldNext)
+dnl ** RTLD_LOCAL isn't available on cygwin
+AC_MSG_CHECKING(for RTLD_LOCAL from dlfcn.h)
+AC_EGREP_CPP(yes,
+[
+ #include <dlfcn.h>
+ #ifdef RTLD_LOCAL
+ yes
+ #endif
+], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_RTLDLOCAL)
+ HaveRtldLocal=YES
+], [
+ AC_MSG_RESULT(no)
+ HaveRtldLocal=NO
+ ])
+AC_SUBST(HaveRtldLocal)
+
FPTOOLS_CHECK_LIB_NOWARN(m, atan)
dnl --------------------------------------------------