2010-11-03 19:01 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* utils/hbmk2/hbmk2.prg
    * Using _APPMAIN() instead of MAIN() as entry function, to be
      friendly with plugins using MAIN().
    * Commented test code added for hbrun integration.
    + Added popular package handler's lib and include directory
      to bsd builds' default setup.
    * Added comments describint which such directory belongs to which package
      system (darwin, bsd)
    + Plugins will now be called with Harbour header directory properly setup,
      so it's possible to use headers in them.

  * include/hbclass.ch
    - Deleted some lines which were active when __HARBOUR__ is not defined.
      As I understand this is Harbour-only header, so __HARBOUR__ is always
      to be defined. Please speak up if you know what it was for.
      It was added here: 2006-10-04 02:30 UTC+0200

  * src/pp/hbpp.c
    + Support for -e option which lets override the name of the
      public entry function in generated PP rules .c file.

  * contrib/hbqt/hbqt_hbmk2_plugin.hbs
    + Some provisions to handle .qth files.

  * INSTALL
    * https links changed to http for win nightly pkgs.
This commit is contained in:
Viktor Szakats
2010-11-03 18:03:03 +00:00
parent 22b4af0268
commit 79b266ca4f
6 changed files with 137 additions and 56 deletions

View File

@@ -16,6 +16,34 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-11-03 19:01 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
* Using _APPMAIN() instead of MAIN() as entry function, to be
friendly with plugins using MAIN().
* Commented test code added for hbrun integration.
+ Added popular package handler's lib and include directory
to bsd builds' default setup.
* Added comments describint which such directory belongs to which package
system (darwin, bsd)
+ Plugins will now be called with Harbour header directory properly setup,
so it's possible to use headers in them.
* include/hbclass.ch
- Deleted some lines which were active when __HARBOUR__ is not defined.
As I understand this is Harbour-only header, so __HARBOUR__ is always
to be defined. Please speak up if you know what it was for.
It was added here: 2006-10-04 02:30 UTC+0200
* src/pp/hbpp.c
+ Support for -e option which lets override the name of the
public entry function in generated PP rules .c file.
* contrib/hbqt/hbqt_hbmk2_plugin.hbs
+ Some provisions to handle .qth files.
* INSTALL
* https links changed to http for win nightly pkgs.
2010-11-03 13:07 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbqt/utils/hbqtgen.prg
% Deleted need for Harbour headers. Except hbclass.ch.

View File

@@ -1194,8 +1194,8 @@ HARBOUR
4.) Harbour nightly binaries (updated once a day from source repository)
Windows (unified):
https://sourceforge.net/projects/harbour-project/files/binaries-windows/nightly/harbour-nightly-win.exe/download
https://sourceforge.net/projects/harbour-project/files/binaries-windows/nightly/harbour-nightly-win.7z/download
http://sourceforge.net/projects/harbour-project/files/binaries-windows/nightly/harbour-nightly-win.exe/download
http://sourceforge.net/projects/harbour-project/files/binaries-windows/nightly/harbour-nightly-win.7z/download
5.) Harbour source download (stable)

View File

