|
@@ -97,37 +97,28 @@ endif
|
|
# FPC version/target Detection
|
|
# FPC version/target Detection
|
|
#####################################################################
|
|
#####################################################################
|
|
|
|
|
|
-# What compiler to use ?
|
|
|
|
-ifndef FPC
|
|
|
|
# Compatibility with old makefiles
|
|
# Compatibility with old makefiles
|
|
|
|
+ifndef FPC
|
|
ifdef PP
|
|
ifdef PP
|
|
FPC=$(PP)
|
|
FPC=$(PP)
|
|
-else
|
|
|
|
-ifdef inUnix
|
|
|
|
-CPU_SOURCE=$(shell uname -m)
|
|
|
|
-ifeq (m68k,$(CPU_SOURCE))
|
|
|
|
-FPC=ppc68k
|
|
|
|
-else
|
|
|
|
-FPC=ppc386
|
|
|
|
endif
|
|
endif
|
|
-else
|
|
|
|
-FPC=ppc386
|
|
|
|
endif
|
|
endif
|
|
|
|
+
|
|
|
|
+# Try to detect the ppcXXX file to use by using "fpc -P?" option
|
|
|
|
+# to query for the default ppcXXX the fpc executable tries
|
|
|
|
+ifndef FPC
|
|
|
|
+FPC:=$(shell fpc -P?)
|
|
|
|
+# Older fpc executables didn't support it and return
|
|
|
|
+# Error: Illegal processor... When found then fallback to ppc386
|
|
|
|
+ifneq ($(findstring Error,$(PPCBIN)),)
|
|
|
|
+override FPC=ppc386
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
+
|
|
|
|
+# Get a clean executable name
|
|
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
|
|
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
|
|
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
|
|
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
|
|
|
|
|
|
-# Target OS
|
|
|
|
-ifndef OS_TARGET
|
|
|
|
-OS_TARGET:=$(shell $(FPC) -iTO)
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
-# Source OS
|
|
|
|
-ifndef OS_SOURCE
|
|
|
|
-OS_SOURCE:=$(shell $(FPC) -iSO)
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
# Target CPU
|
|
# Target CPU
|
|
ifndef CPU_TARGET
|
|
ifndef CPU_TARGET
|
|
CPU_TARGET:=$(shell $(FPC) -iTP)
|
|
CPU_TARGET:=$(shell $(FPC) -iTP)
|
|
@@ -138,6 +129,16 @@ ifndef CPU_SOURCE
|
|
CPU_SOURCE:=$(shell $(FPC) -iSP)
|
|
CPU_SOURCE:=$(shell $(FPC) -iSP)
|
|
endif
|
|
endif
|
|
|
|
|
|
|
|
+# Target OS
|
|
|
|
+ifndef OS_TARGET
|
|
|
|
+OS_TARGET:=$(shell $(FPC) -iTO)
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+# Source OS
|
|
|
|
+ifndef OS_SOURCE
|
|
|
|
+OS_SOURCE:=$(shell $(FPC) -iSO)
|
|
|
|
+endif
|
|
|
|
+
|
|
# FPC version
|
|
# FPC version
|
|
ifndef FPC_VERSION
|
|
ifndef FPC_VERSION
|
|
FPC_VERSION:=$(shell $(FPC) -iV)
|
|
FPC_VERSION:=$(shell $(FPC) -iV)
|
|
@@ -628,8 +629,11 @@ endif
|
|
# Compiler Command Line
|
|
# Compiler Command Line
|
|
#####################################################################
|
|
#####################################################################
|
|
|
|
|
|
-# Load commandline OPTDEF and add FPC_CPU define
|
|
|
|
|
|
+# Load commandline OPTDEF and add FPC_CPU define, for compiling the
|
|
|
|
+# compiler this needs to be turned off
|
|
|
|
+ifndef NOCPUDEF
|
|
override FPCOPTDEF=$(CPU_TARGET)
|
|
override FPCOPTDEF=$(CPU_TARGET)
|
|
|
|
+endif
|
|
|
|
|
|
# Load commandline OPT and add target and unit dir to be sure
|
|
# Load commandline OPT and add target and unit dir to be sure
|
|
ifneq ($(OS_TARGET),$(OS_SOURCE))
|
|
ifneq ($(OS_TARGET),$(OS_SOURCE))
|