From: Eric Backus Subject: autoconf 2.12 To: bug-gnu-utils@prep.ai.mit.edu Date: Mon, 2 Dec 96 14:12:53 PST I recently got autoconf-2.12.tar.gz from prep.ai.mit.edu. I was able to configure, compile, and install this package successfully on my HP 725/100 running HP-UX 9.05. Thanks! I ran into one problem with autoconf 2.12 that was not there in autoconf 2.11. When configuring the package, I got this output: creating cache ./config.cache checking for gm4... no checking for gnum4... no checking for m4... /usr/gnu/bin/m4 checking for mawk... no checking for gawk... gawk checking for perl... /usr/gnu/bin/perl checking for a BSD compatible install... /usr/gnu/bin/install -c ./configure: sh internal 2K buffer overflow updating cache ./config.cache creating ./config.status creating Makefile creating testsuite/Makefile Note the "./configure: sh internal 2K buffer overflow" error message. It turns out that the 2.12 configure script uses a construct that 2.11 didn't, and which causes an error in my shell. Fortunately, the only bad thing caused by this error is the config.cache file is left empty. The offending lines in the configure script are (starting at line 758 of the configure script): (set) 2>&1 | case `(ac_space=' '; set) 2>&1` in <-- This is causing the problem *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache Apparently the call to "set" in the case statement word is causing a buffer to overflow in my shell. I tried experimenting with different shells on my system, and found: /bin/ksh ok /bin/posix/sh ok /usr/gnu/bin/bash ok /bin/sh buffer overflow The following diff fixes the problem on my machine, but I don't know if it would break the test for non-POSIX quoting. However, the real fix will of course have to be in one of the autoconf m4 files rather than in configure, since configure is created from them. *** configure~ Sun Dec 1 15:50:56 1996 --- configure Mon Dec 2 14:06:32 1996 *************** *** 756,762 **** # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | ! case `(ac_space=' '; set) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). --- 756,762 ---- # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | ! case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). -- Eric Backus http://labejb.lsid.hp.com/ PGP: B6 CC EC B2 CD A4 79 A8 1C BF 19 96 69 EE E5 CC (206) 335-2495