NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: misc/50166



El 20/09/15 a les 14:48, Antti Kantee ha escrit:
We can address make separately too if need be.  Do you still need the bits in compat/{Makefile,defs.mk.in}?  Can those be addressed by using compat_defs.h instead of hardcoding the values based on uname -s?  Or does that require including nbtool_config.h from a large number of .c files?

As you suggested, I took a closer inspection by disabling all the generic -D flags and
using nbtool_config.h instead.

Then I added back only the defines that were needed in the corresponding individual
files.

The result is much smaller than I expected. In fact, other than make (because of the
bootstrap issue) and some Rump components, all remaining MAXPATHLEN/etc issues are
handled by nbtool_config.h.

Please consider attached patch.

--
Robert Millan
Index: rumpkernel/buildrump.sh/src/usr.bin/make/make.h
===================================================================
--- rumpkernel.orig/buildrump.sh/src/usr.bin/make/make.h
+++ rumpkernel/buildrump.sh/src/usr.bin/make/make.h
@@ -503,4 +503,10 @@ int str2Lst_Append(Lst, char *, const ch
 #define MAX(a, b) ((a > b) ? a : b)
 #endif
 
+/* GNU/Hurd systems lack MAXPATHLEN */
+#include <limits.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN	4096
+#endif
+
 #endif /* _MAKE_H_ */
Index: rumpkernel/buildrump.sh/src/tools/compat/compat_defs.h
===================================================================
--- rumpkernel.orig/buildrump.sh/src/tools/compat/compat_defs.h
+++ rumpkernel/buildrump.sh/src/tools/compat/compat_defs.h
@@ -1201,6 +1201,17 @@ __GEN_ENDIAN_DEC(64, le)
 #define LINE_MAX 2048
 #endif
 
+/* GNU/Hurd systems lack MAXPATHLEN (aka PATH_MAX) and MAXHOSTNAMELEN */
+#ifndef MAXPATHLEN
+#define MAXPATHLEN	4096
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX	MAXPATHLEN
+#endif
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN	256
+#endif
+
 /* <sys/time.h> */
 
 #ifndef timercmp
Index: rumpkernel/buildrump.sh/src/sys/rump/include/rump/rumpuser.h
===================================================================
--- rumpkernel.orig/buildrump.sh/src/sys/rump/include/rump/rumpuser.h
+++ rumpkernel/buildrump.sh/src/sys/rump/include/rump/rumpuser.h
@@ -251,4 +251,8 @@ int	rumpuser_sp_raise(void *, int);
 void	rumpuser_sp_fini(void *);
 #endif /* _RUMP_SYSPROXY || LIBRUMPUSER */
 
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
+
 #endif /* _RUMP_RUMPUSER_H_ */
Index: rumpkernel/buildrump.sh/src/lib/librumpuser/sp_common.c
===================================================================
--- rumpkernel.orig/buildrump.sh/src/lib/librumpuser/sp_common.c
+++ rumpkernel/buildrump.sh/src/lib/librumpuser/sp_common.c
@@ -64,6 +64,10 @@
 #define __unused __attribute__((__unused__))
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 //#define DEBUG
 #ifdef DEBUG
 #define DPRINTF(x) mydprintf x
Index: rumpkernel/buildrump.sh/src/usr.bin/rump_allserver/rump_allserver.c
===================================================================
--- rumpkernel.orig/buildrump.sh/src/usr.bin/rump_allserver/rump_allserver.c
+++ rumpkernel/buildrump.sh/src/usr.bin/rump_allserver/rump_allserver.c
@@ -50,6 +50,10 @@ __RCSID("$NetBSD: rump_allserver.c,v 1.3
 #include <rump/rumpdefs.h>
 #include <rump/rumperr.h>
 
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+
 __dead static void
 usage(void)
 {


Home | Main Index | Thread Index | Old Index