From 7080cd9c62f3ea25951159739537be7eeaedd085 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 22 Feb 2009 20:05:16 +0000 Subject: [PATCH] 2009-02-22 21:04 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * bin/hb-func.sh * utils/hbmk2/hbmk2.prg + Previous workaround changed to generic solution, keeping all Harbour lib specific external lib knowledge inside hbmk2. Guy, if you can please retest. * bin/hb-mkdll.bat * Minor in comment. --- harbour/ChangeLog | 11 ++++++++++ harbour/bin/hb-func.sh | 11 +++------- harbour/bin/hb-mkdll.bat | 2 +- harbour/utils/hbmk2/hbmk2.prg | 39 +++++++++++++++++++++++++++++++---- 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 849ef98408..751c8e9f93 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,17 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-22 21:04 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * bin/hb-func.sh + * utils/hbmk2/hbmk2.prg + + Previous workaround changed to generic solution, keeping + all Harbour lib specific external lib knowledge inside + hbmk2. + Guy, if you can please retest. + + * bin/hb-mkdll.bat + * Minor in comment. + 2009-02-22 19:34 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * bin/postinst.sh % Deleted part generating hbfm/hbfmmt libs. Now this is diff --git a/harbour/bin/hb-func.sh b/harbour/bin/hb-func.sh index 47128299a7..44cdbd2687 100755 --- a/harbour/bin/hb-func.sh +++ b/harbour/bin/hb-func.sh @@ -238,18 +238,13 @@ mk_hbtools() echo "libs=gpm">> ${hb_hbmkcfg} fi if [ "${HB_WITHOUT_X11}" != "yes" ]; then - [ -d "/usr/X11R6/lib64" ] && echo "libpaths=/usr/X11R6/lib64">> ${hb_hbmkcfg} - echo "libpaths=/usr/X11R6/lib">> ${hb_hbmkcfg} - echo "libs=X11">> ${hb_hbmkcfg} - echo "inlibshared=gtxvc">> ${hb_hbmkcfg} + echo "libdynhas=gtxwc">> ${hb_hbmkcfg} fi if [ "${HB_WITHOUT_GTCRS}" != "yes" ]; then - echo "libs=${HB_CRS_LIB}">> ${hb_hbmkcfg} - echo "inlibshared=gtcrs">> ${hb_hbmkcfg} + echo "libdynhas=gtcrs">> ${hb_hbmkcfg} fi if [ "${HB_WITHOUT_GTSLN}" != "yes" ]; then - echo "libs=${HB_SLN_LIB}">> ${hb_hbmkcfg} - echo "inlibshared=gtsln">> ${hb_hbmkcfg} + echo "libdynhas=gtsln">> ${hb_hbmkcfg} fi echo "Generating ${hb_tool}... " diff --git a/harbour/bin/hb-mkdll.bat b/harbour/bin/hb-mkdll.bat index b0d5defb7c..32088c5c20 100644 --- a/harbour/bin/hb-mkdll.bat +++ b/harbour/bin/hb-mkdll.bat @@ -62,7 +62,7 @@ cd .. md vmmt cd vmmt set HB_DLL_LIBS=hbvmmt -rem ; Extract VM objects +rem ; Extract VM (MT) objects echo.> ..\_hbovmmt.txt for %%f in (%HB_DLL_LIBS%) do ( echo %%f diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 2aa8701356..83ace1a050 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -181,6 +181,7 @@ FUNCTION Main( ... ) LOCAL s_aLIB3RD LOCAL s_aLIBSYS LOCAL s_aLIBPATH + LOCAL s_aLIBDYNHAS LOCAL s_aOPTPRG LOCAL s_aOPTC LOCAL s_aOPTL @@ -579,6 +580,7 @@ FUNCTION Main( ... ) s_aRESCMP := {} s_aLIBUSER := {} s_aLIBUSERGT := {} + s_aLIBDYNHAS := {} s_aOBJUSER := {} s_aOBJA := {} s_cPROGDIR := NIL @@ -611,6 +613,7 @@ FUNCTION Main( ... ) @s_aLIBUSER,; @s_aLIBUSERGT,; @s_aLIBPATH,; + @s_aLIBDYNHAS,; @s_aOPTPRG,; @s_aOPTC,; @s_aOPTL,; @@ -723,6 +726,7 @@ FUNCTION Main( ... ) @s_aLIBUSER,; @s_aLIBUSERGT,; @s_aLIBPATH,; + @s_aLIBDYNHAS,; @s_aOPTPRG,; @s_aOPTC,; @s_aOPTL,; @@ -976,11 +980,11 @@ FUNCTION Main( ... ) AAdd( s_aLIBSYS, "rt" ) ENDCASE - IF IsGTRequested( s_cGT, s_aLIBUSERGT, "gtcrs" ) + IF IsGTRequested( s_cGT, s_aLIBUSERGT, s_aLIBDYNHAS, s_lSHARED, "gtcrs" ) /* TOFIX: Sometimes 'ncur194' is needed. */ AAdd( s_aLIBSYS, "ncurses" ) ENDIF - IF IsGTRequested( s_cGT, s_aLIBUSERGT, "gtsln" ) + IF IsGTRequested( s_cGT, s_aLIBUSERGT, s_aLIBDYNHAS, s_lSHARED, "gtsln" ) AAdd( s_aLIBSYS, "slang" ) /* Add paths, where this isn't a system component */ DO CASE @@ -991,7 +995,7 @@ FUNCTION Main( ... ) AAdd( s_aLIBPATH, "/usr/local/lib" ) ENDCASE ENDIF - IF IsGTRequested( s_cGT, s_aLIBUSERGT, "gtxwc" ) + IF IsGTRequested( s_cGT, s_aLIBUSERGT, s_aLIBDYNHAS, s_lSHARED, "gtxwc" ) IF hb_DirExists( "/usr/X11R6/lib64" ) AAdd( s_aLIBPATH, "/usr/X11R6/lib64" ) ENDIF @@ -1833,6 +1837,7 @@ STATIC PROCEDURE HBP_ProcessAll( lConfigOnly,; /* @ */ aLIBUSER,; /* @ */ aLIBUSERGT,; /* @ */ aLIBPATH,; + /* @ */ aLIBDYNHAS,; /* @ */ aOPTPRG,; /* @ */ aOPTC,; /* @ */ aOPTL,; @@ -1861,6 +1866,7 @@ STATIC PROCEDURE HBP_ProcessAll( lConfigOnly,; @aLIBUSER,; @aLIBUSERGT,; @aLIBPATH,; + @aLIBDYNHAS,; @aOPTPRG,; @aOPTC,; @aOPTL,; @@ -1889,6 +1895,7 @@ STATIC PROCEDURE HBP_ProcessAll( lConfigOnly,; @aLIBUSER,; @aLIBUSERGT,; @aLIBPATH,; + @aLIBDYNHAS,; @aOPTPRG,; @aOPTC,; @aOPTL,; @@ -1914,6 +1921,7 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; /* @ */ aLIBUSER,; /* @ */ aLIBUSERGT,; /* @ */ aLIBPATH,; + /* @ */ aLIBDYNHAS,; /* @ */ aOPTPRG,; /* @ */ aOPTC,; /* @ */ aOPTL,; @@ -1959,6 +1967,18 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; ENDIF NEXT + /* NOTE: This keyword is used in hbmkcfg.hbp and signals whether + a given optional module (gtsln, gtcrs, gtxwt) is part of the + Harbour shared library, so that we can automatically add + the required libs here. [vszakats] */ + CASE Lower( Left( cLine, Len( "libdynhas=" ) ) ) == "libdynhas=" ; cLine := SubStr( cLine, Len( "libdynhas=" ) + 1 ) + FOR EACH cItem IN hb_ATokens( cLine,, .T. ) + cItem := PathSepToTarget( StrStripQuote( cItem ) ) + IF AScan( aLIBDYNHAS, {|tmp| tmp == cItem } ) == 0 + AAddNotEmpty( aLIBDYNHAS, cItem ) + ENDIF + NEXT + CASE Lower( Left( cLine, Len( "prgflags=" ) ) ) == "prgflags=" ; cLine := SubStr( cLine, Len( "prgflags=" ) + 1 ) FOR EACH cItem IN hb_ATokens( cLine,, .T. ) cItem := PathSepToTarget( StrStripQuote( cItem ) ) @@ -2038,6 +2058,10 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; CASE ValueIsF( cLine ) ; lRUN := .F. ENDCASE + /* NOTE: This keyword is used to signal the default GT used when + building Harbour. It only needs to be filled if this default + GT is different from the Harbour default one, IOW when it + was overridden by user at Harbour build time. [vszakats] */ CASE Lower( Left( cLine, Len( "gtdef=" ) ) ) == "gtdef=" ; cLine := SubStr( cLine, Len( "gtdef=" ) + 1 ) IF ! Empty( cLine ) IF ! SetupForGT( cLine, @t_cGTDEFAULT, @lGUI ) @@ -2076,7 +2100,14 @@ STATIC PROCEDURE HBP_ProcessOne( cFileName,; Can be NIL, when it's the Harbour default. Isn't necessarily on the aGT list in case it is a _non-default_ core GT. */ -STATIC FUNCTION IsGTRequested( cGT, aGT, cWhichGT ) +STATIC FUNCTION IsGTRequested( cGT, aGT, aLIBDYNHAS, lSHARED, cWhichGT ) + + IF lSHARED + /* Checking for included in shared lib GT. */ + IF AScan( aLIBDYNHAS, {|tmp| Lower( tmp ) == cWhichGT } ) > 0 + RETURN .T. + ENDIF + ENDIF /* Checking for the default GT, always requested by core. */ IF cGT == NIL .AND. t_cGTDEFAULT == cWhichGT