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

Hi all:

    I've seen a bug in autoconf 2.49a that I downloaded from CVS
yesterday. I noted that when I used "AC_SEARCH_LIBS", the conftest*
files were not deleted. I then inspected the source code and I found
that when one calls the "..._IFELSE" macros with a "break"
ACTION-IF-FOUND (or ACTION-IF-NOT-FOUND), the macro ends without
deleting the files. In AC_SEARCH_LIBS, a loop check all the libraries
given, and a "break" is necessary to end when a suitable library has
been found.

    AUTOCONF MAINTAINERS: please, note that this bug is deep in the
code, and it may require to inspect all the code. The "q&d" solution
I've found is checking all the "..._IFELSE" invocation and changing
them with temporal variables: For example, in

 AC_TRY_LINK_FUNC([$1],
 [ac_cv_search_$1="-l$ac_lib"
-break])
+ac_tmp_found_lib=1])
+if test $ac_tmp_found_lib ; then break ; fi
 done

in which I've changed the break for a temporary variable that is
checked afterwards. Note that there aren't innecessary iterations, as
this test is just within the loop, but it lets the "..._IFELSE" macros
to end nicely as it's expected to.

I've included a patch for acgeneral.m4, but NOTE THAT THE REMAINIG .M4
FILES MAY ALSO BE IN ERROR.

    The solution is:

1. Change the code of the macros calling ".._IFELSE" ones, or
2. Write a more robust ".._IFELSE" macros. One could think on
"catching" the breaks by surrounding the body of the macro inside a
while true, but this cannot prevent from a break n, where n is greater
than 1
3. Forbid the use of "break" in ACTIONs.

    Regards and hope this helps.
    diego.

--
Diego Sevilla Ruiz - http://ditec.um.es/~dsevilla/ - [EMAIL PROTECTED]
Departamento de Ingeniería y Tecnología de Computadores
Facultad de Informática. Universidad de Murcia
Campus de Espinardo - 30080 Murcia (SPAIN). Tel. +34-968-367570
PGP: http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xC9B964B7
\huge d\em\kern-.36em\lower-.2ex\hbox{\small sevilla}\[EMAIL PROTECTED]

$_="\\l/) (>".     "_'\n<";@@=        /.|\n/g;$_=
"\@".     "\007f".   "DDq".           "DD5".   "\204".
"\@".     "DT4CE".    "D54E".         "DD".    "\244".
"\021".   "dBDTC".     "\010DD".      "\200\$FD\024".
"GDAG".   "DAGDT".       "CqI";$c     =0;$p    =5;for$q
(/./g)    {$q=              ord$q;    for(a,   b){$z[$c]
=$@[$p+=($q&15)    -4];$q>>=4;$c+=33  ;$c>98   &&($c-=98);}};print@z;




-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: CovO/jUy3fCxjf0ZwJ4IuOyAYi6obBEN

iQA/AwUBOZvEldoq0AfJuWS3EQK/6gCfXNEEJm1k/wNgJOqCQpAktzjUiQoAn1bc
m8Gr2lyXwNmQh+4WfKOKbiFY
=QF8p
-----END PGP SIGNATURE-----
--- acgeneral-old.m4    Mon Aug  7 14:33:18 2000
+++ acgeneral.m4        Thu Aug 17 02:44:43 2000
@@ -3151,7 +3151,8 @@
 LIBS=3D"-l$ac_lib $5 $ac_func_search_save_LIBS"
 AC_TRY_LINK_FUNC([$1],
 [ac_cv_search_$1=3D"-l$ac_lib"
-break])
+ac_tmp_found_lib=3D1])
+if test $ac_tmp_found_lib ; then break ; fi
 done
 LIBS=3D$ac_func_search_save_LIBS])
 AC_SHELL_IFELSE([test "$ac_cv_search_$1" !=3D no],
@@ -3580,14 +3581,16 @@
  [ac_lo=3D0 ac_try=3D0
   while true; do
     AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <=3D $ac_try=
])],
-                   [ac_hi=3D$ac_try; break],
+                   [ac_hi=3D$ac_try; ac_tmp_compiled=3D1],
                    [ac_lo=3D`expr $ac_try + 1`; ac_try=3D`expr 2 '*' $ac=
_try + 1`])
+    if test $ac_tmp_compiled ; then break; fi
   done],
  [ac_hi=3D-1 ac_try=3D-1
   while true; do
     AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >=3D $ac_try=
])],
-                      [ac_lo=3D$ac_try; break],
+                      [ac_lo=3D$ac_try; ac_tmp_compiled=3D1],
                       [ac_hi=3D`expr $ac_try - 1`; ac_try=3D`expr 2 '*' =
$ac_try`])
+    if test $ac_tmp_compiled ; then break; fi
   done])
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" !=3D "x$ac_hi"; do

Reply via email to