]> git.proxmox.com Git - mirror_corosync-qdevice.git/commitdiff
configure: Add user-flags configure option
authorJan Friesse <jfriesse@redhat.com>
Mon, 10 Jun 2019 08:25:42 +0000 (10:25 +0200)
committerJan Friesse <jfriesse@redhat.com>
Mon, 10 Jun 2019 09:15:37 +0000 (11:15 +0200)
configure.ac adds by optimization and debug flags by default. This is
not always intended so conifgure option is added.

Support for using this option in specfile is added too.

Also fix GDB_CFLAGS typo. GDB_FLAGS (without C)
is the correct name of variable to print in the summary.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Makefile.am
configure.ac
corosync-qdevice.spec.in

index 11f71496a021e664a87c6d6b101fcf159981be61..00ac436452726feea898666653a8035f91bf67f8 100644 (file)
@@ -110,6 +110,11 @@ $(SPEC): $(SPEC).in
                -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
index cd3a58d36cf76ec7e61a7ec03f39e1af801970c4..fbb45c01915015d595be9470ef7444ef0aac584b 100644 (file)
@@ -136,6 +136,11 @@ AC_ARG_ENABLE([secure-build],
        [],
        [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" ])
@@ -244,6 +249,13 @@ else
        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], [
@@ -358,7 +370,7 @@ AC_MSG_RESULT([  Features                 = ${PACKAGE_FEATURES}])
 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}])
index 36c2c01d91c6fb04a2ff96b01b6e319da025dd28..1179167a6251188f9e11e8def559c4b033627b29 100644 (file)
@@ -5,6 +5,7 @@
 # Conditionals
 # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
 # to disable or enable specific features
+%@bcond_userflags@ userflags
 %@bcond_runautogen@ runautogen
 %@bcond_systemd@ systemd
 
@@ -64,6 +65,9 @@ BuildRequires: autoconf automake libtool
 %endif
 
 %{configure} \
+%if %{with userflags}
+       --enable-user-flags \
+%endif
 %if %{with systemd}
        --enable-systemd \
 %endif