aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar stolz <unknown>2004-11-12 12:12:53 +0000
committerGravatar stolz <unknown>2004-11-12 12:12:53 +0000
commit2eaaf04f858a0762b9d7e027308ee38e336a52f0 (patch)
tree26fea6e1d0ae839e9fc85c09e0dc680484f03b55 /configure.ac
parent03d7d528fbc352a016395cb5adaf47f2bb625808 (diff)
[project @ 2004-11-12 12:12:53 by stolz]
Push some unixisms from toplvl into package: usleep, SunOS-handling, getpw*
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 26 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index cfd15fc..d140561 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,15 @@ AC_CONFIG_SRCDIR([include/HsUnix.h])
AC_CONFIG_HEADERS([include/HsUnixConfig.h])
+AC_CHECK_FUNCS([getgrgid_r getgrnam_r getpwnam_r getpwuid_r getpwnam getpwuid])
+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
+
AC_MSG_CHECKING([for _SC_GETGR_R_SIZE_MAX])
AC_EGREP_CPP(we_have_that_sysconf_thing,
[
@@ -29,4 +38,21 @@ we_have_that_sysconf_thing
AC_DEFINE([HAVE_SC_GETPW_R_SIZE_MAX], [1], [Define to 1 if <unistd.h> defines _SC_GETPW_R_SIZE_MAX.])],
[AC_MSG_RESULT([no])])
+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
+
AC_OUTPUT