From 3b6e247f8f1fa45f6a2e75847b706d5e9b078053 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 23 Jul 2010 15:36:22 +0000 Subject: [PATCH] 2010-07-23 17:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * harbour-win-spec * harbour-wce-spec * harbour.spec * HB_CONTRIBLIBS -> HB_BUILD_CONTRIBS * contrib/make.hbs ! Adjusted wording in log output. * utils/hbmk2/hbmk2.prg ! Fixed bad regression caused by extending filters to all options. I reverted it. It has a killer effect without huge benefit. Maybe it will be implemented differently in the future. The user effect of the regression was that libs were created in bin dir. * Cleaned some variable names passed to plugins. * utils/hbmk2/examples/plug_tpl.hbs + Added comment about requirement of reentrancy. --- harbour/ChangeLog | 23 +++++++++- harbour/contrib/make.hbs | 4 +- harbour/harbour-wce-spec | 4 +- harbour/harbour-win-spec | 4 +- harbour/harbour.spec | 2 +- harbour/utils/hbmk2/examples/plug_tpl.hbs | 4 ++ harbour/utils/hbmk2/hbmk2.prg | 56 +++++++++++------------ 7 files changed, 60 insertions(+), 37 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b15e1b89d4..0890b6ce4f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,27 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-23 17:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * harbour-win-spec + * harbour-wce-spec + * harbour.spec + * HB_CONTRIBLIBS -> HB_BUILD_CONTRIBS + + * contrib/make.hbs + ! Adjusted wording in log output. + + * utils/hbmk2/hbmk2.prg + ! Fixed bad regression caused by extending filters to + all options. I reverted it. It has a killer effect + without huge benefit. Maybe it will be implemented + differently in the future. + The user effect of the regression was that libs were + created in bin dir. + * Cleaned some variable names passed to plugins. + + * utils/hbmk2/examples/plug_tpl.hbs + + Added comment about requirement of reentrancy. + 2010-07-23 14:02 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/make.hbs + Accept package simply as 'hbmylib'. In such case it will @@ -44,7 +65,7 @@ is the last one in the list (order of execution). + Filters can now be used also for file inclusion and -skip options (which means they can now be used for all possible - cmdline and .hbm/.hbp options) + cmdline and .hbm/.hbp options) [REVERTED IN: 2010-07-23 17:34 UTC+0200] ! Fixed the way automatic cmdline options based on hbmk2's own filename are created. From now -hbcmp, -hblnk, -hbcc, -rtlink, -xhb, -hb10 will be added to the left side diff --git a/harbour/contrib/make.hbs b/harbour/contrib/make.hbs index 6e5786e47c..96dd418fd2 100755 --- a/harbour/contrib/make.hbs +++ b/harbour/contrib/make.hbs @@ -367,7 +367,7 @@ PROCEDURE GNUMake( ... ) /* Start building */ - OutStd( hb_StrFormat( "! Package %1$s...", hActions[ nAction ] ) + hb_eol() ) + OutStd( hb_StrFormat( "! Started package %1$s...", hActions[ nAction ] ) + hb_eol() ) FOR EACH cPackage IN aSortedList DESCEND @@ -399,7 +399,7 @@ PROCEDURE GNUMake( ... ) NEXT OutStd( hb_eol() ) - OutStd( "! Building of packages finished." + hb_eol() ) + OutStd( hb_StrFormat( "! Finished package %1$s...", hActions[ nAction ] ) + hb_eol() ) ErrorLevel( 0 ) diff --git a/harbour/harbour-wce-spec b/harbour/harbour-wce-spec index d5415b5f49..67112769cd 100644 --- a/harbour/harbour-wce-spec +++ b/harbour/harbour-wce-spec @@ -76,12 +76,12 @@ rm -fR $RPM_BUILD_ROOT %build #export HB_BUILD_PARTS=compiler -export HB_CONTRIBLIBS=no +export HB_BUILD_CONTRIBS=no export HB_PLATFORM=linux export HB_COMPILER=gcc make %{?_smp_mflags} unset HB_COMPILER -unset HB_CONTRIBLIBS +unset HB_BUILD_CONTRIBS export HB_BUILD_PARTS=lib export HB_PLATFORM=wce diff --git a/harbour/harbour-win-spec b/harbour/harbour-win-spec index e1a45df233..29d7e96339 100644 --- a/harbour/harbour-win-spec +++ b/harbour/harbour-win-spec @@ -76,12 +76,12 @@ rm -fR $RPM_BUILD_ROOT %build #export HB_BUILD_PARTS=compiler -export HB_CONTRIBLIBS=no +export HB_BUILD_CONTRIBS=no export HB_PLATFORM=linux export HB_COMPILER=gcc make %{?_smp_mflags} unset HB_COMPILER -unset HB_CONTRIBLIBS +unset HB_BUILD_CONTRIBS export HB_BUILD_PARTS=lib export HB_PLATFORM=win diff --git a/harbour/harbour.spec b/harbour/harbour.spec index cce95115cb..c0029dccbe 100644 --- a/harbour/harbour.spec +++ b/harbour/harbour.spec @@ -69,7 +69,7 @@ %define hb_ldir export HB_LIB_INSTALL=%{_libdir}/%{name} %define hb_edir export HB_ETC_INSTALL=%{hb_etcdir} %define hb_cmrc export HB_BUILD_NOGPLLIB=%{?_without_gpllib:yes} -%define hb_ctrb export HB_CONTRIBLIBS="hbblink hbclipsm hbct hbgt hbmisc hbmzip hbnetio hbtip hbtpathy hbhpdf hbziparc hbfoxpro hbsms hbfship hbxpp xhb rddbmcdx rddsql sddsqlt3 hbnf %{?_with_allegro:gtalleg} %{?_with_cairo:hbcairo} %{?_with_cups:hbcups} %{?_with_curl:hbcurl} %{?_with_firebird:hbfbird sddfb} %{?_with_freeimage:hbfimage} %{?_with_gd:hbgd} %{?_with_mysql:hbmysql sddmy} %{?_with_odbc:hbodbc sddodbc} %{?_with_pgsql:hbpgsql sddpg} %{?_with_qt:hbqt hbxbp} %{?_with_ads:rddads}" +%define hb_ctrb export HB_BUILD_CONTRIBS="hbblink hbclipsm hbct hbgt hbmisc hbmzip hbnetio hbtip hbtpathy hbhpdf hbziparc hbfoxpro hbsms hbfship hbxpp xhb rddbmcdx rddsql sddsqlt3 hbnf %{?_with_allegro:gtalleg} %{?_with_cairo:hbcairo} %{?_with_cups:hbcups} %{?_with_curl:hbcurl} %{?_with_firebird:hbfbird sddfb} %{?_with_freeimage:hbfimage} %{?_with_gd:hbgd} %{?_with_mysql:hbmysql sddmy} %{?_with_odbc:hbodbc sddodbc} %{?_with_pgsql:hbpgsql sddpg} %{?_with_qt:hbqt hbxbp} %{?_with_ads:rddads}" %define hb_env %{hb_plat} ; %{hb_cc} ; %{hb_cflag} ; %{hb_lflag} ; %{hb_dflag} ; %{shl_path} ; %{hb_gpm} ; %{hb_crs} ; %{hb_sln} ; %{hb_x11} ; %{hb_local} ; %{hb_bdir} ; %{hb_idir} ; %{hb_ldir} ; %{hb_edir} ; %{hb_ctrb} ; %{hb_cmrc} %define hb_host harbour-project.org %define readme README.RPM diff --git a/harbour/utils/hbmk2/examples/plug_tpl.hbs b/harbour/utils/hbmk2/examples/plug_tpl.hbs index 166d105f2e..99c0e50068 100644 --- a/harbour/utils/hbmk2/examples/plug_tpl.hbs +++ b/harbour/utils/hbmk2/examples/plug_tpl.hbs @@ -25,6 +25,10 @@ * */ +/* NOTE: Code must be written in reentrant way. IOW do not use + PUBLIC, PRIVATE and STATIC variables. Also do not use + temporary disk files with non-random names. [vszakats] */ + #pragma warninglevel=3 FUNCTION hbmk2_plugin_tpl( hbmk2 ) diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index b417eb1c68..6c475efe61 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -1776,37 +1776,34 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) /* Collect all command line parameters */ FOR EACH cParam IN aArgs - cParam := ArchCompFilter( hbmk, cParam ) - IF ! Empty( cParam ) - DO CASE - CASE !( Left( cParam, 1 ) == "-" ) .AND. Len( cParam ) >= 1 .AND. Left( cParam, 1 ) == "@" .AND. ; - !( Lower( FNameExtGet( cParam ) ) == ".clp" ) - cParam := SubStr( cParam, 2 ) - IF Empty( FNameExtGet( cParam ) ) - cParam := FNameExtSet( cParam, ".hbm" ) + DO CASE + CASE !( Left( cParam, 1 ) == "-" ) .AND. Len( cParam ) >= 1 .AND. Left( cParam, 1 ) == "@" .AND. ; + !( Lower( FNameExtGet( cParam ) ) == ".clp" ) + cParam := SubStr( cParam, 2 ) + IF Empty( FNameExtGet( cParam ) ) + cParam := FNameExtSet( cParam, ".hbm" ) + ENDIF + IF !( Lower( FNameExtGet( cParam ) ) == ".hbm" ) .AND. lAcceptLDClipper + rtlnk_process( hbmk, MemoRead( PathSepToSelf( cParam ) ), @hbmk[ _HBMK_cPROGNAME ], @hbmk[ _HBMK_aOBJUSER ], @hbmk[ _HBMK_aLIBUSER ] ) + IF ! Empty( hbmk[ _HBMK_aOBJUSER ] ) + DEFAULT hbmk[ _HBMK_cFIRST ] TO hbmk[ _HBMK_aOBJUSER ][ 1 ] ENDIF - IF !( Lower( FNameExtGet( cParam ) ) == ".hbm" ) .AND. lAcceptLDClipper - rtlnk_process( hbmk, MemoRead( PathSepToSelf( cParam ) ), @hbmk[ _HBMK_cPROGNAME ], @hbmk[ _HBMK_aOBJUSER ], @hbmk[ _HBMK_aLIBUSER ] ) - IF ! Empty( hbmk[ _HBMK_aOBJUSER ] ) - DEFAULT hbmk[ _HBMK_cFIRST ] TO hbmk[ _HBMK_aOBJUSER ][ 1 ] - ENDIF - ELSE - tmp := HBM_Load( hbmk, aParams, PathSepToSelf( cParam ), 1, .T. ) /* Load parameters from script file */ - IF tmp != 0 - RETURN tmp - ENDIF - ENDIF - CASE !( Left( cParam, 1 ) == "-" ) .AND. ; - ( Lower( FNameExtGet( cParam ) ) == ".hbm" .OR. ; - Lower( FNameExtGet( cParam ) ) == ".hbp" ) + ELSE tmp := HBM_Load( hbmk, aParams, PathSepToSelf( cParam ), 1, .T. ) /* Load parameters from script file */ IF tmp != 0 RETURN tmp ENDIF - OTHERWISE - AAdd( aParams, { cParam, "", 0 } ) - ENDCASE - ENDIF + ENDIF + CASE !( Left( cParam, 1 ) == "-" ) .AND. ; + ( Lower( FNameExtGet( cParam ) ) == ".hbm" .OR. ; + Lower( FNameExtGet( cParam ) ) == ".hbp" ) + tmp := HBM_Load( hbmk, aParams, PathSepToSelf( cParam ), 1, .T. ) /* Load parameters from script file */ + IF tmp != 0 + RETURN tmp + ENDIF + OTHERWISE + AAdd( aParams, { cParam, "", 0 } ) + ENDCASE NEXT /* Process automatic control files. */ @@ -1815,7 +1812,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) /* Process command line (2nd pass) */ FOR EACH aParam IN aParams - cParam := aParam[ _PAR_cParam ] + cParam := ArchCompFilter( hbmk, aParam[ _PAR_cParam ] ) cParamL := Lower( cParam ) DO CASE @@ -7303,7 +7300,8 @@ STATIC FUNCTION PlugIn_make_ctx( hbmk, cState ) "cCOMP" => hbmk[ _HBMK_cCOMP ] ,; "cCPU" => hbmk[ _HBMK_cCPU ] ,; "cBUILD" => hbmk[ _HBMK_cBUILD ] ,; - "cTARGETNAME" => hbmk[ _HBMK_cPROGNAME ] ,; + "cOUTPUTNAME" => hbmk[ _HBMK_cPROGNAME ] ,; + "cTARGETNAME" => hbmk_TARGETNAME( hbmk ) ,; "cTARGETTYPE" => hbmk_TARGETTYPE( hbmk ) ,; "lREBUILD" => hbmk[ _HBMK_lREBUILD ] ,; "lCLEAN" => hbmk[ _HBMK_lCLEAN ] ,; @@ -8765,7 +8763,7 @@ STATIC FUNCTION HBM_Load( hbmk, aParams, cFileName, nNestingLevel, lProcHBP ) FOR EACH cLine IN hb_ATokens( cFile, _CHR_EOL ) IF !( Left( cLine, 1 ) == "#" ) FOR EACH cParam IN hb_ATokens( cLine,, .T. ) - cParam := ArchCompFilter( hbmk, StrStripQuote( cParam ) ) + cParam := StrStripQuote( cParam ) IF ! Empty( cParam ) DO CASE CASE Lower( cParam ) == "-skip"