From 5994143e6a5f2d28d118d767048e92cbef8c868e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 7 Jul 2010 08:09:04 +0000 Subject: [PATCH] 2010-07-07 10:08 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/postinst.hbs + Using hbi18n tool to generate .hbl files to utils. (currently hbmk2 only) This fixes missing .hbl after latest changes which dropped regenerating utils at postinst phase. At the same time it enables .hbl file generation for all platforms. The logic will automatically generate .hbl files for all .po files found under any utils. * INSTALL * utils/Makefile + Added hbi18 to the list of tools required to build Harbour in cross-platform situations. * contrib/hbqt/hbmk2_plugin_qt.hbs ! Fixed QT tools detection on HB_WITH_QT. --- harbour/ChangeLog | 20 +++++++++- harbour/INSTALL | 4 +- harbour/config/postinst.hbs | 47 ++++++++++++++++++++++++ harbour/contrib/hbqt/hbmk2_plugin_qt.hbs | 16 ++++---- harbour/utils/Makefile | 2 +- 5 files changed, 78 insertions(+), 11 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ec32df9293..74021c355e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,24 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-07 10:08 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/postinst.hbs + + Using hbi18n tool to generate .hbl files to utils. + (currently hbmk2 only) + This fixes missing .hbl after latest changes which dropped + regenerating utils at postinst phase. At the same time it + enables .hbl file generation for all platforms. The logic + will automatically generate .hbl files for all .po files + found under any utils. + + * INSTALL + * utils/Makefile + + Added hbi18 to the list of tools required to build Harbour + in cross-platform situations. + + * contrib/hbqt/hbmk2_plugin_qt.hbs + ! Fixed QT tools detection on HB_WITH_QT. + 2010-07-06 18:29 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + contrib/hbide/editor.ui + Added: to be used a little while. @@ -33,7 +51,7 @@ * contrib/hbide/idesaveload.prg + Implemented: a better control over code completion feature. Now completion list can be presented with argument list intact, - i.e., hbide_isValidSource( cSourceFile ) can be presented + i.e., hbide_isValidSource( cSourceFile ) can be presented either as (default) hbide_isValidSource OR hbide_isValidSource( cSourceFile ) Similarily, code can also be completed including arguments diff --git a/harbour/INSTALL b/harbour/INSTALL index a43405f23a..f8bc34f5f3 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -704,8 +704,8 @@ HARBOUR If you leave this value empty, the make system will try to autodetect it, so in practice all you have to do is to create a native build first (no 'install' required), then create the cross-build. If you set this value - manually, it may be useful to know that only harbour, hbpp, hbmk2, hbrun - executables are required for a cross-build process to succeed. + manually, it may be useful to know that harbour, hbpp, hbmk2, hbrun, + hbi18n executables are required for a cross-build process to succeed. 7. DEBUGGING OPTIONS diff --git a/harbour/config/postinst.hbs b/harbour/config/postinst.hbs index b0b97e0db3..b70a7d978f 100644 --- a/harbour/config/postinst.hbs +++ b/harbour/config/postinst.hbs @@ -88,6 +88,46 @@ PROCEDURE Main() NEXT ENDIF + /* Creating shared version of Harbour binaries */ + + IF ! Empty( GetEnv( "HB_HOST_BIN_DIR" ) ) + +#if 0 + OutStd( "! Making hbmk2 to create .hbl files..." + hb_osNewLine() ) + + tmp := "" + IF GetEnv( "HB_BUILD_MODE" ) == "cpp" + tmp += " -cpp=yes" + ELSEIF GetEnv( "HB_BUILD_MODE" ) == "c" + tmp += " -cpp=no" + ENDIF + IF GetEnv( "HB_BUILD_DEBUG" ) == "yes" + tmp += " -debug" + ENDIF + IF GetEnv( "HB_BUILD_SHARED" ) == "yes" + tmp += " -shared" + ENDIF + + mk_hb_processRun( PathSepToSelf( GetEnv( "HB_HOST_BIN_DIR" ) ) + hb_ps() + "hbmk2" +; + " -quiet -lang=en -q0" + tmp +; + " utils/hbmk2/hbmk2.hbp" +; + " -o${HB_BIN_INSTALL}/hbmk2" ) +#else + OutStd( "! Making .hbl files..." + hb_osNewLine() ) + + FOR EACH tmp IN Directory( "utils" + hb_ps() + hb_osFileMask(), "D" ) + IF "D" $ tmp[ F_ATTR ] .AND. !( tmp[ F_NAME ] == "." ) .AND. !( tmp[ F_NAME ] == ".." ) + FOR EACH cFile IN Directory( "utils" + hb_ps() + tmp[ F_NAME ] + hb_ps() + "*.po" ) + mk_hb_processRun( PathSepToSelf( GetEnv( "HB_HOST_BIN_DIR" ) ) + hb_ps() + "hbi18n" +; + " -q -g -o" + PathSepToSelf( GetEnv( "HB_BIN_INSTALL" ) ) + hb_ps() + FN_ExtSet( cFile[ F_NAME ], ".hbl" ) +; + " " + PathSepToSelf( "utils" + hb_ps() + tmp[ F_NAME ] + hb_ps() + cFile[ F_NAME ] ) ) + NEXT + ENDIF + NEXT +#endif + + ENDIF + /* Creating install packages */ IF GetEnv( "HB_PLATFORM" ) $ "win|wce|os2|dos" .AND. ; @@ -142,6 +182,13 @@ STATIC FUNCTION mk_hb_processRun( cCommand ) STATIC FUNCTION FN_Escape( cFN ) RETURN Chr( 34 ) + cFN + Chr( 34 ) +STATIC FUNCTION FN_ExtSet( cFileName, cExt ) + LOCAL cDir, cName + + hb_FNameSplit( cFileName, @cDir, @cName ) + + RETURN hb_FNameMerge( cDir, cName, cExt ) + STATIC FUNCTION PathSepToSelf( cFileName ) #if defined( __PLATFORM__WINDOWS ) .OR. ; defined( __PLATFORM__DOS ) .OR. ; diff --git a/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs b/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs index 8431e1bbc1..03fae0a146 100644 --- a/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs +++ b/harbour/contrib/hbqt/hbmk2_plugin_qt.hbs @@ -344,6 +344,7 @@ STATIC FUNCTION qt_tool_detect( hbmk2, cName, cEnvQT, cEnvHB ) IF Empty( GetEnv( "HB_QTPATH" ) ) .OR. ; ! hb_FileExists( cBIN := GetEnv( "HB_QTPATH" ) + cName ) + cBIN := "" IF hbmk2[ "cPLAT" ] == "win" hb_AIns( aEnvList, 1, "HB_WITH_QT", .T. ) @@ -351,18 +352,19 @@ STATIC FUNCTION qt_tool_detect( hbmk2, cName, cEnvQT, cEnvHB ) IF ! Empty( GetEnv( "HB_WITH_QT" ) ) .AND. ; !( GetEnv( "HB_WITH_QT" ) == "no" ) - cBIN := GetEnv( "HB_WITH_QT" ) + "\..\bin\" + cName + ".exe" - IF ! hb_FileExists( cBIN ) - hbmk2_OutErr( hbmk2, hb_StrFormat( "HB_WITH_QT points to incomplete QT installation. '%1$s' executable not found.", cName ) ) - RETURN NIL + IF ! hb_FileExists( cBIN := hbmk2_PathNormalize( GetEnv( "HB_WITH_QT" ) + "\..\bin\" + cName + ".exe" ) ) + hbmk2_OutErr( hbmk2, hb_StrFormat( "Warning: HB_WITH_QT points to incomplete QT installation. '%1$s' executable not found.", cName ) ) + cBIN := "" ENDIF ENDIF ENDIF - cBIN := hbmk2_FindInPath( cName, GetEnv( "PATH" ) + hb_osPathListSeparator() + "/opt/qtsdk/qt/bin" ) IF Empty( cBIN ) - hbmk2_OutErr( hbmk2, hb_StrFormat( "%1$s not set, could not autodetect '%2$s' executable", hbmk2_ArrayToList( aEnvList, ", " ), cName ) ) - RETURN NIL + cBIN := hbmk2_FindInPath( cName, GetEnv( "PATH" ) + hb_osPathListSeparator() + "/opt/qtsdk/qt/bin" ) + IF Empty( cBIN ) + hbmk2_OutErr( hbmk2, hb_StrFormat( "%1$s not set, could not autodetect '%2$s' executable", hbmk2_ArrayToList( aEnvList, ", " ), cName ) ) + RETURN NIL + ENDIF ENDIF ENDIF IF hbmk2[ "lINFO" ] diff --git a/harbour/utils/Makefile b/harbour/utils/Makefile index aac9d411b4..64bcecaed1 100644 --- a/harbour/utils/Makefile +++ b/harbour/utils/Makefile @@ -7,11 +7,11 @@ ROOT := ../ DIRS := \ hbrun \ hbmk2 \ + hbi18n \ ifneq ($(HB_BUILD_PARTS),compiler) DIRS += \ - hbi18n \ hbtest \ hbformat \