I seek benediction.  Failing that, I ask for advice.

This patch makes it possible for me to set the environment variable
'CXXFLAGS_FOR_TARGET="-ggdb -O0"' at configure time, and end up with a
debuggable libgcobol.so.

Is this a correct way to gain that capability?

If not, then how?

If so, then OK for trunk?

Thanks all.

>From c03774e34bde193da7f80eea53b49915e311df0d Mon Sep 17 00:00:00 2001
From: Bob Dubner mailto:rdub...@symas.com
Date: Thu, 20 Mar 2025 23:44:12 -0400
Subject: [PATCH] cobol: Make CXXFLAGS_FOR_TARGET available to the
libgcobol
 build.

By setting "CXXFLAGS_FOR_TARGET=-ggdb -O0", a debuggable version
of libgcobol.so is created.

libgcobol

        * Makefile.am: Incorporate AM_CXXFLAGS = $(CXXFLAGS_FOR_TARGET).
        * Makefile.in: Regenerated.
---
 libgcobol/Makefile.am | 2 ++
 libgcobol/Makefile.in | 1 +
 2 files changed, 3 insertions(+)

diff --git a/libgcobol/Makefile.am b/libgcobol/Makefile.am
index eddf209807e6..2bd634f30d4c 100644
--- a/libgcobol/Makefile.am
+++ b/libgcobol/Makefile.am
@@ -52,6 +52,8 @@ libgcobol_la_LINK = $(LIBTOOL) --mode=link --tag=CXX
$(CXX)  \
 
 WARN_CFLAGS = -W -Wall -Wwrite-strings
 
+AM_CXXFLAGS =$(CXXFLAGS_FOR_TARGET)
+
 # not defined: DEFS, MAX_ERRORS, LTLDFLAGS
 ALL_CXXFLAGS = -I. -I$(srcdir) $(AM_CPPFLAGS) $(DEFS)          \
        $(XCFLAGS) $(AM_CXXFLAGS) $(WARN_CFLAGS) $(MAX_ERRORS)  \
diff --git a/libgcobol/Makefile.in b/libgcobol/Makefile.in
index a6096d2a64aa..6f3ef0750114 100644
--- a/libgcobol/Makefile.in
+++ b/libgcobol/Makefile.in
@@ -425,6 +425,7 @@ libgcobol_la_LINK = $(LIBTOOL) --mode=link --tag=CXX
$(CXX)  \
                $(LTLDFLAGS)
 
 WARN_CFLAGS = -W -Wall -Wwrite-strings
+AM_CXXFLAGS = $(CXXFLAGS_FOR_TARGET)
 
 # not defined: DEFS, MAX_ERRORS, LTLDFLAGS
 ALL_CXXFLAGS = -I. -I$(srcdir) $(AM_CPPFLAGS) $(DEFS)          \
-- 
2.34.1

Reply via email to