diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-07-23 20:56:13 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-23 20:56:13 -0700 |
commit | a122c42e6fb5e8bd3b42634be50c4d48b2cb6599 (patch) | |
tree | 61e07369042fb3efdbcb94d4dc94cc1cd07da0f9 | |
parent | 7ccb9459736e9cfcc543229a4ac3e7039e2d54e3 (diff) | |
parent | 8242ff470f2a34b5c0f193c4010cbf3d9b57f9bd (diff) | |
download | git-a122c42e6fb5e8bd3b42634be50c4d48b2cb6599.tar.gz |
Merge branch 'sl/autoconf'
* sl/autoconf:
build: reconfigure automatically if configure.ac changes
build: "make clean" should not remove configure-generated files
autoconf: use AC_CONFIG_COMMANDS instead of ad-hoc 'config.mak.append'
autoconf: remove few redundant semicolons
autoconf: remove some redundant shell indirections
autoconf: GIT_CONF_APPEND_LINE -> GIT_CONF_SUBST
autoconf: GIT_CONF_APPEND_LINE: change signature
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | configure.ac | 56 |
2 files changed, 46 insertions, 27 deletions
@@ -2158,6 +2158,18 @@ configure: configure.ac GIT-VERSION-FILE autoconf -o $@ $<+ && \ $(RM) $<+ +ifdef AUTOCONFIGURED +config.status: configure + $(QUIET_GEN)if test -f config.status; then \ + ./config.status --recheck; \ + else \ + ./configure; \ + fi +reconfigure config.mak.autogen: config.status + $(QUIET_GEN)./config.status +.PHONY: reconfigure # This is a convenience target. +endif + XDIFF_OBJS += xdiff/xdiffi.o XDIFF_OBJS += xdiff/xprepare.o XDIFF_OBJS += xdiff/xutils.o @@ -2742,6 +2754,9 @@ dist-doc: distclean: clean $(RM) configure + $(RM) config.log config.status config.cache + $(RM) config.mak.autogen config.mak.append + $(RM) -r autom4te.cache profile-clean: $(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs))) @@ -2756,8 +2771,6 @@ clean: profile-clean $(RM) -r $(dep_dirs) $(RM) -r po/build/ $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope* - $(RM) -r autom4te.cache - $(RM) config.log config.mak.autogen config.mak.append config.status config.cache $(RM) -r $(GIT_TARNAME) .doc-tmp-dir $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz $(RM) $(htmldocs).tar.gz $(manpages).tar.gz diff --git a/configure.ac b/configure.ac index 4e9012f49b..df7e376590 100644 --- a/configure.ac +++ b/configure.ac @@ -3,11 +3,24 @@ ## Definitions of private macros. -# GIT_CONF_APPEND_LINE(LINE) -# -------------------------- -# Append LINE to file ${config_append} -AC_DEFUN([GIT_CONF_APPEND_LINE], - [echo "$1" >> "${config_append}"]) +# GIT_CONF_SUBST(VAL, VAR) +# ------------------------ +# Cause the line "VAR=VAL" to be eventually appended to ${config_file}. +AC_DEFUN([GIT_CONF_SUBST], + [AC_REQUIRE([GIT_CONF_SUBST_INIT]) + config_appended_defs="$config_appended_defs${newline}$1=$2"]) + +# GIT_CONF_SUBST_INIT +# ------------------- +# Prepare shell variables and autoconf machine required by later calls +# to GIT_CONF_SUBST. +AC_DEFUN([GIT_CONF_SUBST_INIT], + [config_appended_defs=; newline=' +' + AC_CONFIG_COMMANDS([$config_file], + [echo "$config_appended_defs" >> "$config_file"], + [config_file=$config_file + config_appended_defs="$config_appended_defs"])]) # GIT_ARG_SET_PATH(PROGRAM) # ------------------------- @@ -29,13 +42,12 @@ AC_DEFUN([GIT_ARG_SET_PATH], # --without-PROGRAM is used. AC_DEFUN([GIT_CONF_APPEND_PATH], [m4_pushdef([GIT_UC_PROGRAM], m4_toupper([$1]))dnl - PROGRAM=GIT_UC_PROGRAM if test "$withval" = "no"; then if test -n "$2"; then GIT_UC_PROGRAM[]_PATH=$withval - AC_MSG_NOTICE([Disabling use of ${PROGRAM}]) - GIT_CONF_APPEND_LINE(NO_${PROGRAM}=YesPlease) - GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=) + AC_MSG_NOTICE([Disabling use of GIT_UC_PROGRAM]) + GIT_CONF_SUBST([NO_]GIT_UC_PROGRAM, [YesPlease]) + GIT_CONF_SUBST(GIT_UC_PROGRAM[]_PATH, []) else AC_MSG_ERROR([You cannot use git without $1]) fi @@ -45,7 +57,7 @@ AC_DEFUN([GIT_CONF_APPEND_PATH], else GIT_UC_PROGRAM[]_PATH=$withval AC_MSG_NOTICE([Setting GIT_UC_PROGRAM[]_PATH to $withval]) - GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=$withval) + GIT_CONF_SUBST(GIT_UC_PROGRAM[]_PATH, [$withval]) fi fi m4_popdef([GIT_UC_PROGRAM])]) @@ -58,7 +70,6 @@ AC_DEFUN([GIT_CONF_APPEND_PATH], # * Unset NO_PACKAGE for --with-PACKAGE without ARG AC_DEFUN([GIT_PARSE_WITH], [m4_pushdef([GIT_UC_PACKAGE], m4_toupper([$1]))dnl - PACKAGE=GIT_UC_PACKAGE if test "$withval" = "no"; then NO_[]GIT_UC_PACKAGE=YesPlease elif test "$withval" = "yes"; then @@ -67,7 +78,7 @@ AC_DEFUN([GIT_PARSE_WITH], NO_[]GIT_UC_PACKAGE= GIT_UC_PACKAGE[]DIR=$withval AC_MSG_NOTICE([Setting GIT_UC_PACKAGE[]DIR to $withval]) - GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval) + GIT_CONF_SUBST(GIT_UC_PACKAGE[DIR], [$withval]) fi m4_popdef([GIT_UC_PACKAGE])]) @@ -87,7 +98,7 @@ AC_DEFUN([GIT_PARSE_WITH_SET_MAKE_VAR], [a value for $1 ($2). Maybe you do...?]) fi AC_MSG_NOTICE([Setting $2 to $withval]) - GIT_CONF_APPEND_LINE($2=$withval) + GIT_CONF_SUBST([$2], [$withval]) fi)])# GIT_PARSE_WITH_SET_MAKE_VAR # @@ -135,10 +146,9 @@ AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org]) AC_CONFIG_SRCDIR([git.c]) config_file=config.mak.autogen -config_append=config.mak.append config_in=config.mak.in -echo "# ${config_append}. Generated by configure." > "${config_append}" +GIT_CONF_SUBST([AUTOCONFIGURED], [YesPlease]) # Directories holding "saner" versions of common or POSIX binaries. AC_ARG_WITH([sane-tool-path], @@ -150,7 +160,7 @@ AC_ARG_WITH([sane-tool-path], else AC_MSG_NOTICE([Setting SANE_TOOL_PATH to '$withval']) fi - GIT_CONF_APPEND_LINE([SANE_TOOL_PATH=$withval])], + GIT_CONF_SUBST([SANE_TOOL_PATH], [$withval])], [# If the "--with-sane-tool-path" option was not given, don't touch # SANE_TOOL_PATH here, but let defaults in Makefile take care of it. # This should minimize spurious differences in the behaviour of the @@ -169,7 +179,7 @@ AC_ARG_WITH([lib], else lib=$withval AC_MSG_NOTICE([Setting lib to '$lib']) - GIT_CONF_APPEND_LINE(lib=$withval) + GIT_CONF_SUBST([lib], [$withval]) fi]) if test -z "$lib"; then @@ -205,7 +215,7 @@ AC_ARG_ENABLE([jsmin], [ JSMIN=$enableval; AC_MSG_NOTICE([Setting JSMIN to '$JSMIN' to enable JavaScript minifying]) - GIT_CONF_APPEND_LINE(JSMIN=$enableval); + GIT_CONF_SUBST([JSMIN], [$enableval]) ]) # Define option to enable CSS minification @@ -215,7 +225,7 @@ AC_ARG_ENABLE([cssmin], [ CSSMIN=$enableval; AC_MSG_NOTICE([Setting CSSMIN to '$CSSMIN' to enable CSS minifying]) - GIT_CONF_APPEND_LINE(CSSMIN=$enableval); + GIT_CONF_SUBST([CSSMIN], [$enableval]) ]) ## Site configuration (override autodetection) @@ -256,7 +266,7 @@ AS_HELP_STRING([], [ARG can be also prefix for libpcre library and hea USE_LIBPCRE=YesPlease LIBPCREDIR=$withval AC_MSG_NOTICE([Setting LIBPCREDIR to $withval]) - GIT_CONF_APPEND_LINE(LIBPCREDIR=$withval) + GIT_CONF_SUBST([LIBPCREDIR], [$withval]) fi) # # Define NO_CURL if you do not have curl installed. git-http-pull and @@ -1043,9 +1053,5 @@ AC_SUBST(PTHREAD_LIBS) AC_SUBST(NO_PTHREADS) ## Output files -AC_CONFIG_FILES(["${config_file}":"${config_in}":"${config_append}"]) +AC_CONFIG_FILES(["${config_file}":"${config_in}"]) AC_OUTPUT - - -## Cleanup -rm -f "${config_append}" |