AC_MSG_ERROR([$2])
fi
])
+
+AC_DEFUN([SQUID_EMBED_BUILD_INFO],[
+ AC_ARG_ENABLE([build-info],
+ AS_HELP_STRING([--enable-build-info="build info string"],
+ [Add an additional string in the output of "string -v".
+ Default is not to add anything. If the string is not specified,
+ tries to determine nick and revision number of the current
+ bazaar branch]),[
+ case "$enableval" in
+ no) ${TRUE}
+ ;;
+ yes)
+ if test -d "${srcdir}/.bzr"; then
+ AC_PATH_PROG(BZR,bzr,$FALSE)
+ squid_bzr_branch_nick=`${BZR} nick 2>/dev/null`
+ if test $? -eq 0 -a "x$squid_bzr_branch_nick" != "x"; then
+ squid_bzr_branch_revno=`${BZR} revno 2>/dev/null | sed 's/\"//g'`
+ fi
+ if test $? -eq 0 -a "x$squid_bzr_branch_revno" != "x"; then
+ ${BZR} diff 2>&1 >/dev/null
+ if test $? -eq 1; then
+ squid_bzr_branch_revno="$squid_bzr_branch_revno+changes"
+ fi
+ fi
+ if test "x$squid_bzr_branch_revno" != "x"; then
+ squid_build_info="Built branch: ${squid_bzr_branch_nick}-r${squid_bzr_branch_revno}"
+ fi
+ fi
+ ;;
+ *)
+ squid_build_info=$enableval
+ ;;
+ esac
+ ])
+ if test "x${squid_build_info:=no}" != "xno"; then
+ AC_DEFINE_UNQUOTED([SQUID_BUILD_INFO],["$squid_build_info"],
+ [Squid extended build info field for "squid -v" output])
+ fi
+])
SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_arg_pipe"
SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_arg_pipe"
+# possibly include some build info tag into squid -v
+SQUID_EMBED_BUILD_INFO
+
AC_ARG_ENABLE(optimizations,
AS_HELP_STRING([--disable-optimizations],
[Do not compile Squid with compiler optimizations enabled.
#endif
+#ifndef SQUID_BUILD_INFO
+#define SQUID_BUILD_INFO ""
+#endif
+
/** for error reporting from xmalloc and friends */
SQUIDCEXTERN void (*failure_notify) (const char *);
case 'v':
/** \par v
* Display squid version and build information. Then exit. */
- printf("Squid Cache: Version %s\nconfigure options: %s\n", version_string, SQUID_CONFIGURE_OPTIONS);
+ printf("Squid Cache: Version %s\n" ,version_string);
+ if (strlen(SQUID_BUILD_INFO))
+ printf("%s\n",SQUID_BUILD_INFO);
+ printf( "configure options: %s\n", SQUID_CONFIGURE_OPTIONS);
#if USE_WIN32_SERVICE
# above command currently encounters dependancy problems on cleanup.
#
# do not build any of the install's ...
- $base/../configure ${OPTS} ${configcache} 2>&1 &&
+#
+# eval is need to correctly handle quoted arguments
+ eval "$base/../configure ${SQUID_CONFIGURE_FLAGS} ${configcache}" \
+ 2>&1 && \
make ${pjobs} ${MAKETEST} 2>&1
# Remember and then explicitly return the result of the last command
# Default configuration options.
# - Nothing special configured. Just whatever is found by "./configure"
#
-OPTS=""
+SQUID_CONFIGURE_FLAGS=""
# Fix the distclean testing.
-export DISTCHECK_CONFIGURE_FLAGS="${OPTS}"
+export SQUID_CONFIGURE_FLAGS
# --without-build-environment \
#
#
-OPTS=" \
+SQUID_CONFIGURE_FLAGS=" \
+ --disable-build-info \
--disable-loadable-modules \
--disable-gnuregex \
--disable-optimizations \
"
# Fix the distclean testing.
-export DISTCHECK_CONFIGURE_FLAGS="${OPTS}"
+export SQUID_CONFIGURE_FLAGS
# --with-valgrind-debug \
#
#
-OPTS=" \
+SQUID_CONFIGURE_FLAGS=" \
--enable-loadable-modules \
--enable-gnuregex \
--enable-optimizations \
--enable-translation \
--enable-zph-qos \
--enable-esi \
- \
--with-aio \
--with-build-environment=default \
--with-dl \
--with-large-files \
--with-pic \
--with-pthreads \
+ --enable-build-info=squid\ test\ build \
"
# Fix the distclean testing.
-export DISTCHECK_CONFIGURE_FLAGS="${OPTS}"
+export SQUID_CONFIGURE_FLAGS
# NP: there must be no overlap in code for plugging the libraries in/out.
# this means we can test the absence of all in one run and save time.
#
-OPTS="--enable-esi --without-expat --without-libxml2"
+SQUID_CONFIGURE_FLAGS="\
+ --enable-esi \
+ --without-expat \
+ --without-libxml2 \
+ --enable-build-info"
# Fix the distclean testing.
-export DISTCHECK_CONFIGURE_FLAGS="${OPTS}"
+export SQUID_CONFIGURE_FLAGS
#
# This is to test any release build against what the package maintainers are seing
#
-OPTS=" \
+SQUID_CONFIGURE_FLAGS=" \
--build=i486-linux-gnu \
--prefix=/usr \
--includedir="\${prefix}/include" \
#
# Configure options currently supported by MinGW environment
#
-OPTS=" \
+SQUID_CONFIGURE_FLAGS=" \
--prefix=c:/squid \
--enable-storeio="ufs,aufs" \
--enable-removal-policies="lru,heap" \
#
# This is to test any release build against what the package maintainers are seeing
#
-OPTS=" \
+SQUID_CONFIGURE_FLAGS=" \
--build=i486-linux-gnu \
--prefix=/usr \
--includedir="\${prefix}/include" \