-e "s#@DIRTY@#$$dirty#g" \
-e "s#@date@#$$date#g" \
$< > $@-t
+if BUILD_USERFLAGS
+ sed -i -e "s#@bcond_userflags@#bcond_without#g" $@-t
+else
+ sed -i -e "s#@bcond_userflags@#bcond_with#g" $@-t
+endif
if BUILD_RUNAUTOGEN
sed -i -e "s#@bcond_runautogen@#bcond_without#g" $@-t
else
[],
[enable_secure_build="yes"])
+AC_ARG_ENABLE([user-flags],
+ [ --enable-user-flags : rely on user environment. ],
+ [ default="no" ])
+AM_CONDITIONAL(BUILD_USERFLAGS, test x$enable_user_flags = xyes)
+
AC_ARG_ENABLE([systemd],
[ --enable-systemd : Build with libsystemd and install systemd service files],,
[ enable_systemd="no" ])
WERROR_CFLAGS=""
fi
+# don't add addtional cflags
+if test "x${enable_user_flags}" = xyes; then
+ OPT_CFLAGS=""
+ GDB_FLAGS=""
+ EXTRA_WARNINGS=""
+fi
+
if test "x${enable_secure_build}" = xyes; then
# stolen from apache configure snippet
AC_CACHE_CHECK([whether $CC accepts PIE flags], [ap_cv_cc_pie], [
AC_MSG_RESULT([])
AC_MSG_RESULT([$PACKAGE build info:])
AC_MSG_RESULT([ Default optimization = ${OPT_CFLAGS}])
-AC_MSG_RESULT([ Default debug options = ${GDB_CFLAGS}])
+AC_MSG_RESULT([ Default debug options = ${GDB_FLAGS}])
AC_MSG_RESULT([ Extra compiler warnings = ${EXTRA_WARNING}])
AC_MSG_RESULT([ Env. defined CFLAG = ${ENV_CFLAGS}])
AC_MSG_RESULT([ Env. defined CPPFLAGS = ${ENV_CPPFLAGS}])
# Conditionals
# Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
# to disable or enable specific features
+%@bcond_userflags@ userflags
%@bcond_runautogen@ runautogen
%@bcond_systemd@ systemd
%endif
%{configure} \
+%if %{with userflags}
+ --enable-user-flags \
+%endif
%if %{with systemd}
--enable-systemd \
%endif