kern/93502: [patch] Fixes for non-FreeBSD in sys/conf/*.mk
Robert Millan
rmh at aybabtu.com
Fri Feb 17 15:00:27 PST 2006
>Number: 93502
>Category: kern
>Synopsis: [patch] Fixes for non-FreeBSD in sys/conf/*.mk
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Feb 17 23:00:25 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Robert Millan
>Release: GNU/kFreeBSD 7.0-1-686 i686
>Organization:
>Environment:
System: GNU/kFreeBSD orthanc 7.0-1-686 #0 Fri Feb 17 22:46:33 CET 2006 i686 i386 Intel(R) Pentium(R) 4 CPU 1.80GHz GNU/kFreeBSD
Architecture: i686
>Description:
Please could you apply a pair of fixes in sys/conf/*.mk to support
building the kernel of FreeBSD in a non-FreeBSD system?
- On non-FreeBSD systems:
- disable FreeBSD extensions to GCC
- install modules as group "root" instead of "wheel"
Thanks for considering
>How-To-Repeat:
>Fix:
diff -ur sys.old/conf/kern.mk sys/conf/kern.mk
--- sys.old/conf/kern.mk 2006-02-17 20:25:31.000000000 +0100
+++ sys/conf/kern.mk 2006-02-17 20:34:31.000000000 +0100
@@ -1,5 +1,9 @@
# $FreeBSD: src/sys/conf/kern.mk,v 1.46 2005/07/15 11:45:30 ache Exp $
+.if !defined(OPSYS)
+OPSYS!= uname -s
+.endif
+
#
# Warning flags for compiling the kernel and components of the kernel.
#
@@ -9,10 +13,14 @@
.if ${CC} == "icc"
#CWARNFLAGS= -w2 # use this if you are terribly bored
CWARNFLAGS=
-.else
-CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
+.elif !defined(CWARNFLAGS)
+CWARNFLAGS= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
- -fformat-extensions -std=c99
+ -std=c99
+.if ${OPSYS} == "FreeBSD"
+# FreeBSD extensions, not available in upstream GCC
+CWARNFLAGS+= -fformat-extensions
+.endif
.endif
#
# The following flags are next up for working on:
@@ -30,8 +38,12 @@
# reserved for user applications.
#
.if ${MACHINE_ARCH} == "i386" && ${CC} != "icc"
-CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 \
+CFLAGS+= -mpreferred-stack-boundary=2 \
-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3
+.if ${OPSYS} == "FreeBSD"
+# FreeBSD extensions, not available in upstream GCC
+CFLAGS+= -mno-align-long-strings
+.endif
INLINE_LIMIT?= 8000
.endif
diff -ur sys.old/conf/kern.post.mk sys/conf/kern.post.mk
--- sys.old/conf/kern.post.mk 2006-02-17 20:25:31.000000000 +0100
+++ sys/conf/kern.post.mk 2006-02-17 20:35:39.000000000 +0100
@@ -1,5 +1,15 @@
# $FreeBSD: src/sys/conf/kern.post.mk,v 1.92 2006/02/07 13:37:26 ru Exp $
+.if !defined(OPSYS)
+OPSYS!= uname -s
+.endif
+
+.if ${OPSYS} == "FreeBSD"
+WHEEL_GROUP?= wheel
+.else
+WHEEL_GROUP?= root
+.endif
+
# Part of a unified Makefile for building kernels. This part includes all
# the definitions that need to be after all the % directives except %RULES
# and ones that act like they are part of %RULES.
@@ -226,16 +234,16 @@
fi
.endif
mkdir -p ${DESTDIR}${KODIR}
- ${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
+ ${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO} ${DESTDIR}${KODIR}
.if defined(DEBUG) && !defined(INSTALL_NODEBUG)
- ${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO}.symbols ${DESTDIR}${KODIR}
+ ${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR}
.endif
kernel-reinstall:
@-chflags -R noschg ${DESTDIR}${KODIR}
- ${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
+ ${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO} ${DESTDIR}${KODIR}
.if defined(DEBUG) && !defined(INSTALL_NODEBUG)
- ${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO}.symbols ${DESTDIR}${KODIR}
+ ${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR}
.endif
config.o env.o hints.o vers.o vnode_if.o:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list