summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2022-06-03 00:43:42 +0100
committerJohn-Mark Bell <jmb@netsurf-browser.org>2022-06-03 00:43:42 +0100
commit99012dcdd43b916902e4aab839694e311a98f22b (patch)
treed167fdefabcea073c49c5c088cf7e53e145c0770 /frontends
parentc90fb03e58251b8798f1dfd0caaaf6ef6d4c9ff9 (diff)
downloadnetsurf-99012dcdd43b916902e4aab839694e311a98f22b.tar.gz
netsurf-99012dcdd43b916902e4aab839694e311a98f22b.tar.bz2
Buildsystem: update for new RISC OS toolchain
The new toolchain has a different machine triplet, so update the things that care about it to work either way. Remove the expectation that ro-pkg-config exists (it's trivial and the core buildsystem never used it, so let's have some consistency). Determine the location of the zip binary in Makefile.tools, just like for all the other tooling and stop assuming where it's installed in the netsurf.zip target.
Diffstat (limited to 'frontends')
-rw-r--r--frontends/riscos/Makefile4
-rw-r--r--frontends/riscos/Makefile.tools50
2 files changed, 44 insertions, 10 deletions
diff --git a/frontends/riscos/Makefile b/frontends/riscos/Makefile
index af6585c46..79e6fc493 100644
--- a/frontends/riscos/Makefile
+++ b/frontends/riscos/Makefile
@@ -33,7 +33,7 @@ ifeq ($(HOST),riscos)
LDFLAGS += -LOSLib: -lOSLib32
else
LDFLAGS += -lOSLib32
- ifeq ($(SUBTARGET),-elf)
+ ifeq ($(findstring -elf,$(SUBTARGET)),-elf)
# Go for static builds & AIF binary at the moment:
CFLAGS += -static
LDFLAGS += -static
@@ -184,5 +184,5 @@ netsurf.zip: $(EXETARGET)
$(Q) rsync --archive --verbose $(FRONTEND_SOURCE_DIR)/distribution/3rdParty $($@_TMPDIR)
$(Q) cp $(FRONTEND_SOURCE_DIR)/distribution/ReadMe $($@_TMPDIR)
$(Q) cp $(FRONTEND_SOURCE_DIR)/distribution/LeesMij $($@_TMPDIR)
- $(Q) cd $($@_TMPDIR) && /opt/netsurf/arm-unknown-riscos/env/bin/zip -9vr\, $(CURDIR)/$@ *
+ $(Q) cd $($@_TMPDIR) && $(ZIP) -9vr\, $(CURDIR)/$@ *
$(Q) $(RM) -rf $($@_TMPDIR)
diff --git a/frontends/riscos/Makefile.tools b/frontends/riscos/Makefile.tools
index 9ea5c29f2..19a2e7768 100644
--- a/frontends/riscos/Makefile.tools
+++ b/frontends/riscos/Makefile.tools
@@ -15,21 +15,42 @@ ifeq ($(HOST),riscos)
CXX := g++
EXEEXT :=
PKG_CONFIG :=
+ ZIP := zip
else
- # Cross-build for RO (either using GCCSDK 3.4.6 - AOF,
- # either using GCCSDK 4 - ELF)
+ # Cross-build for RO
+ # Three options are available:
+ # a. GCCSDK 3.4.6 - AOF (machine: arm-unknown-riscos)
+ # b. GCCSDK 4 - ELF (machine: arm-unknown-riscos)
+ # c. GCCSDK 8+ - ELF, using EABI (machine: arm-riscos-gnueabihf)
+ # GCCSDK 3.4.6 and 4 are distinguished by GCCSDK 3.4.6 binary names
+ # not having the machine prefix (e.g. gcc), whereas GCCSDK 4 binaries
+ # do (e.g. arm-unknown-riscos-gcc).
+
+ # Search for the toolchain install locations if we haven't been told
+ # The search order prefers GCCSDK 3.4.6/4 over 8+.
ifeq ($(origin GCCSDK_INSTALL_ENV),undefined)
ifneq ($(realpath /opt/netsurf/arm-unknown-riscos/env),)
GCCSDK_INSTALL_ENV := /opt/netsurf/arm-unknown-riscos/env
else
- GCCSDK_INSTALL_ENV := /home/riscos/env
+ ifneq ($(realpath /opt/netsurf/arm-riscos-gnueabihf/env),)
+ GCCSDK_INSTALL_ENV := /opt/netsurf/arm-riscos-gnueabihf/env
+ else
+ # No NetSurf-specific toolchain found: try the "normal" GCCSDK path
+ GCCSDK_INSTALL_ENV := /home/riscos/env
+ endif
endif
endif
- ifeq ($(origin GCCSDK_INSTALL_CROSSBIN),undefined)
+
+ ifeq ($(origin GCCSDK_INSTALL_CROSSBIN),undefined)
ifneq ($(realpath /opt/netsurf/arm-unknown-riscos/cross/bin),)
GCCSDK_INSTALL_CROSSBIN := /opt/netsurf/arm-unknown-riscos/cross/bin
else
- GCCSDK_INSTALL_CROSSBIN := /home/riscos/cross/bin
+ ifneq ($(realpath /opt/netsurf/arm-riscos-gnueabihf/cross/bin),)
+ GCCSDK_INSTALL_CROSSBIN := /opt/netsurf/arm-riscos-gnueabihf/cross/bin
+ else
+ # No NetSurf-specific toolchain found: try the "normal" GCCSDK path
+ GCCSDK_INSTALL_CROSSBIN := /home/riscos/cross/bin
+ endif
endif
endif
@@ -39,14 +60,27 @@ else
SQUEEZE := $(GCCSDK_INSTALL_CROSSBIN)/squeeze
RUNEXT := ,feb
CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
+
+ # Work out what kind of toolchain we're dealing with
ifneq (,$(findstring arm-unknown-riscos-gcc,$(CC)))
+ # GCCSDK 4
SUBTARGET := -elf
EXEEXT := ,e1f
ELF2AIF := $(GCCSDK_INSTALL_CROSSBIN)/elf2aif
else
- SUBTARGET := -aof
- EXEEXT := ,ff8
+ ifneq (,$(findstring arm-riscos-gnueabihf-gcc,$(CC)))
+ # GCCSDK 8+
+ SUBTARGET := -elfeabi
+ EXEEXT := ,e1f
+ ELF2AIF := $(GCCSDK_INSTALL_CROSSBIN)/elf2aif -e
+ else
+ # GCCSDK 3.4.6
+ SUBTARGET := -aof
+ EXEEXT := ,ff8
+ endif
endif
+
CXX := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
- PKG_CONFIG := $(GCCSDK_INSTALL_ENV)/ro-pkg-config
+ PKG_CONFIG = PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/share/pkgconfig" pkg-config
+ ZIP := $(GCCSDK_INSTALL_CROSSBIN)/zip
endif