aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMatthias Klose <doko@ubuntu.com>2025-03-18 16:12:37 +0100
committerMatthias Klose <doko@ubuntu.com>2025-03-18 16:12:37 +0100
commitd1fd9da39abc4e0430fed46d14ebd2360324f8b8 (patch)
tree9840d191b1a7a7ad709461a2ee48decdb907aef2 /gcc
parent26884504503093e5019708f50816897c5d3a4958 (diff)
downloadgcc-d1fd9da39abc4e0430fed46d14ebd2360324f8b8.zip
gcc-d1fd9da39abc4e0430fed46d14ebd2360324f8b8.tar.gz
gcc-d1fd9da39abc4e0430fed46d14ebd2360324f8b8.tar.bz2
Build and install gcobol driver for the cross build
gcc/cobol/ 2025-03-18 Matthias Klose <doko@ubuntu.com> * Make-lang.in (GCOBC_TARGET_INSTALL_NAME, gcobol-cross): New. (cobol.all.cross): Depend on gcobol-cross. (cobol.install-common): Adjust install for the cross build. (cobol.uninstall): Use *_INSTALL_NAME for uninstall.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cobol/Make-lang.in26
1 files changed, 22 insertions, 4 deletions
diff --git a/gcc/cobol/Make-lang.in b/gcc/cobol/Make-lang.in
index eccc1c4..5b61ae9 100644
--- a/gcc/cobol/Make-lang.in
+++ b/gcc/cobol/Make-lang.in
@@ -38,6 +38,7 @@ GCOBOL_INSTALL_NAME := $(shell echo gcobol|sed '$(program_transform_name)')
GCOBOL_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcobol|sed '$(program_transform_name)')
GCOBC_INSTALL_NAME := $(shell echo gcobc|sed '$(program_transform_name)')
+GCOBC_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcobc|sed '$(program_transform_name)')
cobol: cobol1$(exeext)
cobol.serial = cobol1$(exeext)
@@ -149,6 +150,11 @@ gcobol$(exeext): \
$(GCOBOL_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
$(EXTRA_GCC_LIBS) $(LIBS)
+# Create a version of the gcobol driver which calls the cross-compiler.
+gcobol-cross$(exeext): gcobol$(exeext)
+ -rm -f gcobol-cross$(exeext)
+ cp gcobol$(exeext) gcobol-cross$(exeext)
+
#
# These control the build of the cobol1 source-to-GENERIC converter
#
@@ -277,17 +283,29 @@ cobol1$(exeext): $(cobol1_OBJS) $(BACKEND) $(LIBDEPS) attribs.o $(cobol.prev)
$(cobol1_OBJS) $(BACKEND) $(LIBS) $(BACKENDLIBS)
@$(call LINK_PROGRESS,$(INDEX.cobol),end)
-# FIXME
-cobol.all.cross:
+cobol.all.cross: gcobol-cross$(exeext)
cobol.start.encap: gcobol$(exeext)
cobol.rest.encap:
cobol.install-common: installdirs
+ -rm -f $(DESTDIR)$(bindir)/$(GCOBOL_INSTALL_NAME)$(exeext)
+ -rm -f $(DESTDIR)$(bindir)/$(GCOBC_INSTALL_NAME)$(exeext)
$(INSTALL_PROGRAM) gcobol$(exeext) $(DESTDIR)$(bindir)/$(GCOBOL_INSTALL_NAME)$(exeext)
$(INSTALL_PROGRAM) cobol1$(exeext) $(DESTDIR)$(libexecsubdir)/
$(INSTALL) -m 755 $(srcdir)/cobol/gcobc $(DESTDIR)$(bindir)/$(GCOBC_INSTALL_NAME)$(exeext)
+ -if test -f cobol1$(exeext); then \
+ if test -f gcobol-cross$(exeext); then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(bindir)/$(GCOBOL_TARGET_INSTALL_NAME)$(exeext); \
+ rm -f $(DESTDIR)$(bindir)/$(GCOBC_TARGET_INSTALL_NAME)$(exeext); \
+ ( cd $(DESTDIR)$(bindir) && \
+ $(LN) $(GCOBOL_INSTALL_NAME)$(exeext) $(GCOBOL_TARGET_INSTALL_NAME)$(exeext) ); \
+ $(LN) $(GCOBC_INSTALL_NAME)$(exeext) $(GCOBC_TARGET_INSTALL_NAME)$(exeext) ); \
+ fi; \
+ fi
mkdir -p $(DESTDIR)$(datadir)/gcobol/udf
$(INSTALL_DATA) $(srcdir)/cobol/udf/* $(DESTDIR)$(datadir)/gcobol/udf/
@@ -338,9 +356,9 @@ gcobol-io.html: $(srcdir)/cobol/gcobol.3
# the installed location of the cobol1 compiler.
cobol.uninstall:
rm -rf $(DESTDIR)$(bindir)/$(GCOBOL_INSTALL_NAME)$(exeext) \
- $(DESTDIR)$(bindir)/gcobc \
+ $(DESTDIR)$(bindir)/$(GCOBC_INSTALL_NAME) \
$(DESTDIR)$(datadir)/gcobol/ \
- $(DESTDIR)$(man1dir)/gcobol.1 \
+ $(DESTDIR)$(man1dir)/$(GCOBOL_INSTALL_NAME).1 \
$(DESTDIR)$(man3dir)/gcobol.3
cobol.man: