summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-20 08:00:17 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-20 08:00:17 -0800
commit2c679f9bd0abcd8412b9162c74a58ba1eace3ed5 (patch)
treeccafb9c2cc0af51de350a9a1f1325d300e8929c4 /configure
parent50cbab589eb6e5b841dd2e916a1026f477b7be15 (diff)
downloadtxr-2c679f9bd0abcd8412b9162c74a58ba1eace3ed5.tar.gz
txr-2c679f9bd0abcd8412b9162c74a58ba1eace3ed5.tar.bz2
txr-2c679f9bd0abcd8412b9162c74a58ba1eace3ed5.zip
Conform to standard Makefile conventions.
TXR's build should use the values of standard make variables: use the existing $(CC), $(CFLAGS), $(YACC), $(LDFLAGS) and such. * Makefile (TXR_CFLAGS): New variable. Initialized with the value of $(CFLAGS) and then customized. Used everywhere in place of CFLAGS. (CFLAGS): Now used only as the initial value of TXR_CFLAGS; no longer clobbered with the := assignment. Thus if a distribution of free software builds everything with certain CFLAGS, we incorporate those CFLAGS that it wants us to use. (TXR_LDFLAGS): New variable, initialized from $(LDFLAGS). Used in place of LDFLAGS. (LDFLAGS): Use only, do not modify. (NM): Replaced with TXR_NM. (YACC): Replaced with TXR_YACC. * configure (ccname): Default to $(CC) rather than gcc. (lex): Default name portion $(LEX) rather than flex; keep the optional prefixes. (gen_config_make): Generate TXR_CC, TXR_LEX, TXR_YACC and TXR_NM variables, rather than clobbering the standard ones CC, LEX and YACC. Also, in the rule that finds yacc, we now try '$(YACC)' first.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure20
1 files changed, 10 insertions, 10 deletions
diff --git a/configure b/configure
index 9c22bf38..7770872d 100755
--- a/configure
+++ b/configure
@@ -92,14 +92,14 @@ mandir='share/man'
make=
cross=
compiler_prefix=
-ccname=gcc
+ccname='$(CC)'
cc='$(cross)$(compiler_prefix)$(ccname)'
intptr=
exe=
tool_prefix=
-lex='$(cross)$(tool_prefix)flex'
+lex='$(cross)$(tool_prefix)$(LEX)'
yaccname_given=
-yaccname=
+yaccname='' # test tries $(YACC) first
yacc='$(cross)$(tool_prefix)$(yaccname)'
yacc_given=
nm='$(cross)$(tool_prefix)nm'
@@ -307,7 +307,7 @@ cc [$cc]
Specifies the name of the toolchain front-end driver command to use for
compiling C sources to object files, and for linking object files to
- executables. This becomes the CC variable in $config_make.
+ executables. This becomes the TXR_CC variable in $config_make.
intptr [$intptr]
@@ -682,10 +682,10 @@ have_git := $have_git
add_win_res := $([ -n "$have_windows_h" -a -n "$have_windres" ] && echo "y")
-CC := $cc
-LEX := $lex
-YACC := $yacc
-NM := $nm
+TXR_CC := $cc
+TXR_LEX := $lex
+TXR_YACC := $yacc
+TXR_NM := $nm
PROG := txr
@@ -1352,7 +1352,7 @@ printf "Checking for yacc program ... "
if [ -z "$yacc_given" -a -z "$yaccname_given" ] ; then
rm -f conftest.yacc
- for yaccname in "yacc" "byacc" "bison -y" "" ; do
+ for yaccname in '$(YACC)' "yacc" "byacc" "bison -y" "" ; do
yaccpath=$($make yaccname="$yaccname" conftest.yacc)
if command -v $yaccpath > /dev/null ; then
break;
@@ -1364,7 +1364,7 @@ if [ -z "$yacc_given" -a -z "$yaccname_given" ] ; then
exit 1
fi
- printf '"%s"\n' "$yaccpath"
+ printf '"%s" (path "%s")\n' "$yaccname" "$yaccpath"
else
yaccpath=$($make conftest.yacc)
case $yaccpath in