Index: trunk/config.auto.h.in =================================================================== --- trunk/config.auto.h.in (revision 2545) +++ trunk/config.auto.h.in (revision 2546) @@ -26,9 +26,6 @@ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 -/* Define to 1 if you have the `_spawnvp' function. */ -/* #undef HAVE__SPAWNVP */ - /* Define if mkdir takes only one argument. */ /* #undef MKDIR_TAKES_ONE_ARG */ @@ -113,6 +110,10 @@ print {\n\n/* Define to 1 if we should use windows api for dynamic linking. */\n} print_ternary ?libs/LoadLibrary/presents {#define USE_LOADLIBRARY 1} {/* #undef USE_LOADLIBRARY */} +print {\n\n/* Select which mechanism to use for running child processes. */\n} +print_ternary ?/target/libs/proc/wait/presents {#define USE_FORK_WAIT 1} {/* #undef USE_FORK_WAIT */} +print {\n} +print_ternary ?/target/libs/proc/_spawnvp/presents {#define USE_SPAWNVP 1} {/* #undef USE_SPAWNVP */} print [@ Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (revision 2545) +++ trunk/scconfig/hooks.c (revision 2546) @@ -173,6 +173,13 @@ } } + if (require("libs/proc/wait", 0, 0) != 0) { + if (require("libs/proc/_spawnvp", 0, 0) != 0) { + report_repeat("\nERROR: no fork or _spawnvp. Can not compile pcb-rnd.\n\n"); + return 1; + } + } + if (require("libs/fs/getcwd/*", 0, 0) != 0) if (require("libs/fs/_getcwd/*", 0, 0) != 0) if (require("libs/fs/getwd/*", 0, 0) != 0) { Index: trunk/src/compat_fs.c =================================================================== --- trunk/src/compat_fs.c (revision 2545) +++ trunk/src/compat_fs.c (revision 2546) @@ -45,13 +45,6 @@ #include "compat_fs.h" #include "compat_misc.h" -#ifndef HAVE__SPAWNVP -/* The UNIX way of doing this: fork() and wait(). */ -# include -# include -#endif - - #include #include "global.h" @@ -83,13 +76,13 @@ int pcb_spawnvp(char **argv) { -#ifdef HAVE__SPAWNVP +#if defined(USE_SPAWNVP) int result = _spawnvp(_P_WAIT, argv[0], (const char *const *) argv); if (result == -1) return 1; else return 0; -#else +#elif defined(USE_FORK_WAIT) int pid; pid = fork(); if (pid < 0) { @@ -108,6 +101,8 @@ wait(&rv); } return 0; +#else +# error Do not know how to run a background process. #endif } Index: trunk/src/compat_inc.h.in =================================================================== --- trunk/src/compat_inc.h.in (revision 2545) +++ trunk/src/compat_inc.h.in (revision 2546) @@ -5,7 +5,9 @@ @?libs/fs/getcwd/includes@ @?libs/fs/_getcwd/includes@ @?libs/fs/getwd/includes@ - +@?/target/libs/proc/wait/includes@ +@?/target/libs/proc/fork/includes@ +@?/target/libs/proc/_spawnvp/includes@ @] put /tmpasm/IFS {\n}