[Glibc-bsd-commits] r3237 - in trunk/kfreebsd-8/debian: . patches

Robert Millan rmh at alioth.debian.org
Sat Jan 22 11:08:00 UTC 2011


Author: rmh
Date: 2011-01-22 11:07:58 +0000 (Sat, 22 Jan 2011)
New Revision: 3237

Modified:
   trunk/kfreebsd-8/debian/changelog
   trunk/kfreebsd-8/debian/control.flavor.in
   trunk/kfreebsd-8/debian/control.in
   trunk/kfreebsd-8/debian/patches/008_config.diff
   trunk/kfreebsd-8/debian/rules
Log:
Make this package buildable on GNU/Linux.  (Closes: #602768)

Modified: trunk/kfreebsd-8/debian/changelog
===================================================================
--- trunk/kfreebsd-8/debian/changelog	2011-01-18 09:31:22 UTC (rev 3236)
+++ trunk/kfreebsd-8/debian/changelog	2011-01-22 11:07:58 UTC (rev 3237)
@@ -4,8 +4,11 @@
   * Extend 108_teken_utf8_table.diff for middle-dot l/L.
     Closes: #609681. Thanks to Robert Millan.
 
- -- Robert Millan <rmh at debian.org>  Wed, 12 Jan 2011 07:54:31 +0100
+  [ Robert Millan ]
+  * Make this package buildable on GNU/Linux.  (Closes: #602768)
 
+ -- Robert Millan <rmh at debian.org>  Sat, 22 Jan 2011 12:07:11 +0100
+
 kfreebsd-8 (8.2~rc1+dfsg-0.1) experimental; urgency=low
 
   * Non-maintainer upload.

Modified: trunk/kfreebsd-8/debian/control.flavor.in
===================================================================
--- trunk/kfreebsd-8/debian/control.flavor.in	2011-01-18 09:31:22 UTC (rev 3236)
+++ trunk/kfreebsd-8/debian/control.flavor.in	2011-01-22 11:07:58 UTC (rev 3237)
@@ -1,5 +1,5 @@
 Package: kfreebsd-image- at version@- at abiname@- at flavor@
-Architecture: kfreebsd- at arch@
+Architecture: any- at arch@
 Depends: freebsd-utils (>= 5), kldutils (>= 7.1), ${misc:Depends}
 Conflicts: kfreebsd-loader (<< 5.4-1.3)
 Provides: kfreebsd-image- at major@, kfreebsd-image
@@ -11,14 +11,14 @@
  This package is compiled for a @flavor at -class machine.
 
 Package: kfreebsd-image- at major@- at flavor@
-Architecture: kfreebsd- at arch@
+Architecture: any- at arch@
 Depends: kfreebsd-image- at version@- at abiname@- at flavor@, ${misc:Depends}
 Description: kernel of FreeBSD @major@ image
  This package depends on the latest binary image for kernel of FreeBSD @major@ on
  @flavor at -class machines.
 
 Package: kfreebsd-headers- at version@- at abiname@- at flavor@
-Architecture: kfreebsd- at arch@
+Architecture: any- at arch@
 Provides: kfreebsd-headers- at major@
 Depends: kfreebsd-headers- at version@- at abiname@ (= ${binary:Version}), ${misc:Depends}
 Description: header files for kernel of FreeBSD @version@
@@ -29,7 +29,7 @@
  kfreebsd-image- at version@- at abiname@- at flavor@ package.
 
 Package: kfreebsd-headers- at major@- at flavor@
-Architecture: kfreebsd- at arch@
+Architecture: any- at arch@
 Depends: kfreebsd-headers- at version@- at abiname@- at flavor@, ${misc:Depends}
 Description: header files for kernel of FreeBSD @major@
  This package depends on the latest header files for kernel of FreeBSD @major@ on

Modified: trunk/kfreebsd-8/debian/control.in
===================================================================
--- trunk/kfreebsd-8/debian/control.in	2011-01-18 09:31:22 UTC (rev 3236)
+++ trunk/kfreebsd-8/debian/control.in	2011-01-22 11:07:58 UTC (rev 3237)
@@ -6,8 +6,8 @@
 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, quilt, sharutils, flex-old | flex,
- freebsd-buildutils (>= 7) [kfreebsd-any], gcc-4.3 [kfreebsd-any], libdb-dev,
- libbsd-dev [kfreebsd-any], libsbuf-dev [kfreebsd-any]
+ freebsd-buildutils (>= 8.1-2), gcc-4.3, libdb-dev,
+ libbsd-dev, libsbuf-dev
 Standards-Version: 3.9.1
 
 Package: kfreebsd-source- at version@
@@ -20,7 +20,7 @@
  a GNU/kFreeBSD system.
 
 Package: kfreebsd-headers- at version@- at abiname@
-Architecture: kfreebsd-any
+Architecture: any
 Depends: ${misc:Depends}
 Description: Common architecture-specific header files for kernel of FreeBSD @version@
  This package provides the architecture-specific common kernel header files for 

Modified: trunk/kfreebsd-8/debian/patches/008_config.diff
===================================================================
--- trunk/kfreebsd-8/debian/patches/008_config.diff	2011-01-18 09:31:22 UTC (rev 3236)
+++ trunk/kfreebsd-8/debian/patches/008_config.diff	2011-01-22 11:07:58 UTC (rev 3237)
@@ -3,23 +3,17 @@
 Status: gotta uncomment WARNS (see #351366), and find a portable way to add
   "-lbsd".  after this it can be sent upstream.
 
---- a/usr.sbin/config/Makefile
-+++ b/usr.sbin/config/Makefile
-@@ -9,11 +9,11 @@
- kernconf.c: kernconf.tmpl
- 	file2c 'char kernconfstr[] = {' ',0};' < ${.CURDIR}/kernconf.tmpl > kernconf.c
+--- a/usr.sbin/config/config.h
++++ b/usr.sbin/config/config.h
+@@ -34,7 +34,7 @@
+  * Config.
+  */
+ #include <sys/types.h>
+-#include <sys/queue.h>
++#include <bsd/sys/queue.h>
+ #include <stdlib.h>
+ #include <string.h>
  
--WARNS?=	6
--CFLAGS+= -I. -I${.CURDIR}
-+#WARNS?=	6
-+CFLAGS+= -I. -I${.CURDIR} -D_GNU_SOURCE
- 
- DPADD=	${LIBL} ${LIBSBUF}
--LDADD=	-ll -lsbuf
-+LDADD=	-ll -lsbuf -lbsd
- 
- CLEANFILES+=	kernconf.c
- 
 --- a/usr.sbin/config/main.c
 +++ b/usr.sbin/config/main.c
 @@ -41,12 +41,17 @@
@@ -41,7 +35,7 @@
  
  #include <assert.h>
  #include <ctype.h>
-@@ -605,7 +610,11 @@
+@@ -607,7 +612,11 @@
  	if ((dirp = opendir(p)) == NULL)
  		err(EX_OSERR, "opendir %s", p);
  	while ((dp = readdir(dirp)) != NULL) {
@@ -53,3 +47,20 @@
  		/* Skip non-headers */
  		if (dp->d_name[i] != '.' || dp->d_name[i + 1] != 'h')
  			continue;
+--- a/usr.sbin/config/Makefile
++++ b/usr.sbin/config/Makefile
+@@ -9,11 +9,11 @@
+ kernconf.c: kernconf.tmpl
+ 	file2c 'char kernconfstr[] = {' ',0};' < ${.CURDIR}/kernconf.tmpl > kernconf.c
+ 
+-WARNS?=	6
+-CFLAGS+= -I. -I${.CURDIR}
++#WARNS?=	6
++CFLAGS+= -I. -I${.CURDIR} -D_GNU_SOURCE
+ 
+ DPADD=	${LIBL} ${LIBSBUF}
+-LDADD=	-ll -lsbuf
++LDADD=	-ll -lsbuf -lbsd
+ 
+ CLEANFILES+=	kernconf.c
+ 

Modified: trunk/kfreebsd-8/debian/rules
===================================================================
--- trunk/kfreebsd-8/debian/rules	2011-01-18 09:31:22 UTC (rev 3236)
+++ trunk/kfreebsd-8/debian/rules	2011-01-22 11:07:58 UTC (rev 3237)
@@ -12,12 +12,12 @@
 version		:= $(shell echo $(full_version) | sed -e 's/[~+-].*//g')
 major           := $(shell echo $(version) | sed -e 's/\..*//g')
 revision	:= $(shell echo $(full_version) | sed -e 's/^[^+-]*//g')
-os		:= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 cpu		:= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
 config_files	:= $(wildcard debian/arch/$(cpu)/*.config)
 flavours	:= $(config_files:debian/arch/$(cpu)/%.config=%)
 configfile	:= DEBCUSTOM
 abiname		:= 0
+ld_target	:= $(shell ld --help | sed -ne "s/^ld: supported targets: \([^ ]*\) .*/\1/p")
 
 #SVN		:= http://svn.freebsd.org/base/release/$(version).0
 SVN		:= http://svn.freebsd.org/base/releng/$(version)
@@ -76,11 +76,14 @@
 	mkdir $(CURDIR)/src
 	cp -af $(CURDIR)/sys $(CURDIR)/usr.sbin $(CURDIR)/src
 
-	set -e ; find src -type f | (while read i ; do \
+	set -e ; find src/sys -type f | (while read i ; do \
 		sed -i $$i \
-		-e 's/defined\( \|\t\)*(\( \|\t\)*__FreeBSD__\( \|\t\)*)/defined(__FreeBSD_kernel__)/g' \
-		-e 's/#\( \|\t\)*ifdef\( \|\t\)*__FreeBSD__/#ifdef __FreeBSD_kernel__/g' \
-		-e 's/#\( \|\t\)*ifndef\( \|\t\)*__FreeBSD__/#ifndef __FreeBSD_kernel__/g' \
+		-e 's/defined\( \|\t\)*(\( \|\t\)*__FreeBSD__\( \|\t\)*)/1/g' \
+		-e 's/#\( \|\t\)*ifdef\( \|\t\)*__FreeBSD__/#if 1/g' \
+		-e 's/#\( \|\t\)*ifndef\( \|\t\)*__FreeBSD__/#if 0/g' \
+		-e 's/defined\( \|\t\)*(\( \|\t\)*\(__linux__\|linux\)\( \|\t\)*)/0/g' \
+		-e 's/#\( \|\t\)*ifdef\( \|\t\)*\(__linux__\|linux\)/#if 0/g' \
+		-e 's/#\( \|\t\)*ifndef\( \|\t\)*\(__linux__\|linux\)/#if 1/g' \
 		-e 's/__FreeBSD__/$(major)/g' \
 		-e 's,#\( \|\t\)*include\( \|\t\)*<sys/device.h>,,g' \
 		-e 's,#\( \|\t\)*include\( \|\t\)*<dev/rndvar.h>,,g' \
@@ -102,11 +105,7 @@
 
 	touch build-indep-stamp
 
-ifeq ($(os), kfreebsd)
 build: build-arch build-indep
-else
-build: build-indep
-endif
 
 install-indep: install-indep-stamp
 install-indep-stamp: build-indep
@@ -121,14 +120,18 @@
 
 	touch install-indep-stamp
 
-config: src
+config: config-stamp
+config-stamp: src
+	rm -rf config
 	cp -af src/usr.sbin/config config
-	$(MAKE) -C config
+	CFLAGS="-D__va_list=__builtin_va_list" $(MAKE) -C config
+	touch $@
 
 build-arch: $(foreach flavor,$(flavours),build-flavor-$(flavor)-stamp)
-build-flavor-%-stamp: src config
+src-flavor-%-stamp: src config
 	cp -af src $(FLAVOR_DIR)-$*
-
+	touch $@
+build-flavor-%-stamp: src-flavor-%-stamp
 	# Add the abiname and the flavor to the kernel version
 	sed -i -e 's/^RELEASE=".*"/RELEASE="$(version)-$(abiname)-$*"/g' $(FLAVOR_DIR)-$*/sys/conf/newvers.sh
 
@@ -139,6 +142,14 @@
 	sed -i -e 's,^KODIR?=.*,KODIR="/lib/modules/$(version)-$(abiname)-$*",g' $(FLAVOR_DIR)-$*/sys/conf/kern.pre.mk
 	sed -i -e '/^static char linker_path/s,".*","/lib/modules/$(version)-$(abiname)-$*",g' $(FLAVOR_DIR)-$*/sys/kern/kern_linker.c 
 
+	# Always set explicit link target to match with ld's implicit target (needed
+	# to build on non-kFreeBSD)
+ifeq ($(cpu), amd64)
+	sed -i -e 's/elf64-x86-64-freebsd/$(ld_target)/g' $(FLAVOR_DIR)-$*/sys/conf/ldscript.amd64
+else ifeq ($(cpu), i386)
+	sed -i -e 's/elf32-i386-freebsd/$(ld_target)/g' $(FLAVOR_DIR)-$*/sys/conf/ldscript.i386
+endif
+
 	# Configure the kernel
 	cp debian/arch/$(cpu)/$*.config $(FLAVOR_DIR)-$*/sys/$(cpu)/conf/
 	cat $(FLAVOR_DIR)-$*/sys/$(cpu)/conf/GENERIC >> $(FLAVOR_DIR)-$*/sys/$(cpu)/conf/$*.config
@@ -255,7 +266,6 @@
 	dh_builddeb -i
 
 # Build architecture-dependent files here.
-ifeq ($(os), kfreebsd)
 binary-arch: build-arch install-arch
 	dh_testdir
 	dh_testroot
@@ -271,10 +281,6 @@
 	dh_gencontrol -s
 	dh_md5sums -s
 	dh_builddeb -s
-else
-binary-arch:
-	# We have nothing to do
-endif
 
 binary: binary-indep binary-arch
 




More information about the Glibc-bsd-commits mailing list