The ./configure script used to buid libreoffice contains bashisms, causing build failures when called using a /bin/sh that is not bash.
Jonathan: could you be more specific? Which sources are you trying to build? (master sources, 4.3, other?) which bashism have you found? Did you follow https://wiki.documentfoundation.org/Development/BuildingOnLinux ?
I'm finding the same issue. I haven't gone into a huge amount of investigation, but I tend to keep /bin/sh as a symlink to /bin/dash because its faster and is 100% posix/bourne compatible. My login shell is /bin/bash for the extra features, but I use that interactively. Compiling LibreOffice 4.3.2.2 from source fails. I reset the /bin/sh symlink to bash and it compiles. Its still compiling since it was successfule so it could be quite some time before it finishes and I can rebreak it to give some output. I will attach whatever logs I can that will bring about some help as to where the bug is. Incidently, to prevent these issues, I pass SHELL=/bin/bash to the configure script as that sometimes will fix these issues. It didn't.
Evan: thank you for having given the version but could you put the error logs?
s/successfule/successful/ Here is a snippet of configure failing: checking for building the Barcode extension... no checking for building the ConvertTextToNumber extension... no checking for building the Numbertext extension... no checking for building the Hungarian Cross-reference Toolbar extension... no checking for building the Typography Toolbar extension... no checking for building the Google Docs extension... no checking for building the NLPSolver extension... no checking for building the LanguageTool extension... no checking for Sun Professional Template Pack integration (only supported languages displayed)... no integration checking whether to include third-party fonts... no checking for fc-match... /usr/bin/fc-match checking font mapping for 'Calibri'... ./configure: 38799: shift: can't shift that many And that's where it dies. The line is actually 38799 in the usage of shift. Bash will silently ignore shift if it runs out of variables to shift. Bourne shell gives the above error. And .. one other way bash and bourne differ is that bourne shell exits if any built-in fails. So .. since shift is a built-in and it ran out of arguments .. the configure script dies. Maybe you could test how many arguments you have with $# before calling shift. Notice exit status clause of shift in http://pubs.opengroup.org/onlinepubs/009695399/utilities/shift.html
Jonathan/Evan: which branch do you use? (master, 4.3, 4.2?) Would it be possible you attach your autogen.input? (or give params provided for autogen.sh) Indeed, taking example of Evan's case, I downloaded and installed Calibri (+ regenerated font cache), used dash instead of bash (even put SHELL=/bin/dash) but I don't get the lines: hecking for fc-match... /usr/bin/fc-match checking font mapping for 'Calibri' Here's my output: ... checking whether to include third-party fonts... yes checking whether to include extra galleries... yes checking whether to include extra templates... yes checking whether to include extra samples... yes checking whether to include extra fonts... no checking whether to enable online update... yes checking whether to create MSI with LIMITUI=1 (silent install)... no checking whether and how to use Xinerama... yes, with dynamic linking checking X11/extensions/Xinerama.h usability... yes checking X11/extensions/Xinerama.h presence... yes ...
In my case, I'm using Gentoo's build scripts, which do not run autogen.sh. I am building version 4.3.1.2, and have explicitly set --with-external-tar=; not setting that causes the build to work further than setting it does. The complete configure command line is: ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --libdir=/usr/lib64 --docdir=/usr/share/doc/libreoffice-4.3.1.2/ --with-system-headers --with-system-libs --with-system-jars --with-system-dicts --enable-cairo-canvas --enable-graphite --enable-largefile --enable-neon --enable-python=system --enable-randr --enable-randr-link --enable-release-build --disable-hardlink-deliver --disable-ccache --disable-crashdump --disable-dependency-tracking --disable-epm --disable-fetch-external --disable-gnome-vfs --disable-gstreamer-0-10 --disable-report-builder --disable-kdeab --disable-kde --disable-mergelibs --disable-online-update --disable-systray --with-alloc=system --with-build-version="Gentoo official package" --enable-extension-integration --with-external-dict-dir=/usr/share/myspell --with-external-hyph-dir=/usr/share/myspell --with-external-thes-dir=/usr/share/myspell --with-external-tar=/tmp/portage/app-office/libreoffice-4.3.1.2/distdir --with-lang= --with-parallelism=16 --with-system-ucpp --with-vendor="Gentoo Foundation" --with-x --without-fonts --without-myspell-dicts --without-help --with-helppack-integration --without-sun-templates --enable-sdremote-bluetooth --disable-coinmp --disable-collada --enable-cups --disable-debug --enable-dbus --disable-evolution2 --disable-firebird-sdbc --disable-gltf --disable-gconf --disable-gio --disable-lockdown --enable-gstreamer --enable-gtk --disable-gtk3 --enable-kde4 --disable-ext-mariadb-connector --disable-odk --enable-opengl --disable-postgresql-sdbc --disable-telepathy --enable-vba --disable-vlc --without-system-coinmp --without-system-libgltf --without-java --without-system-mysql-cppconn --without-doxygen --without-system-sane --without-system-vigra --disable-ext-nlpsolver --disable-scripting-beanshell --disable-scripting-javascript --disable-ext-wiki-publisher This fails when the AbsolutePath function attempts to run the following line (line 75 of configure.ac): cd - &> /dev/null This code did not work in dash, as "&>" is not valid in POSIX sh. It ended up causing the code following to run in the external tar directory, which is not writable by the user running the build under this build system (instead of in the source directory, which is). After updating dash to a later version, dash now parses that line as two commands: cd - & > /dev/null This is valid, but does not send the output to /dev/null as expected.
Jonathan: Still not valid as its treating it as if & meant to run it in the background as part of an asynchronous list. Its supposed to read it as cd - >/dev/null 2>&1 It's bash shorthand. I'm surprised dash supported "cd -" as I don't think that's posix. Julien: I'm running Gentoo's sister, funtoo. At the moment, I'm doing a full system recompile (not world, just system tools for now) to make sure there are no mistakes on this end, and upgrading to a slightly newer GCC. This means all the automake tools and such will all be rebuilt. Once this is done, I'll try libreoffice again without changing the shell (still dash), and see if I can track down which ./configure flags are causing the issue. I don't believe Gentoo systems normally run automake, but its quite possible that running it to rebuild the configure script could help. I think configure is already made upstream, so Gentoo doesn't tinker with it, but I think autogen may actually be the issue after researching this. I think if autogen is run with a shell that excepts bashism, it generates a configure that does as well. I have to confirm this. The recompile may take quite awhile, but I keep you posted as to what I can find out so that you have all the information you need to track this down.
Thank you for your feedback both of you. I put it at NEW Bjoern/Michael: Jonathan and Evan indicated bashisms, one for you?
configure should run on any /bin/sh, please submit patches against master https://wiki.documentfoundation.org/Development/gerrit
I tried comment 6 but had this: configure: error: Package requirements (libe-book-0.1 >= 0.1.1) were not met: No package 'libe-book-0.1' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables EBOOK_CFLAGS and EBOOK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. However, libe-book is installed, since I've got this: Package: libe-book-0.1-1 Source: libe-book Version: 0.1.1-2 I checked PKG_CONFIG_PATH and EBOOK_CFLAGS, they're empty. So I did "export PKG_CONFIG_PATH=/usr/lib" (since libe-book-0.1.so.1 and libe-book-0.1.so.1.0.1 are there) but no result. It seems Gentoo and related are quite different from Debian.
(In reply to Julien Nabet from comment #10) > I tried comment 6 but had this: > configure: error: Package requirements (libe-book-0.1 >= 0.1.1) were not met: > > No package 'libe-book-0.1' found > > Consider adjusting the PKG_CONFIG_PATH environment variable if you > installed software in a non-standard prefix. > > Alternatively, you may set the environment variables EBOOK_CFLAGS > and EBOOK_LIBS to avoid the need to call pkg-config. > See the pkg-config man page for more details. > > However, libe-book is installed, since I've got this: > Package: libe-book-0.1-1 > Source: libe-book > Version: 0.1.1-2 > > I checked PKG_CONFIG_PATH and EBOOK_CFLAGS, they're empty. > > So I did "export PKG_CONFIG_PATH=/usr/lib" (since libe-book-0.1.so.1 and > libe-book-0.1.so.1.0.1 are there) but no result. > > It seems Gentoo and related are quite different from Debian. You have a different issue. You probaby need to install the package "libe-book-dev". The build system is looking for the file "libe-book-0.1.pc", which is in the -dev package.
(In reply to Jonathan Callen from comment #11) > (In reply to Julien Nabet from comment #10) > > I tried comment 6 but had this: > > configure: error: Package requirements (libe-book-0.1 >= 0.1.1) were not met: > > > > No package 'libe-book-0.1' found > > ... > > You have a different issue. You probaby need to install the package > "libe-book-dev". The build system is looking for the file > "libe-book-0.1.pc", which is in the -dev package. It worked indeed. Now it complains with this: No package 'libetonyek-0.1' found I changed a bit the options to have this: ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --libdir=/usr/lib64 --enable-cairo-canvas --enable-graphite --enable-largefile --enable-neon --enable-python=system --enable-randr --enable-randr-link --enable-release-build --disable-hardlink-deliver --disable-ccache --disable-crashdump --disable-dependency-tracking --disable-epm --disable-fetch-external --disable-gnome-vfs --disable-gstreamer-0-10 --disable-report-builder --disable-kdeab --disable-kde --disable-mergelibs --disable-online-update --disable-systray --with-alloc=system --with-build-version="Gentoo official package" --enable-extension-integration --with-external-dict-dir=/usr/share/myspell --with-external-hyph-dir=/usr/share/myspell --with-external-thes-dir=/usr/share/myspell --with-lang= --with-parallelism=16 --with-system-ucpp --with-vendor="Gentoo Foundation" --with-x --without-fonts --without-myspell-dicts --without-help --with-helppack-integration --without-sun-templates --enable-sdremote-bluetooth --disable-coinmp --disable-collada --enable-cups --disable-debug --enable-dbus --disable-evolution2 --disable-firebird-sdbc --disable-gltf --disable-gconf --disable-gio --disable-lockdown --enable-gstreamer --enable-gtk --disable-gtk3 --disable-ext-mariadb-connector --disable-odk --enable-opengl --disable-postgresql-sdbc --disable-telepathy --enable-vba --disable-vlc --without-system-coinmp --without-system-libgltf --without-java --without-system-mysql-cppconn --without-doxygen --without-system-sane --without-system-vigra --disable-ext-nlpsolver --disable-scripting-beanshell --disable-scripting-javascript --disable-ext-wiki-publisher --enable-python=internal I removed kde4 + system libs + add python internal It's ok fo me. It seems, I won't be of any help here.
I found this link which may help: http://www.shellcheck.net
(In reply to Julien Nabet from comment #5) > SHELL=/bin/dash) but I don't get the lines: > hecking for fc-match... /usr/bin/fc-match > checking font mapping for 'Calibri' Autoconf checks if /bin/sh is POSIXy enough before continuing. If it isn't, configure automatically reruns itself with /bin/bash. Debian devs wanted to make dash fully POSIX-compliant but this caused too many headaches[1], so they disabled the one feature Autoconf checks to detect shells' POSIX-ness: LINENO support. Bottom line, if you want to run ./configure with dash you need to set the following environment variable: CONFIG_SHELL=/bin/dash. (In reply to Evan Langlois from comment #4) > checking font mapping for 'Calibri'... ./configure: 38799: shift: can't > shift that many I hit the same issue. Patch coming up. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582952
Created attachment 111420 [details] Remove bashisms from configure.ac
Created attachment 111424 [details] configure.ac: remove bashisms, see fdo#85214 Here's a properly crafted git patch that applies on today's master head.
Applied: http://cgit.freedesktop.org/libreoffice/core/commit/?id=f53e79acd0d42f5c41e1104056af9cf23e9e2e2a Thanks!
Closing the report assuming that the above commit fixes the reported issue.