libtool-patches
[Top][All Lists]
Advanced

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

Re: mdemo ltdl failure


From: Charles Wilson
Subject: Re: mdemo ltdl failure
Date: Tue, 24 Apr 2007 21:53:47 -0400
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

Ralf Wildenhues wrote:
* Charles Wilson wrote on Fri, Apr 20, 2007 at 12:25:27AM CEST:
Ralf suggests testing this patch on solaris. I can't, but if Ralf does then I expect that the results will be the same as (4) and (5).

Done.

AS_CASE was a problem, as it's not in Autoconf-2.59.

!!! I coulda sworn that my /usr/share/autoconf/m4sugar/ files on my linux box, with its autoconf-2.59, contained a definition for AS_CASE -- but sure enough, it is _not_ there. Maybe I looked on my local cygwin box by mistake...

While fixing, I
noted that we can avoid all the forking by IFS munging.  How does this
fare for you and do you see issues with it?  I hope that it also fixes
the failures with Autoconf-2.59 and Automake-1.9.x on MinGW/MSYS.

I see a few issues, but they are minor.  More below.

Can we rely on "uname -r" on Cygwin to always return NN.NN.NN[.-].* with
NN being runs of digits?

No. The typical cygwin answer is '1.5.24(0.156/4/2)', in which case your code results in
     lt_os_major=1
     lt_os_minor=5
     lt_os_micro=24(0  <<< bad
With snapshot kernels, `uname -r` is (e.g.) '1.7.0s(0.167/4/2)' -- note the extra 's' embedded in the result. (The extra digits are cygwin_api_major.cygwin_api_minor/cygwin_shared_data_format/cygwin_registry_format)

So, I think we'll need at least one fork, using sed to strip off everything but the first block of [0-9\.]

Anyway I've made the patch err on the side of
caution when cross compiling, for now.

when $host=cygwin (and, of course, $build != cygwin), only. Other cross-compiles still default to 'yes-it-probably works'. That's good, because it probably does.

I guess we can change that sometime in the future.

Sure.

Index: libltdl/argz_.h

ok.

Index: libltdl/libltdl/lt__glibc.h

ok.

Index: libltdl/m4/argz.m4

+AS_IF([test -z "$ARGZ_H"],
+    [AC_CACHE_CHECK(
+        [if argz actually works],
+        [lt_cv_sys_argz_works],
+        [case $host_os in #(

I like this trick.  Fixes syntax highlighting and paren-matching, right?

+        *cygwin*)
+          lt_cv_sys_argz_works=no
+          if test "$cross_compiling" != no; then
+            lt_cv_sys_argz_works="guessing no"
+          else
+            save_IFS=$IFS
+            IFS=-.
+            set x `uname -r`

set x `uname -r | $SED -e 's/^\([[0-9\.]]*\).*/\1/'`

+            IFS=$save_IFS
+            lt_os_major=$[]2
+            lt_os_minor=$[]3
+            lt_os_micro=$[]4

in your original comments to this patch, you worried about 'empty' lt_os_* variables. Granted, inside the case *cygwin*), we are most likely not going to see '1.7s(xxxxxx)' leading to an empty _micro. But that assumes some other software not under our control is going to behave as it currently does, forever. Better safe. It would be nice to use ${var:=0}, but according to autoconf:

`${VAR:-VALUE}'
     Old BSD shells, including the Ultrix `sh', don't accept the colon
     for any shell substitution, and complain and die.

(Note that we can, and already do elsewhere in ltmain.m4sh, use ${var=0} -- and, because you're using IFS, it turns out that _is_ good enough here. From bash manpage:

    ...bash tests for a parameter that is unset or null;  omitting  the
    colon results in a test only for a parameter that is unset.

When words are missing, positional parameters are unset, not merely null.

So,
  lt_os_major=$[]{2-0}
  lt_os_minor=$[]{3-0}
  lt_os_micro=$[]{4-0}
works just fine (and no extra forks).

Unless you feel that 'this is cygwin-specific; I trust the cygwin folks to not ever change the output format of uname -r'

+            if test "$lt_os_major" -gt 1 ||
+               { test "$lt_os_major" -eq 1 &&
+                 { test "$lt_os_minor" -gt 5 ||
+                   { test "$lt_os_minor" -eq 5 &&
+                     test "$lt_os_micro" -gt 24; }; }; }; then

Eeewww. It's more efficient than my version, but ugly!

+              lt_cv_sys_argz_works=yes
+            fi
+          fi
+          ;; #(
+        *) lt_cv_sys_argz_works=yes ;;
+        esac])
+     AS_IF([test $lt_cv_sys_argz_works != yes],
+        [AC_DEFINE([SYSTEM_ARGZ_IS_BROKEN], 1,
+                   [This value is set to 1 to indicate that the system argz 
facility does not work])
+        ARGZ_H=argz.h
+        AC_LIBOBJ([argz])])])
+
 AC_SUBST([ARGZ_H])
 ])

I'll run some tests on a modified version of your patch, and post the revised version with (sigh...) my gamut of test results. And, as with gcc testing, I'll revert my cygwin system to autoconf-2.59 first...

--
Chuck




reply via email to

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