From 8d70faa33f782504838d0da8892f978d17adcdec Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 24 Aug 2023 15:02:14 +0100 Subject: make: fix POSIX build If upstream BusyBox had a 'make' applet a native build with it enabled should match the corresponding build from the busybox-w32 source. Make it so. --- miscutils/make.c | 15 +++++++++++++++ win32/Kbuild | 3 +-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/miscutils/make.c b/miscutils/make.c index 7e156e302..a2cd03707 100644 --- a/miscutils/make.c +++ b/miscutils/make.c @@ -336,6 +336,21 @@ auto_concat(const char *s1, const char *s2) return auto_string(xasprintf("%s%s", s1, s2)); } +#if !ENABLE_PLATFORM_MINGW32 +/* + * Append a word to a space-separated string of words. The first + * call should use a NULL pointer for str, subsequent calls should + * pass an allocated string which will be freed. + */ +static char * +xappendword(const char *str, const char *word) +{ + char *newstr = str ? xasprintf("%s %s", str, word) : xstrdup(word); + free((void *)str); + return newstr; +} +#endif + static unsigned int getbucket(const char *name) { diff --git a/win32/Kbuild b/win32/Kbuild index ecd27645c..3e1f845df 100644 --- a/win32/Kbuild +++ b/win32/Kbuild @@ -8,8 +8,7 @@ lib-$(CONFIG_PLATFORM_MINGW32) += dirent.o lib-$(CONFIG_PLATFORM_MINGW32) += env.o lib-$(CONFIG_PLATFORM_MINGW32) += fnmatch.o lib-$(CONFIG_PLATFORM_MINGW32) += fsync.o -lib-$(CONFIG_MAKE) += glob.o -lib-$(CONFIG_PDPMAKE) += glob.o +lib-$(CONFIG_PLATFORM_MINGW32) += glob.o lib-$(CONFIG_PLATFORM_MINGW32) += inet_pton.o lib-$(CONFIG_PLATFORM_MINGW32) += ioctl.o lib-$(CONFIG_FEATURE_PRNG_ISAAC) += isaac.o -- cgit v1.2.3-55-g6feb