2010-06-10 02:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* config/global.mk
    % Minor optimization, in bcc location detection. I hope.
    + Changed autodetection to look for fixed .exe extension
      for tools which have no native *nix versions, so their
      name always ends with .exe regardless of host platform.
      This should make these tools usable under WINE.

  * config/win/bcc.mk
    + Attempt to better support bcc on linux build scenario,
      by using backslash escaping in this case.

  * utils/hbmk2/hbmk2.prg
    * Cleaned up to use hard-coded .exe extensions in autodetection 
      code for tools which have no other version. (syncing with 
      above GNU Make change). This has no effect yet.

  * config/global.mk
  * utils/hbmk2/hbmk2.prg
    ! xcc.exe -> xCC.exe
This commit is contained in:
Viktor Szakats
2010-06-10 00:34:12 +00:00
parent 70d4cc71ee
commit 0618886c04
4 changed files with 67 additions and 38 deletions

View File

@@ -16,6 +16,27 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-06-10 02:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/global.mk
% Minor optimization, in bcc location detection. I hope.
+ Changed autodetection to look for fixed .exe extension
for tools which have no native *nix versions, so their
name always ends with .exe regardless of host platform.
This should make these tools usable under WINE.
* config/win/bcc.mk
+ Attempt to better support bcc on linux build scenario,
by using backslash escaping in this case.
* utils/hbmk2/hbmk2.prg
* Cleaned up to use hard-coded .exe extensions in autodetection
code for tools which have no other version. (syncing with
above GNU Make change). This has no effect yet.
* config/global.mk
* utils/hbmk2/hbmk2.prg
! xcc.exe -> xCC.exe
2010-06-10 02:02 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/global.mk
! Attempt to fix rare case when Windows cross-build on Linux

View File

