[coreboot] r3770 - trunk/util/msrtool

Jordan Crouse jordan at cosmicpenguin.net
Tue Nov 25 18:25:33 CET 2008


Peter Stuge wrote:
> Jordan Crouse wrote:
>>> +pc_CFLAGS="$(pkg-config libpci --cflags 2>/dev/null)"
>>> +pc_LDFLAGS="$(pkg-config libpci --libs 2>/dev/null)"
>>> +CFLAGS=$(trycompile "libpci (from pciutils)" "${pc_CFLAGS}" 
>>> "-I/usr/local/include") || {
>>> +	rm -f .config.c
>>> +	exit 1
>> Any reason why we don't just drink all the koolaid and use the full
>> autoconf/automake/pkgconfig system in all its glory?
> 
> findprog(), trycompile() and trylink() in the configure script are
> short, fairly easy to understand and hopefully portable enough.

Right - but autoconf scripts are portable _without_ hacking.  Thats the 
whole point.

> 
>> This seems to be fairly prone to porting issues - especially the
>> -I/usr/local/include bit.
> 
> The first parameter to trycompile and trylink is a message, all the
> rest are CFLAGS that should be tried in order, one at a time, until
> one is found that will successfully compile/link the file.
> 
> So pkg-config output is tried first, if that doesn't work (maybe no
> pkg-config installed) then -I/usr/local/include is tried. On Gentoo
> no CFLAGS are needed at all because the library is in /usr and
> /usr/include is always searched by gcc.
> 
> My thinking is that this is flexible enough while staying simpler
> than autotools. I hope to get a similar configure script into
> flashrom too, ticket 101.

I really wish you would reconsider - this would probably be a three or 
four line autoconf script
(10 with comments).  You can't get much simpler then that and you would 
really be helping out the packaging folks.  A home brewed configure 
script (and one that is named 'configure' to boot) may seem simpler to 
you, but its just another barrier for others to accept our tools.

Jordan




More information about the coreboot mailing list