@@ -32,7 +32,7 @@
#define I_( x ) hb_i18n_gettext( x )
#if ! defined( __HBSCRIPT__HBRUN )
#if defined( __HBSCRIPT__HBMK )
FUNCTION hbmk2_plugin_qt( hbmk2 )
LOCAL cRetVal := ""
@@ -56,6 +56,7 @@ FUNCTION hbmk2_plugin_qt( hbmk2 )
hbmk2_Register_Input_File_Extension( hbmk2, ".ui" )
hbmk2_Register_Input_File_Extension( hbmk2, ".hpp" )
hbmk2_Register_Input_File_Extension( hbmk2, ".h" )
hbmk2_Register_Input_File_Extension( hbmk2, ".qth" )
EXIT
@@ -66,6 +67,7 @@ FUNCTION hbmk2_plugin_qt( hbmk2 )
hbmk2[ "vars" ][ "aQRC_Src" ] := {}
hbmk2[ "vars" ][ "aUIC_Src" ] := {}
hbmk2[ "vars" ][ "aMOC_Src" ] := {}
hbmk2[ "vars" ][ "aQTH_Src" ] := {}
FOR EACH cSrc IN hbmk2[ "params" ]
SWITCH Lower( hbmk2_FNameExtGet( cSrc ) )
@@ -79,6 +81,9 @@ FUNCTION hbmk2_plugin_qt( hbmk2 )
CASE ".h"
AAdd( hbmk2[ "vars" ][ "aMOC_Src" ], cSrc )
EXIT
CASE ".qth"
AAdd( hbmk2[ "vars" ][ "aQTH_Src" ], cSrc )
EXIT
ENDSWITCH
NEXT
@@ -86,9 +91,6 @@ FUNCTION hbmk2_plugin_qt( hbmk2 )
hbmk2[ "vars" ][ "aQRC_Dst" ] := {}
hbmk2[ "vars" ][ "aQRC_PRG" ] := {}
hbmk2[ "vars" ][ "aUIC_Dst" ] := {}
hbmk2[ "vars" ][ "aMOC_Dst" ] := {}
FOR EACH cSrc IN hbmk2[ "vars" ][ "aQRC_Src" ]
cDst := hbmk2_FNameDirExtSet( "rcc_" + hbmk2_FNameNameGet( cSrc ), hbmk2[ "cWorkDir" ], ".qrb" )
AAdd( hbmk2[ "vars" ][ "aQRC_Dst" ], cDst )
@@ -97,18 +99,31 @@ FUNCTION hbmk2_plugin_qt( hbmk2 )
hbmk2_AddInput_PRG( hbmk2, cDst )
NEXT
hbmk2[ "vars" ][ "aUIC_Dst" ] := {}
FOR EACH cSrc IN hbmk2[ "vars" ][ "aUIC_Src" ]
cDst := hbmk2_FNameDirExtSet( "uic_" + hbmk2_FNameNameGet( cSrc ), hbmk2[ "cWorkDir" ], ".prg" )
AAdd( hbmk2[ "vars" ][ "aUIC_Dst" ], cDst )
hbmk2_AddInput_PRG( hbmk2, cDst )
NEXT
hbmk2[ "vars" ][ "aMOC_Dst" ] := {}
FOR EACH cSrc IN hbmk2[ "vars" ][ "aMOC_Src" ]
cDst := hbmk2_FNameDirExtSet( "moc_" + hbmk2_FNameNameGet( cSrc ), hbmk2[ "cWorkDir" ], ".cpp" )
AAdd( hbmk2[ "vars" ][ "aMOC_Dst" ], cDst )
hbmk2_AddInput_CPP( hbmk2, cDst )
NEXT
hbmk2[ "vars" ][ "aQTH_CPP" ] := {}
hbmk2[ "vars" ][ "aQTH_PRG" ] := {}
FOR EACH cSrc IN hbmk2[ "vars" ][ "aQTH_Src" ]
cDst := hbmk2_FNameDirExtSet( "qth_cpp_" + hbmk2_FNameNameGet( cSrc ), hbmk2[ "cWorkDir" ], ".cpp" )
AAdd( hbmk2[ "vars" ][ "aQTH_CPP" ], cDst )
hbmk2_AddInput_CPP( hbmk2, cDst )
cDst := hbmk2_FNameDirExtSet( "qth_prg_" + hbmk2_FNameNameGet( cSrc ), hbmk2[ "cWorkDir" ], ".prg" )
AAdd( hbmk2[ "vars" ][ "aQTH_PRG" ], cDst )
hbmk2_AddInput_PRG( hbmk2, cDst )
NEXT
/* Detect tool locations */
IF ! hbmk2[ "lCLEAN" ]
@@ -317,6 +332,8 @@ FUNCTION hbmk2_plugin_qt( hbmk2 )
AEval( hbmk2[ "vars" ][ "aQRC_PRG" ], {| tmp | FErase( tmp ) } )
AEval( hbmk2[ "vars" ][ "aUIC_Dst" ], {| tmp | FErase( tmp ) } )
AEval( hbmk2[ "vars" ][ "aMOC_Dst" ], {| tmp | FErase( tmp ) } )
AEval( hbmk2[ "vars" ][ "aQTH_CPP" ], {| tmp | FErase( tmp ) } )
AEval( hbmk2[ "vars" ][ "aQTH_PRG" ], {| tmp | FErase( tmp ) } )
ENDIF
EXIT
@@ -384,30 +401,30 @@ PROCEDURE Main( cSrc, cDst )
LOCAL nError
LOCAL cExt
LOCAL cName
IF cSrc != NIL .AND. ;
cDst != NIL
FClose( hb_FTempCreateEx( @cTmp ) )
cName := "TEST"
hb_FNameSplit( cSrc,,, @cExt )
SWITCH Lower( cExt )
CASE ".ui"
FClose( hb_FTempCreateEx( @cTmp ) )
IF ( nError := hb_processRun( "uic " + cSrc + " -o " + cTmp ) ) == 0
IF ! uic_to_prg( NIL, cTmp, cDst, cName )
IF ! uic_to_prg( NIL, cTmp, cDst, "TEST" )
nError := 9
ENDIF
ELSE
OutErr( "Error: Calling 'uic' tool: " + hb_ntos( nError ) + hb_eol() )
ENDIF
EXIT
ENDSWITCH
FErase( cTmp )
FErase( cTmp )
EXIT
CASE ".qth"
qth_to_src( cSrc, cDst )
ENDSWITCH
ELSE
OutErr( "Missing parameter. Call with: <input> <output>" + hb_eol() )
nError := 8
@@ -427,6 +444,17 @@ STATIC FUNCTION hbmk2_OutErr( hbmk2, ... )
#endif
/* ----------------------------------------------------------------------- */
STATIC FUNCTION qth_to_src( cSrc, cDst )
HB_SYMBOL_UNUSED( cSrc )
HB_SYMBOL_UNUSED( cDst )
RETURN .F.
/* ----------------------------------------------------------------------- */
STATIC FUNCTION uic_to_prg( hbmk2, cFileNameSrc, cFileNameDst, cName )
LOCAL aLinesPRG
LOCAL cFile
@@ -518,7 +546,7 @@ STATIC FUNCTION hbq_gen_ui_prg( cFile, cFuncName )
lCreateFinished := .T.
ELSEIF Left( s, 1 ) == "Q" .AND. ! lCreateFinished .AND. ( n := At( "*", s ) ) > 0
// We eill deal later - just skip
// We will deal later - just skip
ELSEIF hbq_notAString( s ) .AND. ! Empty( aReg := hb_regex( regEx, s ) )
cCls := RTrim( aReg[ 1 ] )
@@ -632,12 +660,10 @@ STATIC FUNCTION hbq_gen_ui_prg( cFile, cFuncName )
IF "addWidget" $ cCmd
IF hbq_occurs( cCmd, "," ) >= 4
// cCmd := StrTran( cCmd, "addWidget", "addWidget_1" )
cCmd := StrTran( cCmd, "addWidget", "addWidget" )
ENDIF
ELSEIF "addLayout" $ cCmd
IF hbq_occurs( cCmd, "," ) >= 4
// cCmd := StrTran( cCmd, "addLayout", "addLayout_1" )
cCmd := StrTran( cCmd, "addLayout", "addLayout" )
ENDIF
ENDIF

