Hi Gary, * Gary V. Vaughan wrote on Tue, Aug 30, 2005 at 06:31:42PM CEST: > Ralf Wildenhues wrote: > > >Just a slight cleanup of your suggestion. Changes: change > >m4_fatal to m4_warn, because we want to be forward compatible, > > Agreed.
I also had to add a few newlines, else we'd end up with | # Set options | enable_dlopen=yesenable_win32_dll=yes see updated patch at end. > >I didn't change m4_foreach to AC_FOREACH as in your snippet, because I > > don't know the difference in semantics. > > AC_FOREACH([_x], [$1], == m4_foreach([_x], m4_split(m4_normalize([$1])), Ah, OK. > Your change is correct for frozen HEAD though. We can clean it up > post release... I don't care. > >But there is another problem with respect to macro ordering: The > >settings set by the LT_INIT options appear too late in the configure > >script. If I set AC_LIBTOOL_DLOPEN, everything is OK; but if I use > >LT_INIT([dlopen]), it appears after a macro which might override > >enable_dlopen. > > Which macro is that? LT_SYS_DLOPEN_SELF, but basically all the hundreds of require'ments of _LT_SETUP are expanded before LT_INIT as well.. > The fix belongs there I think. Are you sure? > > IOW, the part titled "# Set options" in LT_INIT appears > >much too late. > > The only code between LT_INIT and the call to _LT_SET_OPTIONS, is a > bunch of AC_REQUIRE of foo_VERSION macros, and > m4_require([_LT_PROG_LTMAIN]) which has a very short provide chain that > doesn't appear to be responsible for that bug... The _LT_SETUP macro is instantiated after _LT_SET_OPTIONS in LT_INIT, but all its requirements are expanded before LT_INIT; see http://lists.gnu.org/archive/html/autoconf/2005-08/msg00100.html for a nice explanation about AC_REQUIRE. :) (I wouldn't have guessed I could tell the M4 maintainer something about macro expansion.. ;-) > Does moving _LT_SET_OPTIONS([$1])dnl up to being the first line of > LT_INIT work? No, why should it? > >Is this bug description comprehensible? (I guess a couple of m4_require > >and/or AC_REQUIRE are needed, I'm sure you'll know the correct answer > >right away.) > > Maybe. Or perhaps LT_INIT needs splitting, or _LT_SET_OPTIONS running > in a diversion... If you tell me the macro that is getting emitted > before the _LT_SET_OPTIONS expansion I should be able to figure it out. Have fun. :) Cheers, Ralf 2005-08-30 Gary V. Vaughan <[EMAIL PROTECTED]>, Ralf Wildenhues <[EMAIL PROTECTED]> * libltdl/m4/ltoptions.m4 (_LT_SET_OPTIONS): Move option macro dipatch.. (_LT_SET_OPTION): here. Do not fail but warn on unknown options. (_LT_UNLESS_OPTIONS(win32-dll), LT_OPTION_DEFINE(dlopen)): Add whitespace. Reported by Robert Ă–gren <[EMAIL PROTECTED]> and Akim Demaille <[EMAIL PROTECTED]>. Index: libltdl/m4/ltoptions.m4 =================================================================== RCS file: /cvsroot/libtool/libtool/libltdl/m4/ltoptions.m4,v retrieving revision 1.2 diff -u -r1.2 ltoptions.m4 --- libltdl/m4/ltoptions.m4 30 Aug 2005 14:31:40 -0000 1.2 +++ libltdl/m4/ltoptions.m4 30 Aug 2005 16:46:52 -0000 @@ -20,9 +20,15 @@ # _LT_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Other NAMEs are saved as a flag. -m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1]))]) +# -------------------- +# Set option NAME, and if there is a matching handler defined, +# dispatch to it. Other NAMEs are saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1]), + _LT_MANGLE_DEFUN([$1]), + [m4_warn([Unknown Libtool option `$1'])])[]dnl +]) # _LT_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) @@ -52,16 +58,14 @@ # and exit. m4_define([_LT_SET_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$1])), - [_LT_SET_OPTION(_LT_Option) - m4_ifdef(_LT_MANGLE_DEFUN(_LT_Option), - _LT_MANGLE_DEFUN(_LT_Option), - [m4_fatal([Unknown option `]_LT_Option[' to LT][_INIT_LIBTOOL])]) - ])dnl + [_LT_SET_OPTION(_LT_Option)]) dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: -_LT_UNLESS_OPTIONS([dlopen], enable_dlopen=no) -_LT_UNLESS_OPTIONS([win32-dll], enable_win32_dll=no) +_LT_UNLESS_OPTIONS([dlopen], [enable_dlopen=no +]) +_LT_UNLESS_OPTIONS([win32-dll], [enable_win32_dll=no +]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither @@ -92,7 +96,8 @@ # dlopen # ------ -LT_OPTION_DEFINE([dlopen], [enable_dlopen=yes]) +LT_OPTION_DEFINE([dlopen], [enable_dlopen=yes +]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([dlopen])
