pombreda / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

Use bourne shell available on all systems instead of bash #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What is the expected behavior? What do you see instead?

configure script should work cross-platform, but now depends on bash which 
isn't always available.

What version are you using? On what operating system?

Problem was encountered on FreeBSD.

Please provide any additional information below.

See patch. Seems to work, but something may have broken that we haven't 
bumped in to yet.

Original issue reported on code.google.com by philip.j...@gmail.com on 3 Jun 2010 at 7:00

Attachments:

GoogleCodeExporter commented 9 years ago
build/make/configure.sh should also have the same change. Also, there's a 
warning 
from this code:

    if [ "${libdir#${prefix}}" == "${libdir}" ]; then
        die "Libdir ${libdir} must be a subdirectory of ${prefix}"
    fi

The warning is [: 1: /lib: unexpected operator

I guess the # operator isn't portable?

Original comment by philip.j...@gmail.com on 3 Jun 2010 at 10:13

GoogleCodeExporter commented 9 years ago
In FFmpeg we have some checks and some fallbacks if the /bin/sh is broken, 
probably
you could use the same logic here.

Original comment by luca.bar...@gmail.com on 3 Jun 2010 at 10:50

GoogleCodeExporter commented 9 years ago
POSIX comparator is = not ==

Original comment by alex.con...@gmail.com on 3 Jun 2010 at 2:08

GoogleCodeExporter commented 9 years ago
I'm was having the same problem on FreeBSD. I normally get around it using 
/usr/bin/env as per the attached (though you still have to install bash, it can 
be anywhere). There are a few files affected:

gsed -i 's,/bin/bash, /usr/bin/env bash,' ./configure
gsed -i 's,/bin/bash, /usr/bin/env bash,' ./build/make/*.sh

Thanks,

Tony

Original comment by tony.the...@gmail.com on 18 Sep 2010 at 5:56

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks. I'd definitely like to clean this up. Shouldn't need to rely on bash. 
Is there a strict posix sh available on linux that I can test against? I seem 
to recall that bash is still mostly bash, even if you invoke it as sh.

Original comment by jkoles...@google.com on 18 Sep 2010 at 7:09

GoogleCodeExporter commented 9 years ago
You could try dash: http://gondor.apana.org.au/~herbert/dash/

Original comment by avleeu...@gmail.com on 18 Sep 2010 at 8:41

GoogleCodeExporter commented 9 years ago
There is no promise of /usr/bin/env existing.  It is often installed as 
/bin/env.

Original comment by mrullgard@gmail.com on 20 Sep 2010 at 4:31

GoogleCodeExporter commented 9 years ago
I wasn't aware of /bin/env...

It seems then that the best option is to use /bin/sh. AFAIK dash is used by 
Debian and derived from ash that the BSDs tend to use.

Original comment by tony.the...@gmail.com on 20 Sep 2010 at 4:55

GoogleCodeExporter commented 9 years ago
Just to follow up, replacing /bin/bash with /bin/sh works for me on FreeBSD 8.1 
amd64. The attached patch is basically just a diff after:

gsed -i 's,/bin/bash, /bin/sh,' ./configure
gsed -i 's,/bin/bash, /bin/sh,' ./build/make/*.sh

I'm configuring as follows:

CROSS='i686-pc-mingw32-' ./configure 
--prefix='/home/mingw-cross-env/usr/i686-pc-mingw32' --target=x86-win32-gcc 
--disable-examples

and all is fine.

Cheers,

Tony

Original comment by tony.the...@gmail.com on 1 Oct 2010 at 4:58

Attachments:

GoogleCodeExporter commented 9 years ago
/build/make/configure.sh uses ${RANDOM} which is a bashism.

Original comment by alex.con...@gmail.com on 1 Oct 2010 at 5:24

GoogleCodeExporter commented 9 years ago
Started this, see https://review.webmproject.org/662

There are still a couple bashims, the sample code generation relies on bash 
math for example. Will try to get back to this next week, but posted for your 
review in case somebody wants to take a crack at it.

Original comment by jkoles...@google.com on 1 Oct 2010 at 5:08

GoogleCodeExporter commented 9 years ago

Original comment by iss...@webmproject.org on 16 Mar 2011 at 2:50

GoogleCodeExporter commented 9 years ago
Ping? We're still having to patch this to build on FreeBSD.

Original comment by philip.j...@gmail.com on 24 Feb 2012 at 2:30

GoogleCodeExporter commented 9 years ago
link to patch? we haven't had a chance to work on this but if you have a
patch I will review and commit.

Original comment by johannko...@google.com on 24 Feb 2012 at 2:58

GoogleCodeExporter commented 9 years ago

Original comment by albe...@google.com on 8 Mar 2012 at 12:08

GoogleCodeExporter commented 9 years ago
All we've done to make it work is to change /bin/bash to /bin/sh in these files:
build/make/configure.sh
build/make/version.sh
configure

Original comment by philip.j...@gmail.com on 29 May 2012 at 11:53

GoogleCodeExporter commented 9 years ago
Oh, also build/make/gen_asm_deps.sh

Original comment by philip.j...@gmail.com on 29 May 2012 at 11:54

GoogleCodeExporter commented 9 years ago
So those files have no bashism? Or does your /bin/sh allow them?

Original comment by johannko...@google.com on 29 May 2012 at 3:49

GoogleCodeExporter commented 9 years ago
We didn't look for or fix any bashisms, but it did work for the configuration 
we are using:

configure \
        --prefix=$(GStreamerTempDir) \
        --enable-pic \
        --enable-runtime-cpu-detect \
        --disable-vp8-encoder \
        --disable-multithread \
        --disable-postproc \
        --disable-examples \
        --disable-install-docs \
        --disable-install-bins \
        --disable-install-srcs

Original comment by philip.j...@gmail.com on 30 May 2012 at 8:08

GoogleCodeExporter commented 9 years ago

Original comment by louquil...@google.com on 13 Aug 2013 at 10:13

GoogleCodeExporter commented 9 years ago
Tentative patch at https://gerrit.chromium.org/gerrit/#/c/65794/ to get rid of 
most of the bashisms, let me know if it breaks or fixes things!

Original comment by gmart...@google.com on 14 Aug 2013 at 1:14

GoogleCodeExporter commented 9 years ago
Latest git checkout works on Freebsd here - thanks!

Original comment by tony.the...@gmail.com on 17 Aug 2013 at 11:09

GoogleCodeExporter commented 9 years ago
Closing for now. Please re-open if edge cases are found.

Original comment by louquil...@google.com on 19 Aug 2013 at 9:25

GoogleCodeExporter commented 9 years ago
If we wanted to use checkbashisms as a pre-commit check to prevent regressions 
configure.sh would need to rename enable() which shadows a builtin.

Original comment by jz...@google.com on 20 Aug 2013 at 1:46