libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing compiler flags at configure time


From: Eric Blake
Subject: Re: changing compiler flags at configure time
Date: Tue, 13 Jun 2006 07:26:25 -0600
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Greetings, Ralf,

According to Ralf Wildenhues on 6/13/2006 6:49 AM:
> 
> Thanks for helping!

Thanks for the feedback. It will be a while before I can incorporate it
all (and most importantly, add a testsuite case to exercise it all), but I
appreciate your first read of my hastily written first cut.

>> 2006-06-12  Eric Blake  <address@hidden>
>>
>>      * libltdl/m4/ltoptions.m4 (_LT_SET_OPTION): Require literal
>>      options.
>>      (LT_ENABLE_SHARED,  LT_DISABLE_SHARED): New macros.
>>      (LT_ENABLE_STATIC,  LT_DISABLE_STATIC): New macros.
>>      (_LT_OBSOLETE): New helper macro.
> 
> I did not see _LT_OBSOLETE anywhere.

Oops.  I originally tried:

m4_define([_LT_OBSOLETE], [AU_DEFUN([$1], [$2])
AC_DIAGNOSE([obsolete])])

But that killed aclocal.  I guess I didn't re-update changelog.

> 
>>      * libltdl/m4/libtool.m4 (LT_INIT): Fail on multiple invocations.
>>      * doc/libtool.texi (LT_INIT, LT_DISABLE_SHARED, LT_ENABLE_SHARED),
>>      (LT_DISABLE_STATIC, LT_ENABLE_STATIC): Document these changes.
>>      * NEWS: Document new macros.
> 
>> --- NEWS     15 May 2006 16:40:42 -0000      1.194
>> +++ NEWS     13 Jun 2006 11:48:07 -0000
>> @@ -1,6 +1,9 @@
>>  NEWS - list of user-visible changes between releases of GNU Libtool
>>  
>>  New in 1.9h: 2005-??-??; CVS version 2.1a, Libtool team:
>> +* New macros LT_ENABLE_SHARED, LT_DISABLE_SHARED, LT_ENABLE_STATIC,
>> +  and LT_DISABLE_STATIC work alongside LT_INIT to replace obsoleted
>> +  AC_ENABLE_SHARED and friends.
> 
> Please spell out all four.  Future greppability is a major bonus.

Gotcha.

> 
>> --- doc/libtool.texi 18 May 2006 00:10:37 -0000      1.215
>> +++ doc/libtool.texi 13 Jun 2006 11:48:09 -0000
> 
>> @@ -1902,6 +1901,11 @@ friend.}
>>  LT_INIT([disable-shared])
>>  @end example
>>  
>> address@hidden may only be invoked once.  If you need to change the
>> +default selections after the fact, such as based on whether a particular
>> address@hidden option was passed to @code{./configure}, you can use
>> +macros such as @code{LT_DISABLE_SHARED} or @code{LT_DISABLE_STATIC}.
> 
> prior to using LT_INIT.

OK, and I'll see about making those macros do m4_fatal once LT_INIT has
happened.

> 
>> @@ -1996,6 +2000,16 @@ Change the default behaviour of @command
>>  address@hidden objects.  The user may still override this default by
>>  specifying @option{--with-pic} to @command{configure}.
>>  
>> address@hidden shared
>> +Change the default behaviour for @code{LT_INIT} to enable
>> +shared libraries.  The user may still override this default by
>> +specifying @option{--disable-shared} to @command{configure}.
> 
> Maybe add "This is the default." after the first sentence?

Good idea.

