summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorKrzesimir Nowak <qdlacz@gmail.com>2011-09-13 13:09:30 +0200
committerKrzesimir Nowak <qdlacz@gmail.com>2011-09-20 16:41:17 +0200
commit1553ebe1d99082dea2512dcb10aebd237ed53432 (patch)
tree3c64db35e5328932f41ba5dc70da5923f77a5d37 /configure.ac
parent3db44499e1e1ac81a4e4d16f2ef831649fb83f44 (diff)
downloadmm-common-1553ebe1d99082dea2512dcb10aebd237ed53432.tar.gz
Make downloading tags optional.
Allow networking to be disabled - may be useful for developers with no connection to Internet. By default networking is paired with maintainer mode, that is - it is enabled/disabled when maintainer mode is enabled/disabled. * configure.ac: Check for networking. Check for wget and curl if networking is enabled. * Makefile.am: Use NETWORK_ENABLED condition.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac33
1 files changed, 29 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 10f2320..d437cc2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,11 +32,36 @@ AC_PROG_SED
dnl list of tar execs is taken from the generated ./missing script.
AC_CHECK_PROGS([TAR], [tar gnutar gtar], [no])
AS_VAR_IF([TAR], [no], [AC_MSG_ERROR([tar utility not found])])
-AC_CHECK_PROG([CURL], [curl], [curl])
-AC_CHECK_PROG([WGET], [wget], [wget])
-AS_IF([test "x$USE_MAINTAINER_MODE" != xno && test "x$CURL$WGET" = x],
- [AC_MSG_FAILURE([[Either curl or wget is required for building mm-common.]])])
+AC_MSG_CHECKING([whether to enable network])
+AC_ARG_ENABLE([network],
+ [AS_HELP_STRING([--enable-network],
+ [use network to download tags if needed @<:@default=same as maintainer mode@:>@])],
+ [AS_VAR_IF([enableval], ['yes'],,
+ [AS_VAR_IF([enableval], ['no'],,
+ [AC_MSG_ERROR([[Pass either `yes', `no' or nothing to --enable-network.]])]
+ )
+ ]
+ )
+ AS_VAR_SET([enable_network], ["$enableval"])
+ ],
+ [AS_VAR_SET([enable_network], ["$USE_MAINTAINER_MODE"])]
+ )
+AC_SUBST([USE_NETWORK], ["$enable_network"])
+AM_CONDITIONAL(NETWORK_ENABLED, [test "x$enable_network" = 'xyes'])
+AC_MSG_RESULT([$USE_NETWORK])
+
+AS_VAR_IF([USE_NETWORK], ['yes'],
+ [AC_CHECK_PROG([CURL], [curl], [curl])
+ AC_CHECK_PROG([WGET], [wget], [wget])
+ AS_VAR_IF([CURL], [],
+ [AS_VAR_IF([WGET], [],
+ [AC_MSG_FAILURE([[Network is enabled so either curl or wget is required for building mm-common.]])]
+ )
+ ]
+ )
+ ]
+ )
AC_CONFIG_FILES([Makefile
doctags/mm-common-libstdc++.pc