Search code examples
bashcompiler-errorsconfigmsys2

I was trying to run ./configure file with MSYS but I get Syntax Error near unexpected token?


When I try to run ./configure.ac file with MSYS .sh from the command line with mingw64 compiler, I get the following Error from the ./configure file.

Error:

./configure.ac: line 11: syntax error near unexpected token `[svnversion],'
./configure.ac: line 11: `define([svnversion], esyscmd([sh -c "C:\trunk\bin\run_svnversion_if_it_exists.bash|tr -d '\n'"]))dnl'
sh-4.3$

From this Code:

define([svnversion], esyscmd([sh -c "C:\trunk\bin\run_svnversion_if_it_exists.bash|tr -d '\n'"]))dnl
AC_INIT([oomph-lib],[1.0.svnversion],[***@contact])

Is there another way to define SVN version or call it from the bash file?


Solution

  • No, configure.ac is a not a Bash script. Note that configure.ac is different from configure because it ends with .ac. If whatever project you are trying to compile has a configure script, that should be a Bash script that you can run. If it only has configure.ac, you have to run some arcane series of GNU autotools commands to generate a configure script from it (e.g. autoconf, autoreconf). Look at the documentation for your that project to figure out what commands to run.