summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac3
-rw-r--r--libguile/posix.c7
-rw-r--r--module/Makefile.am8
3 files changed, 15 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 52fff6918..36103df2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -748,11 +748,14 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
# isblank - available as a GNU extension or in C99
# _NSGetEnviron - Darwin specific
# strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
+# fork - unavailable on Windows
# utimensat: posix.1-2008
# sched_getaffinity, sched_setaffinity: GNU extensions (glibc)
#
AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime ftruncate fchown fchmod getcwd geteuid getsid gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe poll readdir_r readdir64_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron strcoll strcoll_l newlocale utimensat sched_getaffinity sched_setaffinity])
+AM_CONDITIONAL([HAVE_FORK], [test "x$ac_cv_func_fork" = "xyes"])
+
# Reasons for testing:
# netdb.h - not in mingw
# sys/param.h - not in mingw
diff --git a/libguile/posix.c b/libguile/posix.c
index 4f8b8ac7a..ce64256db 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
- *
+/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ * 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3 of
@@ -2375,10 +2376,12 @@ scm_init_posix ()
#include "libguile/cpp-SIG.c"
#include "libguile/posix.x"
+#ifdef HAVE_FORK
scm_c_register_extension ("libguile-" SCM_EFFECTIVE_VERSION,
"scm_init_popen",
(scm_t_extension_init_func) scm_init_popen,
NULL);
+#endif /* HAVE_FORK */
}
/*
diff --git a/module/Makefile.am b/module/Makefile.am
index 44af07f2e..3d3eae364 100644
--- a/module/Makefile.am
+++ b/module/Makefile.am
@@ -220,7 +220,6 @@ ICE_9_SOURCES = \
ice-9/optargs.scm \
ice-9/poe.scm \
ice-9/poll.scm \
- ice-9/popen.scm \
ice-9/posix.scm \
ice-9/q.scm \
ice-9/rdelim.scm \
@@ -252,6 +251,13 @@ ICE_9_SOURCES = \
ice-9/serialize.scm \
ice-9/local-eval.scm
+if HAVE_FORK
+
+# This functionality is missing on systems without `fork'---i.e., Windows.
+ICE_9_SOURCES += ice-9/popen.scm
+
+endif HAVE_FORK
+
SRFI_SOURCES = \
srfi/srfi-2.scm \
srfi/srfi-4.scm \