configure: Make Cygwin take regular configure path
authorTomohiro Kusumi <tkusumi@tuxera.com>
Tue, 7 Mar 2017 20:13:08 +0000 (22:13 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 10 Mar 2017 21:43:37 +0000 (14:43 -0700)
commitca205a752c3d6ebe7de74a3dfe81808e48a502e3
tree2f803bf1bcede88218a0795ddb7b1439206f0d43
parent710bf9c592b849935e1bcc56ffc805fa1d5f9365
configure: Make Cygwin take regular configure path

Cygwin (and only Cygwin) has been using customized configure process
by forcing hard-coded "known good options" without going through
regular compile_prog() based configure path. This was necessary due
to difference from other Unix likes, but it could be changed so that
Cygwin at least takes the regular configure path while continue to
use hard-coded configurations. This makes the configure script less
platform specific.

This commit basically gets rid of "exit 0" part from Cygwin case,
which enables Cygwin to go through the regular compile_prog() based
configure path. Removing "exit 0" requires some other small fixes
explained below so that Cygwin outputs consistent results (i.e. don't
ignore hard-coded configurations and lie on outputs).

Also note that this commit does nothing to Linux or other platforms.
It only affects Cygwin or any other platform that wants to override
or ignore regular configure path (i.e. compile_prog() results) in
the future. If there's any specific reason Cygwin has to workaround
the regular configure path, this shouldn't be applied, but there
seems to be no reason not to do so as it compiles and runs on Cygwin.

--
0. Remove "exit 0" in Cygwin case which is the main objective.

1. Change hard-coded output_sym() calls in Cygwin case to use shell
variables that have been used and initialized with "no" in the regular
compile_prog() based configure path.

2. Change the regular compile_prog() based configure path to check
if shell variables have already been initialized with "yes", and
initialize them with "no" only if they haven't been set to "yes",
so that shell variables statically initialized with "yes" in Cygwin
case don't get reset. This does nothing to Linux/etc because they
never preconfigure variables with "yes".

3. Get rid of output_sym "CONFIG_LITTLE_ENDIAN" call in Cygwin case.
This doesn't need to be here as endianness detection isn't anything
specific to Cygwin. Although x86 is the only supported arch, the regular
compile_prog() based configure path can detect it, and if it doesn't
then a compiler is probably broken.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
configure