diff options
author | Jatin Rungta <jatinrungta27@gmail.com> | 2016-12-23 17:55:44 +0300 |
---|---|---|
committer | rofl0r <retnyg@gmx.net> | 2016-12-24 15:36:42 +0300 |
commit | c91e6a09ef6fe749247438d687d26fd95fbc38b7 (patch) | |
tree | 27afe73f8ec52d9f22d575ef36c269d6d0f778aa | |
parent | bf6eeff75a69e9d560f3f5de48b1eb0a3d93309a (diff) |
Fix configure so the right CC gets picked up
unlike one would expect, setting `CC?=gcc -m32` in config.mak did not actually
lead to `gcc -m32` being used as compiler when running make, even though CC
was not declared anywhere else.
it appears as if the CC variable is implicitly defined by GNU make, so using
the ?= assignment (meaning "assign only if not already assigned") did not have
an effect.
when this configure script and Makefile here were written, they were modeled
after the interface provided by GNU autoconf (so there are no surprises for the
user). the assumption was that environment variables passed during configure
are usually stored and used for the compile, but can be overridden when running
make by exporting the variables again.
in reality though they can not be overridden by environment when running make,
as tests showed.
because of that, the other user-supplied variables will now be hard-assigned as
well.
closes #152
commit message by @rofl0r.
-rwxr-xr-x | configure | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -146,10 +146,10 @@ check_compile_run 'whether OpenBSDs fclose() (illegally) calls close()' \ '#include <stdio.h>\n#include<stdlib.h>\nint close(int x){exit(0);}int main(){fclose(stdin);return 1;}' && \ OUR_CPPFLAGS="$OUR_CPPFLAGS -DBROKEN_FCLOSE" -echo CC?=$CC>config.mak -[ -z "$CPPFLAGS" ] || echo CPPFLAGS?=$CPPFLAGS>>config.mak -[ -z "$CFLAGS" ] || echo USER_CFLAGS?=$CFLAGS>>config.mak -[ -z "$LDFLAGS" ] || echo USER_LDFLAGS?=$LDFLAGS>>config.mak +echo CC=$CC>config.mak +[ -z "$CPPFLAGS" ] || echo CPPFLAGS=$CPPFLAGS>>config.mak +[ -z "$CFLAGS" ] || echo USER_CFLAGS=$CFLAGS>>config.mak +[ -z "$LDFLAGS" ] || echo USER_LDFLAGS=$LDFLAGS>>config.mak echo prefix=$prefix>>config.mak echo exec_prefix=$exec_prefix>>config.mak echo bindir=$bindir>>config.mak |