From 7dde2f4e53dc4cda5a184258e6a85f7ea06574ed Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 16 Jul 2009 10:46:48 +0000 Subject: [PATCH] 2009-07-16 12:46 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/config/win/watcom.cf * added SYS NT to link options - it's default in Windows builds but is necessary in cross builds * harbour/config/global.cf * small modification in platform checking order to reduce possible interactions with some extended host information + added automatic HB_BIN_COMPILE setting based on binaries located in PATH. ! export some variables to avoid repeated setting in recursive calls what causes some bad side effects, i.e. multiple __PLATFORM__* macro settings in cross builds what was breaking cross compilation and also slow down the whole build process. --- harbour/ChangeLog | 15 +++++++++++++++ harbour/config/global.cf | 32 +++++++++++++++++++++++++------- harbour/config/win/watcom.cf | 2 +- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f7b3044fe7..5a59ed60f0 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,21 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-16 12:46 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/config/win/watcom.cf + * added SYS NT to link options - it's default in Windows builds but + is necessary in cross builds + + * harbour/config/global.cf + * small modification in platform checking order to reduce possible + interactions with some extended host information + + added automatic HB_BIN_COMPILE setting based on binaries located + in PATH. + ! export some variables to avoid repeated setting in recursive calls + what causes some bad side effects, i.e. multiple __PLATFORM__* + macro settings in cross builds what was breaking cross compilation + and also slow down the whole build process. + 2009-07-16 12:13 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/instsh.cf * config/dirsh.cf diff --git a/harbour/config/global.cf b/harbour/config/global.cf index 90f131af01..5cebb3028d 100644 --- a/harbour/config/global.cf +++ b/harbour/config/global.cf @@ -40,18 +40,12 @@ else ifneq ($(findstring CYGWIN,$(1)),) HB_HOST_ARCH := win else ifneq ($(findstring Darwin,$(1)),) HB_HOST_ARCH := darwin -else ifneq ($(findstring OS/2,$(1)),) - HB_HOST_ARCH := os2 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 BSD,$(1)),) - HB_HOST_ARCH := bsd -else ifneq ($(findstring bsd,$(1)),) - HB_HOST_ARCH := bsd else ifneq ($(findstring HP-UX,$(1)),) HB_HOST_ARCH := hpux else ifneq ($(findstring hp-ux,$(1)),) @@ -60,6 +54,12 @@ 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 @@ -70,6 +70,15 @@ endef 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),) @@ -131,6 +140,7 @@ ifeq ($(HB_HOST_ARCH),) endif endif + ifeq ($(HB_BUILD_VERBOSE),yes) $(info Detected host platform: $(HB_HOST_ARCH)) endif @@ -189,6 +199,9 @@ ifneq ($(HB_HOST_ARCH)$(HB_HOST_CPU),$(HB_ARCHITECTURE)$(HB_CPU)) ifneq ($(HB_HOST_ARCH)-$(HB_HOST_CPU)-$(HB_ARCHITECTURE)-$(HB_CPU),win-x86-dos-) # 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))))) + endif ifeq ($(HB_BIN_COMPILE),) $(warning Warning: HB_BIN_COMPILE not specified. Couldn't find native build.) else @@ -196,7 +209,9 @@ ifneq ($(HB_HOST_ARCH)$(HB_HOST_CPU),$(HB_ARCHITECTURE)$(HB_CPU)) endif endif endif - else + endif + ifneq ($(HB_HOST_FLAG_),done) + HB_HOST_FLAG_=done # Setup platform macros (undefine host, define target) ifeq ($(HB_HOST_ARCH),win) HB_USER_PRGFLAGS += -undef:__PLATFORM__WINDOWS @@ -262,6 +277,9 @@ 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 HB_BIN_COMPILE HB_HOST_FLAG_ + include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf include $(TOP)$(ROOT)config/globsh.cf include $(TOP)$(ROOT)config/$(ARCH_COMP).cf diff --git a/harbour/config/win/watcom.cf b/harbour/config/win/watcom.cf index f04174f29c..5d913b641f 100644 --- a/harbour/config/win/watcom.cf +++ b/harbour/config/win/watcom.cf @@ -88,7 +88,7 @@ $(foreach lib, $(GTLIBS), $(link_lib)) endef LD = wlink -LDFLAGS = +LDFLAGS = SYS NT ifeq ($(HB_BUILD_DEBUG),yes) LDFLAGS := debug all $(LDFLAGS) endif