Subject: Re: bug#9249: Does Libtool 2.4 support Solaris 2.8?

From: "Gary V. Vaughan" <[email-masked]>
Date: Tue, 9 Aug 2011 03:09:31 +0700

Hi Andreas,

On 9 Aug 2011, at 02:50, Andreas Kupries wrote:
> On 8/5/2011 8:18 PM, Gary V. Vaughan wrote:
>> Here's the snippet from libtool's generated configure script:
> 
> Found it ...
> 
> > Can you investigate some more and report your findings back to the list?
> 
> Sure.

Thanks for following up.

> bash ../../src/configure --prefix=/export/home/andreask/dbn/BuildTmp/Hwloc/solaris2.8-sparc/install --exec-prefix=/export/home/andreask/dbn/BuildTmp/Hwloc/solaris2.8-sparc/install --with-tcl=/export/home/andreask/dbn/BuildTmp/Hwloc/solaris2.8-sparc/install/lib --with-tk=/export/home/andreask/dbn/BuildTmp/Hwloc/solaris2.8-sparc/install/lib --enable-shared --enable-threads
> [[...]]
> The generated Makefile and libtool however have SHELL=/bin/sh
> assignments in them, and without me forcing them to use bash they [[fail]].

Ah, I see the problem.

You needn't tell Autotools that you have a preferred shell to the one it looks for by itself (and actually, if you just let configure run with whatever shell it can get, it might even find and choose /usr/local/bin/bash provided that you have /usr/local/bin in your command search PATH, and provided that there is not a shell called 'sh' also somewhere in PATH that provides all the features Autotools is looking for.

    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
    do
      IFS=$as_save_IFS
      test -z "$as_dir" && as_dir=.
      case $as_dir in
         /*)
           for as_base in sh bash ksh sh5; do
             as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
           done;;
      esac
    done
    IFS=$as_save_IFS

Generally, bash is an excellent shell to use interactively, but it is a little buggy and considerably slower than some of the cut down shells  such as Debian's /bin/sh which is a link to the lightning fast Almqvist shell. Unless you are experiencing real problems with the shell that configure selects for you, then you probably shouldn't need to force another shell.

However, you can safely force an alternative shell to execute the various Autotools scripts by setting both SHELL and CONFIG_SHELL, like so:

   ./configure SHELL=/usr/local/bin/bash CONFIG_SHELL=/usr/local/bin/bash <other arguments as usual>

That should ensure that SHELL is then set correctly in libtool and Makefile to match the tests that configure ran earlier.

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)