diff options
author | Paul Smith <psmith@gnu.org> | 2023-02-18 13:20:00 -0500 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2023-02-19 01:02:16 -0500 |
commit | c85f68c4e952294304e5938acb601e66f5df71a0 (patch) | |
tree | 524f53df01cfd92b2be42457aa7219b18be63872 /src | |
parent | ffa28f3914ff402b3915f75e4fed86ac6fb1449d (diff) | |
download | make-git-c85f68c4e952294304e5938acb601e66f5df71a0.tar.gz |
Allow jobserver style to be forced to "pipe"
Some systems that support mkfifo() don't support the usage that GNU
make wants. Provide a way to force using "pipe" jobserver mode even
when mkfifo() is available.
* src/makeint.h (MK_OS_HURD): Define if we're on Hurd.
(JOBSERVER_USE_FIFO): Define if we have mkfifo() and we're NOT on
Hurd.
* src/main.c (main): Test JOBSERVER_USE_FIFO not HAVE_MKFIFO.
* src/posixos.c (jobserver_setup): Ditto.
* maintMakefile: Create a config check test for forcing "pipe" mode.
* tests/run_make_tests.pl: Show discovered FEATURES in verbose mode.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 3 | ||||
-rw-r--r-- | src/makeint.h | 11 | ||||
-rw-r--r-- | src/posixos.c | 4 |
3 files changed, 15 insertions, 3 deletions
@@ -234,6 +234,7 @@ static const int inf_jobs = 0; char *jobserver_auth = NULL; /* Style for the jobserver. */ + static char *jobserver_style = NULL; /* Shuffle mode for goals and prerequisites. */ @@ -1447,7 +1448,7 @@ main (int argc, char **argv, char **envp) #endif #ifdef MAKE_JOBSERVER " jobserver" -# ifdef HAVE_MKFIFO +# if JOBSERVER_USE_FIFO " jobserver-fifo" # endif #endif diff --git a/src/makeint.h b/src/makeint.h index 187974e4..1e1596d2 100644 --- a/src/makeint.h +++ b/src/makeint.h @@ -83,6 +83,9 @@ extern int errno; #endif /* Define macros specifying which OS we are building for. */ +#if __gnu_hurd__ +# define MK_OS_HURD 1 +#endif #if defined(__MVS__) # define MK_OS_ZOS 1 #endif @@ -742,6 +745,14 @@ extern char cmd_prefix; extern unsigned int no_intermediates; +#if HAVE_MKFIFO +# if !defined(JOBSERVER_USE_FIFO) && !MK_OS_HURD +/* It seems that mkfifo() is not working correctly, or at least not the way + GNU make wants it to work, on GNU/Hurd so don't use it there. */ +# define JOBSERVER_USE_FIFO 1 +# endif +#endif + #define JOBSERVER_AUTH_OPT "jobserver-auth" extern char *jobserver_auth; diff --git a/src/posixos.c b/src/posixos.c index 0fe0948a..0cc0a585 100644 --- a/src/posixos.c +++ b/src/posixos.c @@ -147,8 +147,8 @@ jobserver_setup (int slots, const char *style) { int r; -#if HAVE_MKFIFO - if (style == NULL || strcmp (style, "fifo") == 0) +#if JOBSERVER_USE_FIFO + if (!style || strcmp (style, "fifo") == 0) { /* Unfortunately glibc warns about uses of mktemp even though we aren't using it in dangerous way here. So avoid this by generating our own |