[Glibc-bsd-commits] r1404 - in trunk/freebsd-libs/debian: . patches

Robert Millan rmh at costa.debian.org
Wed Mar 29 18:36:30 UTC 2006


Author: rmh
Date: 2006-03-29 18:36:29 +0000 (Wed, 29 Mar 2006)
New Revision: 1404

Removed:
   trunk/freebsd-libs/debian/patches/03_glibc_libusbhid.diff
Modified:
   trunk/freebsd-libs/debian/control
   trunk/freebsd-libs/debian/patches/01_glibc_libcam.diff
   trunk/freebsd-libs/debian/patches/04_glibc_libkvm.diff
   trunk/freebsd-libs/debian/rules
Log:
- First build on amd64.
- Lots of cleanup: remove functions that are in libfreebsd, use dynamic regexps to get rid of many patch hunks, reenable commented code (thanks to new functions in libfreebsd).

Modified: trunk/freebsd-libs/debian/control
===================================================================
--- trunk/freebsd-libs/debian/control	2006-03-29 18:34:18 UTC (rev 1403)
+++ trunk/freebsd-libs/debian/control	2006-03-29 18:36:29 UTC (rev 1404)
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd at lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32 at debian.org>
-Build-Depends: debhelper (>= 4.1.0), kfreebsd-source-5.4, freebsd5-buildutils, libbsd-dev, libfreebsd-dev, libgdbm-dev
+Build-Depends: debhelper (>= 4.1.0), kfreebsd-source-5.4, freebsd5-buildutils, libbsd-dev, libfreebsd-dev, libgdbm-dev, kfreebsd-kernel-headers (>= 0.17) [kfreebsd-amd64]
 Standards-Version: 3.6.2
 
 Package: libsbuf0

Modified: trunk/freebsd-libs/debian/patches/01_glibc_libcam.diff
===================================================================
--- trunk/freebsd-libs/debian/patches/01_glibc_libcam.diff	2006-03-29 18:34:18 UTC (rev 1403)
+++ trunk/freebsd-libs/debian/patches/01_glibc_libcam.diff	2006-03-29 18:36:29 UTC (rev 1404)
@@ -12,8 +12,8 @@
  INCS=		camlib.h
  
 -DPADD=		${LIBSBUF}
--LDADD=		-lsbuf
-+LDADD=		-L../libsbuf/ -lsbuf -lbsd
+-LDADD+=		-lsbuf
++LDADD+=		-L../libsbuf/ -lsbuf
  
  MAN=		cam.3 cam_cdbparse.3
  
@@ -31,34 +31,31 @@
  CFLAGS+=	-I${.CURDIR} -I${SDIR}
  
  .include <bsd.lib.mk>
-diff -ur lib.old/libcam/camlib.c lib/libcam/camlib.c
---- lib.old/libcam/camlib.c	2004-07-29 17:35:45.000000000 +0200
-+++ lib/libcam/camlib.c	2005-08-15 08:23:38.000000000 +0200
-@@ -24,10 +24,12 @@
+--- lib/libcam/camlib.h~	2006-03-29 19:40:09.000000000 +0200
++++ lib/libcam/camlib.h	2006-03-29 19:41:25.000000000 +0200
+@@ -150,13 +150,11 @@
+ /*
+  * Buffer encoding/decoding routines, from the old SCSI library.
   */
- 
- #include <sys/cdefs.h>
--__FBSDID("$FreeBSD: src/lib/libcam/camlib.c,v 1.12 2004/07/29 15:35:45 scottl Exp $");
- 
- #include <sys/types.h>
- #include <sys/param.h>
-+#ifndef __FreeBSD__
-+#include <bsd/bsd.h>		/* strlcpy */
-+#endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-diff -ur lib.old/libcam/camlib.h lib/libcam/camlib.h
---- lib.old/libcam/camlib.h	2002-04-24 01:58:20.000000000 +0200
-+++ lib/libcam/camlib.h	2005-08-13 11:06:04.000000000 +0200
-@@ -64,6 +64,10 @@
- #ifndef _CAMLIB_H
- #define _CAMLIB_H
- 
-+#ifndef __FreeBSD__
-+#include <bsd/bsd.h>
-+#endif
-+
- #include <sys/cdefs.h>
- #include <sys/param.h>
- 
+-int csio_decode(struct ccb_scsiio *csio, const char *fmt, ...)
+-		__printflike(2, 3);
++int csio_decode(struct ccb_scsiio *csio, const char *fmt, ...);
+ int csio_decode_visit(struct ccb_scsiio *csio, const char *fmt,
+ 		      void (*arg_put)(void *, int, void *, int, char *),
+ 		      void *puthook);
+-int buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...)
+-		__printflike(3, 4);
++int buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...);
+ int buff_decode_visit(u_int8_t *buff, size_t len, const char *fmt,
+ 		      void (*arg_put)(void *, int, void *, int, char *),
+ 		      void *puthook);
+@@ -168,8 +166,7 @@
+ 		     int timeout, const char *cmd_spec,
+ 		     int (*arg_get)(void *hook, char *field_name),
+ 		     void *gethook);
+-int csio_encode(struct ccb_scsiio *csio, const char *fmt, ...)
+-		__printflike(2, 3);
++int csio_encode(struct ccb_scsiio *csio, const char *fmt, ...);
+ int buff_encode_visit(u_int8_t *buff, size_t len, const char *fmt,
+ 		      int (*arg_get)(void *hook, char *field_name),
+ 		      void *gethook);

