New Upstream Release - libmawk

Ready changes

Summary

Merged new upstream version: 1.0.3 (was: 1.0.2).

Resulting package

Built on 2022-03-16T09:57 (took 2m7s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-releases libmawk-devapt install -t fresh-releases libmawk1-dbgsymapt install -t fresh-releases libmawk1

Lintian Result

Diff

diff --git a/Changelog b/Changelog
index 385859f..e549a0a 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,13 @@
 Changelog for libmawk
 ~~~~~~~~~~~~~~~~~~~~~
 
+libmawk 1.0.3 (released: 2021-07-21, r1328)
+	[build] -Fix: move fstool detection from target to host - needed only for installation
+	[build] -Fix: suppress warning on non-existing optional /local/nofork
+	[build] -Fix: make install over a new version over an old version shouldn't fail on lib symlink creation
+	[build] -Add: no-fork configure-time option
+	[vio] -Fix: missing extern caused multiple definitions of the same variable for vio_fifo
+
 libmawk 1.0.2 (released: 2019-06-22, r1318)
 	[core] -Fix: C function calls with uninitialized variables: not sure if array or not, delay resolving it until all the script is parsed so we see if the symbol is an array
 	[build] -Fix: missing make uninstall
diff --git a/Release_notes b/Release_notes
index f602e88..311bb97 100644
--- a/Release_notes
+++ b/Release_notes
@@ -1,6 +1,6 @@
-Release notes for libmawk 1.0.2
+Release notes for libmawk 1.0.3
 
-Minor bugfix release; fixes C function call with uninitialized
-variables and make uninstall.
+Minor bugfix release (missing extern and build system fixes). Adds
+compile time option for no-fork.
 
 
diff --git a/debian/changelog b/debian/changelog
index 9d32993..24c3499 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libmawk (1.0.3-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+  * Drop patch extern-for-gcc-10.patch, present upstream.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Wed, 16 Mar 2022 09:55:31 -0000
+
 libmawk (1.0.2-3) unstable; urgency=medium
 
   * trivial patch to allow for compilation with GCC 10, closes: #957451
diff --git a/debian/patches/extern-for-gcc-10.patch b/debian/patches/extern-for-gcc-10.patch
deleted file mode 100644
index 64ae872..0000000
--- a/debian/patches/extern-for-gcc-10.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/libmawk/vio_fifo.h b/src/libmawk/vio_fifo.h
-index f170c22..a2d751d 100644
---- a/src/libmawk/vio_fifo.h
-+++ b/src/libmawk/vio_fifo.h
-@@ -14,7 +14,7 @@ typedef struct mawk_vio_fifo_s {
- 	int eof_from_app;       /* 1 if there won't be more from the app or the app won't accept more data */
- } mawk_vio_fifo_t;
- 
--const mawk_vio_imp_t mawk_vio_fifo_imp;
-+extern const mawk_vio_imp_t mawk_vio_fifo_imp;
- 
- mawk_vio_t *mawk_vio_fifo_open(mawk_state_t *MAWK, const char *name, mawk_vio_open_mode_t mode);
- 
diff --git a/debian/patches/fix-example-man.patch b/debian/patches/fix-example-man.patch
index 6a420a8..ac6e09a 100644
--- a/debian/patches/fix-example-man.patch
+++ b/debian/patches/fix-example-man.patch
@@ -1,7 +1,7 @@
-diff --git a/src/libmawk/man/example.7libmawk b/src/libmawk/man/example.7libmawk
-index 2313f7f..0c65c5c 100644
---- a/src/libmawk/man/example.7libmawk
-+++ b/src/libmawk/man/example.7libmawk
+Index: libmawk/src/libmawk/man/example.7libmawk
+===================================================================
+--- libmawk.orig/src/libmawk/man/example.7libmawk
++++ libmawk/src/libmawk/man/example.7libmawk
 @@ -12,9 +12,9 @@
  .\" Formatted or processed versions of this manual, if unaccompanied by
  .\" the source, must acknowledge the copyright and authors of this work.
diff --git a/debian/patches/series b/debian/patches/series
index 523757a..727044f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
 fix-example-man.patch
-extern-for-gcc-10.patch
diff --git a/doc/TODO b/doc/TODO
index e1a3f18..02da809 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,3 +1,15 @@
+0000. packaging and fawk
+	- packaging:
+		- rename example manpage to have libmawk prefix
+		- make sure example manpage .TH has no space and matches the name
+	- fawk
+		- implement the . array syntax
+		- array in array (for orig implementation only?)
+		- isarray()
+		- textblock
+		- vararg?
+
+
 packging:
 	- manual page headers use the wrong section
 
@@ -46,7 +58,7 @@ Features:
 
 3.0 extend arrays
 	- array copy
-	- array in array (for orig implementation only?)
+
 	- length(array) as in gawk? POSIX: length() works on strings only
 	  update test_3rd funlen accordingly!
 
diff --git a/scconfig/hooks.c b/scconfig/hooks.c
index cfab11f..601b120 100644
--- a/scconfig/hooks.c
+++ b/scconfig/hooks.c
@@ -101,6 +101,12 @@ int hook_postarg()
 /* Runs when things should be detected for the host system */
 int hook_detect_host()
 {
+	require("fstools/chmodx", 0, 1);
+	require("fstools/cp", 0, 1);
+	require("fstools/rm", 0, 1);
+	require("fstools/ln", 0, 1);
+	require("fstools/mkdir", 0, 1);
+
 	return 0;
 }
 
@@ -145,11 +151,6 @@ int hook_detect_target()
 		require("cc/soname", 0, 0);
 		require("cc/rdynamic", 0, 0);
 		require("cc/pragma_message",  0, 0);
-		require("fstools/chmodx", 0, 1);
-		require("fstools/cp", 0, 1);
-		require("fstools/rm", 0, 1);
-		require("fstools/ln", 0, 1);
-		require("fstools/mkdir", 0, 1);
 		require("sys/types/size_t/includes", 0, 0);
 		require("libs/fs/realpath/presents", 0, 0);
 		require("libs/env/putenv", 0, 1);
diff --git a/scconfig/src/default/arg.c b/scconfig/src/default/arg.c
index b8f1558..9634fe9 100644
--- a/scconfig/src/default/arg.c
+++ b/scconfig/src/default/arg.c
@@ -75,7 +75,7 @@ void process_args(int argc, char *argv[])
 			value++;
 
 			if (strcmp(key, "without") == 0) {
-				char *tmp, *end;
+				char *tmp;
 				if (*value != '/') {
 					const char **r, *roots[] = {"target", "host", "runtime", NULL};
 					for(r = roots; *r != NULL; r++) {
diff --git a/scconfig/src/default/dep.c b/scconfig/src/default/dep.c
index 1cc8aa9..8b17ecd 100644
--- a/scconfig/src/default/dep.c
+++ b/scconfig/src/default/dep.c
@@ -83,7 +83,7 @@ fn_wrap_t *get_wrap(const char *name_, int *wild, int *missing)
 			break;
 		if (istrue(d)) {
 			free(tmp);
-			return USER_WITHOUT;
+			return (fn_wrap_t *)USER_WITHOUT;
 		}
 		while(*sep != '/')
 			sep--;
@@ -136,7 +136,7 @@ int require(const char *name, int logdepth, int fatal)
 
 	if (get(name) == NULL) {
 		w = get_wrap(name, &wild, &missing);
-		if (w == USER_WITHOUT) {
+		if (w == (fn_wrap_t *)USER_WITHOUT) {
 			if (fatal) {
 				error("Node %s is required by the software but disabled by the user using --without\n", name);
 				abort();
diff --git a/scconfig/src/default/deps_default.c b/scconfig/src/default/deps_default.c
index a086062..ad9a2ac 100644
--- a/scconfig/src/default/deps_default.c
+++ b/scconfig/src/default/deps_default.c
@@ -36,6 +36,7 @@ void deps_default_init(void)
 	dep_add("cc/destructor",            find_destructor);
 	dep_add("cc/rdynamic",              find_rdynamic);
 	dep_add("cc/soname",                find_soname);
+	dep_add("cc/so_undefined",          find_so_undefined);
 	dep_add("cc/wlrpath",               find_wlrpath);
 	dep_add("cc/wloutimplib",           find_cc_wloutimplib);
 	dep_add("cc/wloutputdef",           find_cc_wloutputdef);
@@ -95,6 +96,9 @@ void deps_default_init(void)
 	dep_add("libs/fs/getwd/*",          find_fs_getwd);
 	dep_add("libs/fs/mkdir/*",          find_fs_mkdir);
 	dep_add("libs/fs/_mkdir/*",         find_fs__mkdir);
+	dep_add("libs/fs/utime/*",          find_fs_utime);
+	dep_add("libs/fs/_utime/*",         find_fs__utime);
+	dep_add("libs/fs/_utime64/*",       find_fs__utime64);
 	dep_add("libs/fs/mkdtemp/*",        find_fs_mkdtemp);
 	dep_add("libs/fs/mmap/*",           find_fs_mmap);
 	dep_add("libs/fsmount/next_dev/*",  find_fsmount_next_dev);
@@ -105,8 +109,11 @@ void deps_default_init(void)
 	dep_add("libs/fs/statfs/*",         find_fs_statfs);
 	dep_add("libs/fs/statvfs/*",        find_fs_statvfs);
 	dep_add("libs/fs/flock/*",          find_fs_flock);
+	dep_add("libs/fs/makedev/*",        find_fs_makedev);
 
 	dep_add("libs/io/pipe/*",           find_io_pipe);
+	dep_add("libs/io/pipe2/*",          find_io_pipe2);
+	dep_add("libs/io/_pipe/*",          find_io__pipe);
 	dep_add("libs/io/dup2/*",           find_io_dup2);
 	dep_add("libs/io/fileno/*",         find_io_fileno);
 	dep_add("libs/io/lseek/*",          find_io_lseek);
diff --git a/scconfig/src/default/find.h b/scconfig/src/default/find.h
index ae0bb93..05013d5 100644
--- a/scconfig/src/default/find.h
+++ b/scconfig/src/default/find.h
@@ -15,6 +15,7 @@ int find_declspec_dllimport(const char *name, int logdepth, int fatal);
 int find_declspec_dllexport(const char *name, int logdepth, int fatal);
 int find_rdynamic(const char *name, int logdepth, int fatal);
 int find_soname(const char *name, int logdepth, int fatal);
+int find_so_undefined(const char *name, int logdepth, int fatal);
 int find_wlrpath(const char *name, int logdepth, int fatal);
 int find_cc_wloutimplib(const char *name, int logdepth, int fatal);
 int find_cc_wloutputdef(const char *name, int logdepth, int fatal);
@@ -55,6 +56,9 @@ int find_fs__getcwd(const char *name, int logdepth, int fatal);
 int find_fs_getwd(const char *name, int logdepth, int fatal);
 int find_fs_mkdir(const char *name, int logdepth, int fatal);
 int find_fs__mkdir(const char *name, int logdepth, int fatal);
+int find_fs_utime(const char *name, int logdepth, int fatal);
+int find_fs__utime(const char *name, int logdepth, int fatal);
+int find_fs__utime64(const char *name, int logdepth, int fatal);
 int find_fs_mkdtemp(const char *name, int logdepth, int fatal);
 int find_fs_mmap(const char *name, int logdepth, int fatal);
 int find_fsmount_next_dev(const char *name, int logdepth, int fatal);
@@ -65,6 +69,7 @@ int find_fs_ustat(const char *name, int logdepth, int fatal);
 int find_fs_statfs(const char *name, int logdepth, int fatal);
 int find_fs_statvfs(const char *name, int logdepth, int fatal);
 int find_fs_flock(const char *name, int logdepth, int fatal);
+int find_fs_makedev(const char *name, int logdepth, int fatal);
 
 /* printf */
 int find_printf_x(const char *name, int logdepth, int fatal);
@@ -125,6 +130,8 @@ int find_shell(const char *name, int logdepth, int fatal);
 
 /* find_io.c */
 int find_io_pipe(const char *name, int logdepth, int fatal);
+int find_io_pipe2(const char *name, int logdepth, int fatal);
+int find_io__pipe(const char *name, int logdepth, int fatal);
 int find_io_dup2(const char *name, int logdepth, int fatal);
 int find_io_fileno(const char *name, int logdepth, int fatal);
 int find_io_lseek(const char *name, int logdepth, int fatal);
diff --git a/scconfig/src/default/find_cc.c b/scconfig/src/default/find_cc.c
index cbb8cc0..83adf40 100644
--- a/scconfig/src/default/find_cc.c
+++ b/scconfig/src/default/find_cc.c
@@ -645,6 +645,61 @@ int find_soname(const char *name, int logdepth, int fatal)
 	return 1;
 }
 
+int find_so_undefined(const char *name, int logdepth, int fatal)
+{
+	static const char *test_c =
+		NL "#include <stdio.h>"
+		NL "void intentionally_undefined_symbol(void);"
+		NL "int main() {"
+		NL "	intentionally_undefined_symbol();"
+		NL "	puts(\"OK\");"
+		NL "	return 0;"
+		NL "}"
+		NL ;
+	const char **t, *try_ldflags[] = {
+		"",
+		"-undefined dynamic_lookup", /* OSX + clang */
+		NULL
+	};
+
+	require("cc/cc", logdepth, fatal);
+	require("cc/ldflags_dynlib", logdepth, fatal);
+
+	report("Checking for so_undefined... ");
+	logprintf(logdepth, "find_so_undefined: trying to find so_undefined...\n");
+	logdepth++;
+
+	for(t = try_ldflags; *t != NULL; t++) {
+		const char *fpic;
+		char *ldf, *oname = ".o", *libname_dyn, *cflags_c;
+		int res1, res2;
+
+		fpic = get("cc/fpic");
+		if (fpic == NULL) fpic = "";
+
+		cflags_c = str_concat(" ", "-c", fpic, NULL);
+
+		libname_dyn = (char *)get("sys/ext_dynlib");
+		ldf = str_concat(" ", get("cc/ldflags_dynlib"), *t, NULL);
+		res1 = compile_code(logdepth, test_c, &oname, NULL, cflags_c, NULL);
+		res2 = compile_file(logdepth, oname, &libname_dyn, NULL, NULL, ldf);
+		unlink(libname_dyn);
+		unlink(oname);
+		free(libname_dyn);
+		free(oname);
+		free(cflags_c);
+
+		if ((res1 == 0) && (res2 == 0)) {
+			put(name, *t);
+			report("OK (%s)\n", *t);
+			return 0;
+		}
+	}
+
+	report("Not found.\n");
+	return 1;
+}
+
 
 int find_wlrpath(const char *name, int logdepth, int fatal)
 {
@@ -692,6 +747,9 @@ static const char *test_host =
 		NL "#include <stdlib.h>"
 		NL "#include <stdio.h>"
 		NL "#include %s"
+		NL "#ifndef RTLD_NOW"
+		NL "#define RTLD_NOW RTLD_LAZY" /* on old BSD and probably on SunOS */
+		NL "#endif"
 		NL "int main() {"
 		NL "	void *handle = NULL;"
 		NL "	void (*func)() = NULL;"
@@ -699,12 +757,12 @@ static const char *test_host =
 		NL
 		NL "	handle = dlopen(\"%s\", RTLD_NOW);"
 		NL "	if (handle == NULL) {"
-		NL "		printf(\"dlopen fails: \", dlerror());"
+		NL "		printf(\"dlopen fails: %%s\", dlerror());"
 		NL "		return 1;"
 		NL "	}"
 		NL "	func = dlsym(handle, \"hello\");"
 		NL "	if (func == NULL) {"
-		NL "		printf(\"dlsym fails: \", dlerror());"
+		NL "		printf(\"dlsym fails: %%s\", dlerror());"
 		NL "		return 1;"
 		NL "	}"
 		NL "	func();"
@@ -743,7 +801,7 @@ static int try_dynlib(int logdepth, const char *cflags, char *concated_ldflags,
 	libname_dyn = libname = (char *)get("sys/ext_dynlib");
 	if ((compile_code(logdepth, test_lib, &oname, NULL, cflags_c, NULL) != 0) ||
 			(compile_file(logdepth, oname, &libname_dyn, NULL, NULL, concated_ldflags) != 0)) {
-			report("FAILED (compiling dynlib)\n");
+			report("('%s': nope) ", concated_ldflags);
 	}
 	else {
 		sprintf(test_host_app, test_host, ld_include, libname_dyn);
@@ -778,6 +836,7 @@ int find_ldflags_dynlib(const char *name, int logdepth, int fatal)
 
 	if (try_dynlib(logdepth, NULL, concat_nodes("-dynamic -shared", "cc/rdynamic", "libs/ldl", NULL), "cc/ldflags_dynlib", "-dynamic -shared", NULL, get("libs/ldl"))) return 0;
 	if (try_dynlib(logdepth, NULL, concat_nodes("-shared",          "cc/rdynamic", "libs/ldl", NULL), "cc/ldflags_dynlib", "-shared",          NULL, get("libs/ldl"))) return 0;
+	if (try_dynlib(logdepth, NULL, concat_nodes("-G",                              "libs/ldl", NULL), "cc/ldflags_dynlib", "-G",               NULL, get("libs/ldl"))) return 0; /* xlc (on AIX) */
 	report("Not found.\n");
 	return 1;
 }
diff --git a/scconfig/src/default/find_fscalls.c b/scconfig/src/default/find_fscalls.c
index 7e990d2..7f43fec 100644
--- a/scconfig/src/default/find_fscalls.c
+++ b/scconfig/src/default/find_fscalls.c
@@ -92,6 +92,7 @@ int find_fs_readdir(const char *name, int logdepth, int fatal)
 	char *test_c =
 		NL "#include <stdlib.h>"
 		NL "#include <stdio.h>"
+		NL "#include <string.h>"
 		NL "int main() {"
 		NL "	DIR *dirp;"
 		NL "	struct dirent *dp;"
@@ -397,6 +398,7 @@ int find_fs_getcwd(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
 		NL "#include <unistd.h>"
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	char b[1024];"
 		NL "	if (getcwd(b, sizeof(b)) != NULL)"
@@ -419,6 +421,7 @@ int find_fs__getcwd(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
 		NL "#include <stdlib.h>"
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	char b[1024];"
 		NL "	if (_getcwd(b, sizeof(b)) != NULL)"
@@ -442,6 +445,7 @@ int find_fs_getwd(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
 		NL "#include <unistd.h>"
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	char b[8192];"
 		NL "	if (getwd(b) != NULL)"
@@ -576,6 +580,83 @@ int find_fs__mkdir(const char *name, int logdepth, int fatal)
 	return try_fail(logdepth, "libs/fs/_mkdir");
 }
 
+static int find_utime_impl(const char *name, int logdepth, int fatal,
+	const char* key, const char* funcname, const char* typename)
+{
+	char test_c[1024+4096];
+	const char *test_c_templ =
+		NL "void puts_OK();"
+		NL "int main(int argc, char* argv[])"
+		NL "{"
+		NL "	struct %s buf;"
+		NL "	buf.actime = buf.modtime = 1610958044;"
+		NL "	if (%s(\"%s\", &buf) == 0)"
+		NL "		puts_OK();"
+		NL "	return 0;"
+		NL "}"
+		NL "#include <stdio.h>"
+		NL "void puts_OK()"
+		NL "{"
+		NL "	puts(\"OK\");"
+		NL "}"
+		NL;
+
+	const char* includes[] =
+	{
+		/* *NIX */
+		"#include <sys/types.h>\n#include <utime.h>",
+
+		/* windoz */
+		"#include <sys/utime.h>",
+
+		NULL
+	};
+	const char** inc;
+	char* tmpf;
+
+	tmpf = tempfile_new(".txt");
+	sprintf(test_c, test_c_templ, typename, funcname, tmpf);
+
+	require("cc/cc", logdepth, fatal);
+
+	report("Checking for %s... ", funcname);
+	logprintf(logdepth, "find_fs_%s: trying to find %s()...\n", funcname, funcname);
+	logdepth++;
+
+	for (inc=includes; *inc; ++inc)
+	{
+		if (try_icl(logdepth, key, test_c, *inc, NULL, NULL))
+		{
+			unlink(tmpf);
+			free(tmpf);
+			return 0;
+		}
+	}
+
+	unlink(tmpf);
+	free(tmpf);
+
+	return try_fail(logdepth, key);
+}
+
+int find_fs_utime(const char *name, int logdepth, int fatal)
+{
+	return find_utime_impl(name, logdepth, fatal,
+		"libs/fs/utime", "utime", "utimbuf");
+}
+
+int find_fs__utime(const char *name, int logdepth, int fatal)
+{
+	return find_utime_impl(name, logdepth, fatal,
+		"libs/fs/_utime", "_utime", "_utimbuf");
+}
+
+int find_fs__utime64(const char *name, int logdepth, int fatal)
+{
+	return find_utime_impl(name, logdepth, fatal,
+		"libs/fs/_utime64", "_utime64", "__utimbuf64");
+}
+
 int find_fs_mkdtemp(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
@@ -806,3 +887,32 @@ int find_fs_flock(const char *name, int logdepth, int fatal)
 	if (try_icl(logdepth, key, test_c, "#include <sys/file.h>", NULL, NULL)) return 0;
 	return try_fail(logdepth, key);
 }
+
+int find_fs_makedev(const char *name, int logdepth, int fatal)
+{
+	const char *key = "libs/fs/makedev";
+	const char *test_c =
+		NL "#include <stdio.h>"
+		NL "int main() {"
+		NL "	if (1 == major(makedev(1, 2)) && 2 == minor(makedev(1, 2)))"
+		NL "		puts(\"OK\");"
+		NL "	return 0;"
+		NL "}"
+		NL;
+	const char *includes[] = {
+		"#include <sys/sysmacros.h>",
+		NULL
+	};
+	const char **i;
+
+	require("cc/cc", logdepth, fatal);
+
+	report("Checking for makedev()... ");
+	logprintf(logdepth, "find_fs_makedev: trying to find makedev...\n");
+	logdepth++;
+
+	for (i = includes; *i != NULL; i++)
+		if (try_icl(logdepth, key, test_c, *i, NULL, NULL))
+			return 0;
+	return try_fail(logdepth, key);
+}
diff --git a/scconfig/src/default/find_fstools.c b/scconfig/src/default/find_fstools.c
index 5dc894d..d2d230e 100644
--- a/scconfig/src/default/find_fstools.c
+++ b/scconfig/src/default/find_fstools.c
@@ -263,6 +263,8 @@ static int test_ar(int logdepth, const char *command)
 		else
 			expected++;
 
+		logprintf(logdepth, "test_ar path_sep='%s' expected='%s' result='%s'\n", path_sep, expected, result);
+
 		ret = strncmp(expected, result, strlen(expected)) == 0;
 		if (ret) {
 			put("fstools/ar", command);
diff --git a/scconfig/src/default/find_io.c b/scconfig/src/default/find_io.c
index c94a3d6..20aa2ad 100644
--- a/scconfig/src/default/find_io.c
+++ b/scconfig/src/default/find_io.c
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
+#include <unistd.h>
 #include "libs.h"
 #include "log.h"
 #include "db.h"
@@ -33,6 +34,7 @@ int find_io_pipe(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
 		NL "#include <unistd.h>"
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	int fd[2];"
 		NL "	if (pipe(fd) == 0)"
@@ -47,11 +49,55 @@ int find_io_pipe(const char *name, int logdepth, int fatal)
 	logprintf(logdepth, "find_io_pipe: trying to find pipe(2)...\n");
 	logdepth++;
 
-
-	if (try_icl(logdepth, "libs/io/pipe", test_c, NULL, NULL, NULL)) return 0;
+	if (try_icl(logdepth, "libs/io/pipe", test_c, "#include <unistd.h>\n", NULL, NULL)) return 0;
 	return try_fail(logdepth, "libs/io/pipe");
 }
 
+int find_io_pipe2(const char *name, int logdepth, int fatal)
+{
+	const char *test_c =
+		NL "#include <unistd.h>"
+		NL "#include <stdio.h>"
+		NL "int main() {"
+		NL "	int fd[2];"
+		NL "	if (pipe2(fd, 0) == 0)"
+		NL "		puts(\"OK\");"
+		NL "	return 0;"
+		NL "}"
+		NL;
+
+	require("cc/cc", logdepth, fatal);
+
+	report("Checking for pipe2(2)... ");
+	logprintf(logdepth, "find_io_pipe2: trying to find pipe2(2)...\n");
+	logdepth++;
+
+	if (try_icl(logdepth, "libs/io/pipe2", test_c, "#include <unistd.h>\n", NULL, NULL)) return 0;
+	return try_fail(logdepth, "libs/io/pipe2");
+}
+
+int find_io__pipe(const char *name, int logdepth, int fatal)
+{
+	const char *test_c =
+		NL "#include <stdio.h>"
+		NL "int main() {"
+		NL "	int fd[2];"
+		NL "	if (_pipe(fd, 1024, _O_BINARY) == 0)"
+		NL "		puts(\"OK\");"
+		NL "	return 0;"
+		NL "}"
+		NL;
+
+	require("cc/cc", logdepth, fatal);
+
+	report("Checking for _pipe()... ");
+	logprintf(logdepth, "find_io__pipe: trying to find _pipe()...\n");
+	logdepth++;
+
+	if (try_icl(logdepth, "libs/io/_pipe", test_c, "#include <io.h>\n#include <fcntl.h>\n", NULL, NULL)) return 0;
+	return try_fail(logdepth, "libs/io/_pipe");
+}
+
 int find_io_dup2(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
@@ -81,7 +127,7 @@ int find_io_fileno(const char *name, int logdepth, int fatal)
 	char *test_c_ =
 		NL "#include <stdio.h>"
 		NL "int main() {"
-		NL no_implicit(int, "%s", "%s")
+		    /* NOTE: can not check for implicit declaration as fileno() may be a macro (e.g. on MINIX3) */
 		NL "	if (%s(stdout) >= 0)"
 		NL "		puts(\"OK\"); "
 		NL "	return 0;"
@@ -95,20 +141,26 @@ int find_io_fileno(const char *name, int logdepth, int fatal)
 	logdepth++;
 
 	/* UNIX */
-	sprintf(test_c, test_c_, "fileno", "fileno", "fileno");
+	sprintf(test_c, test_c_, "fileno");
+	if (try_icl(logdepth, "libs/io/fileno", test_c, NULL, NULL, NULL)) {
+		put("libs/io/fileno/call", "fileno");
+		return 0;
+	}
+
+	sprintf(test_c, test_c_, "fileno");
 	if (try_icl(logdepth, "libs/io/fileno", test_c, "#include <unistd.h>\n", NULL, NULL)) {
 		put("libs/io/fileno/call", "fileno");
 		return 0;
 	}
 
-	sprintf(test_c, test_c_, "fileno", "fileno", "fileno");
+	sprintf(test_c, test_c_, "fileno");
 	if (try_icl(logdepth, "libs/io/fileno", test_c, "#define _XOPEN_SOURCE\n#include <unistd.h>\n", NULL, NULL)) {
 		put("libs/io/fileno/call", "fileno");
 		return 0;
 	}
 
 	/* windows */
-	sprintf(test_c, test_c_, "_fileno", "_fileno", "_fileno");
+	sprintf(test_c, test_c_, "_fileno");
 	if (try_icl(logdepth, "libs/io/fileno", test_c, "#include <stdio.h>\n", NULL, NULL)) {
 		put("libs/io/fileno/call", "_fileno");
 		return 0;
@@ -151,11 +203,15 @@ int find_io_lseek(const char *name, int logdepth, int fatal)
 	for (inc = incs, fn = fns; *fn; ++inc, ++fn) {
 		sprintf(test_c, test_c_template, tmpf, *fn, *fn, *fn);
 		if (try_icl(logdepth, NODE, test_c, *inc, NULL, NULL)) {
+			unlink(tmpf);
+			free(tmpf);
 			put(NODE "/call", *fn);
 			return 0;
 		}
 	}
 
+	unlink(tmpf);
+	free(tmpf);
 	return try_fail(logdepth, NODE);
 #undef NODE
 }
diff --git a/scconfig/src/default/find_libs.c b/scconfig/src/default/find_libs.c
index 4ba66f1..41d87ca 100644
--- a/scconfig/src/default/find_libs.c
+++ b/scconfig/src/default/find_libs.c
@@ -59,6 +59,9 @@ int find_lib_ldl(const char *name, int logdepth, int fatal)
 	char *test_c =
 		NL "#include <stdio.h>"
 		NL "#include <dlfcn.h>"
+		NL "#ifndef RTLD_NOW"
+		NL "#define RTLD_NOW RTLD_LAZY" /* on old BSD and probably on SunOS */
+		NL "#endif"
 		NL "int main() {"
 		NL "	void *handle;"
 		NL "	handle = dlopen(\"/this file does not exist.\", RTLD_NOW);"
@@ -78,6 +81,10 @@ int find_lib_ldl(const char *name, int logdepth, int fatal)
 		NL "}"
 		NL;
 
+	s = (char *)get("libs/ldl/presents");
+	if (s != NULL)
+		return !istrue(s);
+
 	require("cc/cc", logdepth, fatal);
 
 	report("Checking for -ldl... ");
@@ -94,12 +101,14 @@ int find_lib_ldl(const char *name, int logdepth, int fatal)
 			if (try_icl(logdepth, NULL, test_c, NULL, NULL, NULL)) {
 				put("libs/ldl", "");
 				put("libs/ldl/includes", "#include <dlfcn.h>\\n");
+				put("libs/ldl/presents", strue);
 				report("OK ()\n");
 				return 0;
 			}
 			if (try_icl(logdepth, NULL, test_c, NULL, NULL, "-ldl")) {
 				put("libs/ldl", "-ldl");
 				put("libs/ldl/includes", "#include <dlfcn.h>\\n");
+				put("libs/ldl/presents", strue);
 				report("OK (-ldl)\n");
 				return 0;
 			}
@@ -127,6 +136,7 @@ int find_lib_ldl(const char *name, int logdepth, int fatal)
 			/* check at normal system installation */
 			put("libs/ldl", "-ldl-compat");
 			put("libs/ldl/includes", "#include <dl-compat.h>\\n");
+			put("libs/ldl/presents", strue);
 			report("OK (-ldl-compat)\n");
 			return 0;
 		}
@@ -137,12 +147,14 @@ int find_lib_ldl(const char *name, int logdepth, int fatal)
 		if (try_icl(logdepth, NULL, test_c, NULL, NULL, s)) {
 			put("libs/ldl", ldl);
 			put("libs/ldl/includes", "#include <dlfcn.h>\\n");
+			put("libs/ldl/presents", strue);
 			report("OK (%s)\n", ldl);
 			free(s);
 			return 0;
 		}
 		free(s);
 	}
+	put("libs/ldl/presents", sfalse);
 	report("Not found\n");
 	return 1;
 }
@@ -176,6 +188,7 @@ int find_lib_errno(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
 		NL "#include <errno.h>"
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	errno = 0;"
 		NL "	puts(\"OK\");"
diff --git a/scconfig/src/default/find_sys.c b/scconfig/src/default/find_sys.c
index 79803cf..17fdbc3 100644
--- a/scconfig/src/default/find_sys.c
+++ b/scconfig/src/default/find_sys.c
@@ -274,6 +274,7 @@ static int try_tmp_all(int logdepth)
 				put("sys/path_sep", "\\\\\\\\");
 			else
 				put("sys/path_sep", "\\");
+			put("sys/path_sep_escaped", "\\\\");
 			return 1;
 		}
 		tmp = get("sys/tmp");
@@ -307,6 +308,7 @@ int find_tmp(const char *name, int logdepth, int fatal)
 	require("sys/shell", logdepth, fatal);
 
 	put("sys/path_sep", "/");
+	put("sys/path_sep_escaped", "/");
 
 	report("Detecting temp dir...");
 	logprintf(logdepth, "Finding temp dir (current working directory)...\n");
@@ -338,6 +340,7 @@ int find_tmp(const char *name, int logdepth, int fatal)
 			put("sys/tmp", usertmp);
 			report("using user supplied temp dir '%s' for cross-compilation\n", usertmp);
 			logprintf(logdepth, "using user supplied temp dir '%s' for cross-compilation\n", usertmp);
+			logprintf(logdepth, "Path sep: '%s'\n", get("sys/path_sep"));
 		}
 		return 0;
 	}
@@ -352,12 +355,14 @@ int find_tmp(const char *name, int logdepth, int fatal)
 
 		report(" validated %s\n", get("sys/tmp"));
 		logprintf(logdepth, "Detected temp dir '%s'\n", get("sys/tmp"));
+		logprintf(logdepth, "Path sep: '%s'\n", get("sys/path_sep"));
 		return 0;
 	}
 
 	put("sys/tmp", "");
 	report("using temp dir fallback .\n");
 	logprintf(logdepth, "all temp directories failed, using . as tmp\n");
+	logprintf(logdepth, "Path sep: '%s'\n", get("sys/path_sep"));
 	return 0;
 }
 
diff --git a/scconfig/src/default/find_thread.c b/scconfig/src/default/find_thread.c
index 4ab793b..d10e523 100644
--- a/scconfig/src/default/find_thread.c
+++ b/scconfig/src/default/find_thread.c
@@ -37,6 +37,7 @@ int find_lib_lpthread(const char *name, int logdepth, int fatal)
 	char *test_c_recursive =
 		NL "#define _GNU_SOURCE 1 /* Needed for recursive thread-locking */"
 		NL "#include <pthread.h>"
+		NL "#include <stdio.h>"
 		NL "pthread_mutex_t mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;"
 		NL "int main() {"
 		NL "	pthread_attr_t a;"
@@ -48,6 +49,7 @@ int find_lib_lpthread(const char *name, int logdepth, int fatal)
 
 	char *test_c_simple =
 		NL "#include <pthread.h>"
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	pthread_attr_t a;"
 		NL "	if (pthread_attr_init(&a) == 0)"
diff --git a/scconfig/src/default/find_time.c b/scconfig/src/default/find_time.c
index 25a91a5..7076566 100644
--- a/scconfig/src/default/find_time.c
+++ b/scconfig/src/default/find_time.c
@@ -32,6 +32,7 @@ int find_time_usleep(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
 		NL "#include <unistd.h>"
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	if (usleep(1) == 0)"
 		NL "		puts(\"OK\");"
@@ -53,6 +54,7 @@ int find_time_usleep(const char *name, int logdepth, int fatal)
 int find_time_Sleep(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	Sleep(1);"
 		NL "	puts(\"OK\");"
@@ -75,6 +77,7 @@ int find_time_gettimeofday(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
 		NL "#include <stdlib.h>"
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	struct timeval tv;"
 		NL "	if (gettimeofday(&tv, NULL) == 0)"
@@ -98,6 +101,7 @@ int find_time_gettimeofday(const char *name, int logdepth, int fatal)
 int find_time_ftime(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	struct timeb tb;"
 		NL "	if (ftime(&tb) == 0)"
diff --git a/scconfig/src/default/find_types.c b/scconfig/src/default/find_types.c
index 05c0d84..38f0f2c 100644
--- a/scconfig/src/default/find_types.c
+++ b/scconfig/src/default/find_types.c
@@ -93,6 +93,7 @@ int find_types_stdint(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
 		NL "#include <stdint.h>"
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	if (sizeof(uint8_t) == 1)"
 		NL "		puts(\"OK\");"
@@ -277,7 +278,7 @@ int find_types_something_t(const char *name, int logdepth, int fatal, const char
 
 	for(include = first_include; *include != NULL; include++) {
 		sprintf(test_c, test_c_include, define, *include, typ);
-		if ((compile_run(logdepth, test_c, NULL, NULL, NULL, &out) == 0) && (strncmp(out, "OK", 2) == 0)) {
+		if ((compile_run(logdepth, test_c, NULL, NULL, NULL, &out) == 0) && out != NULL && (strncmp(out, "OK", 2) == 0)) {
 			report("Found; ");
 			logprintf(logdepth+1, "include %s works\n", *include);
 			sprintf(nodeend, "includes");
diff --git a/scconfig/src/default/find_uname.c b/scconfig/src/default/find_uname.c
index 6bf1d82..d6d4908 100644
--- a/scconfig/src/default/find_uname.c
+++ b/scconfig/src/default/find_uname.c
@@ -78,6 +78,7 @@ uname_t unames[] = {
 	{"[Bb][Ss][Dd]",         "BSD",    "UNIX",  sys_unix},
 	{"SunOS",                "SunOS",  "UNIX",  sys_unix},
 	{"OSF1",                 "OSF",    "UNIX",  sys_unix}, /* TODO: note the difference in cflags for debugging ("-ms -g") */
+	{"AIX",                  "AIX",    "UNIX",  sys_unix},
 	{"IRIX",                 "IRIX",   "UNIX",  sys_unix},
 	{"SunOS",                "SunOS",  "UNIX",  sys_unix},
 	{"[Mm]inix",             "Minix",  "UNIX",  sys_unix},
@@ -287,13 +288,15 @@ int find_uname(const char *rname, int logdepth, int fatal)
 		uname_guess("sys/system_name", uname, system_names);
 
 	/* on windows, overwrite the path sep with the right amount of \ (the tmp finder may have left / in it) */
-	if (strcmp(class, "WIN32") == 0) {
+	if ((strcmp(class, "WIN32") == 0) || (strcmp(class, "win32") == 0)) {
 		int eats = istrue(get("sys/shell_eats_backslash"));
 
 		if (eats)
 			put("sys/path_sep", "\\\\\\\\");
 		else
 			put("sys/path_sep", "\\");
+
+		put("sys/path_sep_escaped", "\\\\");
 	}
 
 	return 0;
diff --git a/scconfig/src/default/lib_compile.c b/scconfig/src/default/lib_compile.c
index 12664fc..6f7dca4 100644
--- a/scconfig/src/default/lib_compile.c
+++ b/scconfig/src/default/lib_compile.c
@@ -72,7 +72,7 @@ static char *clone_flags(const char *input, const char *node)
 
 int compile_file_raw(int logdepth, const char *fn_input, char **fn_output, const char *cc, const char *cflags, const char *ldflags)
 {
-	char cmd[2048];
+	char *cmdline;
 	char *cc_esc, *fn_input_esc, *fn_output_esc, *temp_out_esc, *temp_out;
 	int ret;
 
@@ -89,15 +89,18 @@ int compile_file_raw(int logdepth, const char *fn_input, char **fn_output, const
 	fn_output_esc = shell_escape_dup(*fn_output);
 	temp_out_esc = shell_escape_dup(temp_out);
 
-	sprintf(cmd, "%s \"%s %s %s %s -o %s 2>&1\" >%s", get("/host/sys/shell"), cc_esc, cflags, fn_input_esc, ldflags, fn_output_esc, temp_out_esc);
+	cmdline = str_concat("",
+		get("/host/sys/shell"), " \"", cc_esc, " ", cflags, " ", fn_input_esc, " ", \
+		ldflags, " -o ", fn_output_esc, " 2>&1\" >", temp_out_esc, NULL);
 
 	free(cc_esc);
 	free(fn_input_esc);
 	free(fn_output_esc);
 	free(temp_out_esc);
 
-	logprintf(logdepth, "compile: '%s'\n", cmd);
-	ret = system(cmd);
+	logprintf(logdepth, "compile: '%s'\n", cmdline);
+	ret = system(cmdline);
+	free(cmdline);
 	log_merge(logdepth + 1, temp_out);
 #ifndef KEEP_TEST_SRCS
 	unlink(temp_out);
diff --git a/scconfig/src/default/lib_pkg_config.c b/scconfig/src/default/lib_pkg_config.c
index 8f81220..7f1e7ab 100644
--- a/scconfig/src/default/lib_pkg_config.c
+++ b/scconfig/src/default/lib_pkg_config.c
@@ -30,7 +30,10 @@ int run_gen_config(int logdepth, const char *confname, const char *pkgname, char
 {
 	char cmd[256];
 
-	assert(strlen(pkgname) < sizeof(cmd) - 64);
+	if (strlen(confname) + strlen(pkgname) > sizeof(cmd) - 16) {
+		logprintf(logdepth, "run_gen_config(): confname and/or pkgname too long\n");
+		return -1;
+	}
 
 	if (cflags != NULL) {
 		sprintf(cmd, "%s --cflags %s", confname, pkgname);
@@ -82,7 +85,10 @@ int run_pkg_config_modversion(int logdepth, const char *pkgname, char **modversi
 	char cmd[256];
 	const char *confname = pkg_config_name();
 
-	assert(strlen(pkgname) < sizeof(cmd) - 64);
+	if (strlen(confname) + strlen(pkgname) > sizeof(cmd) - 16) {
+		logprintf(logdepth, "run_pkg_config_modversion(): confname and/or pkgname too long\n");
+		return -1;
+	}
 
 	if (modversion != NULL) {
 		sprintf(cmd, "%s --modversion %s", confname, pkgname);
diff --git a/scconfig/src/default/lib_try.c b/scconfig/src/default/lib_try.c
index e926a27..16586c7 100644
--- a/scconfig/src/default/lib_try.c
+++ b/scconfig/src/default/lib_try.c
@@ -140,17 +140,24 @@ int try_icl_(int logdepth, const char *prefix, const char *test_c_in, const char
 	char *rincludes, *rcflags, *rldflags; /* real */
 	char *dbincludes = NULL, *dbcflags = NULL, *dbldflags = NULL; /* what to add in the db at the end */
 
+	if ((prefix == NULL) ? 0 : strlen(prefix) + strlen(db_cwd) > sizeof(apath)-32) {
+		report("ERROR: no room for try_icl_() - prefix is probably too long.\n");
+		return -1;
+	}
+
 	/* load uincludes, uclfags, uldflags and uprefix - LOAD() inserts the u */
-	l = sprintf(apath, "/arg/icl/%s/", prefix); apath_end = apath+l;
-	LOAD(includes);
-	LOAD(cflags);
-	LOAD(ldflags);
-	LOAD(prefix);
-	l = sprintf(apath, "/arg/icl/%s/%s/", db_cwd, prefix); apath_end = apath+l;
-	LOAD(includes);
-	LOAD(cflags);
-	LOAD(ldflags);
-	LOAD(prefix);
+	if (prefix != NULL) { /* prefix == NULL means non-standard icl; caller sets non-standard nodes, the user can't affect that */
+		l = sprintf(apath, "/arg/icl/%s/", prefix); apath_end = apath+l;
+		LOAD(includes);
+		LOAD(cflags);
+		LOAD(ldflags);
+		LOAD(prefix);
+		l = sprintf(apath, "/arg/icl/%s/%s/", db_cwd, prefix); apath_end = apath+l;
+		LOAD(includes);
+		LOAD(cflags);
+		LOAD(ldflags);
+		LOAD(prefix);
+	}
 
 	/* special case: all three specified by the user - ignore what the detector wanted, but run only once per node prefix */
 	if ((uincludes != NULL) && (ucflags != NULL) && (uldflags != NULL)) {
@@ -201,6 +208,12 @@ int try_icl_(int logdepth, const char *prefix, const char *test_c_in, const char
 		rcflags = str_concat("", prfx, "-I", uprefix, "/include ", rcflags, NULL);
 		if (old != cflags) free(old);
 
+		/* add -I to the db too */
+		old = dbcflags;
+		dbcflags = str_concat("", "-I", uprefix, "/include ", dbcflags, NULL);
+		free(old);
+
+
 		old = rldflags;
 		if ((rldflags != NULL) && (*rldflags == '^')) {
 			rldflags++;
@@ -210,6 +223,11 @@ int try_icl_(int logdepth, const char *prefix, const char *test_c_in, const char
 			prfx = "";
 		rldflags = str_concat("", prfx, "-L", uprefix, "/lib ", rldflags, NULL);
 		if (old != ldflags) free(old);
+
+		/* add -L to the db too */
+		old = dbldflags;
+		dbldflags = str_concat("", "-L", uprefix, "/lib ", dbldflags, NULL);
+		free(old);
 	}
 
 	res = try_icl__(logdepth, prefix, test_c_in, rincludes, rcflags, rldflags, dbincludes, dbcflags, dbldflags, run, accept_res);
@@ -334,6 +352,11 @@ int import_icl(const char *key, const char *fn)
 {
 	char path[1024];
 
+	if (strlen(key) > sizeof(path)-32) {
+		report("ERROR: no room for import_icl() - key is probably too long.\n");
+		return -1;
+	}
+
 	switch(*key) {
 		case 'l': sprintf(path, "/arg/icl/%s/ldflags", key+8); break;
 		case 'c': sprintf(path, "/arg/icl/%s/cflags", key+7); break;
@@ -342,7 +365,6 @@ int import_icl(const char *key, const char *fn)
 		default:
 			return 1;
 	}
-	printf("path='%s' fn='%s'\n", path, fn);
 	return put(path, fn) == NULL;
 }
 
@@ -371,6 +393,11 @@ int try_icl_sfield(int logdepth, const char *prefix, const char *structn, const
 		NL "}"
 		NL;
 
+	if (strlen(fieldn) + strlen(structn) + strlen(test_c_in) + 32 >= sizeof(test_c)) {
+		report("ERROR: no room for try_icl_sfield() - struct or field name is probably too long.\n");
+		return -1;
+	}
+
 	sprintf(test_c, test_c_in, structn, fieldn);
 
 	res = try_icl_(logdepth, prefix, test_c, includes, cflags, ldflags, 1, field_accept_res);
diff --git a/scconfig/src/math/find_fpenan.c b/scconfig/src/math/find_fpenan.c
index 064f4ac..7297746 100644
--- a/scconfig/src/math/find_fpenan.c
+++ b/scconfig/src/math/find_fpenan.c
@@ -34,6 +34,7 @@
 int find_math_isnan(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	if (!isnan(1.0))"
 		NL "		puts(\"OK\");"
@@ -60,6 +61,7 @@ int find_math_isnan(const char *name, int logdepth, int fatal)
 int find_math_isinf(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	if (!isinf(1.0))"
 		NL "		puts(\"OK\");"
@@ -87,6 +89,7 @@ int find_math_isinf(const char *name, int logdepth, int fatal)
 int find_math_isfinite(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	if (isfinite(1.0))"
 		NL "		puts(\"OK\");"
@@ -114,6 +117,7 @@ int find_math_isfinite(const char *name, int logdepth, int fatal)
 int find_math_isnormal(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	if (isnormal(1.0))"
 		NL "		puts(\"OK\");"
@@ -145,6 +149,7 @@ int find_math_isnormal(const char *name, int logdepth, int fatal)
 int find_math_nan(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	if (nan(\"foo\") != 0.0)"
 		NL "		puts(\"OK\");"
@@ -174,6 +179,7 @@ int find_math_nanop(const char *name, int logdepth, int fatal)
 	char *test_c_temp =
 		NL "#include <stdlib.h>"
 		NL "#include <stdio.h>"
+		NL "#include <string.h>"
 		NL "%s"
 		NL
 		NL "double s2d(const char *s)"
diff --git a/scconfig/src/math/find_func.c b/scconfig/src/math/find_func.c
index 40c60a9..d2d31d7 100644
--- a/scconfig/src/math/find_func.c
+++ b/scconfig/src/math/find_func.c
@@ -33,6 +33,7 @@
 static int test_mathf(const char *name, int logdepth, int fatal, const char *fname, const char *cond)
 {
 	char *test_c_template =
+		NL "#include <stdio.h>"
 		NL "float one=1.0, zero=0.0;"
 		NL "int main() {"
 		NL "	if (%s)"
diff --git a/scconfig/src/math/find_math.c b/scconfig/src/math/find_math.c
index ac0ba5d..3cb8c6d 100644
--- a/scconfig/src/math/find_math.c
+++ b/scconfig/src/math/find_math.c
@@ -34,6 +34,7 @@
 int find_math_minpack(const char *name, int logdepth, int fatal)
 {
 	char *test_c =
+		NL "#include <stdio.h>"
 		NL "int main() {"
 		NL "	int one=1;"
 		NL "	if (dpmpar_(&one) != 0.0)"
diff --git a/scconfig/src/parsgen/find_parsgen.c b/scconfig/src/parsgen/find_parsgen.c
index 9aab1fe..02a7cba 100644
--- a/scconfig/src/parsgen/find_parsgen.c
+++ b/scconfig/src/parsgen/find_parsgen.c
@@ -1,6 +1,6 @@
 /*
     scconfig - parser generator detection
-    Copyright (C) 2009  Tibor Palinkas
+    Copyright (C) 2009,2020  Tibor Palinkas
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -75,17 +75,18 @@ int find_parsgen_flex(const char *name, int logdepth, int fatal)
 	return 1;
 }
 
-int find_parsgen_bison(const char *name, int logdepth, int fatal)
-{
-	const char *test_bison =
+static const char *test_yacc =
 		NL "%union { char *str; double num;}"
-		NL "%%"
 		NL "%token <str> TOK1;"
 		NL "%token <num> TOK2;"
+		NL "%%"
 		NL "root: one | two;"
 		NL "one: TOK1;"
 		NL "two: TOK2;"
 		NL ;
+
+int find_parsgen_bison(const char *name, int logdepth, int fatal)
+{
 	char *out, *temp_in, *temp_in_esc, *cmd;
 	int ret;
 	char *bisfile, *s;
@@ -95,7 +96,7 @@ int find_parsgen_bison(const char *name, int logdepth, int fatal)
 	logprintf(logdepth, "find_bison: trying to find bison...\n");
 	logdepth++;
 
-	temp_in = tempfile_dump(test_bison, ".y");
+	temp_in = tempfile_dump(test_yacc, ".y");
 	bisfile = malloc(strlen(temp_in) + 32);
 	strcpy(bisfile, temp_in);
 	s = strrchr(bisfile+1, '.');
@@ -132,8 +133,106 @@ int find_parsgen_bison(const char *name, int logdepth, int fatal)
 	return 1;
 }
 
+int find_parsgen_byaccic(const char *name, int logdepth, int fatal)
+{
+	char *out, *temp_in, *temp_in_esc, *cmd;
+	int ret;
+	char *bisfile, *s;
+	(void) fatal;  /* not used */
+
+	report("Checking for byaccic... ");
+	logprintf(logdepth, "find_byaccic: trying to find byaccic...\n");
+	logdepth++;
+
+	temp_in = tempfile_dump(test_yacc, ".y");
+	bisfile = malloc(strlen(temp_in) + 32);
+	strcpy(bisfile, temp_in);
+	s = strrchr(bisfile+1, '.');
+	strcpy(s, ".tab.c");
+	if (is_file(bisfile)) {
+		report("ERROR: %s exists, and I don't dare to delete it. Can't test byaccic, please remove the file by hand.\n", bisfile);
+		logprintf(logdepth, "ERROR: %s exists, and I don't dare to delete it. Can't test byaccic, please remove the file by hand.\n", bisfile);
+		exit(1);
+	}
+	temp_in_esc = shell_escape_dup(temp_in);
+	cmd = malloc(strlen(temp_in_esc)*2 + 32);
+	sprintf(cmd, "byaccic -o %s %s", bisfile, temp_in_esc);
+	free(temp_in_esc);
+
+	ret = run(logdepth, cmd, &out);
+	remove(temp_in);
+	free(temp_in);
+	if (out != NULL)
+		free(out);
+
+	if (is_file(bisfile)) {
+		remove(bisfile);
+		if (ret == 0) {
+			put("parsgen/byaccic", "byaccic");
+			put("parsgen/byaccic/presents", strue);
+			report("Found.\n");
+			return 0;
+		}
+	}
+
+	put("parsgen/byaccic/presents", sfalse);
+	report("Not found.\n");
+	return 1;
+}
+
+int find_parsgen_ureglex(const char *name, int logdepth, int fatal)
+{
+	const char *test_ureglex =
+		NL "rule blank"
+		NL "regex [ \t\r]+"
+		NL "code"
+		NL "	ULX_IGNORE;"
+		NL "rulestring 3D_DXF            return 0;"
+		NL ;
+	char *out, *temp_in, *temp_in_esc, *cmd;
+	int ret;
+	char *lexfile = "lex.yy.c";
+	(void) fatal;  /* not used */
+
+	report("Checking for ureglex... ");
+	logprintf(logdepth, "find_ureglex: trying to find ureglex...\n");
+	logdepth++;
+
+	if (is_file(lexfile)) {
+		report("ERROR: %s exists, and I don't dare to delete it. Can't test ureglex, please remove the file by hand.\n", lexfile);
+		logprintf(logdepth, "ERROR: %s exists, and I don't dare to delete it. Can't test ureglex, please remove the file by hand.\n", lexfile);
+		exit(1);
+	}
+	temp_in = tempfile_dump(test_ureglex, ".lex");
+	temp_in_esc = shell_escape_dup(temp_in);
+	cmd = malloc(strlen(temp_in_esc) + 32);
+	sprintf(cmd, "ureglex -l %s -c %s", temp_in_esc, lexfile);
+	free(temp_in_esc);
+	ret = run(logdepth, cmd, &out);
+	remove(temp_in);
+	free(temp_in);
+	if (out != NULL)
+		free(out);
+
+	if (is_file(lexfile)) {
+		remove(lexfile);
+		if (ret == 0) {
+			put("parsgen/ureglex", "ureglex");
+			put("parsgen/ureglex/presents", strue);
+			report("Found.\n");
+			return 0;
+		}
+	}
+
+	put("parsgen/ureglex/presents", sfalse);
+	report("Not found.\n");
+	return 1;
+}
+
 void deps_parsgen_init()
 {
 	dep_add("parsgen/flex/*",                     find_parsgen_flex);
 	dep_add("parsgen/bison/*",                    find_parsgen_bison);
+	dep_add("parsgen/byaccic/*",                  find_parsgen_byaccic);
+	dep_add("parsgen/ureglex/*",                  find_parsgen_ureglex);
 }
diff --git a/scconfig/src/tmpasm/tmpasm_scconfig.c b/scconfig/src/tmpasm/tmpasm_scconfig.c
index 5bfb6d3..f84a4fa 100644
--- a/scconfig/src/tmpasm/tmpasm_scconfig.c
+++ b/scconfig/src/tmpasm/tmpasm_scconfig.c
@@ -474,7 +474,10 @@ static void instr_include(tmpasm_t *ctx, char *iname, int argc, tmpasm_arg_t *ar
 		tmpasm_t *child;
 
 		fn = tmpasm_arg2str(ctx, argv[n], 0);
-		path = scc_path(ud, fn);
+		if (*fn != '/')
+			path = scc_path(ud, fn);
+		else
+			path = strclone(fn);
 		fin = fopen(path, "r");
 		if (fin == NULL) {
 			tmpasm_runtime_error(ctx, -8, path);
diff --git a/src/awklib/Makefile.in b/src/awklib/Makefile.in
index fb80040..6e8283c 100644
--- a/src/awklib/Makefile.in
+++ b/src/awklib/Makefile.in
@@ -9,19 +9,19 @@ LIBPATH=$(DESTDIR)$(install_root)$(PREFIX)/lib/libmawk
 all:
 
 install:
-	@fstools/mkdir@ $(LIBPATH)
+	@/host/fstools/mkdir@ $(LIBPATH)
 @]
 foreach /local/n in /local/libs
-	print [@	@fstools/cp@ @/local/n@.awk $(LIBPATH)/@/local/n@.awk
+	print [@	@/host/fstools/cp@ @/local/n@.awk $(LIBPATH)/@/local/n@.awk
 @]
 end
 
 print [@
 linstall:
-	@fstools/mkdir@ $(LIBPATH)
+	@/host/fstools/mkdir@ $(LIBPATH)
 @]
 foreach /local/n in /local/libs
-	print [@	@fstools/ln@ @/local/n@.awk $(LIBPATH)/@/local/n@.awk
+	print [@	@/host/fstools/ln@ @/local/n@.awk $(LIBPATH)/@/local/n@.awk
 @]
 end
 
@@ -29,7 +29,7 @@ print [@
 uninstall:
 @]
 foreach /local/n in /local/libs
-	print [@	@fstools/rm@ $(LIBPATH)/@/local/n@.awk
+	print [@	@/host/fstools/rm@ $(LIBPATH)/@/local/n@.awk
 @]
 end
 
diff --git a/src/libmawk/Makefile b/src/libmawk/Makefile
index e0692b1..c2e9087 100644
--- a/src/libmawk/Makefile
+++ b/src/libmawk/Makefile
@@ -142,7 +142,7 @@ install_ :  lmawk libmawk.so
 	$(CP)  $(PWD)/man/example.7libmawk                      $(MAN7DIR)/example.7libmawk
 	$(CHMOD)  0644  $(MAWKMAN)
 	$(CP) $(PWD)/libmawk.so $(LIBARCHDIR)/libmawk.so.$(SOVER1).$(SOVER2).$(SOVER3)
-	rm $(LIBARCHDIR)/libmawk.so.$(SOVER1).$(SOVER2) $(LIBARCHDIR)/libmawk.so.$(SOVER1) 2>/dev/null ; true
+	rm $(LIBARCHDIR)/libmawk.so $(LIBARCHDIR)/libmawk.so.$(SOVER1).$(SOVER2) $(LIBARCHDIR)/libmawk.so.$(SOVER1) 2>/dev/null ; true
 	ln -s libmawk.so.$(SOVER1).$(SOVER2).$(SOVER3) $(LIBARCHDIR)/libmawk.so.$(SOVER1).$(SOVER2)
 	ln -s libmawk.so.$(SOVER1).$(SOVER2).$(SOVER3) $(LIBARCHDIR)/libmawk.so.$(SOVER1)
 	ln -s libmawk.so.$(SOVER1) $(LIBARCHDIR)/libmawk.so
diff --git a/src/libmawk/Makefile.conf.in b/src/libmawk/Makefile.conf.in
index fb3dde6..9865d8d 100644
--- a/src/libmawk/Makefile.conf.in
+++ b/src/libmawk/Makefile.conf.in
@@ -37,16 +37,16 @@ MANEXT = 1
 
 #----------------- scconfig detected ----------------------------------
 CC = @cc/cc@
-CFLAGS = @cc/cflags@ @cc/fpic@ -I.. -I. $(CFLAGS_APP)
+CFLAGS = @cc/cflags@ @cc/fpic@ @?/local/nofork@ -I.. -I. $(CFLAGS_APP)
 LDFLAGS = @cc/ldflags@
 LDFLAGS_SO = @/local/soname@
 LDFLAGS_RDYNAMIC = @cc/rdynamic@
 
-CHMODX = @fstools/chmodx@
+CHMODX = @/host/fstools/chmodx@
 CHMOD = chmod
-MKDIR = @fstools/mkdir@
-CP=@fstools/cp@
-SYMLINK=@fstools/ln@
+MKDIR = @/host/fstools/mkdir@
+CP=@/host/fstools/cp@
+SYMLINK=@/host/fstools/ln@
 @]
 
 switch /local/numeric
diff --git a/src/libmawk/files_children.c b/src/libmawk/files_children.c
index 645d047..2ac6876 100644
--- a/src/libmawk/files_children.c
+++ b/src/libmawk/files_children.c
@@ -17,7 +17,9 @@ the GNU General Public License, version 2, 1991.
 #include <string.h>
 #include <unistd.h>
 #include <sys/types.h>
+#ifndef MAWK_NO_FORK
 #include <sys/wait.h>
+#endif
 #include "mawk.h"
 #include "files.h"
 #include "memory.h"
diff --git a/src/libmawk/vio_fifo.c b/src/libmawk/vio_fifo.c
index 04a3a49..3e94514 100644
--- a/src/libmawk/vio_fifo.c
+++ b/src/libmawk/vio_fifo.c
@@ -10,6 +10,8 @@ the GNU General Public License, version 2, 1991.
 #include "vio_fifo.h"
 #include "memory.h"
 
+const mawk_vio_imp_t mawk_vio_fifo_imp;
+
 mawk_vio_t *mawk_vio_fifo_open(mawk_state_t *MAWK, const char *name, mawk_vio_open_mode_t mode)
 {
 	mawk_vio_fifo_t *v;
diff --git a/src/libmawk/vio_fifo.h b/src/libmawk/vio_fifo.h
index f170c22..a2d751d 100644
--- a/src/libmawk/vio_fifo.h
+++ b/src/libmawk/vio_fifo.h
@@ -14,7 +14,7 @@ typedef struct mawk_vio_fifo_s {
 	int eof_from_app;       /* 1 if there won't be more from the app or the app won't accept more data */
 } mawk_vio_fifo_t;
 
-const mawk_vio_imp_t mawk_vio_fifo_imp;
+extern const mawk_vio_imp_t mawk_vio_fifo_imp;
 
 mawk_vio_t *mawk_vio_fifo_open(mawk_state_t *MAWK, const char *name, mawk_vio_open_mode_t mode);
 

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/lib/debug/.build-id/2f/bc70e315955edfa373cb44180a1977233ec41e.debug
-rw-r--r--  root/root   /usr/lib/debug/.build-id/8a/150991f0c63cd43f679b51bb8a821dabc85109.debug

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/lib/debug/.build-id/77/e4b12084bb4c6379000b81b5a8deeff8cd8788.debug
-rw-r--r--  root/root   /usr/lib/debug/.build-id/91/b3d4d5b9d58305cc134c969466f143f339dc14.debug

No differences were encountered between the control files of package libmawk-dev

Control files of package libmawk1: lines which differ (wdiff format)

  • Depends: libc6 (>= 2.34) 2.29)

Control files of package libmawk1-dbgsym: lines which differ (wdiff format)

  • Build-Ids: 77e4b12084bb4c6379000b81b5a8deeff8cd8788 91b3d4d5b9d58305cc134c969466f143f339dc14 2fbc70e315955edfa373cb44180a1977233ec41e 8a150991f0c63cd43f679b51bb8a821dabc85109

More details

Full run details