[project @ 1998-08-20 15:43:39 by sof]
[ghc-hetmet.git] / aclocal.m4
index 8ac66df..e823a83 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: aclocal.m4,v 1.25 1998/08/14 15:24:10 simonm Exp $
+dnl $Id: aclocal.m4,v 1.27 1998/08/16 16:45:37 sof Exp $
 dnl 
 dnl Extra autoconf macros for the Glasgow fptools
 dnl
@@ -280,7 +280,7 @@ AC_DEFUN(FPTOOLS_PROG_GNUCPP,
        echo > conftest.c
        gcc -v -E conftest.c >/dev/null 2>conftest.out
        # \x5c = backslash
-       echo 'tr/\x5c/\//; /(\S+\/cpp)/ && print "[$]1";' > conftest.pl
+       echo 'tr/\x5c/\//; /(\S+\/)cpp/ && print "[$]{1}cpp -iprefix [$]1";' > conftest.pl
        fptools_cv_gnu_cpp="`eval $PerlCmd -n conftest.pl conftest.out`"
        rm -fr conftest*
  else
@@ -396,3 +396,29 @@ if test "$fptools_cv_have_long_long" = yes; then
 AC_DEFINE(HAVE_LONG_LONG)
 fi
 ])
+
+dnl *** Can we open files in binary mode? ***
+dnl 
+AC_DEFUN(FPTOOLS_O_BINARY,
+[
+AC_REQUIRE([AC_PROG_CC])
+AC_MSG_CHECKING(whether we can open files in binary mode)
+AC_CACHE_VAL(fptools_cv_have_o_binary,
+[
+AC_LANG_SAVE
+AC_LANG_C
+AC_TRY_COMPILE(,
+[#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+int x = O_BINARY;],
+fptools_cv_have_o_binary=yes,
+fptools_cv_have_o_binary=no)
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($fptools_cv_have_o_binary)
+if test "$fptools_cv_have_o_binary" = yes; then
+AC_DEFINE(HAVE_O_BINARY)
+fi
+])
+