From b795fb6ac24123417ca5a5fa0c443e02a3e494ed Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 3 Mar 2012 02:34:43 +0000 Subject: [PATCH] 2012-03-03 03:33 UTC+0100 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg + support for HB_INSTALL_CONTRIB envvar to specify dir(s) of contribs/addons for .hbc autofind purposes. Accepts multiple dirs. F.e.: export HB_INSTALL_CONTRIB=/usr/local/share/harbour/contrib:/usr/local/share/harbour/addons Experimental. --- harbour/ChangeLog | 8 ++++++++ harbour/utils/hbmk2/hbmk2.prg | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 00f7b15cc8..95a9cef703 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,14 @@ The license applies to all entries newer than 2009-04-28. */ +2012-03-03 03:33 UTC+0100 Viktor Szakats (harbour syenar.net) + * utils/hbmk2/hbmk2.prg + + support for HB_INSTALL_CONTRIB envvar to specify dir(s) + of contribs/addons for .hbc autofind purposes. Accepts + multiple dirs. F.e.: + export HB_INSTALL_CONTRIB=/usr/local/share/harbour/contrib:/usr/local/share/harbour/addons + Experimental. + 2012-03-02 11:27 UTC+0100 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg * tuned Harbour root autodetection code to avoid corner diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 6a2fbbeef5..f3fc7382fb 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -1958,6 +1958,20 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) /* Add main Harbour header dir to header path list */ AAddNotEmpty( hbmk[ _HBMK_aINCPATH ], l_cHB_INSTALL_INC ) + /* Add custom search paths for .hbc files */ + IF ! Empty( l_cHB_INSTALL_ADD := GetEnv( "HB_INSTALL_CONTRIB" ) ) + #if defined( __PLATFORM__WINDOWS ) .OR. ; + defined( __PLATFORM__DOS ) .OR. ; + defined( __PLATFORM__OS2 ) + FOR EACH tmp IN hb_ATokens( l_cHB_INSTALL_ADD, hb_osPathListSeparator(), .T., .T. ) + #else + FOR EACH tmp IN hb_ATokens( l_cHB_INSTALL_ADD, hb_osPathListSeparator() ) + #endif + IF ! Empty( tmp ) + AAdd( hbmk[ _HBMK_aLIBPATH ], hb_PathNormalize( hb_DirSepAdd( PathSepToSelf( tmp ) ) ) + "%{hb_name}" ) + ENDIF + NEXT + ENDIF /* Add default search paths for .hbc files */ l_cHB_INSTALL_ADD := hb_PathNormalize( hb_DirSepAdd( l_cHB_INSTALL_PREFIX ) ) AAdd( hbmk[ _HBMK_aLIBPATH ], l_cHB_INSTALL_ADD + "contrib" + hb_ps() + "%{hb_name}" )