From 533b75b2052d1b248bb57f7b1c34973186c8207a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 14 Jul 2010 10:27:06 +0000 Subject: [PATCH] 2010-07-14 12:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/Makefile * utils/hbmk2/hbmk2.prg + Added build time configuration for GPM (on Linux) and WATT (on MS-DOS) builds. This makes hbmk.hbc generation (at 'install' phase) unnecessary, which means that now 'install' is not required on _any_ platforms and scenarios to use hbmk2. Since hbmk2 is now used to build contribs, this is now also a reqiurement. ; Please test, I didn't make any Linux, MS-DOS build tests after this change. * config/postinst.hbs - Deleted hbmk.hbc creation. Now this logic is included in hbmk2 at build-time on Linux and MS-DOS build which have GPM lib and WATT lib detected respectively. * contrib/hbct/numline.c * HB_ISIZ variables renamed. --- harbour/ChangeLog | 20 +++++++++++++++++++ harbour/config/postinst.hbs | 35 +--------------------------------- harbour/contrib/hbct/numline.c | 26 ++++++++++++------------- harbour/utils/hbmk2/Makefile | 9 +++++++++ harbour/utils/hbmk2/hbmk2.prg | 14 ++++++++++++++ 5 files changed, 57 insertions(+), 47 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 818d804def..9d07275e98 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,26 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-14 12:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/Makefile + * utils/hbmk2/hbmk2.prg + + Added build time configuration for GPM (on Linux) and + WATT (on MS-DOS) builds. This makes hbmk.hbc generation + (at 'install' phase) unnecessary, which means that now + 'install' is not required on _any_ platforms and scenarios + to use hbmk2. Since hbmk2 is now used to build contribs, + this is now also a reqiurement. + ; Please test, I didn't make any Linux, MS-DOS build tests + after this change. + + * config/postinst.hbs + - Deleted hbmk.hbc creation. Now this logic is included in + hbmk2 at build-time on Linux and MS-DOS build which have + GPM lib and WATT lib detected respectively. + + * contrib/hbct/numline.c + * HB_ISIZ variables renamed. + 2010-07-14 11:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/hbapi.h * src/common/Makefile diff --git a/harbour/config/postinst.hbs b/harbour/config/postinst.hbs index 97102370a5..0e829770bf 100644 --- a/harbour/config/postinst.hbs +++ b/harbour/config/postinst.hbs @@ -18,14 +18,11 @@ PROCEDURE Main() LOCAL nErrorLevel := 0 - LOCAL cFile LOCAL aFile LOCAL tmp LOCAL cOldDir - LOCAL lContent - IF Empty( GetEnv( "HB_PLATFORM" ) ) .OR. ; Empty( GetEnv( "HB_COMPILER" ) ) .OR. ; Empty( GetEnv( "HB_BIN_INSTALL" ) ) .OR. ; @@ -37,36 +34,6 @@ PROCEDURE Main() RETURN ENDIF - /* Creating hbmk.hbc */ - - lContent := .F. - cFile := "" - cFile += "# hbmk2 configuration" + hb_eol() - cFile += "# Generated by Harbour build process" + hb_eol() - cFile += hb_eol() - - IF GetEnv( "HB_PLATFORM" ) == "dos" .AND. ; - ! Empty( GetEnv( "HB_HAS_WATT" ) ) - cFile += hb_eol() - cFile += "{dos&djgpp}syslibs=watt" + hb_eol() - cFile += "{dos&watcom}syslibs=wattcpwf" + hb_eol() - cFile += "{dos}libpaths=${WATT_ROOT}/lib" + hb_eol() - lContent := .T. - ENDIF - - IF ! Empty( GetEnv( "HB_HAS_GPM" ) ) - cFile += hb_eol() - cFile += "{" + GetEnv( "HB_PLATFORM" ) + "&" + GetEnv( "HB_COMPILER" ) + "}syslibs=gpm" + hb_eol() - lContent := .T. - ENDIF - - IF lContent - OutStd( "! Making " + GetEnv( "HB_BIN_INSTALL" ) + hb_ps() + "hbmk.hbc..." + hb_eol() ) - hb_MemoWrit( GetEnv( "HB_BIN_INSTALL" ) + hb_ps() + "hbmk.hbc", cFile ) - ELSE - FErase( GetEnv( "HB_BIN_INSTALL" ) + hb_ps() + "hbmk.hbc" ) - ENDIF - /* Installing some misc files */ IF GetEnv( "HB_PLATFORM" ) $ "win|wce|os2|dos" .AND. ; @@ -97,7 +64,7 @@ PROCEDURE Main() 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 aFile IN Directory( "utils" + hb_ps() + tmp[ F_NAME ] + hb_ps() + "*.po" ) - mk_hbl( PathSepToSelf( "utils" + hb_ps() + tmp[ F_NAME ] + hb_ps() + aFile[ F_NAME ] ),; + mk_hbl( "utils" + hb_ps() + tmp[ F_NAME ] + hb_ps() + aFile[ F_NAME ],; PathSepToSelf( GetEnv( "HB_BIN_INSTALL" ) ) + hb_ps() + FNameExtSet( aFile[ F_NAME ], ".hbl" ) ) NEXT ENDIF diff --git a/harbour/contrib/hbct/numline.c b/harbour/contrib/hbct/numline.c index 0b153aced3..536615876b 100644 --- a/harbour/contrib/hbct/numline.c +++ b/harbour/contrib/hbct/numline.c @@ -55,34 +55,34 @@ HB_FUNC( NUMLINE ) { - HB_ISIZ lLines = 0; + HB_ISIZ nLines = 0; if( HB_ISCHAR( 1 ) ) { const char * pcString = hb_parc( 1 ); const char * pBuffer; - HB_ISIZ lStrLen = hb_parclen( 1 ); - HB_ISIZ lLength = hb_parnsdef( 2, 80 ); + HB_ISIZ nStrLen = hb_parclen( 1 ); + HB_ISIZ nLength = hb_parnsdef( 2, 80 ); - while( lStrLen > 0 ) + while( nStrLen > 0 ) { - pBuffer = ( char * ) memchr( pcString, 13, lStrLen ); + pBuffer = ( char * ) memchr( pcString, 13, nStrLen ); if( ! pBuffer ) - pBuffer = pcString + lStrLen; + pBuffer = pcString + nStrLen; - if( ( pBuffer - pcString ) > lLength ) - pBuffer = pcString + lLength; + if( ( pBuffer - pcString ) > nLength ) + pBuffer = pcString + nLength; else { - pBuffer++; + ++pBuffer; if( *pBuffer == 10 ) - pBuffer++; + ++pBuffer; } - lStrLen -= pBuffer - pcString; + nStrLen -= pBuffer - pcString; pcString = pBuffer; - lLines++; + ++nLines; } } - hb_retns( lLines ); + hb_retns( nLines ); } diff --git a/harbour/utils/hbmk2/Makefile b/harbour/utils/hbmk2/Makefile index 8620dca6b1..192a57e860 100644 --- a/harbour/utils/hbmk2/Makefile +++ b/harbour/utils/hbmk2/Makefile @@ -4,6 +4,8 @@ ROOT := ../../ +include $(TOP)$(ROOT)config/global.mk + PRG_SOURCES := \ hbmk2.prg \ @@ -11,4 +13,11 @@ PRG_MAIN := hbmk2.prg LIBS = hbcplr hbpp hbcommon $(HB_LIBS_MT_NORDD) +ifneq ($(HB_HAS_GPM),) + HB_PRGFLAGS += -DHB_HAS_GPM +endif +ifneq ($(HB_HAS_WATT),) + HB_PRGFLAGS += -DHB_HAS_WATT +endif + include $(TOP)$(ROOT)config/bin.mk diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index e992ee80d1..1162ee250f 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -1619,6 +1619,20 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) aParams := {} + /* Process build-time configuration */ + + #if defined( HB_HAS_GPM ) + AAdd( hbmk[ _HBMK_aLIBUSERSYS ], "gpm" ) + #endif + + #if defined( HB_HAS_WATT ) + SWITCH hbmk[ _HBMK_cCOMP ] + CASE "djgpp" ; AAdd( hbmk[ _HBMK_aLIBUSERSYS ], "watt" ) ; EXIT + CASE "watcom" ; AAdd( hbmk[ _HBMK_aLIBUSERSYS ], "wattcpwf" ) ; EXIT + ENDSWITCH + AAdd( hbmk[ _HBMK_aLIBPATH ], PathSepToSelf( GetEnv( "WATT_ROOT" ) ) + hb_ps() + "lib" ) + #endif + /* Process automatic make files in current dir. */ IF hb_FileExists( _HBMK_AUTOHBM_NAME ) IF ! hbmk[ _HBMK_lQuiet ]