[project @ 2004-11-20 16:02:41 by panne]
[ghc-hetmet.git] / configure.ac
index c0ea36e..9a02c1f 100644 (file)
@@ -3,11 +3,11 @@ dnl (run "grep '^dnl \*' configure.ac | sed -e 's/dnl / /g; s/\*\*/   +/g;'"
 dnl  (or some such) to see the outline of this file)
 dnl
 #
-# (c) The AQUA Project, Glasgow University, 1994-1998
+# (c) The AQUA Project, Glasgow University, 1994-2004
 #
 # Configure script template for the Glasgow functional programming tools
 #
-# Process with 'autoconf' to get a working configure script.
+# Process with 'autoreconf' to get a working configure script.
 #
 # For the generated configure script, do "./configure --help" to
 # see what flags are available. (Better yet, read the documentation!)
@@ -406,6 +406,16 @@ powerpc-unknown-openbsd*)
         HostVendor_CPP='unknown'
         HostOS_CPP='openbsd'
         ;;
+powerpc64-unknown-linux*)
+       HostPlatform=powerpc64-unknown-linux
+       TargetPlatform=powerpc64-unknown-linux
+       BuildPlatform=powerpc64-unknown-linux
+       HostPlatform_CPP='powerpc64_unknown_linux'
+       HostArch_CPP='powerpc64'
+        HostVendor_CPP='unknown'
+       HostOS_CPP='linux'
+       ;;
+                                                               
 s390-ibm-linux*)
        HostPlatform=s390-ibm-linux
        TargetPlatform=s390-ibm-linux #hack
@@ -568,17 +578,15 @@ dnl use either is considered a Feature.
 dnl ** What command to use to compile compiler sources ?
 dnl --------------------------------------------------------------
 
-AC_ARG_WITH(ghc,
+AC_ARG_WITH([ghc],
 [AC_HELP_STRING([--with-ghc=ARG],
-       [Use ARG as the path to GHC  [default=autodetect]])],
-[ WithGhc="$withval" ],
-[ 
-  if test "$GHC" = ""; then
-    AC_PATH_PROG(GHC,ghc)
+  [Use ARG as the path to GHC  [default=autodetect]])],
+  [WithGhc="$withval"],
+  [if test "$GHC" = ""; then
+    AC_PATH_PROG([GHC], [ghc])
   fi
-  WithGhc=$GHC
-])
-AC_SUBST(WithGhc)
+  WithGhc="$GHC"])
+AC_SUBST([WithGhc])
 
 AC_ARG_WITH(hc,
 [AC_HELP_STRING([--with-hc=ARG],
@@ -809,9 +817,7 @@ dnl ** look for GCC and find out which version
 dnl     Figure out which C compiler to use.  Gcc is preferred.
 dnl     If gcc, make sure it's at least 2.1
 dnl
-AC_PROG_CC
-FPTOOLS_HAVE_GCC
-FPTOOLS_GCC_NEEDS_NO_OMIT_LFPTR
+FP_HAVE_GCC
 
 dnl ** figure out how to invoke cpp directly (gcc -E is no good)
 AC_PROG_CPP
@@ -864,9 +870,6 @@ FP_PROG_FO_PROCESSOR
 dnl ** check for ghc-pkg command
 FP_PROG_GHC_PKG
 
-dnl Check whether this GHC has readline installed
-FPTOOLS_GHC_HAS_READLINE
-
 AC_ARG_WITH(greencard,
 [AC_HELP_STRING([--with-greencard=ARG],
         [Use ARG as the path to greencard  [default=autodetct]])],
@@ -945,8 +948,6 @@ AC_SYS_LARGEFILE
 dnl ** check for specific header (.h) files that we are interested in
 AC_CHECK_HEADERS([bfd.h ctype.h dirent.h dlfcn.h errno.h fcntl.h grp.h limits.h locale.h nlist.h pthread.h pwd.h signal.h sys/mman.h sys/resource.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/utsname.h sys/wait.h termios.h time.h utime.h windows.h winsock.h])
 
-AC_CHECK_HEADER([unistd.h], [AC_CHECK_FUNCS(lchown)])
-
 AC_CHECK_HEADER([readline/readline.h], [HaveReadlineReadlineH=YES], [HaveReadlineReadlineH=NO])
 AC_CHECK_HEADER([readline/history.h], [HaveReadlineHistoryH=YES], [HaveReadlineHistoryH=NO])
 
@@ -1090,15 +1091,10 @@ if test "$ac_cv_type_signal" = void; then
 fi
 
 dnl ** check for more functions
-AC_CHECK_FUNCS([ftime getclock getgrgid_r getgrnam_r getpagesize getpwnam_r getpwuid_r getpwnam getpwuid getrusage gettimeofday gmtime_r localtime_r lstat readdir_r readlink setenv setitimer siginterrupt symlink sysconf times unsetenv])
-
-dnl ** Solaris2 needs additionl flag for getpw*_r()
-case "$TargetPlatform" in
-  *-solaris2*)
-    unix_SRC_HSC2HS_OPTS="-D_POSIX_PTHREAD_SEMANTICS"
-    AC_SUBST(unix_SRC_HSC2HS_OPTS)
-  ;;
-esac
+dnl ** The following have been verified to be used in ghc/, but might be used somewhere else, too.
+AC_CHECK_FUNCS([getclock getrusage gettimeofday setitimer siginterrupt sysconf times])
+dnl ** For ghc/rts/gmp:
+AC_CHECK_FUNCS([getpagesize])
 
 dnl ** check whether this machine has gmp3 installed
 AC_CHECK_LIB(gmp,  __gmpz_fdiv_qr, HaveLibGmp=YES; LibGmp=gmp,
@@ -1141,11 +1137,6 @@ 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
-dnl FreeBSD has an emtpy wctype.h, so test one of the affected
-dnl functions if it's really there.
-AC_CHECK_HEADERS([wctype.h], [AC_CHECK_FUNCS(iswspace)])
-
 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...
@@ -1298,23 +1289,6 @@ else
     AC_SUBST(HaveRtldNow)
 fi
 
-dnl ---------- usleep ----------
-dnl --- stolen from guile configure ---
-dnl --- FIXME: /usr/include/unistd.h can't be right?
-
-### On some systems usleep has no return value.  If it does have one,
-### we'd like to return it; otherwise, we'll fake it.
-AC_CACHE_CHECK([return type of usleep], cv_func_usleep_return_type,
-  [AC_EGREP_HEADER(changequote(<, >)<void[      ]+usleep>changequote([, ]),
-                   /usr/include/unistd.h,
-                   [cv_func_usleep_return_type=void],
-                   [cv_func_usleep_return_type=int])])
-case "$cv_func_usleep_return_type" in
-  "void" )
-    AC_DEFINE([USLEEP_RETURNS_VOID], [1], [Define if the system headers declare usleep to return void.])
-  ;;
-esac
-
 dnl --------------------------------------------------
 dnl * test for GTK+
 dnl --------------------------------------------------
@@ -1365,8 +1339,6 @@ esac
 AC_SUBST(LdCmd)
 FPTOOLS_LD_X
 
-FP_EMPTY_STRUCTS
-
 AC_CONFIG_FILES([mk/config.mk])
 AC_CONFIG_COMMANDS([mk/stamp-h],[echo timestamp > mk/stamp-h])
 AC_OUTPUT