View File

@@ -123,18 +123,6 @@
#endif
#ifndef __HARBOUR__
#ifndef HB_CLS_NO_DECORATION
#define HB_CLS_NO_DECORATION
#endif
#ifndef HB_CLS_NO_DECLARATIONS
#define HB_CLS_NO_DECLARATIONS
#endif
#ifndef HB_CLS_PARAM_LIST
#define HB_CLS_PARAM_LIST
#endif
#endif
/* Disable method decoration when Harbour compiled strict compatibility mode.
In strict mode, PP doesn't support identifier concatenation, which
would be needed for method decoration. */

View File

@@ -191,7 +191,7 @@ static void hb_pp_generateInitFunc( FILE * fout, int iRules,
fprintf( fout, "NULL, 0 );\n" );
}
static void hb_pp_generateRules( FILE * fout, PHB_PP_STATE pState )
static void hb_pp_generateRules( FILE * fout, PHB_PP_STATE pState, const char * szPPRuleFuncName )
{
int iDefs = 0, iTrans = 0, iCmds = 0;
@@ -213,7 +213,7 @@ static void hb_pp_generateRules( FILE * fout, PHB_PP_STATE pState )
if( pState->pCommands )
iCmds = hb_pp_writeRules( fout, pState->pCommands, "cmd" );
fprintf( fout, "\nvoid hb_pp_setStdRules( PHB_PP_STATE pState )\n{\n" );
fprintf( fout, "\nvoid %s( PHB_PP_STATE pState )\n{\n", szPPRuleFuncName ? szPPRuleFuncName : "hb_pp_setStdRules" );
hb_pp_generateInitFunc( fout, iDefs, "Definitions", "def" );
hb_pp_generateInitFunc( fout, iTrans, "Translations", "trs" );
hb_pp_generateInitFunc( fout, iCmds, "Commands", "cmd" );
@@ -257,7 +257,7 @@ static void hb_pp_undefCompilerRules( PHB_PP_STATE pState )
}
}
static int hb_pp_preprocesfile( PHB_PP_STATE pState, const char * szRuleFile )
static int hb_pp_preprocesfile( PHB_PP_STATE pState, const char * szRuleFile, const char * szPPRuleFuncName )
{
int iResult = 0;
HB_SIZE nLen;
@@ -279,7 +279,7 @@ static int hb_pp_preprocesfile( PHB_PP_STATE pState, const char * szRuleFile )
else
{
hb_pp_undefCompilerRules( pState );
hb_pp_generateRules( foutr, pState );
hb_pp_generateRules( foutr, pState, szPPRuleFuncName );
fclose( foutr );
}
}
@@ -636,6 +636,7 @@ static void hb_pp_usage( char * szName )
printf( "\n" );
printf( "Syntax: %s <file[.prg]> [options]\n\n", szName );
printf( "Options: -d<id>[=<val>]\t#define <id>\n"
" -e[<func>] \tuse <func> as entry function in generated .c PP rules\n"
" -i<path> \tadd #include file search path\n"
" -u[<file>] \tuse command def set in <file> (or none)\n"
" -c[<file>] \tlook for ChangeLog file\n"
@@ -654,6 +655,7 @@ int main( int argc, char * argv[] )
HB_BOOL fWrite = HB_FALSE, fChgLog = HB_FALSE;
char * szChangeLogID = NULL, * szLastEntry = NULL;
int iSVNID = 0, iResult = 0, iQuiet = 0, i;
char * szPPRuleFuncName = NULL;
PHB_PP_STATE pState;
pState = hb_pp_new();
@@ -697,6 +699,14 @@ int main( int argc, char * argv[] )
}
break;
case 'e':
case 'E':
if( argv[i][2] )
szPPRuleFuncName = argv[i] + 2;
else
szPPRuleFuncName = NULL;
break;
case 'w':
case 'W':
if( argv[i][2] )
@@ -797,7 +807,7 @@ int main( int argc, char * argv[] )
&iSVNID, &szChangeLogID, &szLastEntry );
if( iResult == 0 )
iResult = hb_pp_preprocesfile( pState, szRuleFile );
iResult = hb_pp_preprocesfile( pState, szRuleFile, szPPRuleFuncName );
if( iResult == 0 && szVerFile )
iResult = hb_pp_generateVerInfo( szVerFile, iSVNID,

View File

@@ -498,7 +498,7 @@ REQUEST HB_REGEX
internal structures referenced from context variable */
STATIC s_cSecToken := NIL
PROCEDURE Main( ... )
PROCEDURE _APPMAIN( ... )
LOCAL aArgsProc
LOCAL nResult
LOCAL tmp, tmp1
@@ -511,10 +511,7 @@ PROCEDURE Main( ... )
LOCAL nTargetPos
LOCAL lHadTarget
LOCAL lOldExact := Set( _SET_EXACT, .F. )
hb_FSetDevMode( hb_gtInfo( HB_GTI_OUTPUTFD ), FD_TEXT )
hb_FSetDevMode( hb_gtInfo( HB_GTI_ERRORFD ), FD_TEXT )
LOCAL lOldExact
/* Expand wildcard project specs */
@@ -529,6 +526,19 @@ PROCEDURE Main( ... )
FOR EACH tmp1 IN FN_Expand( SubStr( tmp, Len( "-target=" ) + 1 ), .F. )
AAdd( aArgsProc, "-target=" + tmp1 )
NEXT
#if 0
CASE Lower( FNameExtGet( tmp ) ) == ".hbs"
hbrun_main( tmp )
QUIT
CASE Lower( tmp ) == "-ui"
#if defined( __PLATFORM__WINCE )
hb_gtSelect( hb_gtCreate( "GTWVT" ) )
#elif defined( __PLATFORM__WINDOWS )
hb_gtSelect( hb_gtCreate( "GTWIN" ) )
#endif
hbrun_main()
QUIT
#endif
OTHERWISE
AAdd( aArgsProc, tmp )
ENDCASE
@@ -575,6 +585,11 @@ PROCEDURE Main( ... )
/* Handle multitarget command lines */
hb_FSetDevMode( hb_gtInfo( HB_GTI_OUTPUTFD ), FD_TEXT )
hb_FSetDevMode( hb_gtInfo( HB_GTI_ERRORFD ), FD_TEXT )
lOldExact := Set( _SET_EXACT, .F. )
nTargetTODO := 1
DO WHILE .T.
@@ -622,6 +637,8 @@ PROCEDURE Main( ... )
++nTargetTODO
ENDDO
Set( _SET_EXACT, lOldExact )
IF nResult != 0 .AND. lPause
OutStd( I_( "Press any key to continue..." ) )
Inkey( 0 )
@@ -629,8 +646,6 @@ PROCEDURE Main( ... )
ErrorLevel( nResult )
Set( _SET_EXACT, lOldExact )
RETURN
#endif
@@ -1695,10 +1710,24 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel )
ENDIF
ENDIF
IF hbmk[ _HBMK_cPLAT ] == "vxworks"
DO CASE
CASE hbmk[ _HBMK_cPLAT ] == "vxworks"
AAdd( hbmk[ _HBMK_aINCPATH ], PathSepToSelf( GetEnv( "WIND_BASE" ) + "/target/usr/h" ) )
AAdd( hbmk[ _HBMK_aINCPATH ], PathSepToSelf( GetEnv( "WIND_BASE" ) + "/target/usr/h/wrn/coreip" ) )
ENDIF
CASE hbmk[ _HBMK_cPLAT ] == "bsd"
IF hb_DirExists( "/usr/local/lib" ) /* For ports */
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/usr/local/lib" )
ENDIF
IF hb_DirExists( "/usr/local/include" )
AAdd( hbmk[ _HBMK_aINCPATH ], "/usr/local/include" )
ENDIF
IF hb_DirExists( "/usr/pkg/lib" ) /* For pkgsrc */
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/usr/pkg/lib" )
ENDIF
IF hb_DirExists( "/usr/pkg/include" )
AAdd( hbmk[ _HBMK_aINCPATH ], "/usr/pkg/include" )
ENDIF
ENDCASE
/* Tweaks to compiler setup */
@@ -3251,7 +3280,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel )
CASE hbmk[ _HBMK_cPLAT ] == "hpux"
AAdd( l_aLIBSYS, "rt" )
CASE hbmk[ _HBMK_cPLAT ] == "beos"
AAdd( hbmk[ _HBMK_aLIBPATH ], "/system/lib" )
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/system/lib" )
AAdd( l_aLIBSYS, "root" )
AAdd( l_aLIBSYS, "network" )
CASE hbmk[ _HBMK_cPLAT ] == "qnx"
@@ -3274,7 +3303,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel )
ENDIF
IF IsGTRequested( hbmk, "gtsln" )
IF hbmk[ _HBMK_cPLAT ] == "bsd" .AND. ;
hb_FileExists( "/usr/pkg/lib/libslang2.so" ) /* For DragonFly BSD */
hb_FileExists( "/usr/pkg/lib/libslang2.so" ) /* For pkgsrc */
AAdd( l_aLIBSYS, "slang2" )
ELSE
AAdd( l_aLIBSYS, "slang" )
@@ -3282,18 +3311,18 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel )
/* Add paths, where this isn't a system component */
DO CASE
CASE hbmk[ _HBMK_cPLAT ] == "darwin"
AAdd( hbmk[ _HBMK_aLIBPATH ], "/sw/lib" )
AAdd( hbmk[ _HBMK_aLIBPATH ], "/opt/local/lib" )
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/sw/lib" ) /* For Fink */
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/opt/local/lib" ) /* For MacPorts (formerly DarwinPorts) */
CASE hbmk[ _HBMK_cPLAT ] == "bsd"
AAdd( hbmk[ _HBMK_aLIBPATH ], "/usr/local/lib" )
AAdd( hbmk[ _HBMK_aLIBPATH ], "/usr/pkg/lib" ) /* For DragonFly BSD */
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/usr/local/lib" ) /* For ports */
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/usr/pkg/lib" ) /* For pkgsrc */
ENDCASE
ENDIF
IF IsGTRequested( hbmk, "gtxwc" )
IF hbmk[ _HBMK_cPLAT ] == "linux" .AND. hb_DirExists( "/usr/X11R6/lib64" )
AAdd( hbmk[ _HBMK_aLIBPATH ], "/usr/X11R6/lib64" )
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/usr/X11R6/lib64" )
ENDIF
AAdd( hbmk[ _HBMK_aLIBPATH ], "/usr/X11R6/lib" )
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/usr/X11R6/lib" )
AAdd( l_aLIBSYS, "X11" )
ENDIF
@@ -4314,9 +4343,9 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel )
ENDIF
IF IsGTRequested( hbmk, "gtxwc" )
IF hbmk[ _HBMK_cPLAT ] == "linux" .AND. hb_DirExists( "/usr/X11R6/lib64" )
AAdd( hbmk[ _HBMK_aLIBPATH ], "/usr/X11R6/lib64" )
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/usr/X11R6/lib64" )
ENDIF
AAdd( hbmk[ _HBMK_aLIBPATH ], "/usr/X11R6/lib" )
AAddNew( hbmk[ _HBMK_aLIBPATH ], "/usr/X11R6/lib" )
AAdd( l_aLIBSYS, "X11" )
ENDIF
@@ -7568,7 +7597,7 @@ STATIC PROCEDURE PlugIn_Load( hbmk, cFileName )
ENDIF
IF ! lOK .AND. !( Lower( cExt ) == ".hrb" ) /* Optimization: Don't try to load it as .prg if the extension is .hrb */
cType := I_( "(source)" )
cFile := hb_compileFromBuf( cFile, "-n2", "-w3", "-es2", "-q0", "-D" + _HBMK_SCRIPT )
cFile := hb_compileFromBuf( cFile, "-n2", "-w3", "-es2", "-q0", "-i" + hbmk[ _HBMK_cHB_INSTALL_INC ], "-D" + _HBMK_SCRIPT )
IF ! Empty( cFile )
hrb := hb_hrbLoad( HB_HRB_BIND_FORCELOCAL, cFile )
ENDIF