aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBob Dubner <rdubner@symas.com>2025-03-17 13:13:50 -0400
committerRobert Dubner <rdubner@symas.com>2025-03-17 17:04:51 -0400
commitaa68eb8d5687f8e0944512cbc8533a77cd312873 (patch)
tree0206adc67730d529efc26f7bfb8bfbc385858733 /gcc
parent80ef26563f17e724af15edd9d5836901192bd26e (diff)
downloadgcc-aa68eb8d5687f8e0944512cbc8533a77cd312873.zip
gcc-aa68eb8d5687f8e0944512cbc8533a77cd312873.tar.gz
gcc-aa68eb8d5687f8e0944512cbc8533a77cd312873.tar.bz2
cobol: Eliminate CPPFLAGS assignment from Make-lang.in [PR119213].
A number of gcc/cobol files had to be modified to '#include "../../libgcobol/xxx.h" instead of "xxx.h" gcc/cobol PR cobol/119213 * Make-lang.in: Eliminate CPPFLAGS= assignment. * cdf.y: Modify #includes that reference libgcobol. * cobol1.cc: Modify #includes that reference libgcobol. * except.cc: Modify #includes that reference libgcobol. * gcobolspec.cc: Modify #includes that reference libgcobol. * genapi.cc: Modify #includes that reference libgcobol. * gengen.cc: Modify #includes that reference libgcobol. * genmath.cc: Modify #includes that reference libgcobol. * genutil.cc: Modify #includes that reference libgcobol. * parse.y: Modify #includes that reference libgcobol. * scan.l: Modify #includes that reference libgcobol. * structs.cc: Modify #includes that reference libgcobol. * symbols.cc: Modify #includes that reference libgcobol. * symfind.cc: Modify #includes that reference libgcobol. * util.cc: Modify #includes that reference libgcobol.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cobol/Make-lang.in45
-rw-r--r--gcc/cobol/cdf.y6
-rw-r--r--gcc/cobol/cobol1.cc8
-rw-r--r--gcc/cobol/except.cc10
-rw-r--r--gcc/cobol/gcobolspec.cc7
-rw-r--r--gcc/cobol/genapi.cc14
-rw-r--r--gcc/cobol/gengen.cc4
-rw-r--r--gcc/cobol/genmath.cc10
-rw-r--r--gcc/cobol/genutil.cc14
-rw-r--r--gcc/cobol/parse.y16
-rw-r--r--gcc/cobol/scan.l6
-rw-r--r--gcc/cobol/structs.cc4
-rw-r--r--gcc/cobol/symbols.cc6
-rw-r--r--gcc/cobol/symfind.cc6
-rw-r--r--gcc/cobol/util.cc6
15 files changed, 82 insertions, 80 deletions
diff --git a/gcc/cobol/Make-lang.in b/gcc/cobol/Make-lang.in
index 650b695..eccc1c4 100644
--- a/gcc/cobol/Make-lang.in
+++ b/gcc/cobol/Make-lang.in
@@ -43,26 +43,8 @@ cobol: cobol1$(exeext)
cobol.serial = cobol1$(exeext)
.PHONY: cobol
-BINCLUDE ?= ./gcc
-LIB_INCLUDE ?= $(srcdir)/../libgcobol
LIB_SOURCE ?= $(srcdir)/../libgcobol
-#
-# At this point, as of 2022-10-21, CPPFLAGS is an empty string and can be
-# altered. CFLAGS and CXXFLAGS are being established upstream, and thus
-# cannot, at this point, be changed.
-#
-# Note further that we are producing only a 64-bit version of libgcobol.so, so
-# it is safe to hard-code the lib64 location. This obviously has to match the
-# installation code in libgcobol/Makefile.in
-#
-CPPFLAGS = \
- -std=c++14 \
- -I$(BINCLUDE) \
- -I$(LIB_INCLUDE) \
- -DEXEC_LIB=\"$(prefix)/lib64\" \
- $(END)
-
YFLAGS = -Werror -Wmidrule-values -Wno-yacc \
--debug --verbose
@@ -96,16 +78,37 @@ cobol1_OBJS = \
# There is source code in libgcobol/charmaps.cc and
# libgcobol/valconv.cc that needs to be compiled into both libgcobol
# and cobol1. We copy those two source code files from libgcobol to
-# here to avoid the nightmare of one file appearing in more than one
-# place. For simplicity, we make those compilations dependent on all
-# of the libgcobol/*.h files, which might lead to the occasional
+# build/gcc/cobol to avoid the nightmare of one file appearing in more
+# than one place. For simplicity, we make those compilations dependent
+# on all of the libgcobol/*.h files, which might lead to the occasional
# unnecessary compilation. The impact of that is negligible.
#
+# Various #includes in the files copied from gcc/libgcobol need to be modified
+# so that the .h files can be found.
+
cobol/charmaps.cc: $(LIB_SOURCE)/charmaps.cc
cp $^ $@
+ sed -i "s|\"ec[.]h\"|\"$(LIB_SOURCE)/ec.h\"|g" $@
+ sed -i "s|\"common-defs[.]h\"|\"$(LIB_SOURCE)/common-defs.h\"|g" $@
+ sed -i "s|\"io[.]h\"|\"$(LIB_SOURCE)/io.h\"|g" $@
+ sed -i "s|\"gcobolio[.]h\"|\"$(LIB_SOURCE)/gcobolio.h\"|g" $@
+ sed -i "s|\"libgcobol[.]h\"|\"$(LIB_SOURCE)/libgcobol.h\"|g" $@
+ sed -i "s|\"gfileio[.]h\"|\"$(LIB_SOURCE)/gfileio.h\"|g" $@
+ sed -i "s|\"charmaps[.]h\"|\"$(LIB_SOURCE)/charmaps.h\"|g" $@
+ sed -i "s|\"valconv[.]h\"|\"$(LIB_SOURCE)/valconv.h\"|g" $@
+ sed -i "s|\"exceptl[.]h\"|\"$(LIB_SOURCE)/exceptl.h\"|g" $@
cobol/valconv.cc: $(LIB_SOURCE)/valconv.cc
cp $^ $@
+ sed -i "s|\"ec[.]h\"|\"$(LIB_SOURCE)/ec.h\"|g" $@
+ sed -i "s|\"common-defs[.]h\"|\"$(LIB_SOURCE)/common-defs.h\"|g" $@
+ sed -i "s|\"io[.]h\"|\"$(LIB_SOURCE)/io.h\"|g" $@
+ sed -i "s|\"gcobolio[.]h\"|\"$(LIB_SOURCE)/gcobolio.h\"|g" $@
+ sed -i "s|\"libgcobol[.]h\"|\"$(LIB_SOURCE)/libgcobol.h\"|g" $@
+ sed -i "s|\"gfileio[.]h\"|\"$(LIB_SOURCE)/gfileio.h\"|g" $@
+ sed -i "s|\"charmaps[.]h\"|\"$(LIB_SOURCE)/charmaps.h\"|g" $@
+ sed -i "s|\"valconv[.]h\"|\"$(LIB_SOURCE)/valconv.h\"|g" $@
+ sed -i "s|\"exceptl[.]h\"|\"$(LIB_SOURCE)/exceptl.h\"|g" $@
LIB_SOURCE_H=$(wildcard $(LIB_SOURCE)/*.h)
diff --git a/gcc/cobol/cdf.y b/gcc/cobol/cdf.y
index 08b5341..beb4697 100644
--- a/gcc/cobol/cdf.y
+++ b/gcc/cobol/cdf.y
@@ -30,13 +30,13 @@
%{
#include "cobol-system.h"
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
#include "copybook.h"
-#include "exceptl.h"
+#include "../../libgcobol/exceptl.h"
#include "exceptg.h"
#define COUNT_OF(X) (sizeof(X) / sizeof(X[0]))
diff --git a/gcc/cobol/cobol1.cc b/gcc/cobol/cobol1.cc
index c2e68ed..08af367 100644
--- a/gcc/cobol/cobol1.cc
+++ b/gcc/cobol/cobol1.cc
@@ -30,15 +30,15 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "stringpool.h"
#define HOWEVER_GCC_DEFINES_TREE 1
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
#include "inspect.h"
-#include "io.h"
+#include "../../libgcobol/io.h"
#include "genapi.h"
-#include "exceptl.h"
+#include "../../libgcobol/exceptl.h"
#include "exceptg.h"
#include "util.h"
#include "gengen.h" // This has some GTY(()) markers
diff --git a/gcc/cobol/except.cc b/gcc/cobol/except.cc
index 859a76d..3510ca3 100644
--- a/gcc/cobol/except.cc
+++ b/gcc/cobol/except.cc
@@ -33,16 +33,16 @@
#include "coretypes.h"
#include "tree.h"
#define HOWEVER_GCC_DEFINES_TREE 1
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
#include "inspect.h"
-#include "io.h"
+#include "../../libgcobol/io.h"
#include "genapi.h"
#include "gengen.h"
-#include "exceptl.h"
+#include "../../libgcobol/exceptl.h"
#include "util.h"
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
@@ -310,7 +310,7 @@ symbol_declaratives_add( size_t program,
* section is PERFORMed, and control branches to the end of this
* section, and thence back to the statement it came from.
*/
-#include "io.h"
+#include "../../libgcobol/io.h"
size_t current_file_index();
file_status_t current_file_handled_status();
diff --git a/gcc/cobol/gcobolspec.cc b/gcc/cobol/gcobolspec.cc
index f3f9c32..5bd6853 100644
--- a/gcc/cobol/gcobolspec.cc
+++ b/gcc/cobol/gcobolspec.cc
@@ -616,10 +616,9 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
if( need_libgcobol )
{
- if( 0 != strcmp(EXEC_LIB, "/usr/lib") )
- {
- append_option(OPT_L, EXEC_LIB, 1);
- }
+#ifdef EXEC_LIB
+ append_option(OPT_L, EXEC_LIB, 1);
+#endif
add_arg_lib(COBOL_LIBRARY, static_libgcobol);
}
if( need_libmath )
diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc
index eac1e26..73aa680 100644
--- a/gcc/cobol/genapi.cc
+++ b/gcc/cobol/genapi.cc
@@ -37,22 +37,22 @@
#define HOWEVER_GCC_DEFINES_TREE 1
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
#include "gengen.h"
#include "inspect.h"
-#include "io.h"
+#include "../../libgcobol/io.h"
#include "genapi.h"
#include "genutil.h"
#include "genmath.h"
#include "structs.h"
-#include "gcobolio.h"
-#include "libgcobol.h"
-#include "charmaps.h"
-#include "valconv.h"
+#include "../../libgcobol/gcobolio.h"
+#include "../../libgcobol/libgcobol.h"
+#include "../../libgcobol/charmaps.h"
+#include "../../libgcobol/valconv.h"
#include "show_parse.h"
extern int yylineno;
diff --git a/gcc/cobol/gengen.cc b/gcc/cobol/gengen.cc
index e433120..d0601e0 100644
--- a/gcc/cobol/gengen.cc
+++ b/gcc/cobol/gengen.cc
@@ -96,8 +96,8 @@
#include "function.h"
#include "fold-const.h"
#define HOWEVER_GCC_DEFINES_TREE 1
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
diff --git a/gcc/cobol/genmath.cc b/gcc/cobol/genmath.cc
index 138551b..42f01cd 100644
--- a/gcc/cobol/genmath.cc
+++ b/gcc/cobol/genmath.cc
@@ -31,19 +31,19 @@
#include "coretypes.h"
#include "tree.h"
#define HOWEVER_GCC_DEFINES_TREE 1
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
#include "inspect.h"
-#include "io.h"
+#include "../../libgcobol/io.h"
#include "genapi.h"
#include "genutil.h"
#include "gengen.h"
#include "structs.h"
-#include "gcobolio.h"
-#include "libgcobol.h"
+#include "../../libgcobol/gcobolio.h"
+#include "../../libgcobol/libgcobol.h"
#include "show_parse.h"
void
diff --git a/gcc/cobol/genutil.cc b/gcc/cobol/genutil.cc
index f7708e8..b58181c 100644
--- a/gcc/cobol/genutil.cc
+++ b/gcc/cobol/genutil.cc
@@ -31,22 +31,22 @@
#include "coretypes.h"
#include "tree.h"
#define HOWEVER_GCC_DEFINES_TREE 1
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
#include "gengen.h"
#include "inspect.h"
-#include "io.h"
+#include "../../libgcobol/io.h"
#include "genapi.h"
#include "genutil.h"
#include "structs.h"
-#include "gcobolio.h"
-#include "libgcobol.h"
-#include "charmaps.h"
+#include "../../libgcobol/gcobolio.h"
+#include "../../libgcobol/libgcobol.h"
+#include "../../libgcobol/charmaps.h"
#include "show_parse.h"
-#include "exceptl.h"
+#include "../../libgcobol/exceptl.h"
#include "exceptg.h"
bool internal_codeset_is_ebcdic() { return gcobol_feature_internal_ebcdic(); }
diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y
index 15dbd1c..c901bd6 100644
--- a/gcc/cobol/parse.y
+++ b/gcc/cobol/parse.y
@@ -33,8 +33,8 @@
#include <cmath>
#include <algorithm>
#include <map>
- #include "io.h"
- #include "ec.h"
+ #include "../../libgcobol/io.h"
+ #include "../../libgcobol/ec.h"
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
@@ -277,8 +277,8 @@
bool set_debug(bool);
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "inspect.h"
}
@@ -286,15 +286,15 @@
#include <fstream> // Before cobol-system because it uses poisoned functions
#include "cobol-system.h"
#include "cdfval.h"
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
#include "inspect.h"
-#include "io.h"
+#include "../../libgcobol/io.h"
#include "genapi.h"
-#include "exceptl.h"
+#include "../../libgcobol/exceptl.h"
#include "exceptg.h"
#include "parse_ante.h"
%}
diff --git a/gcc/cobol/scan.l b/gcc/cobol/scan.l
index e4df4e8..18d0d82 100644
--- a/gcc/cobol/scan.l
+++ b/gcc/cobol/scan.l
@@ -31,8 +31,8 @@
#include <fstream> // Before cobol-system because it uses poisoned functions
#include "cobol-system.h"
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
@@ -41,7 +41,7 @@
#include "copybook.h"
#include "scan_ante.h"
#include "lexio.h"
-#include "exceptl.h"
+#include "../../libgcobol/exceptl.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
diff --git a/gcc/cobol/structs.cc b/gcc/cobol/structs.cc
index bf98d1f..39c8a42 100644
--- a/gcc/cobol/structs.cc
+++ b/gcc/cobol/structs.cc
@@ -56,8 +56,8 @@
#include "coretypes.h"
#include "tree.h"
#define HOWEVER_GCC_DEFINES_TREE 1
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
diff --git a/gcc/cobol/symbols.cc b/gcc/cobol/symbols.cc
index a4e87c8..7cc3b9f 100644
--- a/gcc/cobol/symbols.cc
+++ b/gcc/cobol/symbols.cc
@@ -32,13 +32,13 @@
#include "cobol-system.h"
#include <search.h>
#include <iconv.h>
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
#include "inspect.h"
-#include "io.h"
+#include "../../libgcobol/io.h"
#include "genapi.h"
#pragma GCC diagnostic ignored "-Wunused-result"
diff --git a/gcc/cobol/symfind.cc b/gcc/cobol/symfind.cc
index 3c3b5d0..38a8900 100644
--- a/gcc/cobol/symfind.cc
+++ b/gcc/cobol/symfind.cc
@@ -31,13 +31,13 @@
#include "cobol-system.h"
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "util.h"
#include "cbldiag.h"
#include "symbols.h"
#include "inspect.h"
-#include "io.h"
+#include "../../libgcobol/io.h"
#include "genapi.h"
extern int yydebug;
diff --git a/gcc/cobol/util.cc b/gcc/cobol/util.cc
index 6ade146..9f746a3 100644
--- a/gcc/cobol/util.cc
+++ b/gcc/cobol/util.cc
@@ -56,11 +56,11 @@
#include "lexio.h"
#define HOWEVER_GCC_DEFINES_TREE
-#include "ec.h"
-#include "common-defs.h"
+#include "../../libgcobol/ec.h"
+#include "../../libgcobol/common-defs.h"
#include "symbols.h"
#include "inspect.h"
-#include "io.h"
+#include "../../libgcobol/io.h"
#include "genapi.h"
#pragma GCC diagnostic ignored "-Wunused-result"