Deleted: trunk/freebsd-libs/debian/patches/03_glibc_libusbhid.diff
===================================================================
--- trunk/freebsd-libs/debian/patches/03_glibc_libusbhid.diff	2006-03-29 18:34:18 UTC (rev 1403)
+++ trunk/freebsd-libs/debian/patches/03_glibc_libusbhid.diff	2006-03-29 18:36:29 UTC (rev 1404)
@@ -1,19 +0,0 @@
---- lib.old/libusbhid/Makefile	2005-12-18 04:40:52.000000000 +0100
-+++ lib/libusbhid/Makefile	2005-12-18 04:41:23.000000000 +0100
-@@ -21,4 +21,6 @@
- 
- INCS=	usbhid.h
- 
-+LDADD=  -lbsd
-+
- .include <bsd.lib.mk>
---- lib.old/libusbhid/usage.c	2005-12-18 04:42:25.000000000 +0100
-+++ lib/libusbhid/usage.c	2005-12-18 04:42:42.000000000 +0100
-@@ -35,6 +35,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <bsd/bsd.h>
- 
- #include "usbhid.h"
- 

Modified: trunk/freebsd-libs/debian/patches/04_glibc_libkvm.diff
===================================================================
--- trunk/freebsd-libs/debian/patches/04_glibc_libkvm.diff	2006-03-29 18:34:18 UTC (rev 1403)
+++ trunk/freebsd-libs/debian/patches/04_glibc_libkvm.diff	2006-03-29 18:36:29 UTC (rev 1404)
@@ -19,50 +19,11 @@
  #include <string.h>
  #include <unistd.h>
  
-+#include <bsd/bsd.h>
 +
++
  #include "kvm_private.h"
  
  /* from src/lib/libc/gen/nlist.c */
