From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8715 invoked by alias); 13 Nov 2008 20:02:55 -0000 Received: (qmail 8637 invoked by uid 22791); 13 Nov 2008 20:02:54 -0000 X-Spam-Check-By: sourceware.org Received: from mu-out-0910.google.com (HELO mu-out-0910.google.com) (209.85.134.188) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Nov 2008 20:02:15 +0000 Received: by mu-out-0910.google.com with SMTP id i2so1042569mue.6 for ; Thu, 13 Nov 2008 12:02:11 -0800 (PST) Received: by 10.181.208.15 with SMTP id k15mr31143bkq.130.1226606531143; Thu, 13 Nov 2008 12:02:11 -0800 (PST) Received: by 10.181.232.17 with HTTP; Thu, 13 Nov 2008 12:02:11 -0800 (PST) Message-ID: <9ad8ee4e0811131202n4a219348hf4404a8d9bc5997b@mail.gmail.com> Date: Fri, 14 Nov 2008 16:16:00 -0000 From: "Jesper Skov" To: "Bart Veer" Cc: ecos-discuss@ecos.sourceware.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9ad8ee4e0811121117m705f28fhd8be1aaae472abc1@mail.gmail.com> X-Google-Sender-Auth: 6279c19db6514f7a X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] CDL and makefile output X-SW-Source: 2008-11/txt/msg00084.txt.bz2 On Wed, Nov 12, 2008 at 10:15 PM, Bart Veer wrote: > If you really need to do something like this, it is possible but not > easy. You can invoke a Tcl script from inside a custom build step, > along similar lines to the memalloc package. That Tcl script can read > in install/include/pkgconf/ecos.mak and anything else in pkgconf/ that > contains relevant options, e.g. your CYGBLD_GLOBAL_EXTRAS_LDFLAGS. It > can then exec the linker with the appropriate options. Uh, not liking the looks of that. Partly because I've never really used Tcl, partly because keeping the logic in the makefile would be nicer (IMHO, of course). So I tried to see if I could do it in a simpler fashion. And I found a solution after some tinkering. The real question is now, would something like the below be accepted in a contribution? Index: hal.cdl =================================================================== --- hal.cdl (revision 26) +++ hal.cdl (working copy) @@ -71,10 +71,22 @@ make -priority 250 { /lib/extras.o: /lib/libextras.a - $(CC) $(CFLAGS) -nostdlib -Wl,-r -Wl,--whole-archive -o $@ $< + $(CC) $(CFLAGS) $(shell grep " EXTRAS_LDFLAGS " $(PREFIX)/include/pkgconf/system.h | cut -d' ' -f 3-) -o $@ $< } + cdl_option CYGBLD_GLOBAL_EXTRAS_LDFLAGS { + display "Extras.o linker flags" + flavor data + parent CYGBLD_GLOBAL_OPTIONS + no_define + define -file=system.h EXTRAS_LDFLAGS + default_value { "-nostdlib -Wl,-r -Wl,--whole-archive" } + description " + This option controls the extras.o linker flags. Individual + packages may define options which override these global flags." + } I have only tested in on BSD/OS X (where it works as intended) but I can't see why it shouldn't work on Linux and Windows/CygWin. Comments? Cheers, Jesper -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss