From 547be3056d652726699a2a4fcd656495c3a53c07 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 14 Feb 2005 08:28:26 +0000 Subject: *** empty log message *** --- configure.in | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 0e2e84aa..9071c99a 100644 --- a/configure.in +++ b/configure.in @@ -14,6 +14,45 @@ AC_PROG_RANLIB #AC_PROG_LIBTOOL #AM_PROG_LIBTOOL +# check if UNIX pipes are available +AC_CACHE_CHECK( + [if pipes can be used], + [pipes_avail], + [AC_LANG_PUSH(C++) + AC_TRY_LINK( + [#include + #include + #include + #include + #include + #include ], + [int status, pfd[2]; + status = pipe(pfd); + status = fork(); + if (status < 0) { + ; + } else if (status == 0) { + char *arg0; + + status = dup2(pfd[0], STDIN_FILENO); + + close(pfd[1]); + close(pfd[0]); + + execlp("", arg0, (char *)0); + perror("execl"); + exit(1); + } else { + close(pfd[0]); + }], + [pipes_avail=true], + [pipes_avail=false]) + AC_LANG_POP]) + +if [test x$pipes_avail = xtrue ]; then + AC_DEFINE([HAVE_UNIX_PIPES], [1], [Whether UNIX pipes are available]) +fi + # check for gmp AC_CACHE_CHECK( [if libgmp is available], -- cgit v1.2.3