From 2e27f332859ac28e80cb6bcc838e0a77da16ff2d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 4 Feb 2011 17:27:14 +0000 Subject: [PATCH] 2011-02-04 18:26 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Added -request= option to force linking any custom function/procedure to target executable. * contrib/hbrunext/hbrunext.hbp * Replaced small hack using -main= to force linking, with -request= option. --- harbour/ChangeLog | 8 ++++++++ harbour/contrib/hbrunext/hbrunext.hbp | 3 +-- harbour/utils/hbmk2/hbmk2.prg | 12 ++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 853a958843..eb033d8200 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,14 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-04 18:26 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + + Added -request= option to force linking any custom function/procedure + to target executable. + + * contrib/hbrunext/hbrunext.hbp + * Replaced small hack using -main= to force linking, with -request= option. + 2011-02-04 18:14 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + contrib/hbrunext + contrib/hbrunext/hbrunext.hbp diff --git a/harbour/contrib/hbrunext/hbrunext.hbp b/harbour/contrib/hbrunext/hbrunext.hbp index a0414f5fc6..f0b79848ff 100644 --- a/harbour/contrib/hbrunext/hbrunext.hbp +++ b/harbour/contrib/hbrunext/hbrunext.hbp @@ -8,7 +8,7 @@ -o${hb_name} --main=__PULLEXT +-request=__PULLEXT pullext.prg # Always build in shared mode for these platforms because the @@ -23,4 +23,3 @@ pullext.prg hbct.hbc hbexpat.hbc hbwin.hbc{allwin} - diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index c4ad81d1fb..80405e574d 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -786,6 +786,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) LOCAL l_aOBJA LOCAL l_aCLEAN LOCAL l_cMAIN := NIL + LOCAL l_aREQUEST := {} LOCAL l_cVCSDIR LOCAL l_cVCSHEAD LOCAL l_cTSHEAD @@ -2308,6 +2309,14 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Invalid -main value ignored: %1$s" ), cParam ) ) ENDIF + CASE Left( cParamL, 9 ) == "-request=" + + IF IsValidHarbourID( cParam := SubStr( cParam, 10 ) ) + AAdd( l_aREQUEST, cParam ) + ELSE + hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Invalid -request value ignored: %1$s" ), cParam ) ) + ENDIF + CASE Left( cParamL, 3 ) == "-gt" cParam := MacroProc( hbmk, SubStr( cParam, 2 ), aParam[ _PAR_cFileName ] ) @@ -5049,6 +5058,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) and override the GT if requested by user. */ IF ( ( ! lStopAfterCComp .OR. hbmk[ _HBMK_lDynVM ] ) .AND. ; ( l_cMAIN != NIL .OR. ; + ! Empty( l_aREQUEST ) .OR. ; ! Empty( hbmk[ _HBMK_aLIBUSERGT ] ) .OR. ; hbmk[ _HBMK_cGT ] != NIL .OR. ; l_cCMAIN != NIL ) ) .OR. lHBMAINDLLP @@ -5093,6 +5103,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) IF ! Empty( hbmk[ _HBMK_aLIBUSERGT ] ) AEval( hbmk[ _HBMK_aLIBUSERGT ], {| tmp | AAdd( array, "HB_GT_" + Upper( SubStr( tmp, 3 ) ) ) } ) ENDIF + AEval( l_aREQUEST, {| tmp | AAdd( array, Upper( tmp ) ) } ) /* Build C stub */ /* Use the same EOL for all platforms to avoid unnecessary rebuilds. */ @@ -11908,6 +11919,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong ) NIL,; { "-gui|-std" , I_( "create GUI/console executable" ) },; { "-main=" , I_( "override the name of starting function/procedure" ) },; + { "-request=" , I_( "force function/procedure to be linked" ) },; { "-fullstatic" , I_( "link with all static libs" ) },; { "-[full|fix]shared" , I_( "create shared Harbour binaries without/with absolute dir reference to Harbour library (default: 'fullshared' when Harbour is installed on system location, 'fixshared' otherwise) (fix/full option in *nix only)" ) },; { "-nulrdd[-]" , I_( "link with nulrdd" ) },;