From 0be7b7bcb5e7d19d9f0877b2f5d002be308ae53d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 15 Jun 2010 11:07:26 +0000 Subject: [PATCH] 2010-06-15 13:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * harbour-win-spec * harbour-wce-spec * harbour.spec ! Deleted references to hbcc, hbcmp, hblnk. They still work, and they still can be readded as links if someone finds them necessary. As a general direction for most users though it's preferred to use hbmk2 as-is. * Updated help text. (pls fix it further, it's not perfect) * contrib/hbcomm/hbcomm.prg + OUTCHR() smartened to use a loop until failure or the whole data is transmitted. As suggested by Mindaugas. --- harbour/ChangeLog | 14 +++++++ harbour/contrib/hbcomm/hbcomm.prg | 32 +++++++++++----- harbour/harbour-wce-spec | 62 +++++------------------------- harbour/harbour-win-spec | 62 +++++------------------------- harbour/harbour.spec | 63 ++++--------------------------- 5 files changed, 65 insertions(+), 168 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fe15c2edf1..f97a1ac1fb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,20 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-15 13:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * harbour-win-spec + * harbour-wce-spec + * harbour.spec + ! Deleted references to hbcc, hbcmp, hblnk. They still work, + and they still can be readded as links if someone finds them + necessary. As a general direction for most users though it's + preferred to use hbmk2 as-is. + * Updated help text. (pls fix it further, it's not perfect) + + * contrib/hbcomm/hbcomm.prg + + OUTCHR() smartened to use a loop until failure or the whole + data is transmitted. As suggested by Mindaugas. + 2010-06-15 12:56 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/xhb/xhbcomp.prg * harbour/contrib/xhb/xhbmsgs.c diff --git a/harbour/contrib/hbcomm/hbcomm.prg b/harbour/contrib/hbcomm/hbcomm.prg index 54a5c0319b..0f64bc7c7d 100644 --- a/harbour/contrib/hbcomm/hbcomm.prg +++ b/harbour/contrib/hbcomm/hbcomm.prg @@ -122,23 +122,37 @@ FUNCTION ISWORKING( nPort ) RETURN nPort $ s_hPort /* NOTE: INCOMPATIBILITY. - In contratry to original HBCOMM, here must be passed by reference. + In contratry to original HBCOMM, here must be passed by reference. HBCOMM could corrupt HVM because of its buggy way of returning data. [vszakats] */ -/* Fetch chars into */ -FUNCTION INCHR( nPort, nCount, /* @ */ cString ) - cString := iif( ISNUMBER( nCount ), Space( nCount ), "" ) - RETURN hb_comRecv( nPort, @cString, nCount ) +/* Fetch chars into */ +FUNCTION INCHR( nPort, nCount, /* @ */ cData ) + cData := iif( ISNUMBER( nCount ), Space( nCount ), "" ) + RETURN hb_comRecv( nPort, @cData, nCount ) -/* Send out characters. Returns .t. if successful. */ -FUNCTION OUTCHR( nPort, cString ) - RETURN hb_comSend( nPort, cString ) == Len( cString ) +/* Send out characters. Returns .T. if successful. */ +FUNCTION OUTCHR( nPort, cData ) + LOCAL nLen + + DO WHILE Len( cData ) > 0 + + /* I expect at least some data to be sent in a second */ + nLen := hb_comSend( nPort, cData,, 1000 ) + + IF nLen <= 0 + RETURN .F. + ENDIF + + cData := SubStr( cData, nLen + 1 ) + ENDDO + + RETURN .T. /* Find out how many chars are in input buffer */ FUNCTION INBUFSIZE( nPort ) RETURN hb_comInputCount( nPort ) -/* Find out how many characters are in out buf? */ +/* Find out how many characters are in output buffer */ FUNCTION OUTBUFSIZE( nPort ) RETURN hb_comOutputCount( nPort ) diff --git a/harbour/harbour-wce-spec b/harbour/harbour-wce-spec index e5f460388b..075678fd0f 100644 --- a/harbour/harbour-wce-spec +++ b/harbour/harbour-wce-spec @@ -127,30 +127,16 @@ make install %{?_smp_mflags} # remove unused files rm -fR ${HB_BIN_INSTALL}/{harbour,hbpp,hbmk2,hbrun,hbi18n,hbtest}.exe -rm -fR ${HB_BIN_INSTALL}/{hb,%{hb_pref}}mk.cfg +rm -fR ${HB_BIN_INSTALL}/hbmk.cfg # Create a README file for people using this RPM. cat > doc/%{readme} < # output file name @@ -171,10 +157,6 @@ All these scripts accept command line switches: # exist the name of first public function/procedure # in first linked object module (link) -Link options work only with "%{hb_pref}lnk" and "%{hb_pref}mk" and have no effect -in "%{hb_pref}cc" and "%{hb_pref}cmp". -Other options are passed to Harbour/C compiler/linker. - An example compile/link session looks like: ---------------------------------------------------------------------- druzus@uran:~/tmp$ cat foo.prg @@ -182,35 +164,15 @@ function main() ? "Hello, World!" return nil -druzus@uran:~/tmp$ %{hb_pref}cmp foo -Harbour 1.0.0 Intl. (Rev. 9099) -Copyright (c) 1999-2008, http://harbour-project.org/ -Compiling 'foo.prg'... -Lines 5, Functions/Procedures 2 -Generating C source output to 'foo.c'... Done. - -druzus@uran:~/tmp$ %{hb_pref}lnk foo.o - -druzus@uran:~/tmp$ ls -l foo --rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo.exe ----------------------------------------------------------------------- - -or using %{hb_pref}mk only: ----------------------------------------------------------------------- -druzus@uran:~/tmp$ cat foo.prg -function main() -? "Hello, World!" -return nil - -druzus@uran:~/tmp$ %{hb_pref}mk foo -Harbour 1.0.0 Intl. (Rev. 9099) -Copyright (c) 1999-2008, http://harbour-project.org/ +druzus@uran:~/tmp$ hbmk2 foo +Harbour 2.1.0beta1 (Rev. 14701) +Copyright (c) 1999-2010, http://harbour-project.org/ Compiling 'foo.prg'... Lines 5, Functions/Procedures 2 Generating C source output to 'foo.c'... Done. druzus@uran:~/tmp$ ls -l foo --rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo.exe +-rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo ---------------------------------------------------------------------- I hope this RPM is useful. Have fun with Harbour. @@ -246,11 +208,7 @@ rm -fR $RPM_BUILD_ROOT %doc doc/%{readme} %{_bindir}/%{hb_pref}-mkdyn -%{_bindir}/%{hb_pref}-build -%{_bindir}/%{hb_pref}cc -%{_bindir}/%{hb_pref}cmp -%{_bindir}/%{hb_pref}lnk -%{_bindir}/%{hb_pref}mk +%{_bindir}/hbmk2 %defattr(644,root,root,755) %dir %{_includedir}/%{name} diff --git a/harbour/harbour-win-spec b/harbour/harbour-win-spec index fe56b902da..1285ecea5d 100644 --- a/harbour/harbour-win-spec +++ b/harbour/harbour-win-spec @@ -127,30 +127,16 @@ make install %{?_smp_mflags} # remove unused files rm -fR ${HB_BIN_INSTALL}/{harbour,hbpp,hbmk2,hbrun,hbi18n,hbtest}.exe -rm -fR ${HB_BIN_INSTALL}/{hb,%{hb_pref}}mk.cfg +rm -fR ${HB_BIN_INSTALL}/hbmk.cfg # Create a README file for people using this RPM. cat > doc/%{readme} < # output file name @@ -171,10 +157,6 @@ All these scripts accept command line switches: # exist the name of first public function/procedure # in first linked object module (link) -Link options work only with "%{hb_pref}lnk" and "%{hb_pref}mk" and have no effect -in "%{hb_pref}cc" and "%{hb_pref}cmp". -Other options are passed to Harbour/C compiler/linker. - An example compile/link session looks like: ---------------------------------------------------------------------- druzus@uran:~/tmp$ cat foo.prg @@ -182,35 +164,15 @@ function main() ? "Hello, World!" return nil -druzus@uran:~/tmp$ %{hb_pref}cmp foo -Harbour 1.0.0 Intl. (Rev. 9099) -Copyright (c) 1999-2008, http://harbour-project.org/ -Compiling 'foo.prg'... -Lines 5, Functions/Procedures 2 -Generating C source output to 'foo.c'... Done. - -druzus@uran:~/tmp$ %{hb_pref}lnk foo.o - -druzus@uran:~/tmp$ ls -l foo --rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo.exe ----------------------------------------------------------------------- - -or using %{hb_pref}mk only: ----------------------------------------------------------------------- -druzus@uran:~/tmp$ cat foo.prg -function main() -? "Hello, World!" -return nil - -druzus@uran:~/tmp$ %{hb_pref}mk foo -Harbour 1.0.0 Intl. (Rev. 9099) -Copyright (c) 1999-2008, http://harbour-project.org/ +druzus@uran:~/tmp$ hbmk2 foo +Harbour 2.1.0beta1 (Rev. 14701) +Copyright (c) 1999-2010, http://harbour-project.org/ Compiling 'foo.prg'... Lines 5, Functions/Procedures 2 Generating C source output to 'foo.c'... Done. druzus@uran:~/tmp$ ls -l foo --rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo.exe +-rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo ---------------------------------------------------------------------- I hope this RPM is useful. Have fun with Harbour. @@ -246,11 +208,7 @@ rm -fR $RPM_BUILD_ROOT %doc doc/%{readme} %{_bindir}/%{hb_pref}-mkdyn -%{_bindir}/%{hb_pref}-build -%{_bindir}/%{hb_pref}cc -%{_bindir}/%{hb_pref}cmp -%{_bindir}/%{hb_pref}lnk -%{_bindir}/%{hb_pref}mk +%{_bindir}/hbmk2 %defattr(644,root,root,755) %dir %{_includedir}/%{name} diff --git a/harbour/harbour.spec b/harbour/harbour.spec index 1591fd0e71..4079d6ab84 100644 --- a/harbour/harbour.spec +++ b/harbour/harbour.spec @@ -52,7 +52,6 @@ %define dname Harbour %define version 2.1.0 %define releasen beta1 -%define hb_pref hb %define hb_etcdir /etc/%{name} %define hb_plat export HB_PLATFORM=linux %define hb_cc export HB_COMPILER=gcc @@ -435,25 +434,11 @@ rm -f $HB_INST_PKGPREF$HB_BIN_INSTALL/hbtest # Create a README file for people using this RPM. cat > doc/%{readme} < # output file name @@ -474,10 +459,6 @@ All these scripts accept command line switches: # exist the name of first public function/procedure # in first linked object module (link) -Link options work only with "%{hb_pref}lnk" and "%{hb_pref}mk" and have no effect -in "%{hb_pref}cc" and "%{hb_pref}cmp". -Other options are passed to %{dname}/C compiler/linker. - An example compile/link session looks like: ---------------------------------------------------------------------- druzus@uran:~/tmp$ cat foo.prg @@ -485,31 +466,9 @@ function main() ? "Hello, World!" return nil -druzus@uran:~/tmp$ %{hb_pref}cmp foo -Harbour 1.0.0 Intl. (Rev. 9099) -Copyright (c) 1999-2008, http://harbour-project.org/ -Compiling 'foo.prg'... -Lines 5, Functions/Procedures 2 -Generating C source output to 'foo.c'... Done. - -druzus@uran:~/tmp$ %{hb_pref}lnk foo.o - -druzus@uran:~/tmp$ strip foo - -druzus@uran:~/tmp$ ls -l foo --rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo ----------------------------------------------------------------------- - -or using %{hb_pref}mk only: ----------------------------------------------------------------------- -druzus@uran:~/tmp$ cat foo.prg -function main() -? "Hello, World!" -return nil - -druzus@uran:~/tmp$ %{hb_pref}mk foo -Harbour 1.0.0 Intl. (Rev. 9099) -Copyright (c) 1999-2008, http://harbour-project.org/ +druzus@uran:~/tmp$ hbmk2 foo +Harbour 2.1.0beta1 (Rev. 14701) +Copyright (c) 1999-2010, http://harbour-project.org/ Compiling 'foo.prg'... Lines 5, Functions/Procedures 2 Generating C source output to 'foo.c'... Done. @@ -518,7 +477,6 @@ druzus@uran:~/tmp$ ls -l foo -rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo ---------------------------------------------------------------------- - In this RPM you will find additional wonderful tools: /usr/bin/hbrun You can run clipper/xbase compatible source files with it if you only put in their first line: @@ -581,11 +539,6 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/harbour %{_bindir}/hbpp %{_bindir}/hb-mkdyn -%{_bindir}/%{hb_pref}-build -%{_bindir}/%{hb_pref}cc -%{_bindir}/%{hb_pref}cmp -%{_bindir}/%{hb_pref}lnk -%{_bindir}/%{hb_pref}mk #%{_bindir}/hbtest %{_bindir}/hbrun %{_bindir}/hbi18n @@ -748,7 +701,7 @@ rm -rf $RPM_BUILD_ROOT - 0.82 version set * Wed Apr 30 2003 Przemyslaw Czerpak -- new tool "%{hb_pref}-build" (%{hb_pref}cmp, %{hb_pref}lnk, %{hb_pref}mk) added - +- new tool "hb-build" (hbcmp, hblnk, hbmk) added - compiler/linker wrapper. - new tool "hb-mkdyn" (build shared libraries from static ones and object files).