summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-11-28 20:15:08 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-11-28 20:15:08 -0800
commit0be7721c52cf2978114de43e391c04437d8d875e (patch)
tree89167b68f4c7fe05882b17cfe8b538c8608f51f3 /configure
parent18832d8a641ff25fefccddd34c0325bc8089a69c (diff)
downloadtxr-0be7721c52cf2978114de43e391c04437d8d875e.tar.gz
txr-0be7721c52cf2978114de43e391c04437d8d875e.tar.bz2
txr-0be7721c52cf2978114de43e391c04437d8d875e.zip
* configure: Detect the daemon function.
* eval.c: Include <unistd.h> conditionally. (errno_wrap, daemon_wrap): New functions. (eval_init): Registered errno_wrap and daemon_wrap as intrinsics under the names daemon and errno. * txr.1: Documented errno and daemon in new UNIX PROGRAMMING section.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure b/configure
index fe27ace2..e318ef17 100755
--- a/configure
+++ b/configure
@@ -1281,6 +1281,8 @@ int x = sizeof ((struct tm *) 0)->$try_field;
fi
done
+printf "done\n"
+
printf "Checking for POSIX sleep function ... "
cat > conftest.c <<!
@@ -1301,6 +1303,26 @@ else
have_unistd=y
fi
+printf "Checking for BSD daemon function ... "
+
+cat > conftest.c <<!
+#include <unistd.h>
+
+int main(int argc, char **argv)
+{
+ daemon(0, 0);
+ return 0;
+}
+!
+rm -f conftest
+if ! $make conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then
+ printf "no\n"
+else
+ printf "yes\n"
+ printf "#define HAVE_DAEMON 1\n" >> config.h
+ have_unistd=y
+fi
+
#
# Dependent variables
#