"Sean McGovern" <[email protected]> writes:

> Hi folks,
>
> As anyone who has taken a trip to the fate status page in the last 30
> minutes or so can see, I have attempted to build LibAV with no local
> modifications on my Solaris x86 setup. This has crashed and burned
> horribly for several reasons, the first of which I am writing to ask
> for suggestions on how to fix.
>
> For the longest time now, /bin/sh on Solaris has not been GNU bash,
> nor has it been remotely POSIX-compliant (it most like heralds from
> the original days of SunOS).
>
> All of the scripts in libAV start with '#!/bin/sh' -- I have been
> manually forcing bash (thankfully at least available as /bin/bash on
> current Solaris 10) by modifying the starting line in each of them.
>
> It is worth noting that this problem does not happen on Solaris 11 as
> it ships with /bin/sh as GNU bash.
>
> Any suggestions on what else to do? I don't suppose there's a way to
> force the scripts to run under bash without modifying that start line,
> is there?

It is possible to do, but I don't think it should be done.  POSIX has
been long enough that not supporting a compatible shell as /bin/sh at
all is inexcusable.  Other Unixes have solved the legacy compatibility
problem by making /bin/sh POSIX compatible if an environment variable is
set (_XPG on IRIX, BIN_SH=xpg4 on OSF/Tru64).  Solaris could easily do
the same thing.  Since they probably won't, installing a simple wrapper
as /bin/sh will work as well.  Something like this should do it:

#include <stdlib.h>
#include <unistd.h>

int main(int argc, char **argv)
{
    if (getenv("_XPG"))
        execv("/usr/xpg4/bin/sh", argv);
    else
        execv("/bin/sh.real", argv);
    return 127;
}

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to