[project @ 2003-08-27 15:18:29 by panne]
[ghc-hetmet.git] / configure.ac
index 41a9260..bba4b3c 100644 (file)
@@ -24,9 +24,9 @@ AC_PREREQ(2.52)
 dnl * Declare subdirectories that have a private configure script
 dnl
 dnl After the toplevel configuration is complete, the script will recurse into
-dnl these subdirectories (the use of cache values makes repeated checks cheap)
-dnl (We probably have to add hslibs/{OpenGL,GLUT} here later...)
-AC_CONFIG_SUBDIRS(ghc)
+dnl these subdirectories if they exist. The use of a cache file makes repeated
+dnl checks cheap.
+AC_CONFIG_SUBDIRS([ghc libraries])
 
 # -------------------------------------------------------------------------
 # Prepare to generate the following header files
@@ -206,6 +206,15 @@ ia64-*-linux*)
         HostVendor_CPP='unknown'
         HostOS_CPP='linux'
         ;;
+x86_64-*-linux*)
+        HostPlatform=x86_64-unknown-linux
+        TargetPlatform=x86_64-unknown-linux
+        BuildPlatform=x86_64-unknown-linux
+        HostPlatform_CPP='x86_64_unknown_linux'
+        HostArch_CPP='x86_64'
+        HostVendor_CPP='unknown'
+        HostOS_CPP='linux'
+       ;;
 m68k-next-nextstep2)
         HostPlatform_CPP='m68k_next_nextstep2'
         HostArch_CPP='m68k'
@@ -645,12 +654,10 @@ AC_PROG_CPP
 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
+dnl ** Try to add -mno-cygwin to the C compiler options
+FP_CHECK_FLAG([-mno-cygwin], [
+SRC_CC_OPTS="-mno-cygwin $SRC_CC_OPTS"
+CPPFLAGS="-mno-cygwin $CPPFLAGS"])
 AC_SUBST(SRC_CC_OPTS)
 
 dnl ** figure out how to do context diffs
@@ -683,9 +690,6 @@ dnl ** check for tar
 dnl   if GNU tar is named gtar, look for it first.
 AC_PATH_PROGS(TarCmd,gtar tar,tar)
 
-dnl ** check for gzip/compress
-AC_PATH_PROGS(CompressCmd,gzip compress,gzip)
-
 dnl ** check for jade/openjade & determine a working catalog
 AC_PATH_PROGS(JadeCmd,openjade jade,jade)
 FPTOOLS_DOCBOOK_CATALOG(Catalog, $JadeCmd, docs/fptools-both.dsl, 
@@ -709,15 +713,6 @@ case $Catalog in
 esac   
 AC_SUBST(Catalog)
 
-compress_nm=`basename $CompressCmd`
-if test x"$compress_nm" = xgzip; then
-  CompressCmd="$CompressCmd -d"
-  CompressSuffix="gz"
-else
-  CompressSuffix="Z"
-fi
-AC_SUBST(CompressCmd)
-AC_SUBST(CompressSuffix)
 
 dnl ** check for ghc-pkg command
 changequote(, )dnl
@@ -732,10 +727,10 @@ fi
 
 AC_ARG_WITH(greencard,
 [  --with-greencard=<greencard compiler>
-        Use a command different from 'green-card' to compile GreenCard files
+        Use a command different from 'greencard' to compile GreenCard files
 ],
 [
-GreencardCmd=$withval;
+GreenCardCmd=$withval;
 FPTOOLS_GREENCARD(3.00)
 ]
 )
@@ -792,7 +787,7 @@ dnl    off_t, because it will affect the result of that test.
 AC_SYS_LARGEFILE
 
 dnl ** check for specific header (.h) files that we are interested in
-AC_CHECK_HEADERS(Files.h arpa/inet.h assert.h console.h ctype.h dirent.h errno.h fcntl.h float.h ftw.h grp.h ieee754.h inttypes.h limits.h malloc.h memory.h nlist.h pascal.h pwd.h sgtty.h siginfo.h signal.h stat.h stdint.h stdlib.h stddef.h stdarg.h string.h sys/fault.h sys/file.h sys/ioctl.h sys/limits.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/socket.h netdb.h netinet/in.h netinet/tcp.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/un.h sys/utsname.h sys/vadvise.h sys/wait.h termio.h termios.h time.h types.h unistd.h utime.h values.h bfd.h winsock.h pthread.h sys/uio.h)
+AC_CHECK_HEADERS(Files.h arpa/inet.h assert.h console.h ctype.h dirent.h errno.h fcntl.h float.h ftw.h grp.h ieee754.h inttypes.h limits.h locale.h malloc.h memory.h nlist.h pascal.h pwd.h sgtty.h siginfo.h signal.h stat.h stdint.h stdlib.h stddef.h stdarg.h string.h sys/fault.h sys/file.h sys/ioctl.h sys/limits.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/socket.h netdb.h netinet/in.h netinet/tcp.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/un.h sys/utsname.h sys/vadvise.h sys/wait.h termio.h termios.h time.h types.h unistd.h utime.h values.h bfd.h winsock.h pthread.h sys/uio.h)
 AC_CHECK_HEADER(unistd.h,[AC_CHECK_FUNCS(lchown)])
 
 AC_CHECK_HEADER(readline/readline.h, [HaveReadlineReadlineH=YES], [HaveReadlineReadlineH=NO])
@@ -850,8 +845,16 @@ dnl ** do we have long longs?
 AC_CHECK_TYPES([long long])
 
 dnl ** check what fields struct msghdr contains
-FPTOOLS_MSGHDR_MSG_ACCRIGHTS
-FPTOOLS_MSGHDR_MSG_CONTROL
+AC_CHECK_HEADERS([sys/types.h sys/socket.h sys/uio.h])
+AC_CHECK_MEMBERS([struct msghdr.msg_control, struct msghdr.msg_accrights], [], [], [#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_SYS_UIO_H
+# include <sys/uio.h>
+#endif])
 
 dnl ** what are the sizes of various types
 AC_CHECK_SIZEOF(char,               1)
@@ -947,10 +950,10 @@ FPTOOLS_CHECK_HTYPE(GLdouble)
 FPTOOLS_CHECK_HTYPE(GLclampd)
 fi
 
-FPTOOLS_CHECK_CCONSTS(E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV)
+FP_CHECK_CONSTS([E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV], [#include <errno.h>])
 
 dnl ** can we open files in binary mode?
-FPTOOLS_O_BINARY
+FP_CHECK_CONST([O_BINARY], [#include <fcntl.h>], [0])
 
 dnl ** check for GetModuleFileName and WinExec (windows only)
 dnl Old: AC_CHECK_FUNCS(WinExec GetModuleFileName)       dnl Windows
@@ -1077,6 +1080,9 @@ dnl    the order of these tests matters: bfd needs liberty
 AC_CHECK_LIB(iberty, xmalloc)
 AC_CHECK_LIB(bfd,    bfd_init)
 
+dnl ** check for wide-char classifications
+AC_CHECK_HEADERS(wctype.h)
+
 dnl ** check for readline, for Hugs and hslibs' Readline
 dnl ncurses supersedes termcap and curses, but for compatibility,
 dnl we have to check for all...