From 45819c716e955d5926467d73b027f2b4bc0f32a0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 31 Jul 2010 00:35:57 +0000 Subject: [PATCH] 2010-07-31 02:32 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + -implib= option now accepts filename, too (exactly like -o option) So it's possible to manually set the generated implib lib in -hbdyn (and -hbexe) modes. * contrib/hbpost.hbm + Moved the _dll/_exe implib output name postfixing logic from hbmk2 (though hbmk2 will still keep appending these by default) This way the "_dll" postfix thing is fully controlled by make.hbs and hbpost.hbm, no hidden "agreements" with hbmk2. * config/global.mk + Added log warning, if the source tree is modified. --- harbour/ChangeLog | 15 +++++++++++++++ harbour/config/global.mk | 6 +++++- harbour/contrib/hbpost.hbm | 2 ++ harbour/utils/hbmk2/hbmk2.prg | 26 ++++++++++++++++++++------ 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d234a16f11..d846dada13 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,21 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-31 02:32 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + + -implib= option now accepts filename, too (exactly like -o option) + So it's possible to manually set the generated implib lib in + -hbdyn (and -hbexe) modes. + + * contrib/hbpost.hbm + + Moved the _dll/_exe implib output name postfixing logic from + hbmk2 (though hbmk2 will still keep appending these by default) + This way the "_dll" postfix thing is fully controlled by make.hbs + and hbpost.hbm, no hidden "agreements" with hbmk2. + + * config/global.mk + + Added log warning, if the source tree is modified. + 2010-07-31 01:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/make.hbs + Reworked, simplified internals to support multiple projects diff --git a/harbour/config/global.mk b/harbour/config/global.mk index bfb8bae329..277c5d73a2 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -1551,7 +1551,11 @@ ifeq ($(HB_INIT_DONE),) endif ifeq ($(ROOT),./) ifneq ($(call find_in_path,svnversion),) - $(info ! REVISION: $(shell svnversion .)) + _tmp := $(shell svnversion .) + ifneq ($(findstring M,$(_tmp)),) + $(info ! === WARNING: Locally modified source code ===) + endif + $(info ! REVISION: $(_tmp)) endif endif endif diff --git a/harbour/contrib/hbpost.hbm b/harbour/contrib/hbpost.hbm index bd1f820ea4..fa99754b8d 100644 --- a/harbour/contrib/hbpost.hbm +++ b/harbour/contrib/hbpost.hbm @@ -40,6 +40,8 @@ {_HB_BUILD_LIBDYN}-hbdyn {_HB_BUILD_LIBDYN}-shared {_HB_BUILD_LIBDYN}-implib=../lib/${hb_plat}/${hb_comp}${hb_build}/ +{_HB_BUILD_LIBDYN&hbdyn}-implib=${hb_outputname}_dll +{_HB_BUILD_LIBDYN&hbexe}-implib=${hb_outputname}_exe {_HB_BUILD_LIBDYN&allwin}-lhbmaindllp {_HB_BUILD_LIBDYN}-depimplib- diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index a5dc33ecda..07f729d130 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2171,18 +2171,24 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) IF ! Empty( tmp ) tmp := PathSepToSelf( tmp ) hb_FNameSplit( tmp, @cDir, @cName, @cExt ) - IF Empty( cDir ) + DO CASE + CASE Empty( cDir ) tmp := PathNormalize( PathMakeAbsolute( tmp, aParam[ _PAR_cFileName ] ) ) hb_FNameSplit( tmp, @cDir, @cName, @cExt ) IF l_cIMPLIBDIR == NIL l_cIMPLIBDIR := cDir ENDIF - ELSE + l_cIMPLIBNAME := FNameNameExtGet( tmp ) + CASE ! Empty( cDir ) .AND. Empty( cName ) .AND. Empty( cExt ) l_cIMPLIBDIR := PathNormalize( PathMakeAbsolute( cDir, aParam[ _PAR_cFileName ] ) ) - ENDIF + OTHERWISE /* ! Empty( cDir ) .AND. !( Empty( cName ) .AND. Empty( cExt ) ) */ + l_cIMPLIBDIR := PathNormalize( PathMakeAbsolute( cDir, aParam[ _PAR_cFileName ] ) ) + l_cIMPLIBNAME := FNameNameExtGet( tmp ) + ENDCASE ENDIF ELSE l_cIMPLIBDIR := NIL + l_cIMPLIBNAME := NIL ENDIF CASE Left( cParam, 2 ) == "-L" .AND. ; @@ -4407,12 +4413,20 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) IF Empty( cExt ) .AND. ! Empty( cBinExt ) hbmk[ _HBMK_cPROGNAME ] := hb_FNameMerge( cDir, cName, cBinExt ) ENDIF - l_cIMPLIBNAME := hb_FNameMerge( l_cIMPLIBDIR, cLibLibPrefix + cName + _HBMK_IMPLIB_EXE_POST, cImpLibExt ) + IF l_cIMPLIBNAME == NIL + l_cIMPLIBNAME := cName + _HBMK_IMPLIB_EXE_POST + ENDIF + l_cIMPLIBNAME := hb_FNameMerge( l_cIMPLIBDIR, cLibLibPrefix + l_cIMPLIBNAME, cImpLibExt ) CASE lStopAfterCComp .AND. hbmk[ _HBMK_lCreateDyn ] IF Empty( cExt ) .AND. ! Empty( cDynLibExt ) hbmk[ _HBMK_cPROGNAME ] := hb_FNameMerge( cDir, cName, cDynLibExt ) ENDIF - l_cIMPLIBNAME := hb_FNameMerge( l_cIMPLIBDIR, cLibLibPrefix + cName + _HBMK_IMPLIB_DLL_POST, cImpLibExt ) + IF l_cIMPLIBNAME == NIL + /* By default add default postfix to avoid collision with static lib + with the same name. */ + l_cIMPLIBNAME := cName + _HBMK_IMPLIB_DLL_POST + ENDIF + l_cIMPLIBNAME := hb_FNameMerge( l_cIMPLIBDIR, cLibLibPrefix + l_cIMPLIBNAME, cImpLibExt ) CASE lStopAfterCComp .AND. hbmk[ _HBMK_lCreateLib ] hbmk[ _HBMK_cPROGNAME ] := hb_FNameMerge( cDir, cLibLibPrefix + cName, iif( Empty( cLibLibExt ), cExt, cLibLibExt ) ) ENDCASE @@ -11015,7 +11029,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong ) { "-[no]cpp[=def]" , I_( "force C/C++ mode or reset to default" ) },; { "-[no]map" , I_( "create (or not) a map file" ) },; { "-[no]implib" , I_( "create (or not) an import library (in -hbdyn/-hbexe mode). The name will have a postfix added." ) },; - { "-implib=" , I_( "create import library (in -hbdyn/-hbexe mode) in (default: same as output dir)" ) },; + { "-implib=" , I_( "create import library (in -hbdyn/-hbexe mode) name to (default: same as output)" ) },; { "-[no]strip" , I_( "strip (no strip) binaries" ) },; { "-[no]trace" , I_( "show commands executed" ) },; { "-[no]beep" , I_( "enable (or disable) single beep on successful exit, double beep on failure" ) },;