Thread: Bug #611: configure script produces incorrect results under IRIX
Bug #611: configure script produces incorrect results under IRIX
From
pgsql-bugs@postgresql.org
Date:
Jonathan C. Patschke (jp@celestrion.net) reports a bug with a severity of 2 The lower the number the more severe it is. Short Description configure script produces incorrect results under IRIX Long Description Under IRIX (and, presumably, other commercial UNIX platforms), the configure script in the root of the source distributioncauses a number of tests to fail, where they should pass. Some of these tests (detecting the presence of vsnprintf()and snprintf() in the system headers, for example) must pass for the resulting code to compile with MIPSpro C. The root cause of this problem is that the script interpreter for the configure script is /bin/sh. The configure scriptis NOT a /bin/sh compatible script. It requires GNU BASH to execute properly. This may, in all actuality, be an autoconfbug or an IRIX /bin/sh bug, but it hindered my using PostgreSQL. WORKAROUND: Edit the configure script to run under /usr/freeware/bin/bash, rather than /bin/sh. Or call the script as "bashconfigure [options]" SUGGESTED SOLUTION: Since not everyone installs bash in the same location. the configure script should test its interpreterand throw an error if not running inside BASH. Sample Code Inserting the following code into the configure script will produce the effect I recommended above. I placed the code justbefore the line reading "# Defaults:", and it worked well for me; however, putting it -after- the help generation codeexits might be more fruitful. I'm not an autoconf guru, so I wouldn't know where to put the code in configure.in. ## Begin sample code if [ "" = "$BASH_VERSION" ] ; then echo '*** ERROR: Not running in BASH ***' echo '' echo "The PostgreSQL configure script requires the GNU BASH" echo "command interpreter. If you do not have a copy of BASH," echo "you may obtain one at the following URL:" echo '' echo " http://www.gnu.org/software/bash/bash.html" echo '' echo "If BASH is already installed on your system, please execute" echo "the configure script in the following manner:" echo '' echo ' bash configure [options]' echo '' exit 1; fi ## End sample code No file was uploaded with this report
pgsql-bugs@postgresql.org writes: > The root cause of this problem is that the script interpreter for the > configure script is /bin/sh. The configure script is NOT a /bin/sh > compatible script. It requires GNU BASH to execute properly. Hardly, considering that I don't have GNU BASH installed at all here ;-) There may well be something in the script that is not perfectly portable, but if so, please tell us exactly what, so we can fix it. "Use GNU BASH" is not a portable answer either --- we will most certainly not put anything in the script to deliberately prevent it from working on non-BASH shells. regards, tom lane