From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KxfE9-0001Fm-Rr for mharc-grub-devel@gnu.org; Wed, 05 Nov 2008 05:03:06 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KxfE8-0001Ff-1T for grub-devel@gnu.org; Wed, 05 Nov 2008 05:03:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KxfE6-0001FQ-F9 for grub-devel@gnu.org; Wed, 05 Nov 2008 05:03:03 -0500 Received: from [199.232.76.173] (port=59000 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxfE6-0001FM-B9 for grub-devel@gnu.org; Wed, 05 Nov 2008 05:03:02 -0500 Received: from aybabtu.com ([69.60.117.155]:37911) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KxfE5-00011V-V5 for grub-devel@gnu.org; Wed, 05 Nov 2008 05:03:02 -0500 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Kxf34-0002OJ-Jn for grub-devel@gnu.org; Wed, 05 Nov 2008 10:51:39 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1Kxf2p-0003LH-9K for grub-devel@gnu.org; Wed, 05 Nov 2008 10:51:23 +0100 Date: Wed, 5 Nov 2008 10:51:23 +0100 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20081105095123.GA12677@thorin> References: <20081101123229.GA14438@thorin> <20081101190204.GB4639@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline In-Reply-To: <20081101190204.GB4639@thorin> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] framework for building modules externally X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 10:03:04 -0000 --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Since it looks like the ABI part inspires more need for debate/discussion, I propose merging the rest first. Support for ABI tracking is not essential for building external modules (in Debian, it's barely necessary). Here's a new patch. If nobody objects, I'll commit it in a few days. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all." --jI8keyz6grp/JLjh Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="external_modules_noabi.diff" 2008-11-01 Robert Millan * Makefile.in (PKGLIB): Add $(pkglib_BUILDDIR). (PKGDATA): Add $(pkgdata_SRCDIR). (pkglib_BUILDDIR): New variable. (pkgdata_SRCDIR): New variable. (build_env.mk): New target. (include_DATA): New variable. (install-local): Install $(include_DATA) files in $(includedir). Index: Makefile.in =================================================================== --- Makefile.in (revision 1891) +++ Makefile.in (working copy) @@ -105,8 +105,8 @@ MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \ - $(pkglib_DATA) $(lib_DATA) -PKGDATA = $(pkgdata_DATA) + $(pkglib_DATA) $(lib_DATA) $(pkglib_BUILDDIR) +PKGDATA = $(pkgdata_DATA) $(pkgdata_SRCDIR) PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES) SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) @@ -163,6 +163,22 @@ ruby $(srcdir)/util/unifont2pff.rb 0x0-0x7f $(UNICODE_ARROWS) $(UNICODE_LINES) $(UNIFONT_HEX) > $@ endif +# Used for building modules externally +pkglib_BUILDDIR += build_env.mk +build_env.mk: Makefile + (\ + echo "TARGET_CC=$(TARGET_CC)" ; \ + echo "TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \ + echo "TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir)" ; \ + echo "STRIP=$(STRIP)" ; \ + echo "COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \ + echo "COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \ + echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\ + ) > $@ +pkglib_BUILDDIR += config.h grub_script.tab.h +pkgdata_SRCDIR += genmodsrc.sh genmk.rb +include_DATA += $(shell find include -name \*.h) include/grub/cpu + all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES) install: install-local @@ -175,6 +191,19 @@ dest="`echo $$file | sed 's,.*/,,'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \ done + $(mkinstalldirs) $(DESTDIR)$(includedir) + @list='$(include_DATA)'; \ + for file in $$list; do \ + if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ + dest="`echo $$file | sed 's,include/,,'`"; \ + destdir="`echo $$dest | sed 's,\(^\|/\)[^/]*$$,,g'`"; \ + $(mkinstalldirs) $(DESTDIR)$(includedir)/$$destdir; \ + if test -f "$$dir$$file"; then \ + $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ + elif test -L "$$dir$$file"; then \ + cp -d $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ + fi; \ + done $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) @list='$(PKGDATA)'; \ for file in $$list; do \ --jI8keyz6grp/JLjh--