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 <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefano Lattarini committed Mar 26, 2012 at 18:42 UTC 99cccefbe0927027e69ba7ba96317eba42cec3cb
1 file changed +14 -12
configure.ac
+14 -12
@@ -27,10 +27,11 @@ AC_DEFUN([GIT_ARG_SET_PATH],
27 # Optional second argument allows setting NO_PROGRAM=YesPlease if
28 # --without-PROGRAM is used.
29 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; \
32 if test "$withval" = "no"; then \
33 if test -n "$2"; then \
33 - m4_toupper($1)_PATH=$withval; \
34 + GIT_UC_PROGRAM[]_PATH=$withval; \
35 AC_MSG_NOTICE([Disabling use of ${PROGRAM}]); \
36 GIT_CONF_APPEND_LINE(NO_${PROGRAM}=YesPlease); \
37 GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=); \
@@ -41,12 +42,12 @@ else \
42 if test "$withval" = "yes"; then \
43 AC_MSG_WARN([You should provide path for --with-$1=PATH]); \
44 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]); \
47 GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=$withval); \
48 fi; \
49 fi; \
49 -]) # GIT_CONF_APPEND_PATH
50 +m4_popdef([GIT_UC_PROGRAM])]) # GIT_CONF_APPEND_PATH
51 #
52 # GIT_PARSE_WITH(PACKAGE)
53 # -----------------------
@@ -55,18 +56,19 @@ fi; \
56 # * Set PACKAGEDIR=PATH for --with-PACKAGE=PATH
57 # * Unset NO_PACKAGE for --with-PACKAGE without ARG
58 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; \
61 if test "$withval" = "no"; then \
60 - m4_toupper(NO_$1)=YesPlease; \
62 + NO_[]GIT_UC_PACKAGE=YesPlease; \
63 elif test "$withval" = "yes"; then \
62 - m4_toupper(NO_$1)=; \
64 + NO_[]GIT_UC_PACKAGE=; \
65 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]); \
69 GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval); \
70 fi \
69 -])# GIT_PARSE_WITH
71 +m4_popdef([GIT_UC_PACKAGE])]) # GIT_PARSE_WITH
72 #
73 # GIT_PARSE_WITH_SET_MAKE_VAR(WITHNAME, VAR, HELP_TEXT)
74 # ---------------------