From 8bc59ee68829aab77d5c20db59e0e3d2adf8aa81 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 29 May 2010 16:56:59 +0000 Subject: [PATCH] 2010-05-29 18:56 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Shows version of detected packages. --- harbour/ChangeLog | 4 ++++ harbour/utils/hbmk2/hbmk2.prg | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 98045bab7e..37f8465b37 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,10 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-05-29 18:56 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + + Shows version of detected packages. + 2010-05-29 18:00 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Beefed up and fixed -reqpkg feature: diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 0eedbf7904..46b430c33b 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -5776,9 +5776,11 @@ STATIC FUNCTION pkg_try_detection( hbmk, cName ) LOCAL lFound := .F. LOCAL cDefine + LOCAL tmp LOCAL cNameFlavour LOCAL cIncludeDir + LOCAL cVersion FOR EACH cNameFlavour IN hb_ATokens( cName, "|" ) @@ -5787,12 +5789,21 @@ STATIC FUNCTION pkg_try_detection( hbmk, cName ) cNameFlavour := AllTrim( cNameFlavour ) cStdOut := "" - hb_processRun( "pkg-config --libs --cflags " + cNameFlavour,, @cStdOut, @cErrOut ) + hb_processRun( "pkg-config --modversion --libs --cflags " + cNameFlavour,, @cStdOut, @cErrOut ) IF Empty( cStdOut ) - hb_processRun( cNameFlavour + "-config --libs --cflags",, @cStdOut, @cErrOut ) + hb_processRun( cNameFlavour + "-config --version --libs --cflags",, @cStdOut, @cErrOut ) ENDIF IF ! Empty( cStdOut ) + + cStdOut := StrTran( cStdOut, Chr( 13 ) ) + IF ( tmp := At( Chr( 10 ), cStdOut ) ) > 0 + cVersion := Left( cStdOut, tmp - 1 ) + cStdOut := SubStr( cStdOut, tmp + 1 ) + ELSE + cVersion := "" + ENDIF + FOR EACH cItem IN hb_ATokens( cStdOut,, .T. ) IF ! Empty( cItem ) lFound := .T. @@ -5822,7 +5833,7 @@ STATIC FUNCTION pkg_try_detection( hbmk, cName ) ENDIF cDefine := "HBMK2_HAS_" + StrToDefine( cNameFlavour ) IF hbmk[ _HBMK_lInfo ] - hbmk_OutStd( hbmk, hb_StrFormat( I_( "Autodetected package '%1$s' at '%2$s', defining '%3$s'." ), cNameFlavour, cIncludeDir, cDefine ) ) + hbmk_OutStd( hbmk, hb_StrFormat( I_( "Autodetected package '%1$s' (%2$s) at '%3$s', defining '%4$s'." ), cNameFlavour, cVersion, cIncludeDir, cDefine ) ) ENDIF AAdd( hbmk[ _HBMK_aOPTC ], "-D" + cDefine ) EXIT