Menu

#747 Non-POSIX constructs present in configuration macros

None
analyzed
nobody
None
5
2014-04-13
2012-10-01
Kevin Zheng
No

Background: The 'configure' script uses a M4 file called "macros/cf_python.m4" to test for Python. Python is used for the Crossfire Python plugin, which is somewhat important (actually, very).

"cf_python.m4" contains a few bash-specific shell constructs. Specifically, the script uses brace expressions over strings, which is not defined in POSIX. This happens to break the script on BSD-systems as well as Ubuntu (see https://wiki.ubuntu.com/DashAsBinSh\). The 'checkbashisms' tool gives the following output:

possible bashism in macros/cf_python.m4 line 12 (brace expansion):
for dir in $PYTHON_HOME/include/python{,2.7,2.6,2.5,2.4,3.1,3.0} ; do
possible bashism in macros/cf_python.m4 line 23 (brace expansion):
for dir in /usr{,/local}/include/python{,2.7,2.6,2.5,2.4,3.1,3.0} ; do
possible bashism in macros/cf_python.m4 line 67 (brace expansion):
for lib in python{,2.7,2.6,2.5,2.4,3.1,3.0} ; do

We can replace this with another expression, or just expand it as a quick hack. The former is probably a better solution.

Discussion

  • Kurt Fitzner

    Kurt Fitzner - 2013-04-11

    Brace expansion has been removed from macros/cf_python.m4 in the latest SVN and replaced with POSIX-complient loops that manually piece together the version numbers with file names.

    Testing to see if it works on your system would be appreciated.

     
  • Kevin Zheng

    Kevin Zheng - 2013-07-14

    "macros/cf_python.m4" now works as expected, thanks! However, it seems that "macros/cf_xslt.m4" is broken as well.

    checking for xsltproc... /usr/local/bin/xsltproc
    checking for sabcmd... notfound
    checking xslt compliance of /usr/local/bin/xsltproc -o %3 %2 %1... ./configure: ${to_run/...}: Bad substitution
    
     
  • Kevin Zheng

    Kevin Zheng - 2013-08-30
    • summary: Bashisms break configure script for users of POSIX /bin/sh --> Non-POSIX constructs present in configuration macros
    • Group: --> 1.x_trunk
     
  • Kevin Zheng

    Kevin Zheng - 2014-01-21
    • status: open --> analyzed
     

Log in to post a comment.