From 321f783bd0fe5914bf349ff576ba8988e7cfb18f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 6 Oct 2009 00:52:28 +0000 Subject: [PATCH] 2009-10-06 02:31 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL * config/global.mk * config/wce/msvcarm.mk * config/win/msvc.mk + Replaced MSVC specific compiler version setting with generic compiler version setting. HB_VISUALC_VER_PRE80 and HB_VISUALC_VER_PRE70 setting are deleted and HB_COMPILER_VER is activated. ; INCOMPATIBLE. * config/global.mk + Added MSVC compiler version autodetection. (6.0, 7.x, 8.0, 9.0) * config/win/msvc.mk + Enabled UNICODE mode for MSVC 2008 (9.0) and above. This compiler version doesn't support Win9x anyway. * utils/hbmk2/hbmk2.prg - Deleted support for HB_VISUALC_VER_PRE80 in hbmk2. (HB_COMPILER_VER was already supported in hbmk2) --- harbour/ChangeLog | 23 +++++++++++++++++++++++ harbour/INSTALL | 11 +++++++---- harbour/config/global.mk | 15 +++++++++++++-- harbour/config/wce/msvcarm.mk | 10 +++++----- harbour/config/win/msvc.mk | 16 ++++++++++++---- harbour/utils/hbmk2/hbmk2.prg | 6 +++--- 6 files changed, 63 insertions(+), 18 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3dc02cbc50..28fa86d1e3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,29 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-10-06 02:31 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * INSTALL + * config/global.mk + * config/wce/msvcarm.mk + * config/win/msvc.mk + + Replaced MSVC specific compiler version setting with generic + compiler version setting. + HB_VISUALC_VER_PRE80 and HB_VISUALC_VER_PRE70 setting are + deleted and HB_COMPILER_VER is activated. + ; INCOMPATIBLE. + + * config/global.mk + + Added MSVC compiler version autodetection. + (6.0, 7.x, 8.0, 9.0) + + * config/win/msvc.mk + + Enabled UNICODE mode for MSVC 2008 (9.0) and above. + This compiler version doesn't support Win9x anyway. + + * utils/hbmk2/hbmk2.prg + - Deleted support for HB_VISUALC_VER_PRE80 in hbmk2. + (HB_COMPILER_VER was already supported in hbmk2) + 2009-10-06 00:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/hb-func.sh ! fixed typo in .c file generated by hbmk script diff --git a/harbour/INSTALL b/harbour/INSTALL index bcc8741eb8..73d18d6f09 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -570,9 +570,12 @@ HARBOUR libraries stored in the external directory. - HB_UTIL_ADDONS= Build space separated of additional utilities stored in the utils directory. - - HB_VISUALC_VER_PRE80=yes Set this if you're using a pre-8.0 - (= pre-MSVS 2005) version of MSVC compiler. - Default: no + - HB_COMPILER_VER=[] Set C compiler version. This is used with msvc + targets currently, and in the case of this + compiler, it will be autodetected. + format: + <09><00>[.<00>] = [.] + Default: filled by autodetection or empty - HB_REBUILD_PARSER=yes Rebuild language parser sources. Typically you only need this if your are Harbour core developer modifying grammar rules (.y). @@ -665,7 +668,7 @@ HARBOUR --- MSVC .NET 2003 (untested) call "%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\vcvarsall.bat" - mingw32-make HB_VISUALC_VER_PRE80=yes + mingw32-make --- --- MinGW GCC diff --git a/harbour/config/global.mk b/harbour/config/global.mk index 781fefcb93..036abbec01 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -720,9 +720,9 @@ ifeq ($(HB_COMPILER),) else HB_COMP_PATH := $(call find_in_path,clarm) ifneq ($(HB_COMP_PATH),) + HB_COMPILER_VER := 710 HB_COMPILER := msvcarm HB_PLATFORM := wce - export HB_VISUALC_VER_PRE80 := yes else HB_COMP_PATH := $(call find_in_path,armasm) ifneq ($(HB_COMP_PATH),) @@ -748,6 +748,15 @@ ifeq ($(HB_COMPILER),) HB_COMP_PATH := $(call find_in_path,cl) ifneq ($(HB_COMP_PATH),) HB_COMPILER := msvc + ifneq ($(findstring VC98,$(HB_COMP_PATH)),) + HB_COMPILER_VER := 600 + else ifneq ($(findstring 2003,$(HB_COMP_PATH)),) + HB_COMPILER_VER := 700 + else ifneq ($(findstring 8/,$(HB_COMP_PATH)),) + HB_COMPILER_VER := 800 + else ifneq ($(findstring 9.0,$(HB_COMP_PATH)),) + HB_COMPILER_VER := 900 + endif else HB_COMP_PATH := $(call find_in_path,bcc32) ifneq ($(HB_COMP_PATH),) @@ -891,6 +900,7 @@ ifeq ($(HB_COMPILER),) ifneq ($(HB_COMPILER),) HB_COMP_PATH := $(subst $(substpat), ,$(dir $(firstword $(subst $(subst x, ,x),$(substpat),$(HB_COMP_PATH))))) HB_COMP_AUTO := (autodetected$(if $(HB_COMP_PATH),: $(HB_COMP_PATH),)) + HB_COMP_VER := $(if $(HB_COMPILER_VER), (v$(HB_COMPILER_VER)),) endif export HB_CCPATH export HB_CCPREFIX @@ -905,6 +915,7 @@ endif export HB_PLATFORM export HB_COMPILER +export HB_COMPILER_VER export HB_SHELL ifneq ($(filter $(HB_HOST_PLAT),win wce dos os2),) @@ -995,7 +1006,7 @@ ifeq ($(HB_INIT_DONE),) endif ifneq ($(MAKE_381),) $(info ! HB_PLATFORM: $(HB_PLATFORM)$(if $(HB_CPU), ($(HB_CPU)),) $(HB_PLAT_AUTO)) - $(info ! HB_COMPILER: $(HB_COMPILER) $(HB_COMP_AUTO)) + $(info ! HB_COMPILER: $(HB_COMPILER)$(HB_COMP_VER) $(HB_COMP_AUTO)) endif endif diff --git a/harbour/config/wce/msvcarm.mk b/harbour/config/wce/msvcarm.mk index 302ab52c62..51bc7446ba 100644 --- a/harbour/config/wce/msvcarm.mk +++ b/harbour/config/wce/msvcarm.mk @@ -10,7 +10,7 @@ HB_DYN_COPT := -DHB_DYNLIB CC := cl.exe ifeq ($(HB_COMPILER),msvcarm) - ifneq ($(HB_VISUALC_VER_PRE80),) + ifneq ($(filter $(HB_COMPILER_VER),600 700 710),) CC := clarm.exe endif endif @@ -44,10 +44,10 @@ ifneq ($(HB_BUILD_WARN),no) endif ifneq ($(HB_BUILD_OPTIM),no) - ifeq ($(HB_VISUALC_VER_PRE80),) - CFLAGS += -Od -Os -Gy -GS- -EHsc- - else + ifneq ($(filter $(HB_COMPILER_VER),600 700 710),) CFLAGS += -Oxsb1 -EHsc -YX -GF + else + CFLAGS += -Od -Os -Gy -GS- -EHsc- endif endif @@ -64,7 +64,7 @@ LIBPATHS := -libpath:$(LIB_DIR) LDLIBS := $(foreach lib,$(LIBS) $(SYSLIBS),$(lib)$(LIB_EXT)) LDFLAGS += -nologo -link -subsystem:windowsce -nodefaultlib:oldnames.lib -nodefaultlib:kernel32.lib -ifeq ($(HB_VISUALC_VER_PRE80),) +ifeq ($(filter $(HB_COMPILER_VER),600 700 710),) LDFLAGS += -manifest:no endif LDFLAGS += $(LIBPATHS) diff --git a/harbour/config/win/msvc.mk b/harbour/config/win/msvc.mk index a4a0607542..568ce6b18d 100644 --- a/harbour/config/win/msvc.mk +++ b/harbour/config/win/msvc.mk @@ -6,6 +6,14 @@ OBJ_EXT := .obj LIB_PREF := LIB_EXT := .lib +ifeq ($(HB_CPU),x86) + # Always compile in -UNICODE mode for MSVC 9.0 and upper + # This version doesn't support Win9x anyway. [vszakats] + ifeq ($(filter $(HB_COMPILER_VER),600 700 710 800),) + HB_CFLAGS += -DUNICODE + endif +endif + HB_DYN_COPT := -DHB_DYNLIB CC := cl.exe @@ -32,10 +40,10 @@ ifneq ($(HB_BUILD_WARN),no) endif ifneq ($(HB_BUILD_OPTIM),no) - ifeq ($(HB_VISUALC_VER_PRE80),) - CPPFLAGS += -Ot2b1 -EHs-c- - else + ifneq ($(filter $(HB_COMPILER_VER),600 700 710),) CPPFLAGS += -Ogt2yb1p -GX- -G6 -YX + else + CPPFLAGS += -Ot2b1 -EHs-c- endif endif @@ -47,7 +55,7 @@ endif # # NOTE: -GA flag should be disabled when building MT _.dlls_, # # as it creates bad code according to MS docs [vszakats]. -# ifeq ($(HB_VISUALC_VER_PRE70),) +# ifneq ($(filter $(HB_COMPILER_VER),600),) # CPPFLAGS += -GA # endif diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 1b9a61ab3c..378993e83d 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2799,10 +2799,10 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) IF Empty( nCCompVer ) /* Compatibility with Harbour GNU Make system */ - IF Empty( GetEnv( "HB_VISUALC_VER_PRE80" ) ) .AND. !( hbmk[ _HBMK_cCOMP ] == "msvcarm" .AND. FindInPath( "clarm" ) ) - nCCompVer := 800 /* Visual Studio 2005 */ - ELSE + IF hbmk[ _HBMK_cCOMP ] == "msvcarm" .AND. FindInPath( "clarm" ) nCCompVer := 710 /* Visual Studio .NET 2003 */ + ELSE + nCCompVer := 800 /* Visual Studio 2005 */ ENDIF /* 900 : Visual Studio 2008 */ /* 1000 : Visual Studio 2010 */