[project @ 2002-07-01 15:16:33 by simonmar]
[ghc-hetmet.git] / aclocal.m4
index 0fc26a8..8c11730 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: aclocal.m4,v 1.101 2002/05/17 09:03:13 simonmar Exp $
+dnl $Id: aclocal.m4,v 1.104 2002/06/25 08:32:19 simonmar Exp $
 dnl 
 dnl Extra autoconf macros for the Glasgow fptools
 dnl
@@ -189,7 +189,7 @@ fi
 
 dnl
 dnl Check for Happy and version.  If we're building GHC, then we need
-dnl at least Happy version 1.9.  If there's no installed Happy, we look
+dnl at least Happy version 1.13.  If there's no installed Happy, we look
 dnl for a happy source tree and point the build system at that instead.
 dnl
 AC_DEFUN(FPTOOLS_HAPPY,
@@ -215,29 +215,11 @@ fi;
 changequote([, ])dnl
 ])
 if test -d $srcdir/ghc -a ! -f $srcdir/ghc/compiler/parser/Parser.hs; then
-  FPTOOLS_PROG_CHECK_VERSION([$fptools_cv_happy_version],-lt,[1.9],
-  [AC_MSG_ERROR([Happy version 1.9 or later is required to compile GHC.])])dnl
+  FPTOOLS_PROG_CHECK_VERSION([$fptools_cv_happy_version],-lt,[1.13],
+  [AC_MSG_ERROR([Happy version 1.13 or later is required to compile GHC.])])dnl
 fi
 HappyVersion=$fptools_cv_happy_version;
 AC_SUBST(HappyVersion)
-
-# 1.9 and later is required, assume that we can use the
-# "-agc" options. NOTE: The Master of Happy-ness says:
-# "Don't use -s! (yet)"
-
-HappyOpts="-agc"
-
-# Soon version 1.13 will be required.  To give people a chance to
-# switch over (and me a chance to actually release 1.13 :-) , we have
-# a dummy copy of GlaExts in fptools/libraries/base. 
-#
-# If 1.13 actually is installed, we turn on the --old-ghc option for
-# the time being.
-
-FPTOOLS_PROG_CHECK_VERSION([$fptools_cv_happy_version],-ge,[1.13],
-  [HappyOpts="--old-ghc -ac"])
-
-AC_SUBST(HappyOpts)
 ])
 
 dnl
@@ -1272,3 +1254,32 @@ else
   $2="";
 fi;
 ])
+
+dnl
+dnl Check to see whether 'struct msghdr' contains msg_control
+dnl 
+AC_DEFUN(FPTOOLS_MSGHDR_MSG_CONTROL,
+[AC_CACHE_CHECK([for msg_control in struct msghdr], fptools_cv_struct_msghdr_msg_control,
+[AC_TRY_COMPILE([#include <sys/uio.h>
+#include <sys/socket.h>], [struct msghdr m; m.msg_control;],
+fptools_cv_struct_msghdr_msg_control=yes, fptools_cv_struct_msghdr_msg_control=no)])
+if test $fptools_cv_struct_msghdr_msg_control = yes; then
+  AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL)
+fi
+AC_SUBST(HAVE_MSGHDR_MSG_CONTROL)dnl
+])
+
+dnl
+dnl Check to see whether 'struct msghdr' contains msg_accrights
+dnl 
+AC_DEFUN(FPTOOLS_MSGHDR_MSG_ACCRIGHTS,
+[AC_CACHE_CHECK([for msg_accrights in struct msghdr], fptools_cv_struct_msghdr_msg_accrights,
+[AC_TRY_COMPILE([#include <sys/uio.h>
+#include <sys/socket.h>], [struct msghdr m; m.msg_accrights;],
+fptools_cv_struct_msghdr_msg_accrights=yes, fptools_cv_struct_msghdr_msg_accrights=no)])
+if test $fptools_cv_struct_msghdr_msg_accrights = yes; then
+  AC_DEFINE(HAVE_MSGHDR_MSG_ACCRIGHTS)
+fi
+AC_SUBST(HAVE_MSGHDR_MSG_ACCRIGHTS)dnl
+])
+