]> granicus.if.org Git - check/commitdiff
allow disabling fork, to test for systems without fork
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Fri, 27 Sep 2013 01:38:31 +0000 (01:38 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Fri, 27 Sep 2013 01:38:31 +0000 (01:38 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@798 64e312b2-a51f-0410-8e61-82d0ca0eb02a

configure.ac

index 08a19ac54ce4de10c766b8f6822ff13c7381f2ef..df798b372aee3010cbc3561fa2ac323607ee5d4e 100644 (file)
@@ -95,6 +95,15 @@ esac],
 [echo "Subunit support will enable automatically."
  enable_subunit=autodetect])
 
+AC_ARG_ENABLE(fork,
+AC_HELP_STRING([--enable-fork],
+              [enable support for fork @<:@default=autodetect@:>@]),
+[case "${enableval}" in
+  yes) enable_fork=true ;;
+  no)  enable_fork=false ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for --enable-fork) ;;
+esac], [enable_fork=true ])
+
 # Checks for programs.
 AC_PROG_AWK
 AC_PROG_CC
@@ -196,7 +205,11 @@ AC_CHECK_DECLS([alarm, clock_gettime, timer_create, timer_settime, timer_delete,
 AC_CHECK_FUNCS([setitimer])
 
 # Checks for functions not available in Windows
-AC_CHECK_FUNCS([fork], HAVE_FORK=1, HAVE_FORK=0)
+if $enable_fork; then
+       AC_CHECK_FUNCS([fork], HAVE_FORK=1, HAVE_FORK=0)
+else
+       HAVE_FORK=0
+fi
 AC_SUBST(HAVE_FORK)
 AC_CHECK_FUNCS([sigaction])