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

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

Date: Wed, 07 Nov 2012 22:29:12 -0800

To: Tomi Ollila

Cc: notmuch@notmuchmail.org

From: Blake Jones


>> @@ -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

Thread: