./configure script does not detect Alex version 3.5.0.0
Summary
./configure
fails when using Alex version 3.5.0.0.
checking for version of alex... Option '--verbose' not yet implementedUsage: alex [OPTION...] file
-o FILE --outfile=FILE write the output to FILE (default: file.hs)
-i[FILE] --info[=FILE] put detailed state-machine info in FILE (or file.info)
-t DIR --template=DIR look in DIR for template files
-g --ghc use GHC extensions
-l --latin1 generated lexer will use the Latin-1 encoding instead of UTF-8
-s NUMBER --tab-size=NUMBER set tab size to be used in the generated lexer (default: 8)
-d --debug produce a debugging scanner
-v --verbose be verbose (not yet implemented)
-? --help display this help and exit
-V --version output version information and exit
--numeric-version output the version number and exit
configure: error: Alex >= 3.2.6 && < 4 is required to compile GHC.
In the script, the version of alex is checked via:
fptools_cv_alex_version=`"$AlexCmd" -v |
grep 'Alex [Vv]ersion' | sed -e 's/Alex [Vv]ersion \([0-9\.]*\).*/\1/g'` ;
However, -v
(at least for version 3.5.0.0) is short for verbose. Manually changing the flag to -V
fixes the issue.
I am not familiar with Alex, but I guess there could be a version update that changed the short flag for version lookup from -v
to -V
.
Perhaps using the long flag --version
can achieve backward compatibility?
Steps to reproduce
Install the latest version of Alex, then /boot && ./configure
after pulling/cloning from master.
Expected behavior
Build successful
Environment
- GHC version used: 9.4.7
Optional:
- Operating System: OS X Ventura 13.4.1
- System Architecture: AArch64