[Glibc-bsd-commits] r3811 - in trunk/kfreebsd-10/debian: . patches

Robert Millan rmh at alioth.debian.org
Thu Nov 3 15:38:38 UTC 2011


Author: rmh
Date: 2011-11-03 15:38:38 +0000 (Thu, 03 Nov 2011)
New Revision: 3811

Added:
   trunk/kfreebsd-10/debian/patches/008_verioned_freebsd_macro.diff
   trunk/kfreebsd-10/debian/patches/920_linux_cflags.diff
Modified:
   trunk/kfreebsd-10/debian/changelog
   trunk/kfreebsd-10/debian/control.in
   trunk/kfreebsd-10/debian/patches/series
   trunk/kfreebsd-10/debian/rules
Log:
Replace sed kludge with a pair of patches (920_linux_cflags.diff and 008_verioned_freebsd_macro.diff).

Modified: trunk/kfreebsd-10/debian/changelog
===================================================================
--- trunk/kfreebsd-10/debian/changelog	2011-11-03 14:25:47 UTC (rev 3810)
+++ trunk/kfreebsd-10/debian/changelog	2011-11-03 15:38:38 UTC (rev 3811)
@@ -1,3 +1,10 @@
+kfreebsd-10 (10.0~svn226872-3) UNRELEASED; urgency=low
+
+  * Replace sed kludge with a pair of patches (920_linux_cflags.diff and
+    008_verioned_freebsd_macro.diff).
+
+ -- Robert Millan <rmh at debian.org>  Thu, 03 Nov 2011 16:38:13 +0100
+
 kfreebsd-10 (10.0~svn226872-2) experimental; urgency=low
 
   * Require ZFS v28 userland (Breaks: zfsutils (<< 8.3~)).

Modified: trunk/kfreebsd-10/debian/control.in
===================================================================
--- trunk/kfreebsd-10/debian/control.in	2011-11-03 14:25:47 UTC (rev 3810)
+++ trunk/kfreebsd-10/debian/control.in	2011-11-03 15:38:38 UTC (rev 3811)
@@ -6,7 +6,7 @@
 Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/kfreebsd-@major@/
 Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/kfreebsd-@major@/
 Build-Depends: debhelper (>= 5.0.0), bzip2, sharutils, flex-old | flex,
- freebsd-buildutils (>= 8.2-7) [!kfreebsd-any] | freebsd-buildutils (>= 7) [kfreebsd-any],
+ freebsd-buildutils (>= 8.2-8) [!kfreebsd-any] | freebsd-buildutils (>= 7) [kfreebsd-any],
  gcc- at gcc_version@, libdb-dev,
  libbsd-dev (>= 0.3.0), pkg-config,
  libsbuf-dev, libsbuf-dev (>= 8.2-2) | kfreebsd-kernel-headers (<< 0.56),

Added: trunk/kfreebsd-10/debian/patches/008_verioned_freebsd_macro.diff
===================================================================
--- trunk/kfreebsd-10/debian/patches/008_verioned_freebsd_macro.diff	                        (rev 0)
+++ trunk/kfreebsd-10/debian/patches/008_verioned_freebsd_macro.diff	2011-11-03 15:38:38 UTC (rev 3811)
@@ -0,0 +1,104 @@
+--- a/sys/contrib/ipfilter/netinet/ip_compat.h
++++ b/sys/contrib/ipfilter/netinet/ip_compat.h
+@@ -985,10 +985,10 @@
+ typedef struct mbuf mb_t;
+ # endif /* _KERNEL */
+ 
+-# if __FreeBSD__ < 3
++# if __FreeBSD_version < 300000
+ #  include <machine/spl.h>
+ # else
+-#  if __FreeBSD__ == 3
++#  if __FreeBSD_version < 400000
+ #   if defined(IPFILTER_LKM) && !defined(ACTUALLY_LKM_NOT_KERNEL)
+ #    define	ACTUALLY_LKM_NOT_KERNEL
+ #   endif
+--- a/sys/contrib/ipfilter/netinet/ip_proxy.c
++++ b/sys/contrib/ipfilter/netinet/ip_proxy.c
+@@ -63,7 +63,7 @@
+ # include <sys/stream.h>
+ # include <sys/kmem.h>
+ #endif
+-#if __FreeBSD__ > 2
++#if __FreeBSD_version >= 300000
+ # include <sys/queue.h>
+ #endif
+ #include <net/if.h>
+--- a/sys/dev/bktr/bktr_reg.h
++++ b/sys/dev/bktr/bktr_reg.h
+@@ -717,13 +717,13 @@
+ /* ioctl_cmd_t int on old versions, u_long on new versions */
+ /***********************************************************/
+ 
+-#if (__FreeBSD__ == 2)
+-typedef int ioctl_cmd_t;
+-#endif
+-
+ #if defined(__FreeBSD__)
++#if __FreeBSD_version >= 200000 && __FreeBSD_version < 300000
++typedef int ioctl_cmd_t;
++#else
+ typedef u_long ioctl_cmd_t;
+ #endif
++#endif
+ 
+ #if defined(__NetBSD__) || defined(__OpenBSD__)
+ typedef u_long ioctl_cmd_t;
+--- a/sys/kern/uipc_socket.c
++++ b/sys/kern/uipc_socket.c
+@@ -2828,7 +2828,7 @@
+ 	return (error);
+ }
+ 
+-/* XXX; prepare mbuf for (__FreeBSD__ < 3) routines. */
++/* XXX; prepare mbuf for (__FreeBSD_version < 300000) routines. */
+ int
+ soopt_getm(struct sockopt *sopt, struct mbuf **mp)
+ {
+@@ -2877,7 +2877,7 @@
+ 	return (0);
+ }
+ 
+-/* XXX; copyin sopt data into mbuf chain for (__FreeBSD__ < 3) routines. */
++/* XXX; copyin sopt data into mbuf chain for (__FreeBSD_version < 300000) routines. */
+ int
+ soopt_mcopyin(struct sockopt *sopt, struct mbuf *m)
+ {
+@@ -2906,7 +2906,7 @@
+ 	return (0);
+ }
+ 
+-/* XXX; copyout mbuf chain data into soopt for (__FreeBSD__ < 3) routines. */
++/* XXX; copyout mbuf chain data into soopt for (__FreeBSD_version < 300000) routines. */
+ int
+ soopt_mcopyout(struct sockopt *sopt, struct mbuf *m)
+ {
+--- a/sys/net/if_spppfr.c
++++ b/sys/net/if_spppfr.c
+@@ -25,7 +25,7 @@
+ 
+ #include <sys/param.h>
+ 
+-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
++#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
+ #include "opt_inet.h"
+ #include "opt_inet6.h"
+ #include "opt_ipx.h"
+@@ -45,7 +45,7 @@
+ #include <sys/sockio.h>
+ #include <sys/socket.h>
+ #include <sys/syslog.h>
+-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
++#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
+ #include <sys/random.h>
+ #endif
+ #include <sys/malloc.h>
+@@ -149,7 +149,7 @@
+ 	unsigned short  ptarget2;
+ } __packed;
+ 
+-#if defined(__FreeBSD__) && __FreeBSD__ >= 3 && __FreeBSD_version < 501113
++#if defined(__FreeBSD__) && __FreeBSD_version >= 300000 && __FreeBSD_version < 501113
+ #define	SPP_FMT		"%s%d: "
+ #define	SPP_ARGS(ifp)	(ifp)->if_name, (ifp)->if_unit
+ #else

