From c91e6a09ef6fe749247438d687d26fd95fbc38b7 Mon Sep 17 00:00:00 2001 From: Jatin Rungta Date: Fri, 23 Dec 2016 20:25:44 +0530 Subject: [PATCH] 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. --- configure | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 0eb560c..1996575 100755 --- a/configure +++ b/configure @@ -146,10 +146,10 @@ check_compile_run 'whether OpenBSDs fclose() (illegally) calls close()' \ '#include \n#include\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