@@ -57,15 +57,16 @@ ifeq ($(filter $(_make_ver_min),$(firstword $(sort $(MAKE_VERSION) $(_make_ver_m
endif
find_in_path = $(strip $(subst $(substpat), ,$(firstword $(subst |, ,$(subst $(subst x, ,x),$(substpat),$(filter-out |,$(foreach dir, $(subst $(PTHSEP), ,$(subst $(subst x, ,x),$(substpat),$(PATH))),|$(wildcard $(subst //,/,$(subst $(substpat),\ ,$(subst \,/,$(dir)))/$(1))$(HB_HOST_BIN_EXT)))))))))
find_in_path_raw = $(strip $(subst $(substpat), ,$(firstword $(subst |, ,$(subst $(subst x, ,x),$(substpat),$(filter-out |,$(foreach dir, $(subst $(PTHSEP), ,$(subst $(subst x, ,x),$(substpat),$(PATH))),|$(wildcard $(subst //,/,$(subst $(substpat),\ ,$(subst \,/,$(dir)))/$(1))))))))))
find_in_path_par = $(strip $(subst $(substpat), ,$(firstword $(subst |, ,$(subst $(subst x, ,x),$(substpat),$(filter-out |,$(foreach dir, $(subst $(PTHSEP), ,$(subst $(subst x, ,x),$(substpat),$(2))),|$(wildcard $(subst //,/,$(subst $(substpat),\ ,$(subst \,/,$(dir)))/$(1))$(HB_HOST_BIN_EXT)))))))))
find_in_path_raw = $(strip $(subst $(substpat), ,$(firstword $(subst |, ,$(subst $(subst x, ,x),$(substpat),$(filter-out |,$(foreach dir, $(subst $(PTHSEP), ,$(subst $(subst x, ,x),$(substpat),$(2))),|$(wildcard $(subst //,/,$(subst $(substpat),\ ,$(subst \,/,$(dir)))/$(1))))))))))
find_in_path_prw = $(strip $(subst $(substpat), ,$(firstword $(subst |, ,$(subst $(subst x, ,x),$(substpat),$(filter-out |,$(foreach dir, $(subst $(PTHSEP), ,$(subst $(subst x, ,x),$(substpat),$(2))),|$(wildcard $(subst //,/,$(subst $(substpat),\ ,$(subst \,/,$(dir)))/$(1))))))))))
define detect_watcom_platform
ifneq ($(call find_in_path_raw,os2.h,$(INCLUDE)),)
ifneq ($(call find_in_path_prw,os2.h,$(INCLUDE)),)
HB_PLATFORM := os2
else ifneq ($(call find_in_path_raw,dirent.h,$(INCLUDE)),)
else ifneq ($(call find_in_path_prw,dirent.h,$(INCLUDE)),)
HB_PLATFORM := linux
else ifeq ($(call find_in_path_raw,windows.h,$(INCLUDE)),)
else ifeq ($(call find_in_path_prw,windows.h,$(INCLUDE)),)
HB_PLATFORM := dos
endif
endef
@@ -705,7 +706,7 @@ ifeq ($(HB_COMPILER),)
HB_PLATFORM := wce
HB_CCPREFIX := i386-mingw32ce-
else
HB_COMP_PATH := $(call find_in_path,cygstart)
HB_COMP_PATH := $(call find_in_path_raw,cygstart.exe)
ifneq ($(HB_COMP_PATH),)
# Check for a gcc executable in the same directory
ifeq ($(wildcard $(dir $(HB_COMP_PATH))gcc$(HB_HOST_BIN_EXT)),)
@@ -759,39 +760,39 @@ ifeq ($(HB_COMPILER),)
HB_COMPILER := watcom
$(eval $(call detect_watcom_platform))
else
HB_COMP_PATH := $(call find_in_path,clarm)
HB_COMP_PATH := $(call find_in_path_raw,clarm.exe)
ifneq ($(HB_COMP_PATH),)
HB_COMPILER_VER := 1310
HB_COMPILER := msvcarm
HB_PLATFORM := wce
HB_CPU := arm
else
HB_COMP_PATH := $(call find_in_path,armasm)
HB_COMP_PATH := $(call find_in_path_raw,armasm.exe)
ifneq ($(HB_COMP_PATH),)
HB_COMPILER := msvcarm
HB_PLATFORM := wce
HB_CPU := arm
else
HB_COMP_PATH := $(call find_in_path,idis)
HB_COMP_PATH := $(call find_in_path_raw,idis.exe)
ifneq ($(HB_COMP_PATH),)
HB_COMPILER := iccia64
HB_CPU := ia64
else
HB_COMP_PATH := $(call find_in_path,icl)
HB_COMP_PATH := $(call find_in_path_raw,icl.exe)
ifneq ($(HB_COMP_PATH),)
HB_COMPILER := icc
else
HB_COMP_PATH := $(call find_in_path,ml64)
HB_COMP_PATH := $(call find_in_path_raw,ml64.exe)
ifneq ($(HB_COMP_PATH),)
HB_COMPILER := msvc64
HB_CPU := x86_64
else
HB_COMP_PATH := $(call find_in_path,ias)
HB_COMP_PATH := $(call find_in_path_raw,ias.exe)
ifneq ($(HB_COMP_PATH),)
HB_COMPILER := msvcia64
HB_CPU := ia64
else
HB_COMP_PATH := $(call find_in_path,cl)
HB_COMP_PATH := $(call find_in_path_raw,cl.exe)
ifneq ($(HB_COMP_PATH),)
HB_COMPILER := msvc
ifneq ($(findstring VC98,$(HB_COMP_PATH)),)
@@ -806,18 +807,18 @@ ifeq ($(HB_COMPILER),)
HB_COMPILER_VER := 1600
endif
else
HB_COMP_PATH := $(call find_in_path,bcc32)
HB_COMP_PATH := $(call find_in_path_raw,bcc32.exe)
ifneq ($(HB_COMP_PATH),)
HB_COMPILER := bcc
else
HB_COMP_PATH := $(call find_in_path,pocc)
HB_COMP_PATH := $(call find_in_path_raw,pocc.exe)
ifneq ($(HB_COMP_PATH),)
ifneq ($(call find_in_path_raw,coredll.lib,$(LIB)),)
ifneq ($(call find_in_path_prw,coredll.lib,$(LIB)),)
HB_PLATFORM := wce
HB_COMPILER := poccarm
HB_CPU := arm
else
ifneq ($(call find_in_path_raw,dbgeng.lib,$(LIB)),)
ifneq ($(call find_in_path_prw,dbgeng.lib,$(LIB)),)
HB_COMPILER := pocc64
HB_CPU := x86_64
else
@@ -825,7 +826,7 @@ ifeq ($(HB_COMPILER),)
endif
endif
else
HB_COMP_PATH := $(call find_in_path,xcc)
HB_COMP_PATH := $(call find_in_path_raw,xCC.exe)
ifneq ($(HB_COMP_PATH),)
HB_COMPILER := xcc
else
@@ -983,9 +984,9 @@ endif
# Always autodetect bcc location (hack)
ifeq ($(HB_COMP_PATH_PUB),)
ifeq ($(HB_PLATFORM)-$(HB_COMPILER),win-bcc)
HB_COMP_PATH := $(call find_in_path,bcc32)
HB_COMP_PATH := $(call find_in_path_raw,bcc32.exe)
ifneq ($(HB_COMP_PATH),)
export HB_COMP_PATH_PUB := $(subst $(substpat), ,$(dir $(firstword $(subst $(subst x, ,x),$(substpat),$(HB_COMP_PATH)))))
export HB_COMP_PATH_PUB := $(HB_COMP_PATH)
endif
endif
endif
@@ -996,6 +997,8 @@ else
HB_HOST_PLAT_UNIX := yes
endif
export HB_HOST_PLAT_UNIX
ifneq ($(filter $(HB_PLATFORM),win wce dos os2),)
HB_PLATFORM_UNIX :=
else

View File

@@ -39,9 +39,14 @@ endif
# Hack to autoconfig bcc, and not require properly set .cfg files in its bin dir.
# It only works if we know compiler location.
ifneq ($(HB_COMP_PATH_PUB),)
HB_CFLAGS += $(subst /,\,-I"$(HB_COMP_PATH_PUB)../Include")
LDFLAGS += $(subst /,\,-L"$(HB_COMP_PATH_PUB)../Lib" -L"$(HB_COMP_PATH_PUB)../Lib/PSDK")
DFLAGS += $(subst /,\,-L"$(HB_COMP_PATH_PUB)../Lib" -L"$(HB_COMP_PATH_PUB)../Lib/PSDK")
ifneq ($(HB_HOST_PLAT_UNIX),)
BCKSLASH := $(subst /,\,\\)
else
BCKSLASH := $(subst /,\,\)
endif
HB_CFLAGS += $(subst /,$(BCKSLASH),-I"$(HB_COMP_PATH_PUB)../Include")
LDFLAGS += $(subst /,$(BCKSLASH),-L"$(HB_COMP_PATH_PUB)../Lib" -L"$(HB_COMP_PATH_PUB)../Lib/PSDK")
DFLAGS += $(subst /,$(BCKSLASH),-L"$(HB_COMP_PATH_PUB)../Lib" -L"$(HB_COMP_PATH_PUB)../Lib/PSDK")
endif
RC := brcc32.exe

View File

@@ -232,7 +232,7 @@ REQUEST hbmk_KEYW
#define _WORKDIR_BASE_ ".hbmk"
#define _WORKDIR_DEF_ ( _WORKDIR_BASE_ + hb_osPathSeparator() + hbmk[ _HBMK_cPLAT ] + hb_osPathSeparator() + hbmk[ _HBMK_cCOMP ] )
#define _BCC_BIN_DETECT() FindInPath( "bcc32" )
#define _BCC_BIN_DETECT() FindInPath( "bcc32.exe" )
/* Macro to check for uppercase extension on case-sensitive filesystems */
#if defined( __PLATFORM__DOS )
@@ -1175,26 +1175,26 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
/* Order is significant.
watcom also keeps a cl.exe in its binary dir. */
#if ! defined( __PLATFORM__UNIX )
aCOMPDET := { { {|| FindInSamePath( "cygstart", "gcc" ) }, "cygwin" },;
aCOMPDET := { { {|| FindInSamePath( "cygstart.exe", "gcc" ) }, "cygwin" },;
{ {|| FindInPath( "gcc-dw2" ) }, "mingw", "", "-dw2" },; /* tdragon DWARF-2 build */
{ {|| FindInPath( "x86_64-pc-mingw32-gcc" ) }, "mingw64" },; /* Equation Solution build */
{ {|| FindInPath( hbmk[ _HBMK_cCCPREFIX ] + "gcc" + hbmk[ _HBMK_cCCPOSTFIX ] ) }, "mingw" },;
{ {|| iif( ! Empty( GetEnv( "WATCOM" ) ),;
FindInPath( "wpp386" ),;
NIL ) }, "watcom" },;
{ {|| FindInPath( "clarm" ) }, "msvcarm" },;
{ {|| FindInPath( "armasm" ) }, "msvcarm" },;
{ {|| FindInPath( "ml64" ) }, "msvc64" },;
{ {|| FindInPath( "ias" ) }, "msvcia64" },;
{ {|| FindInPath( "clarm.exe" ) }, "msvcarm" },;
{ {|| FindInPath( "armasm.exe" ) }, "msvcarm" },;
{ {|| FindInPath( "ml64.exe" ) }, "msvc64" },;
{ {|| FindInPath( "ias.exe" ) }, "msvcia64" },;
{ {|| iif( FindInPath( "wpp386" ) == NIL,;
FindInPath( "cl" ),;
FindInPath( "cl.exe" ),;
NIL ) }, "msvc" },;
{ {|| _BCC_BIN_DETECT() }, "bcc" },;
{ {|| iif( FindInPath( "dbgeng.lib", GetEnv( "LIB" ) ) != NIL .AND. ( tmp1 := FindInPath( "pocc" ) ) != NIL, tmp1, NIL ) }, "pocc64" },;
{ {|| FindInPath( "pocc" ) }, "pocc" },;
{ {|| iif( ( tmp1 := FindInPath( "icl" ) ) != NIL .AND. "itanium" $ Lower( tmp1 ), tmp1, NIL ) }, "iccia64" },;
{ {|| FindInPath( "icl" ) }, "icc" },;
{ {|| FindInPath( "xcc" ) }, "xcc" },;
{ {|| iif( FindInPath( "dbgeng.lib", GetEnv( "LIB" ) ) != NIL .AND. ( tmp1 := FindInPath( "pocc.exe" ) ) != NIL, tmp1, NIL ) }, "pocc64" },;
{ {|| FindInPath( "pocc.exe" ) }, "pocc" },;
{ {|| iif( ( tmp1 := FindInPath( "icl.exe" ) ) != NIL .AND. "itanium" $ Lower( tmp1 ), tmp1, NIL ) }, "iccia64" },;
{ {|| FindInPath( "icl.exe" ) }, "icc" },;
{ {|| FindInPath( "xCC.exe" ) }, "xcc" },;
{ {|| FindInPath( "i686-w64-mingw32-gcc" ) }, "mingw64", "i686-w64-mingw32-" },; /* mingw-w64 build */
{ {|| FindInPath( "x86_64-w64-mingw32-gcc" ) }, "mingw64", "x86_64-w64-mingw32-" }} /* mingw-w64 build */
#endif
@@ -1211,9 +1211,9 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
l_aLIBSYSMISC := { "winspool", "comctl32", "comdlg32", "shell32", "uuid", "ole32", "oleaut32", "mpr", "winmm", "mapi32", "imm32", "msimg32", "wininet" }
CASE hbmk[ _HBMK_cPLAT ] == "wce"
#if ! defined( __PLATFORM__UNIX )
aCOMPDET := { { {|| FindInPath( "clarm" ) }, "msvcarm" },;
{ {|| FindInPath( "armasm" ) }, "msvcarm" },;
{ {|| FindInPath( "pocc" ) }, "poccarm" },;
aCOMPDET := { { {|| FindInPath( "clarm.exe" ) }, "msvcarm" },;
{ {|| FindInPath( "armasm.exe" ) }, "msvcarm" },;
{ {|| FindInPath( "pocc.exe" ) }, "poccarm" },;
{ {|| FindInPath( "arm-mingw32ce-gcc" ) }, "mingwarm", "arm-mingw32ce-" } ,;
{ {|| FindInPath( "arm-wince-mingw32ce-gcc" ) }, "mingwarm", "arm-wince-mingw32ce-" } ,;
{ {|| FindInPath( "i386-mingw32ce-gcc" ) }, "mingw" , "i386-mingw32ce-" } ,;
@@ -3449,7 +3449,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
IF Empty( nCCompVer )
/* Compatibility with Harbour GNU Make system */
IF hbmk[ _HBMK_cCOMP ] == "msvcarm" .AND. ! Empty( FindInPath( "clarm" ) )
IF hbmk[ _HBMK_cCOMP ] == "msvcarm" .AND. ! Empty( FindInPath( "clarm.exe" ) )
nCCompVer := 1310 /* Visual Studio .NET 2003 */
ELSE
nCCompVer := 1400 /* Visual Studio 2005 */