[PATCH v2 07/10] gen-version-script: parse Solaris "nm" output (Solaris support)

Blake Jones blakej at foo.net
Wed Nov 7 22:29:12 PST 2012


>> @@ -11,10 +12,44 @@ fi
>>  HEADER=$1
>>  shift
>>  
>> +if [ `uname -s` == SunOS ] ; then
>> +    #
>> +    # Using Solaris "nm", a defined symbol looks like this:
>> +    #
> 
> The POSIX / Bourne -comformant equality comparison is '='. 

Sigh, of course it is.  Fixed.

> e.g.
> 
> $ ./heirloom-sh/sh -c ' [ a == b ] || echo x'
> ./heirloom-sh/sh: test: unknown operator ==
> zsh: exit 1     ./heirloom-sh/sh -c ' [ a == b ] || echo x'
> 
> Interesting that Solaris /bin/sh did not fail there...

I was running on Solaris 11.1, which uses ksh93 as its /bin/sh.  You're
absolutely right that Solaris 10 would fall over, though.

Similarly, the following line:

    demangled=$(demangle $sym)

doesn't work on traditional sh.  I've replaced $() with ``.

> Hmm, gen-version-script doesn't have shebang... it is run like:
> 
> sh $(srcdir)/$(lib)/gen-version-script.sh $< $(libnotmuch_modules) > $@
> 
> in lib/Makefile.local -- taking sh fron PATH.

I updated the first line from the #! invocation to a comment saying

    # This script is invoked via "sh .../gen-version-script.sh".

Would a respun version of these patches help toward testing?

Blake


More information about the notmuch mailing list