[Replicant] [libsamsung-ipc] [PATCH 4/9] Makefile.am: move -ggdb and -O0 CFLAGS to configure.ac

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Mon May 23 16:56:12 UTC 2022


This makes sure that all the program and libraries being built have
the same obtimization level and debug CFLAGS.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 configure.ac                  | 26 +++++++++++++++-----------
 samsung-ipc/Makefile.am       |  2 +-
 samsung-ipc/tests/Makefile.am |  2 +-
 3 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/configure.ac b/configure.ac
index edf7863..b5b694b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,16 +5,6 @@ AM_INIT_AUTOMAKE([dist-bzip2 dist-xz subdir-objects])
 XZ_OPT=-v9e
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_GNU_SOURCE
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
-
-AC_SUBST(CFLAGS)
-AC_SUBST(CPPFLAGS)
-AC_SUBST(LDFLAGS)
-
 OPENSSL_REQUIRED=1.0.0e
 
 #------------------------------------------------------------------------------
@@ -47,8 +37,22 @@ AC_CONFIG_FILES([
     samsung-ipc/tests/Makefile
     tools/Makefile
 ])
-AC_OUTPUT
 
+
+#------------------------------------------------------------------------------
+AS_IF([test x"debug" = x"yes"], [: ${CFLAGS="-ggdb -O0"}], [])
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_GNU_SOURCE
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(LDFLAGS)
+
+AC_OUTPUT
 #------------------------------------------------------------------------------
 # info
 
diff --git a/samsung-ipc/Makefile.am b/samsung-ipc/Makefile.am
index 6b2e9f9..9ffaa03 100644
--- a/samsung-ipc/Makefile.am
+++ b/samsung-ipc/Makefile.am
@@ -7,7 +7,7 @@ AM_CFLAGS = \
 	$(NULL)
 
 if WANT_DEBUG
-AM_CFLAGS += -ggdb -O0 -DDEBUG
+AM_CFLAGS += -DDEBUG
 endif
 
 lib_LTLIBRARIES = \
diff --git a/samsung-ipc/tests/Makefile.am b/samsung-ipc/tests/Makefile.am
index 0249569..cc63d0a 100644
--- a/samsung-ipc/tests/Makefile.am
+++ b/samsung-ipc/tests/Makefile.am
@@ -7,7 +7,7 @@ AM_CFLAGS = \
 	$(NULL)
 
 if WANT_DEBUG
-AM_CFLAGS += -ggdb -O0 -DDEBUG
+AM_CFLAGS += -DDEBUG
 endif
 
 bin_PROGRAMS = libsamsung-ipc-test
-- 
2.36.0



More information about the Replicant mailing list