2010-03-27 18:12 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* bin/postinst.bat
  * bin/postinst.prg
    + Moved shared Harbour tools generation from .bat to .prg.
      So now it should work on OS/2, cross-builds and all shells 
      in general. (some cmdline tweaks may be required for *nix)
    + Changed hbrun regeneration (with icon) to better take into account
      build settings.
    ; This leaves about 50 (!) total lines of DOS batch code in
      Harbour, which is quite good for a project of this size.
This commit is contained in:
Viktor Szakats
2010-03-27 17:15:17 +00:00
parent 0361bc6d60
commit f9e217ed8d
3 changed files with 63 additions and 28 deletions

View File

@@ -17,6 +17,17 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-03-27 18:12 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* bin/postinst.bat
* bin/postinst.prg
+ Moved shared Harbour tools generation from .bat to .prg.
So now it should work on OS/2, cross-builds and all shells
in general. (some cmdline tweaks may be required for *nix)
+ Changed hbrun regeneration (with icon) to better take into account
build settings.
; This leaves about 50 (!) total lines of DOS batch code in
Harbour, which is quite good for a project of this size.
2010-03-27 17:42 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* bin/postinst.bat
* bin/postinst.prg

View File

@@ -45,37 +45,20 @@ if "%HB_SHELL%" == "nt" goto _SH_NT
:_SH_NT
if "%HB_PLATFORM%" == "dos" goto _NO_DLL_BIN
if "%HB_PLATFORM%" == "linux" goto _NO_DLL_BIN
if "%HB_BUILD_DLL%" == "no" goto _NO_DLL_BIN
set HBMK_OPTIONS=
if "%HB_BUILD_MODE%" == "cpp" set HBMK_OPTIONS=%HBMK_OPTIONS% -cpp=yes
if "%HB_BUILD_MODE%" == "c" set HBMK_OPTIONS=%HBMK_OPTIONS% -cpp=no
if "%HB_BUILD_DEBUG%" == "yes" set HBMK_OPTIONS=%HBMK_OPTIONS% -debug
if not "%HB_BUILD_SHARED%" == "yes" (
echo ! Making shared version of Harbour binaries...
"%HB_HOST_BIN_DIR%\hbmk2" -quiet -q0 -lang=en -shared "-o%HB_BIN_INSTALL%\hbrun-dll" "%~dp0..\utils\hbrun\hbrun.hbp"
"%HB_HOST_BIN_DIR%\hbmk2" -quiet -q0 -lang=en -shared "-o%HB_BIN_INSTALL%\hbmk2-dll" "%~dp0..\utils\hbmk2\hbmk2.hbp"
"%HB_HOST_BIN_DIR%\hbmk2" -quiet -q0 -lang=en -shared "-o%HB_BIN_INSTALL%\hbtest-dll" "%~dp0..\utils\hbtest\hbtest.hbp"
"%HB_HOST_BIN_DIR%\hbmk2" -quiet -q0 -lang=en -shared "-o%HB_BIN_INSTALL%\hbi18n-dll" "%~dp0..\utils\hbi18n\hbi18n.hbp"
"%HB_HOST_BIN_DIR%\hbmk2" -quiet -q0 -lang=en -shared "-o%HB_BIN_INSTALL%\hbformat-dll" "%~dp0..\utils\hbformat\hbformat.hbp"
)
:_NO_DLL_BIN
if "%HB_PLATFORM%" == "dos" goto _NO_ICON_BIN
if "%HB_PLATFORM%" == "linux" goto _NO_ICON_BIN
rem ; We build this here, because GNU Make wouldn't add the icon.
echo ! Making hbrun with application icon...
set _HB_SHARED_=
if "%HB_BUILD_SHARED%" == "yes" set _HB_SHARED_=-shared
if "%HB_BUILD_DLL%" == "no" set _HB_SHARED_=
"%HB_HOST_BIN_DIR%\hbmk2" -quiet -q0 -lang=en %_HB_SHARED_% "-o%HB_BIN_INSTALL%\hbrun" "%~dp0..\utils\hbrun\hbrun.hbp"
set _HB_SHARED_=
set _HB_OPTIONS_=
if "%HB_BUILD_SHARED%" == "yes" set _HB_OPTIONS_=-shared
if "%HB_BUILD_DLL%" == "no" set _HB_OPTIONS_=
if "%HB_BUILD_MODE%" == "cpp" set _HB_OPTIONS_=%_HB_OPTIONS_% -cpp=yes
if "%HB_BUILD_MODE%" == "c" set _HB_OPTIONS_=%_HB_OPTIONS_% -cpp=no
if "%HB_BUILD_DEBUG%" == "yes" set _HB_OPTIONS_=%_HB_OPTIONS_% -debug
"%HB_HOST_BIN_DIR%\hbmk2" -quiet -q0 -lang=en %_HB_OPTIONS_% "-o%HB_BIN_INSTALL%\hbrun" "%~dp0..\utils\hbrun\hbrun.hbp"
set _HB_OPTIONS_=
:_NO_ICON_BIN

