unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11797: trunk does not build on NetBSD
@ 2012-06-27  9:44 Herbert J. Skuhra
  2012-06-28  0:05 ` Glenn Morris
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Herbert J. Skuhra @ 2012-06-27  9:44 UTC (permalink / raw)
  To: 11797

[-- Attachment #1: Type: text/plain, Size: 2944 bytes --]

Hi,

I get the following error when I run 'gmake bootstrap' on NetBSD-current:

sysdep.c:2528:16: error: 'CTL_KERN' undeclared (first use in this function)
sysdep.c:2528:16: note: each undeclared identifier is reported only
once for each function it appears in
sysdep.c:2528:26: error: 'KERN_PROC' undeclared (first use in this function)
sysdep.c:2528:37: error: 'KERN_PROC_PROC' undeclared (first use in
this function)
sysdep.c:2537:3: warning: implicit declaration of function 'sysctl'
sysdep.c:2548:18: error: invalid application of 'sizeof' to incomplete
type 'struct kinfo_proc'
sysdep.c:2548:7: warning: division by zero
sysdep.c:2554:7: error: invalid use of undefined type 'struct kinfo_proc'
sysdep.c:2554:25: error: dereferencing pointer to incomplete type
sysdep.c:2554:25: error: request for member 'ki_pid' in something not
a structure or union
sysdep.c:2554:7: error: invalid use of undefined type 'struct kinfo_proc'
sysdep.c:2554:25: error: dereferencing pointer to incomplete type
sysdep.c:2554:25: error: request for member 'ki_pid' in something not
a structure or union
sysdep.c:2554:25: warning: comparison between pointer and integer
sysdep.c:2554:7: error: invalid use of undefined type 'struct kinfo_proc'
sysdep.c:2554:25: error: dereferencing pointer to incomplete type
sysdep.c:2554:25: error: request for member 'ki_pid' in something not
a structure or union
sysdep.c:2554:25: warning: comparison between pointer and integer
sysdep.c:2554:7: error: invalid use of undefined type 'struct kinfo_proc'
sysdep.c:2554:25: error: dereferencing pointer to incomplete type
sysdep.c:2554:25: error: request for member 'ki_pid' in something not
a structure or union
sysdep.c:2554:7: error: incompatible type for argument 1 of 'make_float'
lisp.h:2744:20: note: expected 'double' but argument is of type 'int *'
sysdep.c:2554:7: error: invalid use of undefined type 'struct kinfo_proc'
sysdep.c:2554:25: error: dereferencing pointer to incomplete type
sysdep.c:2554:25: error: request for member 'ki_pid' in something not
a structure or union
sysdep.c:2554:25: warning: pointer/integer type mismatch in
conditional expression
sysdep.c:2554:7: warning: passing argument 1 of 'Fcons' makes integer
from pointer without a cast
lisp.h:2687:1: note: expected 'Lisp_Object' but argument is of type 'int *'
gmake[2]: *** [sysdep.o] Error 1
gmake[2]: Leaving directory `/home/herbert/source/emacs/trunk/src'
gmake[1]: *** [src] Error 2
gmake[1]: Leaving directory `/home/herbert/source/emacs/trunk'
gmake: *** [bootstrap] Error 2

% uname -rms
NetBSD 6.99.8 amd64
% bzr revno
108764
% ./autogen.sh
% CPPFLAGS='-I/usr/pkg/include' LDFLAGS='-L/usr/pkg/lib' ./configure
--prefix=/usr/local/emacs --with-x-toolkit=gtk3
% gmake bootstrap

Notes:

1. I have to modify the configure script so that it checks for -lpng15
instead of -lpng
2. I have to revert 108471 (see my notes to bug #11398)

The attached patch fixes the build.

-- 
Herbert

[-- Attachment #2: patch_src_sysdep_c.txt --]
[-- Type: text/plain, Size: 831 bytes --]

--- src/sysdep.c.bak	2012-06-27 11:32:44.000000000 +0200
+++ src/sysdep.c	2012-06-27 11:34:21.000000000 +0200
@@ -45,7 +45,7 @@
 #include <math.h>
 #endif
 
-#ifdef DARWIN_OS
+#if defined(DARWIN_OS) || defined(__NetBSD__)
 #include <sys/sysctl.h>
 #endif
 
@@ -2522,7 +2522,7 @@
 Lisp_Object
 list_system_processes (void)
 {
-#ifdef DARWIN_OS
+#if defined(DARWIN_OS) || defined(__NetBSD__)
   int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL};
 #else
   int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC};
@@ -2548,7 +2548,7 @@
   len /= sizeof (struct kinfo_proc);
   for (i = 0; i < len; i++)
     {
-#ifdef DARWIN_OS
+#if defined(DARWIN_OS) || defined(__NetBSD__)
       proclist = Fcons (make_fixnum_or_float (procs[i].kp_proc.p_pid), proclist);
 #else
       proclist = Fcons (make_fixnum_or_float (procs[i].ki_pid), proclist);

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-07-13  1:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-27  9:44 bug#11797: trunk does not build on NetBSD Herbert J. Skuhra
2012-06-28  0:05 ` Glenn Morris
2012-06-28 10:18   ` Herbert J. Skuhra
2012-06-28 17:29     ` Glenn Morris
2012-07-07  2:35 ` Paul Eggert
2012-07-07  9:14 ` Han Boetes
2012-07-13  1:27 ` bug#11797: fixed in trunk Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).