2017-05-19 17:03 UTC Viktor Szakats (vszakats users.noreply.github.com)
* utils/hbmk2/hbmk2.prg
+ add ability to inject extra code/directives to the hbmk2/hbrun source
code at build time. It can be enabled by defining
`_HBMK2_EXTRA_CODE`, when a source file named `hbmk2_extra.prg` will
be included between the header and code section of hbmk2.prg.
+ display note when above option is enabled
+ add ability to prepend extra code before the shell execution stub via
the `_HBSHELL_EXEC_PRE` macro. It's initialized by an empty string in
a default build. This macro can be redefined at will by
`hbmk2_extra.prg`.
; commit backported to 3.2 from the 3.4 fork:
2017-05-14 19:35 UTC Viktor Szakats (vszakats users.noreply.github.com)
1ee9a9c6dc
This commit is contained in:
@@ -628,6 +628,14 @@ EXTERNAL __dbgEntry
|
||||
#define _HBSH_lClipperComp 15
|
||||
#define _HBSH_MAX_ 15
|
||||
|
||||
#define _HBSHELL_EXEC_PRE ""
|
||||
|
||||
/* Allow to inject custom code at build-time. The goal is to help
|
||||
adding necessary customizations for certain use-case. */
|
||||
#if defined( _HBMK2_EXTRA_CODE )
|
||||
#include "hbmk2_extra.prg"
|
||||
#endif
|
||||
|
||||
/* Trick to make it run if compiled without -n/-n1/-n2
|
||||
(or with -n-) option.
|
||||
(typically as scripts and precompiled scripts) */
|
||||
@@ -14703,6 +14711,7 @@ STATIC PROCEDURE __hbshell_Exec( cCommand )
|
||||
} )
|
||||
|
||||
cFunc := ;
|
||||
_HBSHELL_EXEC_PRE + hb_eol() + ;
|
||||
"STATIC FUNCTION __HBDOT()" + hb_eol() + ;
|
||||
"RETURN {||" + hb_eol() + ;
|
||||
" " + cCommand + hb_eol() + ;
|
||||
@@ -15671,6 +15680,11 @@ STATIC PROCEDURE ShowHeader( hbmk )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
#if defined( _HBMK2_EXTRA_CODE )
|
||||
Eval( hbmk[ _HBMK_bOut ], _OUT_EOL )
|
||||
Eval( hbmk[ _HBMK_bOut ], "This build contains build-time customizations." + _OUT_EOL )
|
||||
#endif
|
||||
|
||||
Eval( hbmk[ _HBMK_bOut ], _OUT_EOL )
|
||||
|
||||
RETURN
|
||||
|
||||
Reference in New Issue
Block a user