> 
>> address@hidden static
>> +Change the default behaviour for @code{LT_INIT} to enable
>> +static libraries.  The user may still override this default by
>> +specifying @option{--disable-static} to @command{configure}.
> 
> Likewise.
> 
>> @@ -2140,6 +2154,40 @@ Automake regeneration rules, @file{confi
>>  the file itself.
>>  @end defmac
>>  
>> address@hidden LT_DISABLE_SHARED
>> address@hidden AC_DISABLE_SHARED
>> +This macro changes the created @file{libtool} to avoid creating shared
>> +libraries by default.  It is equivalent to
>> address@hidden([disable-shared])}, except that it may be called after
>> address@hidden  Older versions of libtool used the obsolete name
>> address@hidden
>> address@hidden defmac
> 
> It is wrong to call these macros after LT_INIT.  I don't know if we flag
> this, but the old ways was that AC_DISABLE_SHARED must be called before
> AC_PROG_LIBTOOL.  We cannot change this.  If the code doesn't allow this
> now (untested), this is a bug.  Likewise for the other three macros.
> 
>> --- libltdl/m4/libtool.m4    1 Jun 2006 18:39:24 -0000       1.74
>> +++ libltdl/m4/libtool.m4    13 Jun 2006 11:48:11 -0000
>> @@ -37,7 +37,7 @@ m4_define([_LT_COPYING], [dnl
>>  # the same distribution terms that you use for the rest of that program.
>>  ])
>>  
>> -# serial 52 LT_INIT
>> +# serial 53 LT_INIT
>>  
>>  
>>  # LT_PREREQ(VERSION)
>> @@ -78,8 +78,8 @@ AC_SUBST(LIBTOOL)dnl
>>  
>>  _LT_SETUP
>>  
>> -# Only expand once:
>> -m4_define([LT_INIT])
>> +# Diagnose multiple calls:
>> +m4_define([LT_INIT], [AC_MSG_ERROR([[$0 can only be invoked once]])])
> 
> m4_define([LT_INIT], [m4_fatal([$0 can only be invoked once])])
> 
> please; no need to bug the end-user with this.

I always have to think about which macro I should be using there.  It
makes sense when I take my time, but when I write in a hurry I seem to
always get it wrong :)

> 
>> --- libltdl/m4/ltoptions.m4  12 Nov 2005 12:08:14 -0000      1.7
>> +++ libltdl/m4/ltoptions.m4  13 Jun 2006 11:48:11 -0000
>> @@ -1,13 +1,13 @@
>>  # Helper functions for option handling.                    -*- Autoconf -*-
>>  
>> -# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
>> +# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
>>  # Written by Gary V. Vaughan <address@hidden>
>>  #
>>  # This file is free software; the Free Software Foundation gives
>>  # unlimited permission to copy and/or distribute it, with or without
>>  # modifications, as long as this notice is preserved.
>>  
>> -# serial 3 ltoptions.m4
>> +# serial 4 ltoptions.m4
>>  
>>  # This is to help aclocal find these macros, as it can't see m4_define.
>>  AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
>> @@ -23,12 +23,15 @@ m4_define([_LT_MANGLE_OPTION],
>>  # --------------------
>>  # Set option NAME, and if there is a matching handler defined,
>>  # dispatch to it.  Other NAMEs are saved as a flag.
>> +# Die if NAME is not a literal.
>>  m4_define([_LT_SET_OPTION],
>> -[m4_define(_LT_MANGLE_OPTION([$1]))dnl
>> -m4_ifdef(_LT_MANGLE_DEFUN([$1]),
>> -        _LT_MANGLE_DEFUN([$1]),
>> -    [m4_warning([Unknown Libtool option `$1'])])[]dnl
>> -])
>> +[AS_LITERAL_IF([$1],
>> +           [m4_define(_LT_MANGLE_OPTION([$1]))dnl
>> +            m4_ifdef(_LT_MANGLE_DEFUN([$1]),
>> +                     _LT_MANGLE_DEFUN([$1]),
>> +                     [m4_warning([Unknown Libtool option `$1'])])[]dnl],
>> +           [m4_error([Libtool option `$1' is not a literal]
> 
> What is m4_error?  Again m4_fatal, please.
> 
>> +)])])
> 
>>  AU_DEFUN([AC_ENABLE_SHARED],
>> -[_LT_SET_OPTION([shared])
>> +[LT_ENABLE_SHARED
>>  AC_DIAGNOSE([obsolete],
>> -[$0: Remove this warning and the call to _LT_SET_OPTION when you
>> -put the `shared' option into LT_INIT's first parameter.])
>> +[$0: This macro is obsolete.])
> 
> Why not just AU_ALIAS([AC_ENABLE_SHARED], [LT_ENABLE_SHARED])?
> (four instances)
> Except of course that AU_ALIAS is broken before Autoconf 2.59c, 

So should we just make libtool 2.0 AC_REQUIRE([2.59d])?

> when the macro has optional arguments, and the enable/disable macros
> used to have documented arguments, which...
> 
>> +# LT_ENABLE_STATIC
>> +# ----------------
>> +# Set the --enable-static flag by default.
>> +AC_DEFUN([LT_ENABLE_STATIC],
>> +[_LT_SET_OPTION([static])])
> 
> ...this implementation now kills, but our current one should not.
> 
> Cheers,
> Ralf
> 

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEjr0A84KuGfSFAYARAg2IAKCVzY2wIiBxNjcI/szcuOMfxe6OmQCfWJ9I
mVbZ4PxETt9c6+6NNPDvQfg=
=FgyO
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]