From ebakke@steinbit.troll.no  Mon Dec 10 05:26:08 2001
Return-Path: <ebakke@steinbit.troll.no>
Received: from steinbit.troll.no (steinbit.troll.no [213.203.59.113])
	by hub.freebsd.org (Postfix) with ESMTP id C7BA537B416
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 10 Dec 2001 05:26:05 -0800 (PST)
Received: (from root@localhost)
	by steinbit.troll.no (8.11.6/8.11.3) id fBADMbe21925;
	Mon, 10 Dec 2001 14:22:37 +0100 (CET)
	(envelope-from ebakke)
Message-Id: <200112101322.fBADMbe21925@steinbit.troll.no>
Date: Mon, 10 Dec 2001 14:22:37 +0100 (CET)
From: "Erik H. Bakke" <ebakke@trolltech.com>
Reply-To: "Erik H. Bakke" <ebakke@trolltech.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Patch to generate usbdevs.h automatically in kernel build
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         32671
>Category:       kern
>Synopsis:       Patch to generate usbdevs.h automatically in kernel build
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    imp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 10 05:30:01 PST 2001
>Closed-Date:    Tue Jun 29 09:07:11 MDT 2004
>Last-Modified:  Tue Jun 29 09:07:11 MDT 2004
>Originator:     Erik H. Bakke
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD steinbit.troll.no 5.0-CURRENT FreeBSD 5.0-CURRENT #14: Sun Dec 9 20:12:22 CET 2001 root@steinbit.troll.no:/usr/src/sys/i386/compile/WETLANDER i386


	
>Description:
	This patch will make sure usbdevs.h and usbdevs_data.h are
	regenerated automatically when a kernel is built.  It is
	done from the depend target, so the files will be present and
	updated as early as possible in the build process.
	This eliminates the need for separately checked in and maintained
	versions of these files.

>How-To-Repeat:
	
>Fix:

--- kern.post.mk.bak	Sun Nov 11 07:16:53 2001
+++ kern.post.mk	Mon Dec 10 14:10:39 2001
@@ -76,7 +76,12 @@
 
 ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
 
-kernel-depend:
+# This rule makes sure usbdevs.h and usbdevs_data.h are updated from
+# usbdevs
+usbdevs:
+	cd ../../../dev/usb && ${MAKE} -f Makefile.usbdevs
+	
+kernel-depend: usbdevs
 .if defined(EXTRA_KERNELDEP)
 	${EXTRA_KERNELDEP}
 .endif



>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: "Erik H. Bakke" <ebakke@trolltech.com>
Cc: <FreeBSD-gnats-submit@FreeBSD.ORG>
Subject: Re: kern/32671: Patch to generate usbdevs.h automatically in kernel
 build
Date: Tue, 11 Dec 2001 12:06:26 +1100 (EST)

 On Mon, 10 Dec 2001, Erik H. Bakke wrote:
 
 > >Description:
 > 	This patch will make sure usbdevs.h and usbdevs_data.h are
 > 	regenerated automatically when a kernel is built.  It is
 > 	done from the depend target, so the files will be present and
 > 	updated as early as possible in the build process.
 > 	This eliminates the need for separately checked in and maintained
 > 	versions of these files.
 >
 > >How-To-Repeat:
 >
 > >Fix:
 >
 > --- kern.post.mk.bak	Sun Nov 11 07:16:53 2001
 > +++ kern.post.mk	Mon Dec 10 14:10:39 2001
 > @@ -76,7 +76,12 @@
 >
 >  ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
 >
 > -kernel-depend:
 > +# This rule makes sure usbdevs.h and usbdevs_data.h are updated from
 > +# usbdevs
 > +usbdevs:
 > +	cd ../../../dev/usb && ${MAKE} -f Makefile.usbdevs
 > +
 > +kernel-depend: usbdevs
 >  .if defined(EXTRA_KERNELDEP)
 >  	${EXTRA_KERNELDEP}
 >  .endif
 
 Er, this clobbers the src tree at kernel build time and has other
 problems (it doesn't work unless "make depend" is run first...).
 Generated files need to be handled something like the *if.h files, but
 without the dependency bugs in that handling.  Dependencies for the
 latter were broken by excessively zealous cleanups in sys/conf/files*,
 so there are only enough dependencies for things to work right if
 either "make depend" is run first or .depend doesn't exist (when .depend
 doesn't exist, the fudged dependency of all objects on all headers
 gives enough dependencies).  In general, generated headers must be in
 BEFORE_DEPENDS and in all relevant places in .depend for things to
 work right.
 
 Bruce
 
