Search code examples
newlineconfigureautotoolsautoconfautomake

configure.ac with CRLF line endings


If an Autotools project is checked out on Windows using MSys Git (as opposed to Cygwin Git), line endings of the checked-out files will have Windows-native CRLF style (unless configured otherwise in the global ~/.gitconfig). There're, of course, multiple other ways to obtain the configure.ac project file with CRLF line endings.

autoreconf can consume such a file and silently produce the executable configure script, which, when executed, will produce an obscure error message and exit with code 1:

.in'ig.status: error: cannot find input file: `

A capable difftool will show there're regular LF endings mixed with CRLF's in the generated configure script:

enter image description here

Is it possible to somehow tell autoreconf (either via command-line switches or via AC_* m4 macros) to automatically convert CRLF to LF when reading its input?


Solution

  • Is it possible to somehow tell autoreconf (either via command-line switches or via AC_* m4 macros) to automatically convert CRLF to LF when reading its input?

    autoreconf's --help text or manual page would have shown you that no, it does not offer any such command-line option.

    There also is no standard Autoconf macro that would serve the purpose (check its manual if you want to confirm), nor do I know or see a way that GNU m4 can be directly instructed to perform the requested conversion. (But perhaps there's an m4 wizard around somewhere who could provide a suitable spell.)