GNOME Bugzilla – Bug 490042
shell choking on `( lines in configure script
Last modified: 2007-11-17 14:21:24 UTC
My shell is choking on some lines that contain `( in them, causing the configure script to abort, outputting: ./configure: line 29966: syntax error near unexpected token `(' ./configure: line 29966: ` for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do' I think the problem may be that /bin/sh is linked to zsh on my distro. I tried replacing all references to /bin/sh in the configure script with /bin/bash and starting configure from a bash prompt and got the same error; I'm not convinced the configure script was actually using bash for everything, though. I tried compiling an earlier version (0.10.9) using zsh and got a similar error on a different line: ./configure: line 28214: syntax error near unexpected token `(' ./configure: line 28214: ` case `(ac_space=' '; set | grep ac_space) 2>&1` in' I've marked this as "blocker" as it prevents compilation & package creation on any affected systems. I've tried zsh 4.3.4 (i686-pc-linux-gnu) zsh 4.2.6 (i686-pc-linux-gnu) GNU bash, version 3.2.0(1)-release (i686-pc-linux-gnu) Here's full output from configure in gstreamer 0.10.14: checking for a BSD-compatible install... /System/Links/Executables/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking nano version... 0 (release) checking whether to enable maintainer-specific portions of Makefiles... no checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /System/Links/Executables/sed checking for grep that handles long lines and -e... /System/Links/Executables/grep checking for egrep... /System/Links/Executables/grep -E checking for ld used by gcc... /System/Links/Executables/ld checking if the linker (/System/Links/Executables/ld) is GNU ld... yes checking for /System/Links/Executables/ld option to reload object files... -r checking for BSD-compatible nm... /System/Links/Executables/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for xlf... no checking for f77... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for xlf90... no checking for f90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for xlf95... no checking for f95... no checking for fort... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... expr: syntax error checking command to parse /System/Links/Executables/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/System/Links/Executables/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking for shl_load... no checking for shl_load in -ldld... no checking for dlopen... no checking for dlopen in -ldl... yes checking whether a program can dlopen itself... yes checking whether a statically linked program can dlopen itself... no checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /System/Links/Executables/ld checking if the linker (/System/Links/Executables/ld) is GNU ld... yes checking whether the g++ linker (/System/Links/Executables/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/System/Links/Executables/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for msgfmt... /System/Links/Executables/msgfmt checking for gmsgfmt... /System/Links/Executables/msgfmt checking for xgettext... /System/Links/Executables/xgettext checking for msgmerge... /System/Links/Executables/msgmerge checking for ld used by GCC... /System/Links/Executables/ld checking if the linker (/System/Links/Executables/ld) is GNU ld... yes checking for shared library run path origin... done checking whether NLS is requested... yes checking for GNU gettext in libc... yes checking for pkg-config... /System/Links/Executables/pkg-config checking pkg-config is at least version 0.9.0... yes checking for VALGRIND... no configure: Using GStreamer source release as package name configure: Using Unknown package origin as package origin configure: Using /System/Variable/cache/gstreamer-0.10 as registry cache dir configure: WARNING: Sissy ! By asking to not build the tests known to fail, you hereby waive your right to customer support. If you do not agree with this EULA, please press Ctrl-C before the next line is printed. By allowing the next line to be printed, you expressly acknowledge your acceptance of this EULA. checking whether byte ordering is bigendian... no checking if unaligned memory access works correctly... (whitelisted) yes checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... 64 checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking for perl... /System/Links/Executables/perl checking for bison... /System/Links/Executables/bison checking bison version 2.3 >= 1.875... yes checking for flex... /System/Links/Executables/flex checking flex version 2.5.33 >= 2.5.31... yes checking for valgrind... no configure: Looking for Python version >= 2.1 checking for python... /System/Links/Executables/python checking "/System/Links/Executables/python":... okay checking local Python configuration... looks good checking whether to build plugin documentation... no (gtk-doc disabled or not available) checking for strerror in -lcposix... no checking for cos in -lm... yes checking for ANSI C header files... (cached) yes checking ucontext.h usability... yes checking ucontext.h presence... yes checking for ucontext.h... yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/times.h usability... yes checking sys/times.h presence... yes checking for sys/times.h... yes checking for unistd.h... (cached) yes checking process.h usability... no checking process.h presence... no checking for process.h... no checking sys/utsname.h usability... yes checking sys/utsname.h presence... yes checking for sys/utsname.h... yes checking for inline... inline checking to see if compiler understands -fno-common... yes checking for sigaction... yes checking for fork... yes checking for _LARGEFILE_SOURCE value needed for large files... no checking for ftello... yes checking for fgetpos... yes checking for fsetpos... yes checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for getpagesize... yes checking for working mmap... yes checking whether gcc implements __PRETTY_FUNCTION__... yes checking whether gcc implements __FUNCTION__... yes checking whether gcc implements __func__... yes checking for register_printf_function... yes checking for dladdr in -ldl... yes checking for inet_aton... yes checking for GLIB... yes ./configure: line 29966: syntax error near unexpected token `(' ./configure: line 29966: ` for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do'
It seems to me that the configure script bits causing the problem are generated by autoconf and not by anything within GStreamer's build infrastructure. Is this correct? If yes, what are we supposed to do about it? Skim reading through http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_node/autoconf_115.html seems to suggest that there might be ways to make zsh more compatible with autoconf's output.
I'm not really sure how much of the configure script is part of GStreamer's build infrastructure and how much is autoconf generated. Does anyone know for sure? I'll file a bug with bug-autoconf@gnu.org if you guys are pretty sure it's an autoconf issue... The tips on shell compatibility all seem to be integrated into the top of the configure script already. In the meantime, anyone know of workarounds? BTW, I'm using autoconf 2.61, currently the latest.
Well, I can't say for sure, but it doesn't look like ours. Closing as NOTGNOME for now. Please re-open if the autoconf folks or you have evidence that this is something in our realm.
Not a GNOME bug, but a bash one, see: <http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/5792/focus=5793>
Good to know, thanks for the update!
*** Bug 497630 has been marked as a duplicate of this bug. ***