From ed8bb45de8b4e0a6e606c796022195f1b3bab4a8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 10 Oct 2008 08:47:25 +0000 Subject: [PATCH] 2008-10-10 10:42 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * make_b32.mak * make_vc.mak * make_gcc.mak * Removed special 'set HB_GT_LIB=gtXXX' support. For the exact same effect - in case you want to modify default GT at build time, which is not recommended -, pls use this: 'set C_USR=-DHB_GT_LIB=XXX' where XXX is 'wvt', 'std', etc. - Removed HARBOURFLAGSDLL, LDFLAGSDLL, CFLAGSDLL as public options. It's better to keep these settings common IMO, and handle all DLL subtleties in our make files. + L_USR is now respected for .dlls, too. ! Fixed make_gcc.mak internal HARBOURFLAGSDLL to be in sync with the other .mak files (removed -l switch). - Removed HB_BUILD_MODE for VC builds. Now C/C++ is left to the default value (which is C mode for core), and it's possible to override using: 'set C_USR=-TP' for C++ mode (or -TC for forced C mode). % Other minor cleanups. * contrib/mtpl_b32.mak * contrib/mtpl_vc.mak - Removed HB_BUILD_MODE undocumented options from contrib make files. For Borland C++ mode, use 'set C_USR=-P'. For VC, see above. - Removed HB_BUILD_ST undocumented option. % Other minor cleanups. * contrib/xhb/hbcompat.ch * contrib/xhb/xhb.ch ! Moved __COPYFILE() translation to xhb.ch. --- harbour/ChangeLog | 32 ++++++++++++++++++++ harbour/contrib/mtpl_b32.mak | 22 +------------- harbour/contrib/mtpl_vc.mak | 16 +--------- harbour/contrib/xhb/hbcompat.ch | 4 --- harbour/contrib/xhb/xhb.ch | 1 + harbour/make_b32.mak | 29 ++++++------------ harbour/make_gcc.mak | 37 ++++++++--------------- harbour/make_vc.mak | 53 +++++++++------------------------ 8 files changed, 70 insertions(+), 124 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index baa8dc0624..7b00e62d49 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,38 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-10 10:42 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * make_b32.mak + * make_vc.mak + * make_gcc.mak + * Removed special 'set HB_GT_LIB=gtXXX' support. For the exact + same effect - in case you want to modify default GT at + build time, which is not recommended -, pls use this: + 'set C_USR=-DHB_GT_LIB=XXX' where XXX is 'wvt', 'std', etc. + - Removed HARBOURFLAGSDLL, LDFLAGSDLL, CFLAGSDLL as public options. + It's better to keep these settings common IMO, and handle + all DLL subtleties in our make files. + + L_USR is now respected for .dlls, too. + ! Fixed make_gcc.mak internal HARBOURFLAGSDLL to be in sync + with the other .mak files (removed -l switch). + - Removed HB_BUILD_MODE for VC builds. Now C/C++ is left to + the default value (which is C mode for core), and it's possible + to override using: + 'set C_USR=-TP' for C++ mode (or -TC for forced C mode). + % Other minor cleanups. + + * contrib/mtpl_b32.mak + * contrib/mtpl_vc.mak + - Removed HB_BUILD_MODE undocumented options from contrib + make files. For Borland C++ mode, use 'set C_USR=-P'. + For VC, see above. + - Removed HB_BUILD_ST undocumented option. + % Other minor cleanups. + + * contrib/xhb/hbcompat.ch + * contrib/xhb/xhb.ch + ! Moved __COPYFILE() translation to xhb.ch. + 2008-10-10 09:41 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * common.mak * make_b32.mak diff --git a/harbour/contrib/mtpl_b32.mak b/harbour/contrib/mtpl_b32.mak index 9d549675de..c51e0aac3a 100644 --- a/harbour/contrib/mtpl_b32.mak +++ b/harbour/contrib/mtpl_b32.mak @@ -105,23 +105,7 @@ MKLIB = tlib.exe #********************************************************** -# BORLAND has ST mode as default -!if "$(HB_BUILD_ST)" == "" - HB_BUILD_ST = yes -!endif - -#********************************************************** - -# In which mode compile Harbour C or CPP -!if "$(HB_BUILD_MODE)" == "cpp" -HB_BUILD_MODE = -P -!else -HB_BUILD_MODE = -!endif - -#********************************************************** - -CFLAGS = -I$(INCLUDE_DIR) $(C_USR) $(CFLAGS) $(HB_BUILD_MODE) +CFLAGS = -I$(INCLUDE_DIR) $(C_USR) $(CFLAGS) #----------- !if "$(HB_BUILD_DEBUG)" == "yes" @@ -132,10 +116,6 @@ CFLAGS = -I$(INCLUDE_DIR) $(C_USR) $(CFLAGS) $(HB_BUILD_MODE) CFLAGS = -O2 -OS -Ov -Oi -Oc $(CFLAGS) !endif #----------- -!if "$(HB_BUILD_ST)" != "yes" - CFLAGS = -tWM $(CFLAGS) -!endif -#----------- #********************************************************** diff --git a/harbour/contrib/mtpl_vc.mak b/harbour/contrib/mtpl_vc.mak index 551056ee54..b167025db0 100644 --- a/harbour/contrib/mtpl_vc.mak +++ b/harbour/contrib/mtpl_vc.mak @@ -102,15 +102,6 @@ MKLIB = lib.exe #********************************************************** -# In which mode compile Harbour C or CPP -!if "$(HB_BUILD_MODE)" == "cpp" -HB_BUILD_MODE = P -!else -HB_BUILD_MODE = C -!endif - -#********************************************************** - # Visual C++ version !ifndef HB_VISUALC_VER HB_VISUALC_VER = 80 @@ -124,17 +115,12 @@ CFLAGS_VER = -Ogt2yb1p -GX- -G6 -YX !endif #----------- -CFLAGS = -nologo -W4 -wd4127 -Gs -I$(INCLUDE_DIR) $(CFLAGS_VER) -T$(HB_BUILD_MODE) \ +CFLAGS = -nologo -W4 -wd4127 -Gs -I$(INCLUDE_DIR) $(CFLAGS_VER) \ $(C_USR) $(CFLAGS) #----------- !if "$(HB_BUILD_DEBUG)" == "yes" CFLAGS = -Zi $(CFLAGS) -DBGMARKER = d -!endif -#----------- -!if "$(HB_BUILD_ST)" != "yes" -CFLAGS = -MT$(DBGMARKER) $(CFLAGS) !endif #----------- diff --git a/harbour/contrib/xhb/hbcompat.ch b/harbour/contrib/xhb/hbcompat.ch index 2a4f2c72dd..67c8d8bada 100644 --- a/harbour/contrib/xhb/hbcompat.ch +++ b/harbour/contrib/xhb/hbcompat.ch @@ -115,8 +115,6 @@ #xtranslate hb_IniRead([]) => hb_ReadIni() #xtranslate hb_IniWrite([]) => hb_WriteIni() - #xtranslate xhb_CopyFile([]) => __CopyFile() - /* Some statement endings */ #xcommand ENDSEQUENCE => END #xcommand ENDSWITCH => END @@ -194,8 +192,6 @@ #xtranslate hb_ReadIni([]) => hb_IniRead() #xtranslate hb_WriteIni([]) => hb_IniWrite() - #xtranslate __CopyFile([]) => xhb_CopyFile() - #xtranslate Str(,[],[],)=> iif(, LTrim(Str()), Str()) #xtranslate hb_CMDARGARGV([])=> hb_ARGV(0) diff --git a/harbour/contrib/xhb/xhb.ch b/harbour/contrib/xhb/xhb.ch index db6202abe6..0ef9e929ab 100644 --- a/harbour/contrib/xhb/xhb.ch +++ b/harbour/contrib/xhb/xhb.ch @@ -62,6 +62,7 @@ REQUEST XHB_LIB #xtranslate __Keyboard([]) => xhb__Keyboard() + #xtranslate __CopyFile([]) => xhb_CopyFile() #endif #endif /* __HARBOUR__ */ diff --git a/harbour/make_b32.mak b/harbour/make_b32.mak index 5ca38878da..1a28c35d8d 100644 --- a/harbour/make_b32.mak +++ b/harbour/make_b32.mak @@ -22,16 +22,9 @@ # (note that these are all optional) # # C_USR - Extra C compiler options for libraries and for executables -# CLIBFLAGSDLL - Extra C compiler options for the shared libraries -# -# L_USR - Extra linker options for the static libraries -# LDFLAGSDLL - Extra linker options for the shared libraries -# +# L_USR - Extra linker options for libraries # PRG_USR - Extra Harbour compiler options -# HARBOURFLAGSDLL - Extra Harbour compiler options for shared libraries # -# HB_GT_LIB - The default GT driver, choose between: -# gtwin (default), gtcgi, gtwvt, gtstd, gtpca # HB_BUILD_DLL - If set to yes enables building harbour VM+RTL # dll in addition to normal static build # HB_BUILD_DEBUG - If set to yes causes to compile with debug info @@ -39,9 +32,9 @@ # HB_REBUILD_PARSER - If set to yes force preprocessing new rules by # bison (you must use bison 2.3 or later) # HB_INSTALL_PREFIX - Path to installation directory into which -# Harbour will be installed when the command -# "make_bc.bat install" is lauched. Defaults -# to current directory +# Harbour will be installed when using 'install' +# mode. Defaults to current directory +# # HB_BCCDLL_DYNRT - If set to -tWR causes that harbour-bc.dll # will use dynamic runtime library (recommended) @@ -107,29 +100,25 @@ CFLAGSMT = -DHB_MT_VM RTLIBSUFFIX = i !endif #----------- -!if "$(HB_GT_LIB)" != "" - CFLAGS = -DHB_GT_LIB=$(HB_GT_LIB:gt=) $(CFLAGS) -!endif -#----------- #********************************************************** CLIBFLAGS = -c -q -d -Q -w -w-sig- -tWM $(CFLAGS) -CLIBFLAGSDLL = $(HB_BCCDLL_DYNRT) $(CLIBFLAGSDLL) -DHB_DYNLIB -CEXEFLAGSDLL = $(HB_BCCDLL_DYNRT) $(CEXEFLAGSDLL) +CLIBFLAGSDLL = $(HB_BCCDLL_DYNRT) $(CLIBFLAGS) -DHB_DYNLIB +CEXEFLAGSDLL = $(HB_BCCDLL_DYNRT) $(CLIBFLAGS) #********************************************************** # Harbour Compiler Flags HBFLAGSCMN = -i$(INCLUDE_DIR) -q0 -w3 -es2 -km $(PRG_USR) HARBOURFLAGS = -n $(HBFLAGSCMN) -HARBOURFLAGSDLL= -n1 $(HBFLAGSCMN) $(HARBOURFLAGSDLL) +HARBOURFLAGSDLL= -n1 $(HBFLAGSCMN) #********************************************************** # Linker Flags LDFLAGS = -Gn -C -ap -Tpe -L$(LIB_DIR) -L$(BIN_DIR) $(L_USR) -LDFLAGSDLL = -Gn -C -aa -Tpd -Gi -L$(LIB_DIR) $(LDFLAGSDLL) +LDFLAGSDLL = -Gn -C -aa -Tpd -Gi -L$(LIB_DIR) $(L_USR) !if "$(HB_BUILD_DEBUG)" == "yes" LDFLAGS = -v $(LDFLAGS) LDFLAGSDLL = -v $(LDFLAGSDLL) @@ -193,7 +182,7 @@ ARFLAGS = /P32 $(A_USR) # General *.prg --> *.obj COMPILE rules for EXECUTABLES, # which use Harbour SHARED Library compiled as DLL {$(ALL_EXE_SRC_DIRS)}.prg{$(DLL_OBJ_DIR)}$(OBJEXT): - $(HB) $(HARBOURFLAGS) -o$(DLL_OBJ_DIR)\ $** + $(HB) $(HARBOURFLAGS) -o$(DLL_OBJ_DIR)\ $** $(CC) $(CEXEFLAGSDLL) -o$@ $(DLL_OBJ_DIR)\$&.c #********************************************************** diff --git a/harbour/make_gcc.mak b/harbour/make_gcc.mak index d3972a441a..1242cf7052 100644 --- a/harbour/make_gcc.mak +++ b/harbour/make_gcc.mak @@ -22,32 +22,23 @@ # (note that these are all optional) # # C_USR - Extra C compiler options for libraries and for executables -# CLIBFLAGSDLL - Extra C compiler options for the shared libraries -# -# L_USR - Extra linker options for the static libraries -# LDFLAGSDLL - Extra linker options for the shared libraries -# +# L_USR - Extra linker options for libraries # PRG_USR - Extra Harbour compiler options -# HARBOURFLAGSDLL - Extra Harbour compiler options for shared libraries # -# HB_GT_LIB - The default GT driver, choose between: -# gttrm (default), gtcgi, gtpca, gtcrs, gtsln, gtxwc -# HB_GPM_MOUSE - If set to yes enables using GPM mouse driver on console -# HB_WITHOUT_GTSLN - If set to yes causes to not build gtsln -# (if you don't have slang installed) -# -# HB_COMMERCE - If set to yes disables pure GNU modules (slang,GPM,...) # HB_BUILD_DLL - If set to yes enables building harbour VM+RTL # dll in addition to normal static build (currently not working) # HB_BUILD_DEBUG - If set to yes causes to compile with debug info # HB_BUILD_VERBOSE - enables echoing commands being executed # HB_REBUILD_PARSER - If set to yes force preprocessing new rules by # bison (you must use bison 2.3 or later) -# # HB_INSTALL_PREFIX - Path to installation directory into which -# Harbour will be installed when the command -# "make_gcc.bat install" is lauched. Defaults -# to current directory +# Harbour will be installed when using 'install' +# mode. Defaults to current directory +# +# HB_GPM_MOUSE - If set to yes enables using GPM mouse driver on console +# HB_WITHOUT_GTSLN - If set to yes causes to not build gtsln +# (if you don't have slang installed) +# HB_COMMERCE - If set to yes disables pure GNU modules (slang,GPM,...) # --------------------------------------------------------------- @@ -169,13 +160,9 @@ ifeq ($(HB_BUILD_DEBUG),yes) CFLAGS := -g $(CFLAGS) endif #----------- -ifneq ($(HB_GT_LIB),) -CFLAGS += -DHB_GT_LIB=$(HB_GT_LIB:gt%=%) -endif -#----------- CLIBFLAGS := -c $(CFLAGS) -CLIBFLAGSDLL := -DHB_DYNLIB $(CLIBFLAGS) $(CLIBFLAGSDLL) -CEXEFLAGSDLL := $(CFLAGS) $(CEXEFLAGSDLL) +CLIBFLAGSDLL := $(CLIBFLAGS) -DHB_DYNLIB +CEXEFLAGSDLL := $(CFLAGS) # Under architectures other than "DOS based" add -fPIC # to gcc compiler flags for compiling shared libraries @@ -191,7 +178,7 @@ endif HBFLAGSCMN := -i$(INCLUDE_DIR) -q0 -w3 -es2 -km $(PRG_USR) HARBOURFLAGS := -n $(HBFLAGSCMN) -HARBOURFLAGSDLL:= -n1 -l $(HBFLAGSCMN) $(HARBOURFLAGSDLL) +HARBOURFLAGSDLL:= -n1 $(HBFLAGSCMN) #********************************************************** # Linker Flags @@ -228,7 +215,7 @@ LDFLAGS += $(STANDARD_STATIC_HBLIBS) $(HB_OS_LIBS) #LDFLAGS += $(RTL_LIB) $(VM_LIB) endif -LDFLAGSDLL := -shared $(L_USR) -L$(LIB_DIR) $(LDFLAGSDLL) +LDFLAGSDLL := -shared $(L_USR) -L$(LIB_DIR) #********************************************************** # Library manager Flags diff --git a/harbour/make_vc.mak b/harbour/make_vc.mak index c958dfc0a9..f467714b86 100644 --- a/harbour/make_vc.mak +++ b/harbour/make_vc.mak @@ -22,30 +22,22 @@ # (note that these are all optional) # # C_USR - Extra C compiler options for libraries and for executables -# CLIBFLAGSDLL - Extra C compiler options for the shared libraries -# -# L_USR - Extra linker options for the static libraries -# LDFLAGSDLL - Extra linker options for the shared libraries -# +# L_USR - Extra linker options for libraries # PRG_USR - Extra Harbour compiler options -# HARBOURFLAGSDLL - Extra Harbour compiler options for shared libraries # -# HB_GT_LIB - The default GT driver, choose between: -# gtwin (default), gtcgi, gtwvt, gtstd, gtpca # HB_BUILD_DLL - If set to yes enables building harbour VM+RTL # dll in addition to normal static build -# HB_BUILD_MODE - If set to cpp causes to compile in C++ mode -# HB_BUILD_WINCE - If set to yes, a WinCE build will be created. # HB_BUILD_DEBUG - If set to yes causes to compile with debug info # HB_BUILD_VERBOSE - enables echoing commands being executed # HB_REBUILD_PARSER - If set to yes force preprocessing new rules by # bison (you must use bison 2.3 or later) # HB_INSTALL_PREFIX - Path to installation directory into which -# Harbour will be installed when the command -# "make_vc.bat install" is lauched. Defaults -# to current directory +# Harbour will be installed when using 'install' +# mode. Defaults to current directory +# # HB_VISUALC_VER - Version of Visual C++ compiler. # Possible values are: 60, 70, 71, 80 (default), 90 +# HB_BUILD_WINCE - If set to yes, a WinCE build will be created. #********************************************************** @@ -108,15 +100,6 @@ INCLUDE_DIR = include #********************************************************** -# In which mode compile Harbour C or CPP -!if "$(HB_BUILD_MODE)" == "cpp" -HB_BUILD_MODE = P -!else -HB_BUILD_MODE = C -!endif - -#********************************************************** - # C Compiler Flags !if "$(HB_BUILD_WINCE)" == "yes" @@ -128,7 +111,7 @@ CFLAGS_VER = -Oxsb1 -EHsc -YX -GF # TOFIX: These should be cleaned from everything not absolutely necessary: -CFLAGS = -nologo -W3 -I$(INCLUDE_DIR) -I$(CFLAGS_VER) -T$(HB_BUILD_MODE) \ +CFLAGS = -nologo -W3 -I$(INCLUDE_DIR) -I$(CFLAGS_VER) \ -D"_WIN32_WCE=0x420" -D"UNDER_CE=0x420" -D"WIN32_PLATFORM_PSPC" \ -D"WINCE" -D"_WINCE" -D"_WINDOWS" -D"ARM" -D"_ARM_" -D"ARMV4" \ -D"POCKETPC2003_UI_MODEL" -D"_M_ARM" -D"UNICODE" -D"_UNICODE" \ @@ -156,7 +139,7 @@ CFLAGS_VER = -Ot2b1 -EHs-c- -D_CRT_SECURE_NO_DEPRECATE CFLAGS_VER = -Ogt2yb1p -GX- -G6 -YX !endif -CFLAGS = -nologo -W4 -wd4127 -Gs -I$(INCLUDE_DIR) $(CFLAGS_VER) -T$(HB_BUILD_MODE) \ +CFLAGS = -nologo -W4 -wd4127 -Gs -I$(INCLUDE_DIR) $(CFLAGS_VER) \ $(C_USR) -I$(OBJ_DIR) #----------- @@ -169,23 +152,15 @@ CFLAGSMT = -MT$(DBGMARKER) -DHB_MT_VM !endif -#----------- -!if "$(HB_GT_LIB)" != "" -CFLAGS = -D"HB_GT_LIB=$(HB_GT_LIB:gt=)" $(CFLAGS) -!endif -#----------- - #********************************************************** CLIBFLAGS = -c $(CFLAGS) -CLIBFLAGSxxx = $(CLIBFLAGS: -MT= ) -CLIBFLAGSxxx = $(CLIBFLAGSxxx: -MTd= ) !if "$(HB_BUILD_WINCE)" == "yes" -CLIBFLAGSDLL = $(CLIBFLAGS) $(CLIBFLAGSDLL) -DHB_DYNLIB -CEXEFLAGSDLL = $(CLIBFLAGS) $(CEXEFLAGSDLL) +CLIBFLAGSDLL = $(CLIBFLAGS) -DHB_DYNLIB +CEXEFLAGSDLL = $(CLIBFLAGS) !else -CLIBFLAGSDLL = -MT$(DBGMARKER) $(CLIBFLAGS) $(CLIBFLAGSDLL) -DHB_DYNLIB -CEXEFLAGSDLL = -MT$(DBGMARKER) $(CLIBFLAGS) $(CEXEFLAGSDLL) +CLIBFLAGSDLL = -MT$(DBGMARKER) $(CLIBFLAGS) -DHB_DYNLIB +CEXEFLAGSDLL = -MT$(DBGMARKER) $(CLIBFLAGS) !endif #********************************************************** @@ -196,7 +171,7 @@ HBFLAGSCMN = -i$(INCLUDE_DIR) -q0 -w3 -es2 -km $(PRG_USR) HBFLAGSCMN = $(HBFLAGSCMN) -D__PLATFORM__WINCE !endif HARBOURFLAGS = -n $(HBFLAGSCMN) -HARBOURFLAGSDLL= -n1 $(HBFLAGSCMN) $(HARBOURFLAGSDLL) +HARBOURFLAGSDLL= -n1 $(HBFLAGSCMN) #********************************************************** @@ -213,11 +188,11 @@ LDFLAGS = $(LDFLAGS) /MANIFEST:NO LDFLAGSDLL = /DLL \ /NOLOGO /SUBSYSTEM:WINDOWSCE,4.20 /MACHINE:ARM /ARMPADCODE \ /STACK:65536,4096 /NODEFAULTLIB:"oldnames.lib" \ - /LIBPATH:$(LIB_DIR) $(LDFLAGSDLL) + /LIBPATH:$(LIB_DIR) $(L_USR) !else LDFLAGS = /NOLOGO /SUBSYSTEM:console /LIBPATH:$(LIB_DIR) $(L_USR) LDFLAGSDLL = /DLL \ - /NOLOGO /LIBPATH:$(LIB_DIR) $(LDFLAGSDLL) + /NOLOGO /LIBPATH:$(LIB_DIR) $(L_USR) !endif !if "$(HB_BUILD_DEBUG)" == "yes"