[Lcdproc] Autoconf fixes for Net/FreeBSD

Markus Dolze bsdfan@nurfuerspam.de
Sun Sep 2 22:19:02 2007


This is a multi-part message in MIME format.
--------------050301010201040008000508
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hello,

While trying to fix a big configure warning on FreeBSD I found that in
the NetBSD lcdproc client sys/sched.h is included. The configure script
tests for it producing a nasty warning on FreeBSD because sys/sched.h
cannot be included properly by user applications.

I found that on NetBSD <sched.h> already includes <sys/sched.h>, so I
removed the latter one.

Any NetBSD user available to test the change?

The check for <machine/cpufunc.h> also needs an additional prerequisite
header on FreeBSD for the configure script to successfully test for it.

Regards
Markus

--------------050301010201040008000508
Content-Type: text/plain;
 name="conf_sched.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="conf_sched.diff"

Index: configure.in
===================================================================
RCS file: /cvsroot/lcdproc/lcdproc/configure.in,v
retrieving revision 1.70
diff -u -r1.70 configure.in
--- configure.in	26 Aug 2007 21:07:42 -0000	1.70
+++ configure.in	2 Sep 2007 22:09:41 -0000
@@ -107,10 +107,17 @@
 ])
 
 dnl NetBSD, OpenBSD and FreeBSD
-AC_CHECK_HEADERS(sched.h sys/sched.h machine/cpufunc.h sys/types.h machine/pio.h machine/sysarch.h sys/cpuvar.h machine/apm_bios.h)
+AC_CHECK_HEADERS(sched.h sys/types.h machine/pio.h machine/sysarch.h sys/cpuvar.h machine/apm_bios.h)
 ETR_SYSV_IPC
 ETR_UNION_SEMUN
 
+dnl machine/cpufunc.h needs additional header on FreeBSD
+AC_CHECK_HEADERS([machine/cpufunc.h], [], [],
+[[#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+]])
+
 dnl sched_setscheduler on OpenBSD
 AC_CHECK_FUNCS(sched_setscheduler)
 AC_CHECK_LIB(posix4, sched_setscheduler, [
Index: clients/lcdproc/machine_NetBSD.c
===================================================================
RCS file: /cvsroot/lcdproc/lcdproc/clients/lcdproc/machine_NetBSD.c,v
retrieving revision 1.10
diff -u -r1.10 machine_NetBSD.c
--- clients/lcdproc/machine_NetBSD.c	7 Apr 2007 17:37:54 -0000	1.10
+++ clients/lcdproc/machine_NetBSD.c	2 Sep 2007 22:09:41 -0000
@@ -48,7 +48,7 @@
 #include <sys/ucred.h>
 #include <sys/mount.h>
 #include <sys/dkstat.h>
-#include <sys/sched.h>
+#include <sched.h>
 #include <uvm/uvm_extern.h>
 #include <machine/apmvar.h>
 #include <errno.h>

--------------050301010201040008000508--