diff --git a/components/Makefile b/components/Makefile index f5160e1709..f1b499293a 100644 --- a/components/Makefile +++ b/components/Makefile @@ -898,28 +898,31 @@ ifneq ($(filter sparc64,$(shell uname -a)),) ifeq ($(BINUTILSPREFIX),) GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`) else +CROSSGCCOPT=-m32 +endif +endif +endif ifneq ($(filter $(CPU_TARGET),mips64 mipsel64),) ifeq ($(BINUTILSPREFIX),) GCCLIBDIR:=$(shell dirname `gcc -mabi=64 -print-libgcc-file-name`) else CROSSGCCOPT=-mabi=64 endif -else +endif ifneq ($(filter $(CPU_TARGET),mips mipsel),) ifeq ($(BINUTILSPREFIX),) GCCLIBDIR:=$(shell dirname `gcc -mabi=32 -print-libgcc-file-name`) else CROSSGCCOPT=-mabi=32 endif -else +endif ifeq ($(BINUTILSPREFIX),) -GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`) +ifeq ($(GCCLIBDIR),) +GCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`) +endif else -CROSSGCCOPT=-m32 -endif -endif -endif -endif +ifeq ($(CROSSGCCOPT),) +CROSSGCCOPT=-g endif endif endif @@ -931,16 +934,16 @@ else ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),aarch64 powerpc64 riscv64 sparc64 x86_64),) FPCMAKE_CROSSGCCOPT=-m64 else -ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips64 mips64el),) +ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),mips64 mips64el),) FPCMAKE_CROSSGCCOPT=-mabi=64 else -ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips mipsel),) +ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),mips mipsel),) FPCMAKE_CROSSGCCOPT=-mabi=32 else -ifeq ($(FPCFPMAKE_CPU_OPT),riscv64) +ifeq ($(FPCFPMAKE_CPU_TARGET),riscv64) FPCMAKE_CROSSGCCOPT=-mabi=lp64 else -ifeq ($(FPCFPMAKE_CPU_OPT),riscv32) +ifeq ($(FPCFPMAKE_CPU_TARGET),riscv32) FPCMAKE_CROSSGCCOPT=-mabi=ilp32 else FPCMAKE_CROSSGCCOPT=-m32 @@ -1576,6 +1579,9 @@ ifneq ($(filter $(CPU_TARGET),x86_64 mips mipsel mips64 mips64el riscv64 powerpc override FPCOPT+=-Cg endif endif +ifneq ($(filter $(CPU_TARGET),z80),) +override FPCOPT+=-CX -XX +endif ifdef LINKSHARED endif ifdef GCCLIBDIR diff --git a/ide/Makefile b/ide/Makefile index a24a03d132..cf0868b542 100644 --- a/ide/Makefile +++ b/ide/Makefile @@ -2929,28 +2929,31 @@ ifneq ($(filter sparc64,$(shell uname -a)),) ifeq ($(BINUTILSPREFIX),) GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`) else +CROSSGCCOPT=-m32 +endif +endif +endif ifneq ($(filter $(CPU_TARGET),mips64 mipsel64),) ifeq ($(BINUTILSPREFIX),) GCCLIBDIR:=$(shell dirname `gcc -mabi=64 -print-libgcc-file-name`) else CROSSGCCOPT=-mabi=64 endif -else +endif ifneq ($(filter $(CPU_TARGET),mips mipsel),) ifeq ($(BINUTILSPREFIX),) GCCLIBDIR:=$(shell dirname `gcc -mabi=32 -print-libgcc-file-name`) else CROSSGCCOPT=-mabi=32 endif -else +endif ifeq ($(BINUTILSPREFIX),) -GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`) +ifeq ($(GCCLIBDIR),) +GCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`) +endif else -CROSSGCCOPT=-m32 -endif -endif -endif -endif +ifeq ($(CROSSGCCOPT),) +CROSSGCCOPT=-g endif endif endif @@ -2962,16 +2965,16 @@ else ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),aarch64 powerpc64 riscv64 sparc64 x86_64),) FPCMAKE_CROSSGCCOPT=-m64 else -ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips64 mips64el),) +ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),mips64 mips64el),) FPCMAKE_CROSSGCCOPT=-mabi=64 else -ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips mipsel),) +ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),mips mipsel),) FPCMAKE_CROSSGCCOPT=-mabi=32 else -ifeq ($(FPCFPMAKE_CPU_OPT),riscv64) +ifeq ($(FPCFPMAKE_CPU_TARGET),riscv64) FPCMAKE_CROSSGCCOPT=-mabi=lp64 else -ifeq ($(FPCFPMAKE_CPU_OPT),riscv32) +ifeq ($(FPCFPMAKE_CPU_TARGET),riscv32) FPCMAKE_CROSSGCCOPT=-mabi=ilp32 else FPCMAKE_CROSSGCCOPT=-m32 @@ -4846,6 +4849,9 @@ ifneq ($(filter $(CPU_TARGET),x86_64 mips mipsel mips64 mips64el riscv64 powerpc override FPCOPT+=-Cg endif endif +ifneq ($(filter $(CPU_TARGET),z80),) +override FPCOPT+=-CX -XX +endif ifdef LINKSHARED endif ifdef GCCLIBDIR