From 6243be7d28e53f7f098b4579ccd3b48b4091fb6b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Jun 2009 17:38:18 +0000 Subject: [PATCH] 2009-06-10 19:36 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/dos/global.cf ! Fixed to use xcopy instead of copy to 'install' files. This means long filenames (and also casing) will be retained. This also means that now 'install' actually works. It may also mean that creating a DJGPP build isn't anymore possible on a pure DOS system, I can't remember when xcopy was introduced. Anyway I think it's better to have this requirement than not having a proper DOS build at all (since long years). This also means that our DOS release cannot even be *used* in pure DOS environment, since our long filenames will be chopped when extracting the distro .zip. Only final .exes are able to run under DOS. We still have the option to implement full short name support, but I'm not sure this has any importance anymore. If we don't want to do this, we can finally lift some restrictions which tied our hands so far, based on the fact that DOS builds cannot even be created and run on real DOS. So, this means: - We may use long filenames as distro name. - We may convert DOS platform as a target only platform, similar to WinCE/ARM. - If we do the above, we may even embed our DOS libs in Windows distro, and build DOS apps using hbmk2 hello.prg -arch=dos - We may use long filename anywhere in our tree. (but we must check first if long names are also supported for headers, dirnames and source names) If you have an opinion, please tell. * config/dos/global.cf ! Adding ending pathsep to DOC_SUBDIR to make xcopy happy and not ask if the target is a file or directory. ; TOFIX: Anyhow, DOC_SUBDIR feature simply doesn't work since very long, so we should do something about it in the future. * debian/changelog + Added new version entry. (Thanks Guy) * bin/postinst.bat ! Added workaround to make it work under DOS. (avoiding 'Out of environment space' error) + mpkg_dos.bat + Added DOS package generator batch. Very similar to mpkg_win.bat, maybe we should merge them in the future. * mpkg_win.bat * Using short name for main dir, just to sync it with DOS version. * utils/hbformat/hbformat.prg + Changed default GT to GTCGI. * utils/hbmk2/hbmk2.prg ! Added workaround for dos/djgpp anomaly in hb_DirBase() (and also hb_ProgName()) where path contains forward slashed instead of backslashes. ; TOFIX: In core. * source/vm/Makefile ! Disabled hbvmall for dos build because of thid djgpp error: --- gcc -I. -I../../../../include -Wall -W -O3 -c ../../hvmall.c -ohvmall.o In file included from ../../../../include/hbmath.h:60, from ../../itemapi.c:97, from ../../hvmall.c:67: c:/devl/djgpp/include/libm/math.h:97: error: redefinition of 'struct exception' --- * contrib/hbblat/hbblat.hbc * contrib/hbhpdf/hbhpdf.hbc * Minor formatting. --- harbour/ChangeLog | 84 +++++++++++++++++++++++++++-- harbour/bin/postinst.bat | 12 ++--- harbour/config/doc.cf | 2 +- harbour/config/dos/global.cf | 2 +- harbour/contrib/hbblat/hbblat.hbc | 3 +- harbour/contrib/hbhpdf/hbhpdf.hbc | 3 +- harbour/debian/changelog | 7 ++- harbour/mpkg_dos.bat | 73 +++++++++++++++++++++++++ harbour/mpkg_win.bat | 2 +- harbour/source/vm/Makefile | 3 ++ harbour/utils/hbformat/hbformat.prg | 3 ++ harbour/utils/hbmk2/hbmk2.prg | 48 +++++++++-------- 12 files changed, 204 insertions(+), 38 deletions(-) create mode 100644 harbour/mpkg_dos.bat diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4087c28cc5..fe4d940f0a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,11 +17,87 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-10 19:36 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/dos/global.cf + ! Fixed to use xcopy instead of copy to 'install' files. + This means long filenames (and also casing) will be retained. + This also means that now 'install' actually works. + It may also mean that creating a DJGPP build isn't anymore + possible on a pure DOS system, I can't remember when xcopy + was introduced. Anyway I think it's better to have this + requirement than not having a proper DOS build at all + (since long years). + This also means that our DOS release cannot even be *used* + in pure DOS environment, since our long filenames will + be chopped when extracting the distro .zip. Only final + .exes are able to run under DOS. + We still have the option to implement full short name + support, but I'm not sure this has any importance anymore. + If we don't want to do this, we can finally lift some + restrictions which tied our hands so far, based on the + fact that DOS builds cannot even be created and run on + real DOS. So, this means: + - We may use long filenames as distro name. + - We may convert DOS platform as a target only platform, + similar to WinCE/ARM. + - If we do the above, we may even embed our DOS + libs in Windows distro, and build DOS apps using + hbmk2 hello.prg -arch=dos + - We may use long filename anywhere in our tree. + (but we must check first if long names are also + supported for headers, dirnames and source names) + If you have an opinion, please tell. + + * config/dos/global.cf + ! Adding ending pathsep to DOC_SUBDIR to make xcopy happy + and not ask if the target is a file or directory. + ; TOFIX: Anyhow, DOC_SUBDIR feature simply doesn't work since + very long, so we should do something about it in the future. + + * debian/changelog + + Added new version entry. (Thanks Guy) + + * bin/postinst.bat + ! Added workaround to make it work under DOS. + (avoiding 'Out of environment space' error) + + + mpkg_dos.bat + + Added DOS package generator batch. Very similar + to mpkg_win.bat, maybe we should merge them in + the future. + + * mpkg_win.bat + * Using short name for main dir, just to sync it with + DOS version. + + * utils/hbformat/hbformat.prg + + Changed default GT to GTCGI. + + * utils/hbmk2/hbmk2.prg + ! Added workaround for dos/djgpp anomaly in hb_DirBase() + (and also hb_ProgName()) where path contains forward + slashed instead of backslashes. + ; TOFIX: In core. + + * source/vm/Makefile + ! Disabled hbvmall for dos build because of thid djgpp error: + --- + gcc -I. -I../../../../include -Wall -W -O3 -c ../../hvmall.c -ohvmall.o + In file included from ../../../../include/hbmath.h:60, + from ../../itemapi.c:97, + from ../../hvmall.c:67: + c:/devl/djgpp/include/libm/math.h:97: error: redefinition of 'struct exception' + --- + + * contrib/hbblat/hbblat.hbc + * contrib/hbhpdf/hbhpdf.hbc + * Minor formatting. + 2009-06-10 13:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) - + examples/hbmsql/tests/hbmk.hbm - - examples/hbmsql/tests/hbmsql.hbc - + examples/hbmsql/hbmsql.hbc - * hbmk2 make file rearrangement continued. + + examples/hbmsql/tests/hbmk.hbm + - examples/hbmsql/tests/hbmsql.hbc + + examples/hbmsql/hbmsql.hbc + * hbmk2 make file rearrangement continued. 2009-06-10 13:17 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + contrib/gtalleg/tests/hbmk.hbm diff --git a/harbour/bin/postinst.bat b/harbour/bin/postinst.bat index 78bc2f78f9..0d0c4d1866 100644 --- a/harbour/bin/postinst.bat +++ b/harbour/bin/postinst.bat @@ -13,13 +13,11 @@ rem rem See COPYING for licensing terms. rem --------------------------------------------------------------- -set _HBMK_CFG=%HB_BIN_INSTALL%\hbmk.cfg -echo Generating %_HBMK_CFG%... -echo # Harbour Make configuration> %_HBMK_CFG% -echo # Generated by Harbour build process>> %_HBMK_CFG% -echo arch=%HB_ARCHITECTURE%>> %_HBMK_CFG% -echo comp=%HB_COMPILER%>> %_HBMK_CFG% -set _HBMK_CFG= +echo Generating %HB_BIN_INSTALL%\hbmk.cfg... +echo # Harbour Make configuration> %HB_BIN_INSTALL%\hbmk.cfg +echo # Generated by Harbour build process>> %HB_BIN_INSTALL%\hbmk.cfg +echo arch=%HB_ARCHITECTURE%>> %HB_BIN_INSTALL%\hbmk.cfg +echo comp=%HB_COMPILER%>> %HB_BIN_INSTALL%\hbmk.cfg goto inst_%HB_ARCHITECTURE% diff --git a/harbour/config/doc.cf b/harbour/config/doc.cf index eaf05ac19a..53aa6d97f4 100644 --- a/harbour/config/doc.cf +++ b/harbour/config/doc.cf @@ -14,7 +14,7 @@ install:: else INSTALL_OBJS = $(DOC_FILES) -INSTALL_DIR = $(HB_DOC_INSTALL)$(DOC_SUBDIR) +INSTALL_DIR = $(HB_DOC_INSTALL)$(DOC_SUBDIR)/ include $(TOP)$(ROOT)config/install.cf endif diff --git a/harbour/config/dos/global.cf b/harbour/config/dos/global.cf index 0d36feca11..e7b5a2f29c 100644 --- a/harbour/config/dos/global.cf +++ b/harbour/config/dos/global.cf @@ -49,7 +49,7 @@ endif RM = del RD = rmdir -CP = $(COMSPEC) /Ccopy +CP = $(COMSPEC) /Cxcopy /D MV = move MD = md diff --git a/harbour/contrib/hbblat/hbblat.hbc b/harbour/contrib/hbblat/hbblat.hbc index db18b06a2a..f968332de3 100644 --- a/harbour/contrib/hbblat/hbblat.hbc +++ b/harbour/contrib/hbblat/hbblat.hbc @@ -2,4 +2,5 @@ # $Id$ # -libs=hbblat blat +libs=hbblat +libs=blat diff --git a/harbour/contrib/hbhpdf/hbhpdf.hbc b/harbour/contrib/hbhpdf/hbhpdf.hbc index 2f9a4b0af7..a539b2f5fe 100644 --- a/harbour/contrib/hbhpdf/hbhpdf.hbc +++ b/harbour/contrib/hbhpdf/hbhpdf.hbc @@ -2,4 +2,5 @@ # $Id$ # -libs=hbhpdf libhpdf libpng +libs=hbhpdf +libs=libhpdf libpng diff --git a/harbour/debian/changelog b/harbour/debian/changelog index 426cee0c9f..a1f0d0ec21 100644 --- a/harbour/debian/changelog +++ b/harbour/debian/changelog @@ -1,3 +1,9 @@ +harbour (2.0.0beta1-1) unstable; urgency=low + + * 2.0.0beta1-1 + + -- Viktor Szakats Wed, 10 Jun 2009 16:40:15 +0200 + harbour (1.0.1-1) unstable; urgency=low * Please see doc/whatsnew.txt @@ -24,4 +30,3 @@ harbour (0.44-1) unstable; urgency=low * Initial Release (closes: Bug#251486). -- Luis Mayoral Sun, 05 Sep 2004 14:33:19 +0200 - diff --git a/harbour/mpkg_dos.bat b/harbour/mpkg_dos.bat new file mode 100644 index 0000000000..94e251a9c6 --- /dev/null +++ b/harbour/mpkg_dos.bat @@ -0,0 +1,73 @@ +@rem +@rem $Id$ +@rem + +@echo off + +rem --------------------------------------------------------------- +rem Installer creator for Harbour Project +rem +rem Copyright 2009 Viktor Szakats (harbour.01 syenar.hu) +rem See COPYING for licensing terms. +rem +rem This script requires: +rem - Windows NT or upper +rem - Info-ZIP zip.exe in PATH +rem https://sourceforge.net/project/showfiles.php?group_id=118012 +rem - HB_COMPILER envvar configured (see INSTALL doc) +rem - C compiler and GNU Make configured (see INSTALL doc) +rem --------------------------------------------------------------- + +if not "%OS%" == "Windows_NT" goto END + +setlocal + +rem ; Basic setup +set HB_VERSION=200 +if "%HB_ARCHITECTURE%" == "" set HB_ARCHITECTURE=dos +set HB_PKGNAME=hb%HB_VERSION% +set HB_DIRNAME=%HB_PKGNAME% + +rem ; Dir setup +set HB_INSTALL_BASE=%~dp0_hb_inst +set HB_INSTALL_PREFIX=%HB_INSTALL_BASE%\%HB_DIRNAME% +set HB_BIN_INSTALL=%HB_INSTALL_PREFIX%\bin +set HB_LIB_INSTALL=%HB_INSTALL_PREFIX%\lib +set HB_INC_INSTALL=%HB_INSTALL_PREFIX%\include +set HB_DOC_INSTALL=%HB_INSTALL_PREFIX%\doc + +rem ; Pre-build cleanup +if exist %HB_INSTALL_PREFIX% rmdir /q /s %HB_INSTALL_PREFIX% + +rem ; Option setup +set HB_BUILD_OPTIM=yes +set HB_BUILD_DEBUG=no + +rem ; Build Harbour +call make_gnu.bat clean install + +rem if errorlevel 1 goto MK_ERROR + +rem ; Post-build installation +xcopy /D /Y ChangeLog* "%HB_INSTALL_PREFIX%\" +xcopy /D /Y COPYING "%HB_INSTALL_PREFIX%\" +xcopy /D /Y ERRATA "%HB_INSTALL_PREFIX%\" +xcopy /D /Y INSTALL "%HB_INSTALL_PREFIX%\" +xcopy /D /Y TODO "%HB_INSTALL_PREFIX%\" + +rem ; Build .zip package +if exist %HB_PKGNAME%.zip del %HB_PKGNAME%.zip +pushd +cd %HB_INSTALL_BASE% +zip -9 -X -r -o %~dp0%HB_PKGNAME%.zip . -i %HB_DIRNAME%\* +popd + +:MK_ERROR + +rem ; Cleanup +if "%1" == "--deltemp" rmdir /q /s %HB_INSTALL_PREFIX% +if "%1" == "--deltemp" rmdir /q %HB_INSTALL_BASE% + +endlocal + +:END diff --git a/harbour/mpkg_win.bat b/harbour/mpkg_win.bat index 75ac43dcb7..d61a9b08eb 100644 --- a/harbour/mpkg_win.bat +++ b/harbour/mpkg_win.bat @@ -33,7 +33,7 @@ set HB_PKGNAME=harbour-%HB_VERSION%-%HB_ARCHITECTURE%-%HB_COMPILER% set HB_DIRNAME=harbour-%HB_ARCHITECTURE%-%HB_COMPILER% rem ; Dir setup -set HB_INSTALL_BASE=%~dp0_hb_install_temp +set HB_INSTALL_BASE=%~dp0_hb_inst set HB_INSTALL_PREFIX=%HB_INSTALL_BASE%\%HB_DIRNAME% set HB_BIN_INSTALL=%HB_INSTALL_PREFIX%\bin set HB_LIB_INSTALL=%HB_INSTALL_PREFIX%\lib diff --git a/harbour/source/vm/Makefile b/harbour/source/vm/Makefile index 03d848ed8a..ec04591309 100644 --- a/harbour/source/vm/Makefile +++ b/harbour/source/vm/Makefile @@ -30,6 +30,9 @@ endif ifeq ($(HB_COMPILER),dmc) HB_HVM_ALL = no endif +ifeq ($(HB_ARCHITECTURE),dos) + HB_HVM_ALL = no +endif export HB_HVM_ALL endif diff --git a/harbour/utils/hbformat/hbformat.prg b/harbour/utils/hbformat/hbformat.prg index e93c14d793..61d00dabc4 100644 --- a/harbour/utils/hbformat/hbformat.prg +++ b/harbour/utils/hbformat/hbformat.prg @@ -58,6 +58,9 @@ #ifndef _CODEFORMAT_EMBEDDED_ +ANNOUNCE HB_GTSYS +REQUEST HB_GT_CGI_DEFAULT + MEMVAR cFunctions FUNCTION MAIN( ... ) diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index dc8b46f925..6acde08876 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -103,7 +103,6 @@ #pragma linenumber=on ANNOUNCE HB_GTSYS - REQUEST HB_GT_CGI_DEFAULT /* Include these for -pause support. */ @@ -188,6 +187,13 @@ REQUEST hbmk_KEYW #define HB_ISFIRSTIDCHAR( c ) ( HB_ISALPHA( c ) .OR. ( c ) == '_' ) #define HB_ISNEXTIDCHAR( c ) ( HB_ISFIRSTIDCHAR(c) .OR. IsDigit( c ) ) +/* Workaround for dos/djgpp bug */ +#if defined( __PLATFORM__DOS ) + #define HB_DIRBASE() StrTran( hb_DirBase(), "/", "\" ) +#else + #define HB_DIRBASE() hb_DirBase() +#endif + /* This requires Set( _SET_EXACT, .F. ) */ #define LEFTEQUAL( l, r ) ( l = r ) @@ -975,10 +981,10 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) IF hbmk[ _HBMK_nHBMODE ] != _HBMODE_RAW_C /* Detect system locations to enable shared library option by default */ - lSysLoc := hb_DirBase() == "/usr/local/bin/" .OR. ; - hb_DirBase() == "/usr/bin/" .OR. ; - hb_DirBase() == "/opt/harbour/" .OR. ; - hb_DirBase() == "/opt/bin/" + lSysLoc := HB_DIRBASE() == "/usr/local/bin/" .OR. ; + HB_DIRBASE() == "/usr/bin/" .OR. ; + HB_DIRBASE() == "/opt/harbour/" .OR. ; + HB_DIRBASE() == "/opt/bin/" s_cHB_BIN_INSTALL := PathSepToSelf( GetEnv( "HB_BIN_INSTALL" ) ) s_cHB_LIB_INSTALL := PathSepToSelf( GetEnv( "HB_LIB_INSTALL" ) ) @@ -987,14 +993,14 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) s_cHB_INSTALL_PREFIX := PathSepToSelf( GetEnv( "HB_INSTALL_PREFIX" ) ) IF Empty( s_cHB_INSTALL_PREFIX ) DO CASE - CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + cBin_CompPRG + cBinExt ) - s_cHB_INSTALL_PREFIX := DirAddPathSep( hb_DirBase() ) + ".." - CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + "bin" + hb_osPathSeparator() + cBin_CompPRG + cBinExt ) - s_cHB_INSTALL_PREFIX := DirAddPathSep( hb_DirBase() ) - CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + "bin" + hb_osPathSeparator() + cBin_CompPRG + cBinExt ) - s_cHB_INSTALL_PREFIX := DirAddPathSep( hb_DirBase() ) + ".." + hb_osPathSeparator() + ".." - CASE hb_FileExists( DirAddPathSep( hb_DirBase() ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + "bin" + hb_osPathSeparator() + cBin_CompPRG + cBinExt ) - s_cHB_INSTALL_PREFIX := DirAddPathSep( hb_DirBase() ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + ".." + CASE hb_FileExists( DirAddPathSep( HB_DIRBASE() ) + cBin_CompPRG + cBinExt ) + s_cHB_INSTALL_PREFIX := DirAddPathSep( HB_DIRBASE() ) + ".." + CASE hb_FileExists( DirAddPathSep( HB_DIRBASE() ) + "bin" + hb_osPathSeparator() + cBin_CompPRG + cBinExt ) + s_cHB_INSTALL_PREFIX := DirAddPathSep( HB_DIRBASE() ) + CASE hb_FileExists( DirAddPathSep( HB_DIRBASE() ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + "bin" + hb_osPathSeparator() + cBin_CompPRG + cBinExt ) + s_cHB_INSTALL_PREFIX := DirAddPathSep( HB_DIRBASE() ) + ".." + hb_osPathSeparator() + ".." + CASE hb_FileExists( DirAddPathSep( HB_DIRBASE() ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + "bin" + hb_osPathSeparator() + cBin_CompPRG + cBinExt ) + s_cHB_INSTALL_PREFIX := DirAddPathSep( HB_DIRBASE() ) + ".." + hb_osPathSeparator() + ".." + hb_osPathSeparator() + ".." OTHERWISE hbmk_OutErr( hbmk, I_( "Error: HB_INSTALL_PREFIX not set, failed to autodetect." ) ) RETURN 3 @@ -4202,8 +4208,8 @@ STATIC FUNCTION FindInPath( cFileName ) ENDIF /* Check in the dir of this executable. */ - IF ! Empty( hb_DirBase() ) - IF hb_FileExists( cFileName := hb_FNameMerge( hb_DirBase(), cName, cExt ) ) + IF ! Empty( HB_DIRBASE() ) + IF hb_FileExists( cFileName := hb_FNameMerge( HB_DIRBASE(), cName, cExt ) ) RETURN cFileName ENDIF ENDIF @@ -4662,11 +4668,11 @@ STATIC PROCEDURE HBC_ProcessAll( hbmk, lConfigOnly ) #if defined( __PLATFORM__UNIX ) aCFGDirs := { GetEnv( "HOME" ) + "/.harbour/",; "/etc/harbour",; - DirAddPathSep( hb_DirBase() ) + "../etc/harbour",; - DirAddPathSep( hb_DirBase() ) + "../etc",; - hb_DirBase() } + DirAddPathSep( HB_DIRBASE() ) + "../etc/harbour",; + DirAddPathSep( HB_DIRBASE() ) + "../etc",; + HB_DIRBASE() } #else - aCFGDirs := { hb_DirBase() } + aCFGDirs := { HB_DIRBASE() } #endif FOR EACH cDir IN aCFGDirs @@ -5133,7 +5139,7 @@ STATIC FUNCTION MacroProc( hbmk, cString, cDirParent ) DO CASE CASE cMacro == "HB_ROOT" - cMacro := PathSepToSelf( DirAddPathSep( hb_DirBase() ) ) + cMacro := PathSepToSelf( DirAddPathSep( HB_DIRBASE() ) ) CASE cMacro == "HB_SELF" IF Empty( cDirParent ) cMacro := "" @@ -6036,7 +6042,7 @@ STATIC PROCEDURE SetUILang( hbmk ) hb_i18n_set( NIL ) ELSE tmp := "${hb_root}hbmk2.${lng}.hbl" - tmp := StrTran( tmp, "${hb_root}", PathSepToSelf( DirAddPathSep( hb_DirBase() ) ) ) + tmp := StrTran( tmp, "${hb_root}", PathSepToSelf( DirAddPathSep( HB_DIRBASE() ) ) ) tmp := StrTran( tmp, "${lng}", StrTran( hbmk[ _HBMK_cUILNG ], "-", "_" ) ) hb_i18n_set( iif( hb_i18n_check( tmp := hb_MemoRead( tmp ) ), hb_i18n_restoretable( tmp ), NIL ) ) ENDIF