From 1ef801e92a5b074a55232c18329986bdb0c4c11b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 18 May 2012 12:43:09 -0700 Subject: * configure: New test added for fork, pipe, exec and waitpid. Produces HAVE_FORK_STUFF in config.h. --- ChangeLog | 5 +++++ configure | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/ChangeLog b/ChangeLog index 795d80b2..1137c29b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-18 Kaz Kylheku + + * configure: New test added for fork, pipe, exec and waitpid. + Produces HAVE_FORK_STUFF in config.h. + 2012-05-18 Kaz Kylheku * utf8.c (w_fopen, w_popen): Removing unnecessary casts of diff --git a/configure b/configure index a612dbf1..1c556808 100755 --- a/configure +++ b/configure @@ -1188,6 +1188,37 @@ else printf "#define HAVE_GETENVIRONMENTSTRINGS 1\n" >> config.h fi +# +# fork, pipe, exec, waitpid. +# + +printf "Checking for POSIX fork/pipe/exec/waitpid ... " + +cat > conftest.c < +#endif +#include + +int main(int argc, char **argv) +{ + int status, fd[2]; + pid_t p = fork(); + (void) execvp(argv[0], argv); + (void) waitpid(p, &status, 0); + (void) pipe(fd); + 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_FORK_STUFF 1\n" >> config.h +fi + # # Check for fields inside struct tm # -- cgit v1.2.3