NetBSD-Bugs archive

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

Re: netbsd-3 branch won't build; minor fix



Martin Husemann wrote:
>On Fri, Jan 23, 2009 at 10:19:21AM -0500, Brad Parker wrote:
>> 
>> Hi,
>> 
>> I was trying to build netbsd-3 and netbsd-3-3-1-RELEASE and ran into a small
>> problem.  This was cross compiling for vax on using a linux host.
>
>What was the problem?

one of the libraries (lib/libmagic) would not build because MIN() was
defined twice.  I included a diff which show (I thought) the problem.

It occurred because the local include defined MIN() and then included a
system include which also defined it (always best to put system includes 
first, imho)

>P.S.: netbsd-bugs is not the proper list, maybe netbsd-users would be better,
>but let's keep it here now.

sure.  I was worried that people on -users might not be building
"release" from sources.

ps: there is another problem; WARNS?=4 in a makefile causes (usr.bin/xargs)

  .if ${WARNS} > 3
  CFLAGS+=        -std=c99
  .endif

which is not understood by the vax C compiler.  Probably a gcc version skew
problem only on the vax.

-brad

--- src/dist/file/src/file.h.~1.10.6.2.~        2007-06-24 15:45:34.000000000 -\
0400
+++ src/dist/file/src/file.h    2009-01-23 07:23:16.000000000 -0500
@@ -85,9 +85,11 @@
 #endif
 #endif

+#if 0
 #ifndef MIN
 #define        MIN(a,b)        (((a) < (b)) ? (a) : (b))
 #endif
+#endif

 #ifndef HOWMANY
 # define HOWMANY (256 * 1024)  /* how much of the file to look at */
--- src/dist/file/src/softmagic.c.~1.2.6.1.~    2007-06-24 15:45:38.000000000 -\
0400
+++ src/dist/file/src/softmagic.c       2009-01-23 07:23:57.000000000 -0500
@@ -38,6 +38,9 @@
 #include <stdlib.h>
 #include <time.h>

+#ifndef MIN
+#define        MIN(a,b)        (((a) < (b)) ? (a) : (b))
+#endif

 #ifndef        lint
 #if 0



Home | Main Index | Thread Index | Old Index