-@@ -80,7 +84,19 @@
- 	return (kd->errbuf);
- }
- 
--#include <stdarg.h>
-+const char *
-+getbootfile(void)
-+{
-+	static char name[MAXPATHLEN];
-+	size_t size = sizeof name;
-+	int mib[2];
-+
-+	mib[0] = CTL_KERN;
-+	mib[1] = KERN_BOOTFILE;
-+	if (sysctl(mib, 2, name, &size, NULL, 0) == -1)
-+		return ("/boot/kernel/kernel");
-+	return (name);
-+}
- 
- /*
-  * Report an error using printf style arguments.  "program" is kd->program
-@@ -235,7 +251,7 @@
- kvm_openfiles(uf, mf, sf, flag, errout)
- 	const char *uf;
- 	const char *mf;
--	const char *sf __unused;
-+	const char *sf;
- 	int flag;
- 	char *errout;
- {
-@@ -254,7 +270,7 @@
- kvm_open(uf, mf, sf, flag, errstr)
- 	const char *uf;
- 	const char *mf;
--	const char *sf __unused;
-+	const char *sf;
- 	int flag;
- 	const char *errstr;
- {
 diff -Nur lib.old/lib/libkvm/kvm_file.c lib/libkvm/kvm_file.c
 --- lib.old/lib/libkvm/kvm_file.c	2003-07-31 23:44:31.000000000 +0200
 +++ lib/libkvm/kvm_file.c	2005-12-20 11:32:50.000000000 +0100
@@ -133,29 +94,6 @@
 diff -Nur lib.old/lib/libkvm/kvm_getswapinfo.c lib/libkvm/kvm_getswapinfo.c
 --- lib.old/lib/libkvm/kvm_getswapinfo.c	2004-07-31 20:49:53.000000000 +0200
 +++ lib/libkvm/kvm_getswapinfo.c	2005-12-20 12:00:15.000000000 +0100
-@@ -47,6 +47,8 @@
- #include <unistd.h>
- #include <limits.h>
- 
-+#include <bsd/bsd.h>
-+
- #include "kvm_private.h"
- 
- #define NL_SWAPBLIST	0
-@@ -118,11 +120,13 @@
- 		return -1;
- 
- 	mibi = SWI_MAXMIB - 1;
-+#if 0
- 	if (sysctlnametomib("vm.swap_info", soid, &mibi) == -1) {
- 		_kvm_err(kd, kd->program, "sysctlnametomib failed: %s",
- 		    strerror(errno));
- 		return -1;
- 	}
-+#endif
- 	bzero(&tot, sizeof(tot));
- 	for (unswdev = 0;; unswdev++) {
- 		soid[mibi] = unswdev;
 @@ -151,8 +155,10 @@
  			swap_ary[unswdev].ksw_total = ttl;
  			swap_ary[unswdev].ksw_used = xsd.xsw_used;
@@ -190,15 +128,6 @@
 diff -Nur lib.old/lib/libkvm/kvm_proc.c lib/libkvm/kvm_proc.c
 --- lib.old/lib/libkvm/kvm_proc.c	2005-03-01 10:30:14.000000000 +0100
 +++ lib/libkvm/kvm_proc.c	2005-12-20 12:03:51.000000000 +0100
-@@ -77,6 +77,8 @@
- #include <memory.h>
- #include <paths.h>
- 
-+#include <bsd/bsd.h>
-+
- #include "kvm_private.h"
- 
- #define KREAD(kd, addr, obj) \
 @@ -94,6 +96,7 @@
  	struct kinfo_proc *bp;
  	int maxcnt;

Modified: trunk/freebsd-libs/debian/rules
===================================================================
--- trunk/freebsd-libs/debian/rules	2006-03-29 18:34:18 UTC (rev 1403)
+++ trunk/freebsd-libs/debian/rules	2006-03-29 18:36:29 UTC (rev 1404)
@@ -9,7 +9,7 @@
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
-CFLAGS = -Wall -g -pipe -fPIC -D__FBSDID\(s\)= -I.
+CFLAGS = -Wall -g -pipe -fPIC -I. -D_GNU_SOURCE
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 	CFLAGS += -O0
@@ -20,14 +20,24 @@
 SRC_DIR=lib
 PATH:=/usr/lib/freebsd:$(PATH)
 DESTDIR=$(CURDIR)/debian/tmp
-PMAKE=make DESTDIR=$(DESTDIR) CFLAGS="$(CFLAGS)"
+PMAKE=make COPTS="$(CFLAGS)" CFLAGS="$(CFLAGS)" NO_WERROR=1 NOGCCERROR=1 NOSHARED=NO NO_SHARED=NO DESTDIR=$(DESTDIR)
+export LDADD=-lbsd -lfreebsd
 
 $(SRC_DIR):
 	tar -xzf $(CURDIR)/lib.tar.gz
 	tar -C $(SRC_DIR) -xjf /usr/src/kfreebsd-source-5.4.tar.bz2 kfreebsd-source-5.4/sys/kern/subr_sbuf.c kfreebsd-source-5.4/sys/cam
 	mv $(SRC_DIR)/kfreebsd-source-5.4 $(SRC_DIR)/kernel
+
+	find $(SRC_DIR) -type f | (set -e ; while read i ; do sed -i $$i \
+		-e "/^__FBSDID/d" \
+		-e "s/[ \t]*__\(dead2\|unused\|result\\)[ \t]*//g" \
+		-e "s,<sys/queue\.h>,<bsd/queue.h>,g" \
+		-e "s,<sys/iconv\.h>,<iconv.h>,g" \
+		-e "s/^LDADD=/LDADD+=/g" \
+		-e "s/getline/bsd_&/g" \
+	; done)
 	
-	for i in $(CURDIR)/debian/patches/*.diff ; do \
+	set -e ; for i in $(CURDIR)/debian/patches/*.diff ; do \
 		echo "--- Patch $$i ---" ; \
 		patch -p1 -d $(SRC_DIR) < $$i ; \
 	done




More information about the Glibc-bsd-commits mailing list