Subject: Re: pkg/24861: mail/metamail doesn't build on linux
To: Jeremy C. Reed <reed@reedmedia.net>
From: Antonio Marques <froz@icix.org>
List: netbsd-bugs
Date: 03/21/2004 13:47:00
On Sat, 20 Mar 2004 10:46:21 -0800 (PST)
"Jeremy C. Reed" <reed@reedmedia.net> wrote:
> On Sat, 20 Mar 2004, Jeremy C. Reed wrote:
> 
> > MAKE_ENV+=	-DLINUX
> 
> Sorry, I meant MAKE_ARGS, but that didn't work.
> 
> But this partially works:
> CFLAGS.Linux+=  -DLINUX
> 
> Then I see that patches/patch-ab has:
> +#if !(defined(__sun__) && defined(__svr4__))
>  #define killpg(a, b) kill(-(a), (b))
> +#endif
> 
> which is wrong for Linux.
> 
> And under Linux the bzero should not be defined in config.h.

With "CFLAGS.Linux+=  -DLINUX" in the Makefile along with the following patch-ap,
this package should build fine.

$NetBSD$

--- config.h.orig	2004-03-21 13:27:01.000000000 +0000
+++ config.h
@@ -38,6 +38,8 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE
 
 #ifdef LINUX
 #define SYSV /* Linux is SysV */
+#define HAVE_KILLPG
+#define HAVE_BZERO
 #endif
 
 #ifdef SVR3
@@ -107,10 +109,14 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE
 
 #ifdef SYSV
 #if !(defined(__sun__) && defined(__svr4__))
+#ifndef HAVE_KILLPG
 #define killpg(a, b) kill(-(a), (b))
+#endif
 #endif
 #define bcopy(a, b, c) memcpy(b, a, c)
+#ifndef HAVE_BZERO
 #define bzero(a, b) memset(a, 0, b)
+#endif
 #define bcmp memcmp
 #define index strchr
 #define rindex strrchr

Please commit if this is ok.

--
Antonio Marques