Skip to content

Commit 3a34c2b

Browse files
slattarinigitster
authored andcommitted
build: improve GIT_CONF_SUBST signature
Now, in configure.ac, a call like: GIT_CONF_SUBST([FOO]) will be considered equivalent to: GIT_CONF_SUBST([FOO], [$FOO]) This is mostly a preparatory refactoring in view of future changes. No semantic change to the generated configure or config.mak.auto is intended. Signed-off-by: Stefano Lattarini <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 682ce8b commit 3a34c2b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

configure.ac

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
# ------------------------
88
# Cause the line "VAR=VAL" to be eventually appended to ${config_file}.
99
AC_DEFUN([GIT_CONF_SUBST],
10-
[AC_REQUIRE([GIT_CONF_SUBST_INIT])
11-
config_appended_defs="$config_appended_defs${newline}$1=$2"])
10+
[AC_REQUIRE([GIT_CONF_SUBST_INIT])
11+
config_appended_defs="$config_appended_defs${newline}dnl
12+
$1=m4_if([$#],[1],[${$1}],[$2])"])
1213

1314
# GIT_CONF_SUBST_INIT
1415
# -------------------
@@ -179,7 +180,7 @@ AC_ARG_WITH([lib],
179180
else
180181
lib=$withval
181182
AC_MSG_NOTICE([Setting lib to '$lib'])
182-
GIT_CONF_SUBST([lib], [$withval])
183+
GIT_CONF_SUBST([lib])
183184
fi])
184185

185186
if test -z "$lib"; then
@@ -215,7 +216,7 @@ AC_ARG_ENABLE([jsmin],
215216
[
216217
JSMIN=$enableval;
217218
AC_MSG_NOTICE([Setting JSMIN to '$JSMIN' to enable JavaScript minifying])
218-
GIT_CONF_SUBST([JSMIN], [$enableval])
219+
GIT_CONF_SUBST([JSMIN])
219220
])
220221

221222
# Define option to enable CSS minification
@@ -225,7 +226,7 @@ AC_ARG_ENABLE([cssmin],
225226
[
226227
CSSMIN=$enableval;
227228
AC_MSG_NOTICE([Setting CSSMIN to '$CSSMIN' to enable CSS minifying])
228-
GIT_CONF_SUBST([CSSMIN], [$enableval])
229+
GIT_CONF_SUBST([CSSMIN])
229230
])
230231

231232
## Site configuration (override autodetection)
@@ -265,8 +266,8 @@ AS_HELP_STRING([], [ARG can be also prefix for libpcre library and hea
265266
else
266267
USE_LIBPCRE=YesPlease
267268
LIBPCREDIR=$withval
268-
AC_MSG_NOTICE([Setting LIBPCREDIR to $withval])
269-
GIT_CONF_SUBST([LIBPCREDIR], [$withval])
269+
AC_MSG_NOTICE([Setting LIBPCREDIR to $LIBPCREDIR])
270+
GIT_CONF_SUBST([LIBPCREDIR])
270271
fi)
271272
#
272273
# Define NO_CURL if you do not have curl installed. git-http-pull and

0 commit comments

Comments
 (0)