[project @ 2002-04-22 00:53:59 by chak]
[ghc-hetmet.git] / configure.in
index ff3b0ec..f61558e 100644 (file)
@@ -556,18 +556,16 @@ FPTOOLS_HAVE_GCC
 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
@@ -991,6 +989,24 @@ AC_EGREP_CPP(yes,
   ])    
 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 --------------------------------------------------