2015-09-24 14:28 UTC+0200 Tamas TEVESZ (ice extreme.hu)

* utils/hbmk2/hbmk2.prg
    + Partially merge 8f16b6731 from vszakats/harbour-core:
      "refined the way pkg-config queries the package version. Now
       it does it in a separate call to make some pkg-config versions
       happy where version query option cannot be mixed with --cflags
       and similar options (f.e. pkg-config 0.28 in current homebrew)."
This commit is contained in:
Tamas TEVESZ
2015-09-24 14:56:59 +02:00
parent 2ca29eafd1
commit f3f218f2d4
2 changed files with 32 additions and 22 deletions

View File

@@ -10,6 +10,14 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2015-09-24 14:28 UTC+0200 Tamas TEVESZ (ice extreme.hu)
* utils/hbmk2/hbmk2.prg
+ Partially merge 8f16b6731 from vszakats/harbour-core:
"refined the way pkg-config queries the package version. Now
it does it in a separate call to make some pkg-config versions
happy where version query option cannot be mixed with --cflags
and similar options (f.e. pkg-config 0.28 in current homebrew)."
2015-09-18 13:15 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/common/hbffind.c
+ added support for link attribute (HB_FA_LINK -> "L") passed to

View File

@@ -9087,50 +9087,52 @@ STATIC FUNCTION dep_try_pkg_detection( hbmk, dep )
IF ! dep[ _HBMKDEP_lFound ]
cName := AllTrim( cName )
cStdOut := ""
hb_processRun( "pkg-config --modversion --libs --cflags " + cName,, @cStdOut, @cStdErr )
hb_processRun( "pkg-config --libs --cflags " + cName,, @cStdOut, @cStdErr )
hb_processRun( "pkg-config --modversion " + cName,, @cVersion, @cStdErr )
IF Empty( cStdOut )
hb_processRun( cName + "-config --version --libs --cflags",, @cStdOut, @cStdErr )
hb_processRun( cName + "-config --libs --cflags",, @cStdOut, @cStdErr )
hb_processRun( cName + "-config --version",, @cVersion, @cStdErr )
ENDIF
#if defined( __PLATFORM__DARWIN )
/* Homebrew */
IF Empty( cStdOut )
IF hb_FileExists( "/usr/local/bin/pkg-config" )
hb_processRun( "/usr/local/bin/pkg-config --modversion --libs --cflags " + cName,, @cStdOut, @cStdErr )
IF hb_vfExists( tmp := "/usr/local/bin/pkg-config" )
hb_processRun( tmp + " --libs --cflags " + cName,, @cStdOut, @cStdErr )
hb_processRun( tmp + " --modversion " + cName,, @cVersion, @cStdErr )
ENDIF
ENDIF
IF Empty( cStdOut )
IF hb_FileExists( "/usr/local/bin/" + cName + "-config" )
hb_processRun( "/usr/local/bin/" + cName + "-config --version --libs --cflags",, @cStdOut, @cStdErr )
IF hb_vfExists( tmp := "/usr/local/bin/" + cName + "-config" )
hb_processRun( tmp + " --libs --cflags",, @cStdOut, @cStdErr )
hb_processRun( tmp + " --version",, @cVersion, @cStdErr )
ENDIF
ENDIF
/* MacPorts/DarwinPorts */
IF Empty( cStdOut )
IF hb_FileExists( "/opt/local/bin/pkg-config" )
hb_processRun( "/opt/local/bin/pkg-config --modversion --libs --cflags " + cName,, @cStdOut, @cStdErr )
IF hb_vfExists( tmp := "/opt/local/bin/pkg-config" )
hb_processRun( tmp + " --libs --cflags " + cName,, @cStdOut, @cStdErr )
hb_processRun( tmp + " --modversion " + cName,, @cVersion, @cStdErr )
ENDIF
ENDIF
IF Empty( cStdOut )
IF hb_FileExists( "/opt/local/bin/" + cName + "-config" )
hb_processRun( "/opt/local/bin/" + cName + "-config --version --libs --cflags",, @cStdOut, @cStdErr )
IF hb_vfExists( tmp := "/opt/local/bin/" + cName + "-config" )
hb_processRun( tmp + " --libs --cflags",, @cStdOut, @cStdErr )
hb_processRun( tmp + " --version",, @cVersion, @cStdErr )
ENDIF
ENDIF
#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 := "unknown version"
cVersion := hb_StrReplace( cVersion, Chr( 13 ) + Chr( 10 ) )
IF Empty( cVersion )
cVersion := "unrecognized version"
ENDIF
cStdOut := StrTran( cStdOut, Chr( 10 ), " " )
cStdOut := StrTran( StrTran( cStdOut, Chr( 13 ) ), Chr( 10 ), " " )
FOR EACH cItem IN hb_ATokens( cStdOut,, .T. )
IF Left( cItem, Len( "-I" ) ) == "-I"
IF hb_LeftEq( cItem, "-I" )
dep[ _HBMKDEP_lFound ] := .T.
EXIT
ENDIF
@@ -9140,17 +9142,17 @@ STATIC FUNCTION dep_try_pkg_detection( hbmk, dep )
FOR EACH cItem IN hb_ATokens( cStdOut,, .T. )
DO CASE
CASE Left( cItem, Len( "-l" ) ) == "-l"
CASE hb_LeftEq( cItem, "-l" )
cItem := SubStr( cItem, Len( "-l" ) + 1 )
IF _IS_AUTOLIBSYSPRE( cItem )
AAdd( hbmk[ _HBMK_aLIBUSERSYSPRE ], cItem )
ELSE
AAdd( hbmk[ _HBMK_aLIBUSER ], cItem )
ENDIF
CASE Left( cItem, Len( "-L" ) ) == "-L"
CASE hb_LeftEq( cItem, "-L" )
cItem := SubStr( cItem, Len( "-L" ) + 1 )
AAdd( hbmk[ _HBMK_aLIBPATH ], hb_DirSepDel( hb_DirSepToOS( cItem ) ) )
CASE Left( cItem, Len( "-I" ) ) == "-I"
CASE hb_LeftEq( cItem, "-I" )
cItem := hb_DirSepDel( hb_DirSepToOS( SubStr( cItem, Len( "-I" ) + 1 ) ) )
IF Empty( cIncludeDir )
cIncludeDir := cItem