From 2090585ee1e20ed4cb3976a33644ef9545e64887 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 21 Jul 2010 12:46:54 +0000 Subject: [PATCH] 2010-07-21 14:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/hbmk2_plugin_qt.hbs + Do not pollute output with meaningless error message, when HB_WITH_QT=no is used. * contrib/hbpgsql/postgres.c ! Fixed msvc C mode warning. (this one is valid, though I couldn't find out why this is only reported in C mode, there are also some other seemingly unfixable warnings reported in C mode.) * contrib/hbpre.hbm + Will now enable C++ mode by default for msvc compilers, to stay in since with GNU Make behavior. * utils/hbmk2/hbmk2.prg ! Fixed to not rebase dirs passed to -deptimplibs options. ! Fixed to stay silent but still fail when dependencies are forcefully disabled. ! Reorganized msvc compiler version dependent options to better handle the case when no compiler version is present (to go with the less risky option in such case) * config/global.mk + Added msvc64 and msvcia64 version detection. * Renamed one variable to avoid being same as new hbmk2 macro. * config/postinst.hbs * Minor in feedback text. --- harbour/ChangeLog | 38 +++++++++++++++++++++--- harbour/config/global.mk | 26 ++++++++++++++-- harbour/config/postinst.hbs | 2 +- harbour/contrib/hbpgsql/postgres.c | 2 +- harbour/contrib/hbpre.hbm | 2 +- harbour/contrib/hbqt/hbmk2_plugin_qt.hbs | 14 +++++---- harbour/utils/hbmk2/hbmk2.prg | 29 ++++++++++-------- 7 files changed, 86 insertions(+), 27 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 446ff0b15f..b9f0218250 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,20 +16,50 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-21 14:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/hbmk2_plugin_qt.hbs + + Do not pollute output with meaningless error message, when + HB_WITH_QT=no is used. + + * contrib/hbpgsql/postgres.c + ! Fixed msvc C mode warning. (this one is valid, though I + couldn't find out why this is only reported in C mode, + there are also some other seemingly unfixable warnings + reported in C mode.) + + * contrib/hbpre.hbm + + Will now enable C++ mode by default for msvc compilers, + to stay in since with GNU Make behavior. + + * utils/hbmk2/hbmk2.prg + ! Fixed to not rebase dirs passed to -deptimplibs options. + ! Fixed to stay silent but still fail when dependencies + are forcefully disabled. + ! Reorganized msvc compiler version dependent options to + better handle the case when no compiler version is present + (to go with the less risky option in such case) + + * config/global.mk + + Added msvc64 and msvcia64 version detection. + * Renamed one variable to avoid being same as new hbmk2 macro. + + * config/postinst.hbs + * Minor in feedback text. + 2010-07-21 02:55 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/idebrowse.prg % Refind: < SrNo Type FieldName> - + Added: + + Added: - + ------------- - + 2010-07-21 11:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg @@ -742,7 +772,7 @@ generated one. ; NOTE: By this change Harbour VxWorks base port is finished. Besides - being an interesting excercise, it helped to develope new + being an interesting exercise, it helped to develope new non-*nix to *nix cross building codepaths, tweak Harbour for "headless" (w/o terminal) OSes, and to break the ground for target CPU selection inside one target platform. diff --git a/harbour/config/global.mk b/harbour/config/global.mk index 9d4e0560fb..85a73111a9 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -862,11 +862,33 @@ ifeq ($(HB_COMPILER),) ifneq ($(HB_COMP_PATH),) HB_COMPILER := msvc64 HB_CPU := x86_64 + ifneq ($(findstring 8/,$(HB_COMP_PATH)),) + HB_COMPILER_VER := 1400 + else + ifneq ($(findstring 9.0,$(HB_COMP_PATH)),) + HB_COMPILER_VER := 1500 + else + ifneq ($(findstring 10.0,$(HB_COMP_PATH)),) + HB_COMPILER_VER := 1600 + endif + endif + endif else HB_COMP_PATH := $(call find_in_path_raw,ias.exe) ifneq ($(HB_COMP_PATH),) HB_COMPILER := msvcia64 HB_CPU := ia64 + ifneq ($(findstring 8/,$(HB_COMP_PATH)),) + HB_COMPILER_VER := 1400 + else + ifneq ($(findstring 9.0,$(HB_COMP_PATH)),) + HB_COMPILER_VER := 1500 + else + ifneq ($(findstring 10.0,$(HB_COMP_PATH)),) + HB_COMPILER_VER := 1600 + endif + endif + endif else HB_COMP_PATH := $(call find_in_path_raw,cl.exe) ifneq ($(HB_COMP_PATH),) @@ -1064,7 +1086,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)),) + HB_COMP_VERD := $(if $(HB_COMPILER_VER), (v$(HB_COMPILER_VER)),) endif export HB_CCPATH export HB_CCPREFIX @@ -1209,7 +1231,7 @@ ifeq ($(HB_INIT_DONE),) endif endif $(info ! HB_PLATFORM: $(HB_PLATFORM)$(if $(HB_CPU), ($(HB_CPU)),) $(HB_PLAT_AUTO)) - $(info ! HB_COMPILER: $(HB_COMPILER)$(HB_COMP_VER) $(HB_COMP_AUTO)) + $(info ! HB_COMPILER: $(HB_COMPILER)$(HB_COMP_VERD) $(HB_COMP_AUTO)) endif export HB_CPU diff --git a/harbour/config/postinst.hbs b/harbour/config/postinst.hbs index 2a2263fc75..faaffd32ae 100644 --- a/harbour/config/postinst.hbs +++ b/harbour/config/postinst.hbs @@ -57,7 +57,7 @@ PROCEDURE Main() /* Creating language files */ - OutStd( "! Making translation (.hbl) files..." + hb_eol() ) + OutStd( "! Making core translation (.hbl) files..." + hb_eol() ) FOR EACH tmp IN Directory( "utils" + hb_ps() + hb_osFileMask(), "D" ) IF "D" $ tmp[ F_ATTR ] .AND. !( tmp[ F_NAME ] == "." ) .AND. !( tmp[ F_NAME ] == ".." ) diff --git a/harbour/contrib/hbpgsql/postgres.c b/harbour/contrib/hbpgsql/postgres.c index 2d12fda3e2..0ec5d15ea0 100644 --- a/harbour/contrib/hbpgsql/postgres.c +++ b/harbour/contrib/hbpgsql/postgres.c @@ -508,7 +508,7 @@ HB_FUNC( PQEXECPARAMS ) hb_PGresult_ret( PQexecParams( conn, hb_parcx( 2 ), n, NULL, paramvalues, NULL, NULL, 1 ) ); - hb_xfree( paramvalues ); + hb_xfree( ( void * ) paramvalues ); } else hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); diff --git a/harbour/contrib/hbpre.hbm b/harbour/contrib/hbpre.hbm index 4c43b68c10..05b19cb381 100644 --- a/harbour/contrib/hbpre.hbm +++ b/harbour/contrib/hbpre.hbm @@ -10,7 +10,7 @@ {!HB_BUILD_DEBUG}-l -{HB_BUILD_MODE='cpp'}-cpp=yes +{(HB_BUILD_MODE='cpp')|(!HB_BUILD_MODE&allmsvc)}-cpp=yes {HB_BUILD_MODE='c'}-cpp=no -warn=yes diff --git a/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs b/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs index 73d297a81d..c7ff8c55aa 100644 --- a/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs +++ b/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs @@ -338,12 +338,16 @@ STATIC FUNCTION qt_tool_detect( hbmk2, cName, cEnvQT, cEnvHB ) hb_AIns( aEnvList, 1, "HB_WITH_QT", .T. ) - IF ! Empty( GetEnv( "HB_WITH_QT" ) ) .AND. ; - !( GetEnv( "HB_WITH_QT" ) == "no" ) + IF ! Empty( GetEnv( "HB_WITH_QT" ) ) - IF ! hb_FileExists( cBIN := hbmk2_PathNormalize( GetEnv( "HB_WITH_QT" ) + "\..\bin\" + cName + ".exe" ) ) - hbmk2_OutErr( hbmk2, hb_StrFormat( "Warning: HB_WITH_QT points to incomplete QT installation. '%1$s' executable not found.", cName ) ) - cBIN := "" + IF GetEnv( "HB_WITH_QT" ) == "no" + /* Return silently. It shall fail at dependency detection inside hbmk2 */ + RETURN "" + ELSE + IF ! hb_FileExists( cBIN := hbmk2_PathNormalize( GetEnv( "HB_WITH_QT" ) + "\..\bin\" + cName + ".exe" ) ) + hbmk2_OutErr( hbmk2, hb_StrFormat( "Warning: HB_WITH_QT points to incomplete QT installation. '%1$s' executable not found.", cName ) ) + cBIN := "" + ENDIF ENDIF ENDIF ENDIF diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index e89de3faa4..988793f4c7 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -1572,7 +1572,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) /* Detect compiler version (where applicable) */ - IF Empty( hbmk[ _HBMK_nCOMPVer ] ) .AND. ! Empty( cPath_CompC ) + IF hbmk[ _HBMK_nCOMPVer ] == 0 .AND. ! Empty( cPath_CompC ) DO CASE CASE ( hbmk[ _HBMK_cPLAT ] == "win" .AND. hbmk[ _HBMK_cCOMP ] == "cygwin" ) @@ -2343,7 +2343,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) cParam := MacroProc( hbmk, SubStr( cParam, Len( "-depimplibs=" ) + 1 ), aParam[ _PAR_cFileName ] ) IF dep_split_arg( hbmk, cParam, @cParam, @tmp ) - AAddNew( hbmk[ _HBMK_hDEP ][ cParam ][ _HBMKDEP_aIMPLIBSRC ], PathNormalize( PathMakeAbsolute( PathSepToSelf( tmp ), aParam[ _PAR_cFileName ] ) ) ) + AAddNew( hbmk[ _HBMK_hDEP ][ cParam ][ _HBMKDEP_aIMPLIBSRC ], PathSepToSelf( tmp ) ) ENDIF CASE Left( cParam, Len( "-depimplibd=" ) ) == "-depimplibd=" @@ -3741,7 +3741,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) cBin_Dyn := cBin_Link ELSE cBin_Lib := "lib.exe" - IF hbmk[ _HBMK_cCOMP ] == "msvcarm" .AND. hbmk[ _HBMK_nCOMPVer ] < 1400 + IF hbmk[ _HBMK_cCOMP ] == "msvcarm" .AND. ( hbmk[ _HBMK_nCOMPVer ] != 0 .AND. hbmk[ _HBMK_nCOMPVer ] < 1400 ) cBin_CompC := "clarm.exe" ELSE cBin_CompC := "cl.exe" @@ -3755,21 +3755,21 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) cOpt_CompC := "-nologo -c" IF hbmk[ _HBMK_lOPTIM ] IF hbmk[ _HBMK_cPLAT ] == "wce" - IF hbmk[ _HBMK_nCOMPVer ] >= 1400 - cOpt_CompC += " -Os -Gy" - ELSE + IF hbmk[ _HBMK_nCOMPVer ] != 0 .AND. hbmk[ _HBMK_nCOMPVer ] < 1400 cOpt_CompC += " -Oxsb1 -GF" + ELSE + cOpt_CompC += " -Os -Gy" ENDIF ELSE - IF hbmk[ _HBMK_nCOMPVer ] >= 1400 - cOpt_CompC += " -O2" - ELSE + IF hbmk[ _HBMK_nCOMPVer ] != 0 .AND. hbmk[ _HBMK_nCOMPVer ] < 1400 cOpt_CompC += " -Ogt2yb1p -GX- -G6" + ELSE + cOpt_CompC += " -O2" ENDIF ENDIF ENDIF IF hbmk[ _HBMK_cPLAT ] == "win" - IF hbmk[ _HBMK_nCOMPVer ] < 1400 + IF hbmk[ _HBMK_nCOMPVer ] != 0 .AND. hbmk[ _HBMK_nCOMPVer ] < 1400 IF hbmk[ _HBMK_lDEBUG ] AAdd( hbmk[ _HBMK_aOPTC ], "-MTd" ) ELSE @@ -3788,7 +3788,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) SWITCH hbmk[ _HBMK_nWARN ] CASE _WARN_MAX ; AAdd( hbmk[ _HBMK_aOPTC ], "-W4" ) ; EXIT CASE _WARN_YES - IF hbmk[ _HBMK_cCOMP ] == "msvcarm" .AND. hbmk[ _HBMK_nCOMPVer ] < 1400 + IF hbmk[ _HBMK_cCOMP ] == "msvcarm" .AND. hbmk[ _HBMK_nCOMPVer ] != 0 .AND. hbmk[ _HBMK_nCOMPVer ] < 1400 /* Lowered warning level to avoid large amount of warnings in system headers. Maybe this is related to the msvc2003 kit I was using. [vszakats] */ AAdd( hbmk[ _HBMK_aOPTC ], "-W3" ) @@ -6672,6 +6672,7 @@ STATIC FUNCTION dep_evaluate( hbmk ) LOCAL aREQ := {} LOCAL aOPT := {} LOCAL aWRN := {} + LOCAL lAnyForcedOut := .F. FOR EACH dep IN hbmk[ _HBMK_hDEP ] IF dep[ _HBMKDEP_lFound ] @@ -6688,6 +6689,8 @@ STATIC FUNCTION dep_evaluate( hbmk ) IF hbmk[ _HBMK_lInfo ] hbmk_OutStd( hbmk, hb_StrFormat( I_( "Dependency '%1$s' forcefully disabled" ), dep[ _HBMKDEP_cName ] ) ) ENDIF + lAnyForcedOut := .T. + LOOP ELSE IF hbmk[ _HBMK_lDEBUGDEPD ] hbmk_OutStd( hbmk, hb_StrFormat( "debugdepd: REQ %1$s: missing", dep[ _HBMKDEP_cName ] ) ) @@ -6736,7 +6739,7 @@ STATIC FUNCTION dep_evaluate( hbmk ) ENDIF ENDIF - RETURN Empty( aREQ ) .AND. Empty( aWRN ) + RETURN Empty( aREQ ) .AND. Empty( aWRN ) .AND. ! lAnyForcedOut /* Try '*-config' and 'pkg-config *' detection */ STATIC FUNCTION dep_try_pkg_detection( hbmk, dep ) @@ -8655,7 +8658,7 @@ STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) IF dep_split_arg( hbmk, cLine, @cName, @cLine ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) - AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cName ][ _HBMKDEP_aIMPLIBSRC ], PathNormalize( PathMakeAbsolute( PathSepToSelf( MacroProc( hbmk, cItem, cFileName ) ), FNameDirGet( cFileName ) ) ) ) + AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cName ][ _HBMKDEP_aIMPLIBSRC ], PathSepToSelf( MacroProc( hbmk, cItem, cFileName ) ) ) NEXT ENDIF