|
@@ -164,10 +164,13 @@ override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
|
|
|
|
|
|
# FPC version
|
|
# FPC version
|
|
ifndef FPC_VERSION
|
|
ifndef FPC_VERSION
|
|
-FPC_VERSION:=$(shell $(FPC) -iV)
|
|
|
|
|
|
+# For 1.1 and up we can use a single compiler call to retrieve
|
|
|
|
+# all needed information
|
|
|
|
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
|
|
|
|
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
|
|
endif
|
|
endif
|
|
|
|
|
|
-export FPC FPC_VERSION
|
|
|
|
|
|
+export FPC FPC_VERSION FPC_COMPILERINFO
|
|
# CHECKDEPEND should not be exported
|
|
# CHECKDEPEND should not be exported
|
|
# This should limit multiple checks
|
|
# This should limit multiple checks
|
|
unexport CHECKDEPEND ALLDEPENDENCIES
|
|
unexport CHECKDEPEND ALLDEPENDENCIES
|
|
@@ -182,53 +185,34 @@ ifdef CPU_TARGET_DEFAULT
|
|
CPU_TARGET=$(CPU_TARGET_DEFAULT)
|
|
CPU_TARGET=$(CPU_TARGET_DEFAULT)
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
-
|
|
|
|
ifndef OS_TARGET
|
|
ifndef OS_TARGET
|
|
ifdef OS_TARGET_DEFAULT
|
|
ifdef OS_TARGET_DEFAULT
|
|
OS_TARGET=$(OS_TARGET_DEFAULT)
|
|
OS_TARGET=$(OS_TARGET_DEFAULT)
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
|
|
-
|
|
|
|
-# For 1.1 and up we can use a single compiler call to retrieve
|
|
|
|
-# all needed information
|
|
|
|
-ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
|
|
|
|
-
|
|
|
|
-COMPILERINFO:=$(shell $(FPC) -iSP -iTP -iSO -iTO)
|
|
|
|
-
|
|
|
|
-# Retrieve Target/Source CPU and Target/Source OS
|
|
|
|
-ifndef CPU_SOURCE
|
|
|
|
-CPU_SOURCE:=$(word 1,$(COMPILERINFO))
|
|
|
|
-endif
|
|
|
|
-ifndef CPU_TARGET
|
|
|
|
-CPU_TARGET:=$(word 2,$(COMPILERINFO))
|
|
|
|
-endif
|
|
|
|
-ifndef OS_SOURCE
|
|
|
|
-OS_SOURCE:=$(word 3,$(COMPILERINFO))
|
|
|
|
-endif
|
|
|
|
-ifndef OS_TARGET
|
|
|
|
-OS_TARGET:=$(word 4,$(COMPILERINFO))
|
|
|
|
|
|
+# For 1.0.x we need to use extra calls to retrieve all info
|
|
|
|
+ifneq ($(words $(FPC_COMPILERINFO)),5)
|
|
|
|
+FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
|
|
|
|
+FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
|
|
|
|
+FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
|
|
|
|
+FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
|
|
endif
|
|
endif
|
|
|
|
|
|
-else
|
|
|
|
-
|
|
|
|
# Retrieve Target/Source CPU and Target/Source OS
|
|
# Retrieve Target/Source CPU and Target/Source OS
|
|
ifndef CPU_SOURCE
|
|
ifndef CPU_SOURCE
|
|
-CPU_SOURCE:=$(shell $(FPC) -iSP)
|
|
|
|
|
|
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
|
|
endif
|
|
endif
|
|
ifndef CPU_TARGET
|
|
ifndef CPU_TARGET
|
|
-CPU_TARGET:=$(shell $(FPC) -iTP)
|
|
|
|
|
|
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
|
|
endif
|
|
endif
|
|
ifndef OS_SOURCE
|
|
ifndef OS_SOURCE
|
|
-OS_SOURCE:=$(shell $(FPC) -iSO)
|
|
|
|
|
|
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
|
|
endif
|
|
endif
|
|
ifndef OS_TARGET
|
|
ifndef OS_TARGET
|
|
-OS_TARGET:=$(shell $(FPC) -iTO)
|
|
|
|
|
|
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
|
|
endif
|
|
endif
|
|
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
-
|
|
|
|
# Full name of the target, including CPU and OS
|
|
# Full name of the target, including CPU and OS
|
|
FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
|
|
FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
|
|
FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
|
|
FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
|