Skip to content

Commit 99cccef

Browse files
slattarinigitster
authored andcommitted
configure: avoid some code repetitions thanks to m4_{push,pop}def
This change is just cosmetic, and should cause no semantic change, nor any change in the generated configure script. Signed-off-by: Stefano Lattarini <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e9e8c80 commit 99cccef

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

configure.ac

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ AC_DEFUN([GIT_ARG_SET_PATH],
2727
# Optional second argument allows setting NO_PROGRAM=YesPlease if
2828
# --without-PROGRAM is used.
2929
AC_DEFUN([GIT_CONF_APPEND_PATH],
30-
[PROGRAM=m4_toupper($1); \
30+
[m4_pushdef([GIT_UC_PROGRAM], m4_toupper([$1]))dnl
31+
PROGRAM=GIT_UC_PROGRAM; \
3132
if test "$withval" = "no"; then \
3233
if test -n "$2"; then \
33-
m4_toupper($1)_PATH=$withval; \
34+
GIT_UC_PROGRAM[]_PATH=$withval; \
3435
AC_MSG_NOTICE([Disabling use of ${PROGRAM}]); \
3536
GIT_CONF_APPEND_LINE(NO_${PROGRAM}=YesPlease); \
3637
GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=); \
@@ -41,12 +42,12 @@ else \
4142
if test "$withval" = "yes"; then \
4243
AC_MSG_WARN([You should provide path for --with-$1=PATH]); \
4344
else \
44-
m4_toupper($1)_PATH=$withval; \
45-
AC_MSG_NOTICE([Setting m4_toupper($1)_PATH to $withval]); \
45+
GIT_UC_PROGRAM[]_PATH=$withval; \
46+
AC_MSG_NOTICE([Setting GIT_UC_PROGRAM[]_PATH to $withval]); \
4647
GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=$withval); \
4748
fi; \
4849
fi; \
49-
]) # GIT_CONF_APPEND_PATH
50+
m4_popdef([GIT_UC_PROGRAM])]) # GIT_CONF_APPEND_PATH
5051
#
5152
# GIT_PARSE_WITH(PACKAGE)
5253
# -----------------------
@@ -55,18 +56,19 @@ fi; \
5556
# * Set PACKAGEDIR=PATH for --with-PACKAGE=PATH
5657
# * Unset NO_PACKAGE for --with-PACKAGE without ARG
5758
AC_DEFUN([GIT_PARSE_WITH],
58-
[PACKAGE=m4_toupper($1); \
59+
[m4_pushdef([GIT_UC_PACKAGE], m4_toupper([$1]))dnl
60+
PACKAGE=GIT_UC_PACKAGE; \
5961
if test "$withval" = "no"; then \
60-
m4_toupper(NO_$1)=YesPlease; \
62+
NO_[]GIT_UC_PACKAGE=YesPlease; \
6163
elif test "$withval" = "yes"; then \
62-
m4_toupper(NO_$1)=; \
64+
NO_[]GIT_UC_PACKAGE=; \
6365
else \
64-
m4_toupper(NO_$1)=; \
65-
m4_toupper($1)DIR=$withval; \
66-
AC_MSG_NOTICE([Setting m4_toupper($1)DIR to $withval]); \
66+
NO_[]GIT_UC_PACKAGE=; \
67+
GIT_UC_PACKAGE[]DIR=$withval; \
68+
AC_MSG_NOTICE([Setting GIT_UC_PACKAGE[]DIR to $withval]); \
6769
GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval); \
6870
fi \
69-
])# GIT_PARSE_WITH
71+
m4_popdef([GIT_UC_PACKAGE])]) # GIT_PARSE_WITH
7072
#
7173
# GIT_PARSE_WITH_SET_MAKE_VAR(WITHNAME, VAR, HELP_TEXT)
7274
# ---------------------

0 commit comments

Comments
 (0)