|
@@ -208,15 +208,6 @@ ifndef FPC
|
|
|
FPC=$(FPCNATIVE)
|
|
|
endif
|
|
|
|
|
|
-# If FPCFPMAKE is not set and we're cross-compiling, use the native compiler.
|
|
|
-ifndef FPCFPMAKE
|
|
|
-ifdef CROSSOMPILE
|
|
|
-FPCFPMAKE=$(FPCNATIVE)
|
|
|
-else
|
|
|
-FPCFPMAKE=$(FPC)
|
|
|
-endif
|
|
|
-endif
|
|
|
-
|
|
|
# Get a clean executable name
|
|
|
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
|
|
|
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
|
|
@@ -242,7 +233,7 @@ ifndef FPC_VERSION
|
|
|
FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
|
|
|
endif
|
|
|
|
|
|
-export FPC FPCFPMAKE FPC_VERSION FPC_COMPILERINFO
|
|
|
+export FPC FPC_VERSION FPC_COMPILERINFO
|
|
|
# CHECKDEPEND should not be exported
|
|
|
# This should limit multiple checks
|
|
|
unexport CHECKDEPEND ALLDEPENDENCIES
|
|
@@ -335,6 +326,29 @@ endif
|
|
|
|
|
|
export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
|
|
|
|
|
|
+[fpmakefpcdetect]
|
|
|
+#####################################################################
|
|
|
+# FPC Binary and Version Detection
|
|
|
+#####################################################################
|
|
|
+# If FPCFPMAKE is not set and we're cross-compiling, use the native compiler.
|
|
|
+ifndef FPCFPMAKE
|
|
|
+ifdef CROSSCOMPILE
|
|
|
+# Search for the (native) ppc compiler which is used to do the latest build
|
|
|
+# of the native rtl
|
|
|
+ifeq ($(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR)))),)
|
|
|
+# If that compiler is not found, use the common, installed native compiler
|
|
|
+FPCFPMAKE:=$(FPCNATIVE)
|
|
|
+else
|
|
|
+# Use the ppc compiler. Because the path to the compiler is relative, do not
|
|
|
+# evaluate the variable here, but do that on the fly.
|
|
|
+FPCFPMAKE=$(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR))))
|
|
|
+endif
|
|
|
+else
|
|
|
+FPCFPMAKE=$(FPC)
|
|
|
+endif
|
|
|
+endif
|
|
|
+
|
|
|
+export FPCFPMAKE
|
|
|
|
|
|
[fpcdircheckenv]
|
|
|
#####################################################################
|