Files
harbour-core/harbour/config/global.cf
Viktor Szakats 2f3f3252de 2009-07-22 22:10 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/global.cf
    ! Fixed GTSLN exclusion if HB_COMMERCE is set.
      This is rrequired to communicate this fact with 
      postinst.sh (hb-func.sh -> hbmk script and hbmk.cfg)
      Thanks to Tamas Tevesz for report and tests.

  ; Reported libharu WinCE failures and Pelles C warnings:
    http://bugs.libharu.org/view.php?id=22
    http://bugs.libharu.org/view.php?id=21
2009-07-22 20:12:26 +00:00

383 lines
10 KiB
CFEngine3

#
# $Id$
#
# ---------------------------------------------------------------
# See GNU make docs here:
# http://www.gnu.org/software/make/manual/make.html
# http://www.jgc.org/feeds/topic-gnumake.xml
# ---------------------------------------------------------------
# This isn't strictly necessary, but it does signficantly reduce
# the number of rules that make has to evaluate otherwise, which may give
# a performance boost on a slow system.
.SUFFIXES:
need := 3.70
ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need))))
ifeq ($(ok),)
all: ; @echo Error: GNU Make version $(MAKE_VERSION) found, $(need) or upper needed for Harbour.
else
need := 3.81
ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need))))
GRANDP = ../../../
ARCH_COMP := $(HB_ARCHITECTURE)/$(HB_COMPILER)
OBJ_BASE := obj
OBJ_DIR := $(OBJ_BASE)/$(ARCH_COMP)
OBJ_ARCH_DIR := $(OBJ_BASE)/$(HB_ARCHITECTURE)
define check_host
ifneq ($(findstring MINGW,$(1)),)
HB_HOST_ARCH := win
else
ifneq ($(findstring MSys,$(1)),)
HB_HOST_ARCH := win
else
ifneq ($(findstring Windows,$(1)),)
HB_HOST_ARCH := win
else
ifneq ($(findstring CYGWIN,$(1)),)
HB_HOST_ARCH := win
else
ifneq ($(findstring Darwin,$(1)),)
HB_HOST_ARCH := darwin
else
ifneq ($(findstring darwin,$(1)),)
HB_HOST_ARCH := darwin
else
ifneq ($(findstring Linux,$(1)),)
HB_HOST_ARCH := linux
else
ifneq ($(findstring linux,$(1)),)
HB_HOST_ARCH := linux
else
ifneq ($(findstring HP-UX,$(1)),)
HB_HOST_ARCH := hpux
else
ifneq ($(findstring hp-ux,$(1)),)
HB_HOST_ARCH := hpux
else
ifneq ($(findstring SunOS,$(1)),)
HB_HOST_ARCH := sunos
else
ifneq ($(findstring sunos,$(1)),)
HB_HOST_ARCH := sunos
else
ifneq ($(findstring BSD,$(1)),)
HB_HOST_ARCH := bsd
else
ifneq ($(findstring bsd,$(1)),)
HB_HOST_ARCH := bsd
else
ifneq ($(findstring OS/2,$(1)),)
HB_HOST_ARCH := os2
else
ifneq ($(findstring msdos,$(1)),)
HB_HOST_ARCH := dos
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endef
# Directory separator default
ifeq ($(DIRSEP),)
DIRSEP = /
endif
ifeq ($(PTHSEP),)
# small hack, it's hard to detect what is real path separator because
# some shells in DOS/Windows translates DOS style paths to POSIX form
ifeq ($(subst ;,:,$(PATH)),$(PATH))
PTHSEP = :
else
PTHSEP = ;
endif
endif
# Shell detection
ifneq ($(SHLVL),)
HB_SHELL := sh
else
ifneq ($(OS2_SHELL),)
HB_SHELL := os2
else
ifneq ($(ComSpec),)
COMSPEC := $(ComSpec)
endif
ifeq ($(COMSPEC),)
ifeq ($(OS),Windows_NT)
COMSPEC := cmd.exe
else
COMSPEC := command.com
endif
endif
ifneq ($(findstring COMMAND,$(COMSPEC)),)
HB_SHELL := dos
else
ifneq ($(findstring command,$(COMSPEC)),)
HB_SHELL := dos
else
HB_SHELL := nt
endif
endif
endif
endif
CMDPREF :=
ifneq ($(HB_SHELL),sh)
ifneq ($(COMSPEC),)
CMDPREF := $(COMSPEC) /C
endif
endif
ifeq ($(HB_HOST_ARCH),)
$(eval $(call check_host,$(OSTYPE),))
ifeq ($(HB_HOST_ARCH),)
$(eval $(call check_host,$(MACHTYPE),))
ifeq ($(HB_HOST_ARCH),)
$(eval $(call check_host,$(OS),))
ifeq ($(HB_HOST_ARCH),)
$(eval $(call check_host,$(shell uname -s),))
endif
endif
endif
endif
ifeq ($(HB_HOST_ARCH),)
ifneq ($(OS2_SHELL),)
HB_HOST_ARCH := os2
else
ifneq ($(windir),)
HB_HOST_ARCH := win
else
ifneq ($(WINDIR),)
HB_HOST_ARCH := win
else
HB_HOST_ARCH := dos
endif
endif
endif
endif
ifeq ($(HB_BUILD_VERBOSE),yes)
ifeq ($(ok),)
$(info Detected host platform: $(HB_HOST_ARCH))
endif
endif
HB_HOST_CPU :=
ifeq ($(HB_HOST_ARCH),win)
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
HB_HOST_CPU := x86_64
else
ifeq ($(PROCESSOR_ARCHITECTURE),IA64)
HB_HOST_CPU := ia64
else
HB_HOST_CPU := x86
endif
endif
else
# TODO: CPU detection for rest of systems.
endif
ifeq ($(HB_BUILD_VERBOSE),yes)
ifeq ($(ok),)
$(info Detected host CPU: $(HB_HOST_CPU))
endif
endif
# TODO: Set this in <arch>/<comp>.cf
HB_CPU :=
ifeq ($(HB_ARCHITECTURE),win)
ifeq ($(HB_COMPILER),msvc64)
HB_CPU := x86_64
else
ifeq ($(HB_COMPILER),mingw64)
HB_CPU := x86_64
else
ifeq ($(HB_COMPILER),pocc64)
HB_CPU := x86_64
else
ifeq ($(HB_COMPILER),msvcia64)
HB_CPU := ia64
else
ifeq ($(HB_COMPILER),iccia64)
HB_CPU := ia64
else
HB_CPU := x86
endif
endif
endif
endif
endif
endif
ifeq ($(HB_BUILD_VERBOSE),yes)
ifeq ($(ok),)
$(info Detected target CPU: $(HB_CPU))
endif
endif
ifneq ($(findstring $(HB_HOST_ARCH),win wce dos os2),)
HB_HOST_BIN_EXT := .exe
else
HB_HOST_BIN_EXT :=
endif
ifeq ($(HB_BUILD_VERBOSE),yes)
ifeq ($(ok),)
$(info Detected host executable extension: $(HB_HOST_BIN_EXT))
endif
endif
HB_CROSS_BUILD :=
ifneq ($(HB_HOST_ARCH)$(HB_HOST_CPU),$(HB_ARCHITECTURE)$(HB_CPU))
ifeq ($(HB_BIN_COMPILE),)
# Not required in these combinations: [vszakats]
ifneq ($(HB_HOST_ARCH)-$(HB_HOST_CPU)-$(HB_ARCHITECTURE)-$(HB_CPU),win-x86_64-win-x86)
ifneq ($(HB_HOST_ARCH)-$(HB_HOST_CPU)-$(HB_ARCHITECTURE)-$(HB_CPU),win-x86-dos-)
HB_CROSS_BUILD := yes
# Try to autosetup
HB_BIN_COMPILE := $(dir $(firstword $(wildcard $(TOP)$(ROOT)bin/$(HB_HOST_ARCH)/*/harbour$(HB_HOST_BIN_EXT))))
ifeq ($(HB_BIN_COMPILE),)
HB_BIN_COMPILE := $(dir $(firstword $(foreach dir,$(subst $(PTHSEP), ,$(PATH)),$(wildcard $(dir)/harbour$(HB_HOST_BIN_EXT)))))
ifeq ($(HB_BIN_COMPILE),)
export HB_BIN_COMPILE
endif
endif
ifeq ($(HB_BIN_COMPILE),)
$(warning Warning: HB_BIN_COMPILE not specified. Couldn't find native build.)
else
ifeq ($(ok),)
$(info HB_BIN_COMPILE not specified. Automatically set to: $(HB_BIN_COMPILE))
endif
endif
endif
endif
else
HB_CROSS_BUILD := yes
endif
HB_FLAGSEXTRA :=
ifeq ($(HB_CROSS_BUILD),yes)
# Setup platform macros (undefine host, define target)
ifeq ($(HB_HOST_ARCH),win)
HB_FLAGSEXTRA += -undef:__PLATFORM__WINDOWS
else
ifeq ($(HB_HOST_ARCH),dos)
HB_FLAGSEXTRA += -undef:__PLATFORM__DOS
else
ifeq ($(HB_HOST_ARCH),os2)
HB_FLAGSEXTRA += -undef:__PLATFORM__OS2
else
ifeq ($(HB_HOST_ARCH),linux)
HB_FLAGSEXTRA += -undef:__PLATFORM__LINUX -undef:__PLATFORM__UNIX
endif
endif
endif
endif
ifeq ($(HB_ARCHITECTURE),win)
HB_FLAGSEXTRA += -D__PLATFORM__WINDOWS
ifeq ($(HB_CPU),x86_64)
HB_FLAGSEXTRA += -D__ARCH64BIT__
else
ifeq ($(HB_CPU),ia64)
HB_FLAGSEXTRA += -D__ARCH64BIT__
endif
endif
else
ifeq ($(HB_ARCHITECTURE),wce)
HB_FLAGSEXTRA += -D__PLATFORM__WINDOWS -D__PLATFORM__WINCE
else
ifeq ($(HB_ARCHITECTURE),dos)
HB_FLAGSEXTRA += -D__PLATFORM__DOS
else
ifeq ($(HB_ARCHITECTURE),os2)
HB_FLAGSEXTRA += -D__PLATFORM__OS2
else
ifeq ($(HB_ARCHITECTURE),linux)
HB_FLAGSEXTRA += -D__PLATFORM__LINUX -D__PLATFORM__UNIX
endif
endif
endif
endif
endif
endif
endif
# Exclude Harbour-wide features prohibiting commercial usage
ifeq ($(HB_COMMERCE),yes)
export HB_GPM_MOUSE := no
export HB_WITHOUT_GTSLN := yes
endif
# Names of portable GT drivers
HB_GT_LIBS=\
gtcgi \
gtpca \
gtstd \
# Names of valid RDD libraries
HB_DB_DRIVERS=\
rddntx \
rddnsx \
rddcdx \
rddfpt \
hbsix \
hbhsx \
hbusrrdd \
hbuddall \
# Names of valid RDD subdirectories
HB_DB_DIRS=\
dbfntx \
dbfnsx \
dbfcdx \
dbffpt \
hbsix \
hsx \
usrrdd \
usrrdd/rdds \
ifneq ($(HB_DB_DRVEXT),)
HB_DB_DRIVERS += $(HB_DB_DRVEXT)
HB_DB_DIRS += $(HB_DB_DRVEXT)
endif
ifeq ($(HB_BIN_COMPILE),)
HB_HOST_BIN_DIR := $(TOP)$(ROOT)bin/$(ARCH_COMP)
else
HB_HOST_BIN_DIR := $(HB_BIN_COMPILE)
endif
ifeq ($(HB_INC_COMPILE),)
HB_INC_COMPILE := $(TOP)$(ROOT)include
endif
# export some variables to eliminate repeated setting in recursive calls
export HB_HOST_ARCH
include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf
include $(TOP)$(ROOT)config/globsh.cf
include $(TOP)$(ROOT)config/$(ARCH_COMP).cf
endif