Subject: Re: openoffice build broken under -current
To: None <tech-pkg@netbsd.org>
From: Rui-Xiang Guo <rxg@myrealbox.com>
List: tech-pkg
Date: 11/20/2004 15:30:04
--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

> [...]
> EAD   -o ../../unxbsdi2.pro/obj/system.o system.c
> In file included from system.c:62:
> system.h:172:1: warning: "ETIME" redefined
> In file included from /usr/include/errno.h:43,
>                  from system.h:69,
>                  from system.c:62:
> /usr/include/sys/errno.h:165:1: warning: this is the location of the previo=
> us definition
> system.c:102: error: conflicting types for `getpwnam_r'
> /usr/include/pwd.h:127: error: previous declaration of `getpwnam_r'
> system.c: In function `getpwuid_r':
> system.c:221: warning: assignment makes pointer from integer without a cast
> system.c:227: warning: assignment makes pointer from integer without a cast
> system.c:233: warning: return makes integer from pointer without a cast
> system.c: In function `gethostbyname_r':
> system.c:423: warning: assignment from incompatible pointer type
> system.c:435: warning: assignment from incompatible pointer type
> dmake:  Error code 1, while making '../../unxbsdi2.pro/obj/system.obj'
> ---* TG_SLO.MK *---
>
> ERROR: Error 65280 occurred while making /usr/pkgsrc/misc/openoffice/work/o=
> o_1.1.1_src/sal/osl/unx
> dmake:  Error code 1, while making 'build_all'
> ---* TG_SLO.MK *---
> *** Error code 255
>
> Stop.
> make: stopped in /usr/pkgsrc/misc/openoffice
> *** Error code 1

Hi, all.
These two patches work for me.
I think they also work for 1.6.x but need someone to test it. ;)

-rxg

--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-ad

--- ../sal/osl/unx/system.c.orig	2003-07-17 01:21:47.000000000 +0800
+++ ../sal/osl/unx/system.c	2004-11-19 10:46:49.000000000 +0800
@@ -97,8 +97,11 @@
 struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int size )
 #endif /* BUILD_OS_APPLEOSX */
 #else /* MACOSX */
+#if (__NetBSD_Version__ < 200000000)
 struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int size )
+#endif
 #endif /* MACOSX */
+#if (__NetBSD_Version__ < 200000000)
 {
   	struct passwd* res;
 
@@ -164,8 +167,9 @@
         return(res);
 #endif /* MACOSX */
 }
+#endif
 
-#if defined(NETBSD) || defined(MACOSX)
+#if defined(NETBSD) && (__NetBSD_Version__ < 200000000) || defined(MACOSX)
 int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer,
            size_t buflen, struct passwd **result)
 {
@@ -460,7 +464,7 @@
   	return res;
 }
 
-#if defined(MACOSX)
+#if defined(MACOSX) || defined(NETBSD)
 /*
  * This section works around calls that are missing or broken
  * in MacOS X 10.1.x and earlier.
@@ -504,6 +508,10 @@
     return nRet;
 }
 
+#endif
+
+#if defined(MACOSX)
+
 /* No reentrant asctime() either... */
 
 /*******************************************************************************/

--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-aw

--- ../sal/osl/unx/system.h.orig	2004-11-19 09:23:53.000000000 +0800
+++ ../sal/osl/unx/system.h	2004-11-19 09:27:55.000000000 +0800
@@ -169,7 +169,10 @@
 #endif
 
 #ifdef NETBSD
+#	include <sys/param.h>
+#if (__NetBSD_Version__ < 200000000)
 #	define  ETIME ETIMEDOUT
+#endif
 #	define _POSIX_THREAD_SYSCALL_SOFT 1
 #	include <pthread.h>
 #	include <netdb.h>

--FL5UXtIhxfXey3p5--