From 9d353c511a9b582a002b72e25ef65cb284ccab6e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 15 Jun 2009 13:43:32 +0000 Subject: [PATCH] 2009-06-15 15:41 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Added skip=yes|no option support to .hbc files. skip=yes will cause the rest of the .hbc file to be skipped from processing. + Now .hbc files are recognized even in libs= lines. + Showing error message when a referred .hbc cannot be found. * utils/hbmk2/examples/contribf.hbc * Updates/fixes. * contrib/xhb/xhb.hbc * contrib/hbtpathy/hbtpathy.hbc * contrib/hbblat/hbblat.hbc * contrib/hbziparc/hbziparc.hbc * contrib/hbxbp/hbxbp.hbc * contrib/rddsql/sddmy/sddmy.hbc + contrib/rddsql/sddpg/sddpg.hbc + contrib/rddsql/sddfb/sddfb.hbc * contrib/rddsql/sddodbc/sddodbc.hbc * contrib/rddado/rddado.hbc * contrib/gtwvg/gtwvg.hbc * contrib/rddads/rddads.hbc * contrib/hbfimage/hbfimage.hbc * contrib/hbtip/hbtip.hbc * contrib/hbwin/hbwin.hbc * contrib/hbssl/hbssl.hbc + Added some missing .hbc files. * Tweaked to use .hbc references. * Tweaked filters. .hbc files will now filter themselves out, if they are references in unsupported environment, like hbwin under linux. --- harbour/ChangeLog | 33 +++++++++++++++ harbour/contrib/gtwvg/gtwvg.hbc | 6 ++- harbour/contrib/hbblat/hbblat.hbc | 2 + harbour/contrib/hbfimage/hbfimage.hbc | 2 + harbour/contrib/hbssl/hbssl.hbc | 2 + harbour/contrib/hbtip/hbtip.hbc | 2 + harbour/contrib/hbtpathy/hbtpathy.hbc | 2 + harbour/contrib/hbwin/hbwin.hbc | 4 +- harbour/contrib/hbxbp/hbxbp.hbc | 2 +- harbour/contrib/hbziparc/hbziparc.hbc | 2 +- harbour/contrib/rddado/rddado.hbc | 6 ++- harbour/contrib/rddads/rddads.hbc | 2 + harbour/contrib/rddsql/sddfb/sddfb.hbc | 8 ++++ harbour/contrib/rddsql/sddmy/sddmy.hbc | 2 +- harbour/contrib/rddsql/sddodbc/sddodbc.hbc | 2 +- harbour/contrib/rddsql/sddpg/sddpg.hbc | 8 ++++ harbour/contrib/xhb/xhb.hbc | 5 ++- harbour/utils/hbmk2/examples/contribf.hbc | 9 ++-- harbour/utils/hbmk2/hbmk2.prg | 49 +++++++++++++++++++--- 19 files changed, 126 insertions(+), 22 deletions(-) create mode 100644 harbour/contrib/rddsql/sddfb/sddfb.hbc create mode 100644 harbour/contrib/rddsql/sddpg/sddpg.hbc diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a47b14561e..db979873c6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,39 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-15 15:41 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + + Added skip=yes|no option support to .hbc files. + skip=yes will cause the rest of the .hbc file to be skipped + from processing. + + Now .hbc files are recognized even in libs= lines. + + Showing error message when a referred .hbc cannot be found. + + * utils/hbmk2/examples/contribf.hbc + * Updates/fixes. + + * contrib/xhb/xhb.hbc + * contrib/hbtpathy/hbtpathy.hbc + * contrib/hbblat/hbblat.hbc + * contrib/hbziparc/hbziparc.hbc + * contrib/hbxbp/hbxbp.hbc + * contrib/rddsql/sddmy/sddmy.hbc + + contrib/rddsql/sddpg/sddpg.hbc + + contrib/rddsql/sddfb/sddfb.hbc + * contrib/rddsql/sddodbc/sddodbc.hbc + * contrib/rddado/rddado.hbc + * contrib/gtwvg/gtwvg.hbc + * contrib/rddads/rddads.hbc + * contrib/hbfimage/hbfimage.hbc + * contrib/hbtip/hbtip.hbc + * contrib/hbwin/hbwin.hbc + * contrib/hbssl/hbssl.hbc + + Added some missing .hbc files. + * Tweaked to use .hbc references. + * Tweaked filters. .hbc files will now filter themselves out, + if they are references in unsupported environment, like hbwin + under linux. + 2009-06-15 15:19 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/mainstd.c * forced '\' in argv[0] instead of '/' in DJGPP builds diff --git a/harbour/contrib/gtwvg/gtwvg.hbc b/harbour/contrib/gtwvg/gtwvg.hbc index 5461ad3856..73126c20bc 100644 --- a/harbour/contrib/gtwvg/gtwvg.hbc +++ b/harbour/contrib/gtwvg/gtwvg.hbc @@ -2,7 +2,9 @@ # $Id$ # -{win}gt=gtwvg -{win}libs=hbwin +{!win}skip=yes + +gt=gtwvg +libs=..\hbwin\hbwin.hbc gui=yes mt=yes diff --git a/harbour/contrib/hbblat/hbblat.hbc b/harbour/contrib/hbblat/hbblat.hbc index 5be2a0014b..c20bde0e37 100644 --- a/harbour/contrib/hbblat/hbblat.hbc +++ b/harbour/contrib/hbblat/hbblat.hbc @@ -2,6 +2,8 @@ # $Id$ # +{!win}skip=yes + incpaths=. libs=hbblat diff --git a/harbour/contrib/hbfimage/hbfimage.hbc b/harbour/contrib/hbfimage/hbfimage.hbc index 494020795d..53c82aeaf9 100644 --- a/harbour/contrib/hbfimage/hbfimage.hbc +++ b/harbour/contrib/hbfimage/hbfimage.hbc @@ -2,6 +2,8 @@ # $Id$ # +{dos}skip=yes + incpaths=. libs=hbfimage diff --git a/harbour/contrib/hbssl/hbssl.hbc b/harbour/contrib/hbssl/hbssl.hbc index 37ff2d41f4..a44c411b45 100644 --- a/harbour/contrib/hbssl/hbssl.hbc +++ b/harbour/contrib/hbssl/hbssl.hbc @@ -2,6 +2,8 @@ # $Id$ # +{dos}skip=yes + incpaths=. libs=hbssl diff --git a/harbour/contrib/hbtip/hbtip.hbc b/harbour/contrib/hbtip/hbtip.hbc index b87892e6a7..8baf7e5792 100644 --- a/harbour/contrib/hbtip/hbtip.hbc +++ b/harbour/contrib/hbtip/hbtip.hbc @@ -2,6 +2,8 @@ # $Id$ # +{dos}skip=yes + incpaths=. libs=hbtip diff --git a/harbour/contrib/hbtpathy/hbtpathy.hbc b/harbour/contrib/hbtpathy/hbtpathy.hbc index b7ad00a482..14e3d6940d 100644 --- a/harbour/contrib/hbtpathy/hbtpathy.hbc +++ b/harbour/contrib/hbtpathy/hbtpathy.hbc @@ -2,6 +2,8 @@ # $Id$ # +{!(linux|win|os2)}skip=yes + incpaths=. libs=hbtpathy diff --git a/harbour/contrib/hbwin/hbwin.hbc b/harbour/contrib/hbwin/hbwin.hbc index 4138709e13..6723b95219 100644 --- a/harbour/contrib/hbwin/hbwin.hbc +++ b/harbour/contrib/hbwin/hbwin.hbc @@ -2,6 +2,8 @@ # $Id$ # +{!allwin}skip=yes + incpaths=. -{win}libs=hbwin +libs=hbwin diff --git a/harbour/contrib/hbxbp/hbxbp.hbc b/harbour/contrib/hbxbp/hbxbp.hbc index 97abd9b099..3ead70361f 100644 --- a/harbour/contrib/hbxbp/hbxbp.hbc +++ b/harbour/contrib/hbxbp/hbxbp.hbc @@ -5,4 +5,4 @@ incpaths=. libs=hbxbp -hbcs=../hbqt/hbqt.hbc +libs=../hbqt/hbqt.hbc diff --git a/harbour/contrib/hbziparc/hbziparc.hbc b/harbour/contrib/hbziparc/hbziparc.hbc index cad9ec8c26..2c7f2af65b 100644 --- a/harbour/contrib/hbziparc/hbziparc.hbc +++ b/harbour/contrib/hbziparc/hbziparc.hbc @@ -3,4 +3,4 @@ # libs=hbziparc -hbcs=../hbmzip/hbmzip.hbc +libs=../hbmzip/hbmzip.hbc diff --git a/harbour/contrib/rddado/rddado.hbc b/harbour/contrib/rddado/rddado.hbc index dcbb11c82b..12c5211447 100644 --- a/harbour/contrib/rddado/rddado.hbc +++ b/harbour/contrib/rddado/rddado.hbc @@ -2,7 +2,9 @@ # $Id$ # +{!allwin}skip=yes + incpaths=. -{win}libs=rddado -{win}libs=hbwin +libs=rddado +libs=..\hbwin\hbwin.hbc diff --git a/harbour/contrib/rddads/rddads.hbc b/harbour/contrib/rddads/rddads.hbc index ae936e01d5..05818015ce 100644 --- a/harbour/contrib/rddads/rddads.hbc +++ b/harbour/contrib/rddads/rddads.hbc @@ -2,6 +2,8 @@ # $Id$ # +{!(linux|win)}skip=yes + incpaths=. libs=rddads diff --git a/harbour/contrib/rddsql/sddfb/sddfb.hbc b/harbour/contrib/rddsql/sddfb/sddfb.hbc new file mode 100644 index 0000000000..2c6d1cb440 --- /dev/null +++ b/harbour/contrib/rddsql/sddfb/sddfb.hbc @@ -0,0 +1,8 @@ +# +# $Id$ +# + +libs=sddfb +libs=fbclient + +libs=../rddsql.hbc diff --git a/harbour/contrib/rddsql/sddmy/sddmy.hbc b/harbour/contrib/rddsql/sddmy/sddmy.hbc index 7703c96325..e5d89fac0c 100644 --- a/harbour/contrib/rddsql/sddmy/sddmy.hbc +++ b/harbour/contrib/rddsql/sddmy/sddmy.hbc @@ -5,4 +5,4 @@ libs=sddmy libs=libmysql -hbcs=../rddsql.hbc +libs=../rddsql.hbc diff --git a/harbour/contrib/rddsql/sddodbc/sddodbc.hbc b/harbour/contrib/rddsql/sddodbc/sddodbc.hbc index 7e0b37a612..2e870ba399 100644 --- a/harbour/contrib/rddsql/sddodbc/sddodbc.hbc +++ b/harbour/contrib/rddsql/sddodbc/sddodbc.hbc @@ -5,4 +5,4 @@ libs=sddodbc {win}libs=odbc32 -hbcs=../rddsql.hbc +libs=../rddsql.hbc diff --git a/harbour/contrib/rddsql/sddpg/sddpg.hbc b/harbour/contrib/rddsql/sddpg/sddpg.hbc new file mode 100644 index 0000000000..91fc052fdd --- /dev/null +++ b/harbour/contrib/rddsql/sddpg/sddpg.hbc @@ -0,0 +1,8 @@ +# +# $Id$ +# + +libs=sddpg +libs=libpq + +libs=../rddsql.hbc diff --git a/harbour/contrib/xhb/xhb.hbc b/harbour/contrib/xhb/xhb.hbc index c7451e520e..ab755e96ae 100644 --- a/harbour/contrib/xhb/xhb.hbc +++ b/harbour/contrib/xhb/xhb.hbc @@ -8,5 +8,6 @@ libs=xhb # xhb has these as part of core, so we're adding them to emulate it. # They are not needed to use xhb lib itself. -libs=hbct hbtip -{allwin}libs=hbwin +libs=../hbct/hbct.hbc +libs=../hbtip/hbtip.hbc +libs=../hbwin/hbwin.hbc diff --git a/harbour/utils/hbmk2/examples/contribf.hbc b/harbour/utils/hbmk2/examples/contribf.hbc index 1758e3edb2..039b8ca669 100644 --- a/harbour/utils/hbmk2/examples/contribf.hbc +++ b/harbour/utils/hbmk2/examples/contribf.hbc @@ -9,15 +9,14 @@ libs=hbbmcdx hbbtree hbclipsm hbcrypt hbct hbgt hbmisc hbmzip hbnf hbvpdf hbziparc rddsql xhb # contribs portable, with external dependencies: -libs=hbcurl hbfbird hbgd hbhpdf hbmsql hbmysql hbpgsql hbqt sddfb sddmy sddpg +libs=hbcurl hbfbird hbgd hbhpdf hbmysql hbpgsql hbqt sddfb sddmy sddpg # contribs with limited availability (some with external dependencies): {!pocc&!xcc&!dmc&!watcom}libs=gtalleg -{!dos}libs=hbapollo hbfimage hbssl hbtip rddads +{!dos}libs=hbfimage hbssl hbtip +{linux|win}libs=rddads {linux|win|os2}libs=hbtpathy -{win}libs=gtwvg hbblat hbgfwin hbwin rddado +{win}libs=gtwvg hbblat hbwin rddado {win&!dmc}libs=hbwhat -{linux}libs=hbgfgtk -{os2}libs=hbgfos2 {!rsxnt}libs=hbodbc {!bsd&!hpux&!pocc}libs=hbsqlit3 diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 18e1d36bbc..138885cc25 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -4742,12 +4742,17 @@ STATIC PROCEDURE HBC_ProcessAll( hbmk, lConfigOnly ) #define _EOL Chr( 10 ) -STATIC PROCEDURE HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) +STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) LOCAL cFile LOCAL cLine LOCAL cItem LOCAL tmp + IF ! hb_FileExists( cFileName ) + hbmk_OutErr( hbmk, hb_StrFormat( I_( "Error: Opening: %1$s" ), cFileName ) ) + RETURN .F. + ENDIF + cFile := MemoRead( cFileName ) /* NOTE: Intentionally using MemoRead() which handles EOF char. */ IF ! hb_osNewLine() == _EOL @@ -4762,6 +4767,15 @@ STATIC PROCEDURE HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) cLine := AllTrim( ArchCompFilter( hbmk, AllTrim( cLine ) ) ) DO CASE + CASE Lower( Left( cLine, Len( "skip=" ) ) ) == "skip=" ; cLine := SubStr( cLine, Len( "skip=" ) + 1 ) + cLine := MacroProc( hbmk, cLine, FN_DirGet( cFileName ) ) + IF ValueIsT( cLine ) + IF hbmk[ _HBMK_lInfo ] + hbmk_OutStd( hbmk, hb_StrFormat( I_( "Skipping from: %1$s" ), cFileName ) ) + ENDIF + EXIT + ENDIF + CASE Lower( Left( cLine, Len( "pos=" ) ) ) == "pos=" ; cLine := SubStr( cLine, Len( "pos=" ) + 1 ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) cItem := PathSepToTarget( hbmk, PathProc( StrStripQuote( cItem ), FN_DirGet( cFileName ) ) ) @@ -4772,9 +4786,32 @@ STATIC PROCEDURE HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) CASE Lower( Left( cLine, Len( "libs=" ) ) ) == "libs=" ; cLine := SubStr( cLine, Len( "libs=" ) + 1 ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) - cItem := PathSepToTarget( hbmk, MacroProc( hbmk, StrStripQuote( cItem ), FN_DirGet( cFileName ) ) ) - IF AScan( hbmk[ _HBMK_aLIBUSER ], {|tmp| tmp == cItem } ) == 0 - AAddNotEmpty( hbmk[ _HBMK_aLIBUSER ], cItem ) + cItem := MacroProc( hbmk, StrStripQuote( cItem ), FN_DirGet( cFileName ) ) + IF FN_ExtGet( cItem ) == ".hbc" + cItem := PathProc( cItem, FN_DirGet( cFileName ) ) + IF nNestingLevel < _HBMK_NEST_MAX + IF ! hb_FileExists( cItem ) + FOR EACH tmp IN hbmk[ _HBMK_aLIBPATH ] + IF hb_FileExists( DirAddPathSep( tmp ) + FN_NameExtGet( cItem ) ) + cItem := DirAddPathSep( tmp ) + FN_NameExtGet( cItem ) + EXIT + ENDIF + NEXT + ENDIF + + IF hbmk[ _HBMK_lInfo ] + hbmk_OutStd( hbmk, hb_StrFormat( I_( "Processing: %1$s" ), cItem ) ) + ENDIF + + HBC_ProcessOne( hbmk, cItem, nNestingLevel + 1 ) + ELSE + hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Cannot nest deeper in %1$s" ), cFileName ) ) + ENDIF + ELSE + cItem := PathSepToTarget( hbmk, cItem ) + IF AScan( hbmk[ _HBMK_aLIBUSER ], {|tmp| tmp == cItem } ) == 0 + AAddNotEmpty( hbmk[ _HBMK_aLIBUSER ], cItem ) + ENDIF ENDIF NEXT @@ -5022,7 +5059,7 @@ STATIC PROCEDURE HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) ENDCASE NEXT - RETURN + RETURN .T. STATIC FUNCTION IsGTRequested( hbmk, cWhichGT ) @@ -6249,7 +6286,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong ) hb_StrFormat( I_( "%1$s option file in hbmk directory is always processed if it exists. On *nix platforms ~/.harbour, /etc/harbour, /etc/harbour, /etc are checked (in that order) before the hbmk directory. The file format is the same as .hbc." ), _HBMK_CFG_NAME ),; hb_StrFormat( I_( "%1$s make script in current directory is always processed if it exists." ), _HBMK_AUTOHBM_NAME ),; I_( ".hbc config files in current dir are automatically processed." ),; - I_( ".hbc options (they should come in separate lines): libs=[], hbcs=[<.hbc file[s]>], gt=[gtname], prgflags=[Harbour flags], cflags=[C compiler flags], resflags=[resource compiler flags], ldflags=[linker flags], libpaths=[paths], pos=[.po files], incpaths=[paths], inctrypaths=[paths], instpaths=[paths], gui|mt|shared|nulrdd|debug|opt|map|strip|run|inc=[yes|no], compr=[yes|no|def|min|max], head=[off|partial|full], echo=\nLines starting with '#' char are ignored" ),; + I_( ".hbc options (they should come in separate lines): libs=[], hbcs=[<.hbc file[s]>], gt=[gtname], prgflags=[Harbour flags], cflags=[C compiler flags], resflags=[resource compiler flags], ldflags=[linker flags], libpaths=[paths], pos=[.po files], incpaths=[paths], inctrypaths=[paths], instpaths=[paths], gui|mt|shared|nulrdd|debug|opt|map|strip|run|inc=[yes|no], compr=[yes|no|def|min|max], head=[off|partial|full], skip=[yes|no], echo=\nLines starting with '#' char are ignored" ),; I_( "Platform filters are accepted in each .hbc line and with several options.\nFilter format: {[!][||]}. Filters can be combined using '&', '|' operators and grouped by parantheses. Ex.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!watcom}, {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}, -stop{!allwin}, {allpocc|allgcc|allmingw|unix}, {allmsvc}, {x86|x86_64|ia64|arm}, {debug|nodebug|gui|std|mt|st|xhb}" ),; I_( "Certain .hbc lines (libs=, hbcs=, prgflags=, cflags=, ldflags=, libpaths=, inctrypaths=, instpaths=, echo=) and corresponding command line parameters will accept macros: ${hb_root}, ${hb_self}, ${hb_arch}, ${hb_comp}, ${hb_cpu}, ${hb_bin}, ${hb_lib}, ${hb_dyn}, ${hb_inc}, ${}" ),; I_( "Defaults and feature support vary by architecture/compiler." ) }