Responsible-Changed-From-To: freebsd-bugs->imp 
Responsible-Changed-By: imp 
Responsible-Changed-When: Tue Dec 11 02:30:31 MST 2001 
Responsible-Changed-Why:  
I'll look into this.  However, I share Bruce's concerns, as well as the 
ability to build usb modules outside the tree.  One really needs to make 
all instances of dev/usb/usbdevs*.h into "usbdevs*.h" and generate it 
at kernel build time in the kernel build directory (since the kernel tree may 
be read only).  One further needs to ensure that drivers build outside the 
tree will work as well.  This is an ugly problem. 

Warner 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32671 

From: Sheldon Hearn <sheldonh@starjuice.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: kern/32671
Date: Tue, 11 Dec 2001 11:43:51 +0200

 Interesting feedback from Warner Losh...
 
 ----- Original Message -----
 
 Date:  Tue, 11 Dec 2001 02:36:40 -0700
 From:  Warner Losh <imp@harmony.village.org>
 cc:  "Erik H. Bakke" <ebakke@trolltech.com>,
        "Sheldon Hearn" <sheldonh@starjuice.net>, cvs-committers@FreeBSD.org,
        cvs-all@FreeBSD.org
 Subject:  Re: cvs commit: src/sys/dev/usb usbdevs.h usbdevs_data.h 
 
 
 > In message <200112110923.fBB9NYM25866@harmony.village.org> Warner Losh writes:
 > : In message <010b01c18181$0ac4f9d0$5b3bcbd5@breiflabb> "Erik H. Bakke" writes:
 > : : I just submitted pr kern/32671 which works fine on my system.
 > : 
 > : Including modules?  And in read only kernel sources?
 > 
 > I just took ownership of this problem, since I have the same problem
 > with pccarddevs.  It is ugly.  Your patches I don't think will work
 > for building modules w/o first building the kernel, for modules
 > outside the kernel source tree, a read only kernel source tree, plus
 > suffers from the dependency issues that I alluded to in my last email
 > and that Bruce explicitly referred to in his followup to the bug.
 > 
 > Warner
 

From: MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>
To: <imp@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org, ebakke@trolltech.com
Subject: Re: kern/32671: Patch to generate usbdevs.h automatically in
 kernel build
Date: Sat, 29 May 2004 07:20:17 +0900 (JST)

 Hi
 Warner-san
 
   May I close this PR?
 
   I think you commit some code about usbdevs.
 
 ---
 MIHIRA, Sanpei Yoshiro
 Tokyo, Japan.
 

From: "M. Warner Losh" <imp@bsdimp.com>
To: sanpei@sanpei.org
Cc: freebsd-gnats-submit@freebsd.org, ebakke@trolltech.com
Subject: Re: kern/32671: Patch to generate usbdevs.h automatically in
 kernel build
Date: Fri, 28 May 2004 19:38:50 -0600 (MDT)

 In message: <20040529.072017.119935332.sanpei@sanpei.org>
             MIHIRA Sanpei Yoshiro <sanpei@sanpei.org> writes:
 : Hi
 : Warner-san
 : 
 :   May I close this PR?
 : 
 :   I think you commit some code about usbdevs.
 
 Not just yet.  I did 1/2 of the commit, but bde and I have been
 working to make it better.  I have something similar to this PR in my
 tree, but since it isn't yet in current it is best to keep it open.
 
 Warner
State-Changed-From-To: open->closed 
State-Changed-By: imp 
State-Changed-When: Tue Jun 29 09:06:25 MDT 2004 
State-Changed-Why:  
I've managed to get this done 


http://www.freebsd.org/cgi/query-pr.cgi?pr=32671 
>Unformatted:
