Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 16 Dec 2000 06:40:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 16 Dec 2000 06:40:29 -0500 Received: from enterprise.cistron.net ([195.64.68.33]:50190 "EHLO enterprise.cistron.net") by vger.kernel.org with ESMTP id ; Sat, 16 Dec 2000 06:40:17 -0500 From: miquels@traveler.cistron-office.nl (Miquel van Smoorenburg) Subject: Re: Linus's include file strategy redux Date: 16 Dec 2000 11:09:49 GMT Organization: Cistron Internet Services B.V. Lines: 59 Message-ID: <91fiht$7ve$1@enterprise.cistron.net> In-Reply-To: <91e0so$9bn$1@enterprise.cistron.net> X-Trace: enterprise.cistron.net 976964989 8174 195.64.65.67 (16 Dec 2000 11:09:49 GMT) X-Complaints-To: abuse@cistron.nl X-Newsreader: trn 4.0-test74 (May 26, 2000) Originator: miquels@traveler.cistron-office.nl (Miquel van Smoorenburg) To: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org In article , wrote: >On 15 Dec 2000, Miquel van Smoorenburg wrote: > >> I think /lib/modules/`uname -r`/ should contain a script that >> reproduces the CFLAGS used to compile the kernel. > >However it happens, the necessary information THAT I KNOW OF is: >0) The kernel headers under linux/include >1) The state information generated by running make configure ; make dep ; >make clean -OR- equivalently by Debian's make-kpkg clean ; make-kpkg >configure which does the same thing but adds packaging-specific metadata. That state info is in ARCH, CFLAGS, CC and include/linux/autoconf.h >A SYMLINK from /lib/modules/`uname -r`/ into /path/to/kernel-`uname -r` >will not always work, because: >0) The destination may not even exist (if the kernel has been installed >onto another machine) Yes but in that case, how are you going to compile a module without the kernel headers anyway. If you compiled a kernel on one machine and you know that you want to be able to compile modules on the second machine you need to copy over /usr/src/linux-x.y.z/include as well. >1) The destination has no metadata or has the WRONG metadata (if I've just >compiled and installed 2.4.0-test11 on my i386, then am now building same >for my sun4c) As I said the kconfig script should do some simple sanity checks- compare version and architecture at least. >I have been recently told that a full copy of kernel headers and metadata >in /lib/modules/`uname -r`/ isn't going to work either, but the gentleman >who informed me of this hasn't yet shown why. Because lots of use have a small root file system of just 30 MB ? Hmm, but as soon as you start thinking about cross-compiles etc you need more and more state - like CROSS_COMPILE, AS, LD, CPP, AR, NM etc etc. Yuck. It would probably be better to put all that info in /usr/src/linux/Config.make, and use the current "build" symlink. A module makefile would then look like this: #! /usr/bin/make -f # You might want to point BUILD somewhere else. BUILD = /lib/modules/$(shell uname -r)/build include $(BUILD)/Config.make module.o: $(CC) $(CFLAGS) -c module.c Ah yes, this is probably a much better approach then a kconfig script Mike. -- RAND USR 16514 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/