* better detection of used ppcXXX

This commit is contained in:
peter 2001-09-22 11:13:09 +00:00
parent 67f5dc7f76
commit 2ac1305371
2 changed files with 293 additions and 282 deletions

File diff suppressed because it is too large Load Diff

View File

@ -97,37 +97,28 @@ endif
# FPC version/target Detection
#####################################################################
# What compiler to use ?
ifndef FPC
# Compatibility with old makefiles
ifndef FPC
ifdef PP
FPC=$(PP)
else
ifdef inUnix
CPU_SOURCE=$(shell uname -m)
ifeq (m68k,$(CPU_SOURCE))
FPC=ppc68k
else
FPC=ppc386
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
# Get a clean executable name
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
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
ifndef CPU_TARGET
CPU_TARGET:=$(shell $(FPC) -iTP)
@ -138,6 +129,16 @@ ifndef CPU_SOURCE
CPU_SOURCE:=$(shell $(FPC) -iSP)
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
ifndef FPC_VERSION
FPC_VERSION:=$(shell $(FPC) -iV)
@ -628,8 +629,11 @@ endif
# 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)
endif
# Load commandline OPT and add target and unit dir to be sure
ifneq ($(OS_TARGET),$(OS_SOURCE))