From 1b779e7dec5226a9641ac82bde074c47bffce690 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Date: Tue, 6 Apr 2021 21:45:33 -0400
Subject: [PATCH] configure.ac: Clear the implicit default C and C++ flags.

They were being added by Autoconf following our own defaults, leading
to the erroneous -g -O3 -g -O2 options being passed to GCC.  This is
documented in the C Compiler and C++ Compiler sections of the Autoconf
manual.

* configure.ac: Clear the default CFLAGS and CXXFLAGS variables.

Reported-by: Adrien Beraud <adrien.beraud@savoirfairelinux.com>
Change-Id: Id5e24cb2544ac4492b229746ad7ea1dee7cbb963
---
 configure.ac | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/configure.ac b/configure.ac
index 30c89fe66a..3a93831c2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,6 +4,12 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ([2.69])
 AC_INIT([Jami Daemon],[10.0.0],[jami@gnu.org],[jami])
 
+dnl Clear the implicit flags that default to '-g -O2', otherwise they
+dnl take precedence over the values we set via the
+dnl DAEMONCFLAGS/DAEMONCXXFLAGS variables below.
+: ${CFLAGS=""}
+: ${CXXFLAGS=""}
+
 AC_COPYRIGHT([[Copyright (c) Savoir-faire Linux 2004-2021]])
 AC_REVISION([$Revision$])
 
-- 
GitLab