View File

@@ -17,8 +17,9 @@ PROCEDURE Main()
LOCAL cFile
LOCAL aFile
LOCAL aImpLibs
LOCAL aArray
LOCAL tmp
LOCAL cOptions
IF Empty( GetEnv( "HB_PLATFORM" ) ) .OR. ;
Empty( GetEnv( "HB_COMPILER" ) ) .OR. ;
@@ -31,6 +32,8 @@ PROCEDURE Main()
RETURN
ENDIF
/* Creating hbmk.cfg */
OutStd( "! Making " + GetEnv( "HB_BIN_INSTALL" ) + _PS_ + "hbmk.cfg..." + hb_osNewLine() )
cFile := ""
@@ -51,6 +54,8 @@ PROCEDURE Main()
hb_MemoWrit( GetEnv( "HB_BIN_INSTALL" ) + _PS_ + "hbmk.cfg", cFile )
/* Installing some misc files */
IF GetEnv( "HB_PLATFORM" ) $ "win|wce|os2|dos" .AND. ;
! Empty( GetEnv( "HB_INSTALL_PREFIX" ) )
@@ -63,11 +68,13 @@ PROCEDURE Main()
hb_FCopy( "TODO" , GetEnv( "HB_INSTALL_PREFIX" ) + _PS_ + "TODO" )
ENDIF
/* Import library generation */
IF GetEnv( "HB_PLATFORM" ) $ "win|wce|os2" .AND. ;
GetEnv( "HB_BUILD_IMPLIB" ) == "yes" .AND. ;
! Empty( GetEnv( "HB_HOST_BIN_DIR" ) )
aImpLibs := {;
aArray := {;
{ "ace32" , "HB_WITH_ADS" , "\Redistribute\ace32.dll" , .F. },;
{ "ace32" , "HB_WITH_ADS" , "\ace32.dll" , .F. },;
{ "ace32" , "HB_WITH_ADS" , "\32bit\ace32.dll" , .F. },;
@@ -95,7 +102,7 @@ PROCEDURE Main()
{ "ssleay32" , "HB_WITH_OPENSSL" , "\..\ssleay32.dll" , .T. },;
{ "libpq" , "HB_WITH_PGSQL" , "\..\lib\libpq.dll" , .T. }}
FOR EACH tmp IN aImpLibs
FOR EACH tmp IN aArray
IF ! Empty( GetEnv( tmp[ 2 ] ) )
hb_processRun( GetEnv( "HB_HOST_BIN_DIR" ) + _PS_ + "hbmk2" +;
" " + Chr( 34 ) + "-mkimplib=" + GetEnv( "HB_LIB_INSTALL" ) + _PS_ + tmp[ 1 ] + Chr( 34 ) +;
@@ -114,6 +121,40 @@ PROCEDURE Main()
ENDIF
ENDIF
/* Creating shared version of Harbour binaries */
IF !( GetEnv( "HB_PLATFORM" ) $ "dos|linux" ) .AND. ;
!( GetEnv( "HB_BUILD_DLL" ) == "no" ) .AND. ;
!( GetEnv( "HB_BUILD_SHARED" ) == "yes" )
cOptions := ""
IF GetEnv( "HB_BUILD_MODE" ) == "cpp"
cOptions += " -cpp=yes"
ELSEIF GetEnv( "HB_BUILD_MODE" ) == "c"
cOptions += " -cpp=no"
ENDIF
IF GetEnv( "HB_BUILD_DEBUG" ) == "yes"
cOptions += " -debug"
ENDIF
OutStd( "! Making shared version of Harbour binaries..." + hb_osNewLine() )
aArray := {;
{ "hbrun-dll" , "utils\hbrun\hbrun.hbp" },;
{ "hbmk2-dll" , "utils\hbmk2\hbmk2.hbp" },;
{ "hbtest-dll" , "utils\hbtest\hbtest.hbp" },;
{ "hbi18n-dll" , "utils\hbi18n\hbi18n.hbp" },;
{ "hbformat-dll" , "utils\hbformat\hbformat.hbp" }}
FOR EACH tmp IN aArray
hb_processRun( GetEnv( "HB_HOST_BIN_DIR" ) + _PS_ + "hbmk2" +;
" -quiet -q0 -lang=en -shared" + cOptions +;
" " + Chr( 34 ) + "-o" + GetEnv( "HB_BIN_INSTALL" ) + _PS_ + tmp[ 1 ] + Chr( 34 ) +;
" " + Chr( 34 ) + StrTran( tmp[ 2 ], "\", _PS_ ) + Chr( 34 ) )
NEXT
ENDIF
ErrorLevel( nErrorLevel )
RETURN