Added: trunk/kfreebsd-10/debian/patches/920_linux_cflags.diff
===================================================================
--- trunk/kfreebsd-10/debian/patches/920_linux_cflags.diff	                        (rev 0)
+++ trunk/kfreebsd-10/debian/patches/920_linux_cflags.diff	2011-11-03 15:38:38 UTC (rev 3811)
@@ -0,0 +1,27 @@
+
+Rejected on freebsd-hackers:
+
+http://lists.freebsd.org/pipermail/freebsd-hackers/2011-July/thread.html#35854
+
+--- a/sys/conf/kern.pre.mk
++++ b/sys/conf/kern.pre.mk
+@@ -97,6 +97,8 @@
+ .endif
+ WERROR?= -Werror
+ 
++CFLAGS+= -Ulinux -U__linux__ -D__FreeBSD__
++
+ # XXX LOCORE means "don't declare C stuff" not "for locore.s".
+ ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}
+ 
+--- a/sys/conf/kmod.mk
++++ b/sys/conf/kmod.mk
+@@ -99,6 +99,8 @@
+ CFLAGS+=	-D_KERNEL
+ CFLAGS+=	-DKLD_MODULE
+ 
++CFLAGS+=	-Ulinux -U__linux__ -D__FreeBSD__
++
+ # Don't use any standard or source-relative include directories.
+ CSTD=		c99
+ NOSTDINC=	-nostdinc

Modified: trunk/kfreebsd-10/debian/patches/series
===================================================================
--- trunk/kfreebsd-10/debian/patches/series	2011-11-03 14:25:47 UTC (rev 3810)
+++ trunk/kfreebsd-10/debian/patches/series	2011-11-03 15:38:38 UTC (rev 3811)
@@ -5,6 +5,7 @@
 005_linux_cflags.diff
 006_mips_i8259_alloc.diff
 #007_clone_signals.diff
+008_verioned_freebsd_macro.diff
 #009_disable_duped_modules.diff
 020_linker.diff 
 #107_mount_update.diff
@@ -25,6 +26,7 @@
 917_disable_kgssapi.diff
 918_unix_socket_overflow.diff
 919_delete_key.diff
+920_linux_cflags.diff
 950_no_stack_protector.diff
 951_disable_mk_magic.diff
 999_config.diff

Modified: trunk/kfreebsd-10/debian/rules
===================================================================
--- trunk/kfreebsd-10/debian/rules	2011-11-03 14:25:47 UTC (rev 3810)
+++ trunk/kfreebsd-10/debian/rules	2011-11-03 15:38:38 UTC (rev 3811)
@@ -84,18 +84,6 @@
 	mkdir $(CURDIR)/src
 	cp -af $(CURDIR)/sys $(CURDIR)/usr.sbin $(CURDIR)/src
 
-	set -e ; find src/sys -type f | (while read i ; do \
-		sed -i $$i \
-		-e 's/defined\s*(\s*__FreeBSD__\s*)/1/g' \
-		-e 's/#\s*ifdef\s*__FreeBSD__\(\s\|$$\)/#if 1/g' \
-		-e 's/#\s*ifndef\s*__FreeBSD__\(\s\|$$\)/#if 0/g' \
-		-e 's/__FreeBSD__/$(major)/g' \
-		\
-		-e 's/defined\s*(\s*\(__linux__\|linux\)\s*)/0/g' \
-		-e 's/#\s*ifdef\s*\(__linux__\|linux\)\(\s\|$$\)/#if 0/g' \
-		-e 's/#\s*ifndef\s*\(__linux__\|linux\)\(\s\|$$\)/#if 1/g' \
-	; done)
-
 	install debian/gen-ld-u-options src/usr.sbin/config
 
 	touch src-stamp




More information about the Glibc-bsd-commits mailing list