From cdf2d3ced6d573d473b732e27200689ea7da54a3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 18 Sep 2009 10:35:17 +0000 Subject: [PATCH] 2009-09-18 12:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * ChangeLog ! Typos. * source/rtl/hbsocket.c ! Applied patch for BEOS/HAIKU by Tamas Tevesz. * contrib/hbtip/sendmail.prg ! Fixed to append CRLF instead of hb_osNewLine() to e-mail body. Patch submitted by Lorenzo Fiorini. NOTE: This fix is surely valid, I'll apply further fixes as we manage to find out more on the bigger picture. * contrib/hbtip/mail.prg ! Applied a few patches from mail.prg sent by Gerald Drouillard: - Using :setBody() from :New() instead of replicating (little bit different) logic. - "Content-Length" deleted from generated e-mail text. - Added parameter list to METHOD declaration for :setHeader(). * Minor formatting. * config/beos/libs.mk + Applied patch from Tamas Tevesz changing 'socket' lib to 'network' for BEOS/HAIKU. * utils/hbmk2/hbmk2.prg + Done the same for hbmk2 (changed 'socket' lib to 'network' for BEOS/HAIKU). * config/detfun.mk + Changed to avoid duplicate component detection lines in verbose output. (_DET_OPT_VERB=very|yes - not yet documented) (note this needs absolute paths to be used when referring to internal components in _DET_INC_DEFP/_DET_INC_LOCL) * external/sqlite3/Makefile * external/libhpdf/Makefile * external/libpng/Makefile * contrib/hbsqlit3/Makefile * contrib/hbhpdf/Makefile + Changed to use absolute paths when referring to locally hosted components in _DET_INC_LOCL variables. --- harbour/ChangeLog | 47 ++++++++++++++++++++++++++++-- harbour/config/beos/libs.mk | 2 +- harbour/config/detfun.mk | 5 ++++ harbour/contrib/hbhpdf/Makefile | 3 +- harbour/contrib/hbsqlit3/Makefile | 2 +- harbour/contrib/hbtip/mail.prg | 16 ++++------ harbour/contrib/hbtip/sendmail.prg | 4 +-- harbour/external/libhpdf/Makefile | 4 +-- harbour/external/libpng/Makefile | 2 +- harbour/external/sqlite3/Makefile | 2 +- harbour/source/rtl/hbsocket.c | 4 +++ harbour/utils/hbmk2/hbmk2.prg | 2 +- 12 files changed, 69 insertions(+), 24 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b6bb6986ff..b095fc1b43 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,47 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-18 12:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * ChangeLog + ! Typos. + + * source/rtl/hbsocket.c + ! Applied patch for BEOS/HAIKU by Tamas Tevesz. + + * contrib/hbtip/sendmail.prg + ! Fixed to append CRLF instead of hb_osNewLine() to e-mail body. + Patch submitted by Lorenzo Fiorini. + NOTE: This fix is surely valid, I'll apply further fixes as we + manage to find out more on the bigger picture. + + * contrib/hbtip/mail.prg + ! Applied a few patches from mail.prg sent by Gerald Drouillard: + - Using :setBody() from :New() instead of replicating (little bit + different) logic. + - "Content-Length" deleted from generated e-mail text. + - Added parameter list to METHOD declaration for :setHeader(). + * Minor formatting. + + * config/beos/libs.mk + + Applied patch from Tamas Tevesz changing 'socket' lib to 'network' for BEOS/HAIKU. + + * utils/hbmk2/hbmk2.prg + + Done the same for hbmk2 (changed 'socket' lib to 'network' for BEOS/HAIKU). + + * config/detfun.mk + + Changed to avoid duplicate component detection lines in verbose output. + (_DET_OPT_VERB=very|yes - not yet documented) + (note this needs absolute paths to be used when referring to internal + components in _DET_INC_DEFP/_DET_INC_LOCL) + + * external/sqlite3/Makefile + * external/libhpdf/Makefile + * external/libpng/Makefile + * contrib/hbsqlit3/Makefile + * contrib/hbhpdf/Makefile + + Changed to use absolute paths when referring to locally hosted components + in _DET_INC_LOCL variables. + 2009-09-18 12:05 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/hb-func.sh * updated hb* scripts to work modified bast build conditions @@ -171,7 +212,7 @@ * package/winuni/mpkg_win_uni.bat * package/winuni/mpkg_win_uni.nsi + Replaced ERRATA file (which was never updated), with a link - to bug/feature/etc tracker link in INSTALL. + to bug/feature/etc tracker in INSTALL. * INSTALL * Minor improvements. @@ -274,7 +315,7 @@ can be specified in the same format as in the cmdline. This is the supported and recommended way to control hbmk2 by envvar. - + Documented HBMK_OPTION on help screen. + + Documented HBMK_OPTIONS on help screen. % Cleaned internal handling of 'legacy' environment variables. This means they will be processed in one central place and converted to regular cmdline options @@ -321,7 +362,7 @@ * contrib/hbtip/sendmail.prg ! Fixed hang experienced in some situations when sending e-mail. This was reported on Linux, but was also present - on Windows (and all OSes). It was cause by not checking + on Windows (and all OSes). It was caused by not checking :GetOk() return value, but looking for :cReply being NIL. This seems to be incorrectly coded since the very beginning, but surfaced only after cleaning up socket API in core. diff --git a/harbour/config/beos/libs.mk b/harbour/config/beos/libs.mk index 3ab28697f0..7178433769 100644 --- a/harbour/config/beos/libs.mk +++ b/harbour/config/beos/libs.mk @@ -26,5 +26,5 @@ ifneq ($(HB_LINKING_RTL),) ifeq ($(HB_HAS_ZLIB_LOCAL),) SYSLIBS += z endif - SYSLIBS += root socket + SYSLIBS += root network endif diff --git a/harbour/config/detfun.mk b/harbour/config/detfun.mk index f5d32ce525..016d9853e3 100644 --- a/harbour/config/detfun.mk +++ b/harbour/config/detfun.mk @@ -18,7 +18,9 @@ # _DET_FLT_PLAT - positive and negative platform filters. Prefix negative ones with '!' char. # _DET_FLT_COMP - positive and negative compiler filters. Prefix negative ones with '!' char. # _DET_INC_DEFP - default location to look at. Not effective in 'HB_BUILD_EXTDEF=no' mode. +# (you must use absolute paths only.) # _DET_INC_LOCL - embedded location to look at. +# (you must use absolute paths only.) # _DET_INC_HEAD - header filename to look for. Unless looking for a directory, prefix with forward slash. # - variable name specified by _DET_VAR_INC_ (typically "HB_INC_*") containing: # (empty) or yes - will enable external component if found on default locations. @@ -135,6 +137,9 @@ ifeq ($($(_DET_VAR_HAS_)),) endif endif +export $(_DET_VAR_HAS_) +export $(_DET_VAR_HAS_)_LOCAL + _DET_DSP_NAME := _DET_VAR_INC_ := _DET_VAR_HAS_ := diff --git a/harbour/contrib/hbhpdf/Makefile b/harbour/contrib/hbhpdf/Makefile index 9be317a7f2..1e4a7a1fd8 100644 --- a/harbour/contrib/hbhpdf/Makefile +++ b/harbour/contrib/hbhpdf/Makefile @@ -20,7 +20,7 @@ _DET_VAR_HAS_ := HB_HAS_LIBHARU _DET_FLT_PLAT := _DET_FLT_COMP := _DET_INC_DEFP := /usr/include /usr/local/include -_DET_INC_LOCL := $(TOP)$(ROOT)external/libhpdf +_DET_INC_LOCL := $(realpath $(TOP)$(ROOT)external/libhpdf) _DET_INC_HEAD := /hpdf.h include $(TOP)$(ROOT)config/detfun.mk @@ -30,7 +30,6 @@ ifneq ($(HB_HAS_LIBHARU),) include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk - else HB_SKIP_REASON := $(_DET_RES_TEXT) include $(TOP)$(ROOT)config/none.mk diff --git a/harbour/contrib/hbsqlit3/Makefile b/harbour/contrib/hbsqlit3/Makefile index 3a3ad7d3fc..c0e8794eab 100644 --- a/harbour/contrib/hbsqlit3/Makefile +++ b/harbour/contrib/hbsqlit3/Makefile @@ -20,7 +20,7 @@ _DET_VAR_HAS_ := HB_HAS_SQLITE3 _DET_FLT_PLAT := _DET_FLT_COMP := _DET_INC_DEFP := /usr/include /boot/common/include -_DET_INC_LOCL := $(TOP)$(ROOT)external/sqlite3 +_DET_INC_LOCL := $(realpath $(TOP)$(ROOT)external/sqlite3) _DET_INC_HEAD := /sqlite3.h include $(TOP)$(ROOT)config/detfun.mk diff --git a/harbour/contrib/hbtip/mail.prg b/harbour/contrib/hbtip/mail.prg index 26689ba402..8eff52a5a5 100644 --- a/harbour/contrib/hbtip/mail.prg +++ b/harbour/contrib/hbtip/mail.prg @@ -102,7 +102,7 @@ CREATE CLASS TipMail METHOD isMultiPart() METHOD getMultiParts() - METHOD setHeader + METHOD setHeader( cSubject, cFrom, cTo, cCC, cBCC ) METHOD attachFile( cFileName ) METHOD detachFile( cPath ) METHOD getFileName() @@ -110,7 +110,7 @@ CREATE CLASS TipMail HIDDEN: VAR cBody - VAR lBodyEncoded init .F. + VAR lBodyEncoded INIT .F. VAR oEncoder VAR aAttachments VAR nAttachPos INIT 1 @@ -128,13 +128,7 @@ METHOD New( cBody, oEncoder ) CLASS TipMail ENDIF IF cBody != NIL - IF ::oEncoder != NIL - ::cBody := ::oEncoder:Encode( cBody ) - ::hHeaders[ "Content-Transfer-Encoding" ] := ::oEncoder:cName - ELSE - ::cBody := cBody - ENDIF - ::hHeaders[ "Content-Length" ] := hb_ntos( Len( ::cBody ) ) + ::setBody( cBody ) ENDIF RETURN Self @@ -151,11 +145,13 @@ METHOD SetEncoder( cEnc ) CLASS TipMail METHOD SetBody( cBody ) CLASS TipMail IF ::oEncoder != NIL ::cBody := ::oEncoder:Encode( cBody ) + ::hHeaders[ "Content-Transfer-Encoding" ] := ::oEncoder:cName ::lBodyEncoded := .T. //GD needed to prevent an extra crlf from being appended ELSE ::cBody := cBody ENDIF - ::hHeaders[ "Content-Length" ] := hb_ntos( Len( cBody ) ) + // not needed + // ::hHeaders[ "Content-Length" ] := hb_ntos( Len( cBody ) ) RETURN .T. METHOD GetBody() CLASS TipMail diff --git a/harbour/contrib/hbtip/sendmail.prg b/harbour/contrib/hbtip/sendmail.prg index 86b828a18f..d388a2196d 100644 --- a/harbour/contrib/hbtip/sendmail.prg +++ b/harbour/contrib/hbtip/sendmail.prg @@ -139,8 +139,8 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, cBody, cSubject, aF IF !( ( ".htm" $ Lower( cBody ) .OR. ".html" $ Lower( cBody ) ) .AND. hb_FileExists( cBody ) ) - IF !( Right( cBody, 2 ) == hb_osNewLine() ) - cBody += hb_osNewLine() + IF !( Right( cBody, 2 ) == Chr( 13 ) + Chr( 10 ) ) + cBody += Chr( 13 ) + Chr( 10 ) ENDIF ENDIF diff --git a/harbour/external/libhpdf/Makefile b/harbour/external/libhpdf/Makefile index ac4cd62ebb..7b4ed847ca 100644 --- a/harbour/external/libhpdf/Makefile +++ b/harbour/external/libhpdf/Makefile @@ -88,7 +88,7 @@ ifeq ($(HB_SUPPORTED),yes) _DET_FLT_PLAT := _DET_FLT_COMP := _DET_INC_DEFP := /usr/include /usr/local/include - _DET_INC_LOCL := $(TOP)$(ROOT)external/libhpdf + _DET_INC_LOCL := $(realpath $(TOP)$(ROOT)external/libhpdf) _DET_INC_HEAD := /hpdf.h include $(TOP)$(ROOT)config/detfun.mk @@ -100,7 +100,7 @@ ifeq ($(HB_SUPPORTED),yes) _DET_FLT_PLAT := _DET_FLT_COMP := _DET_INC_DEFP := /usr/include /opt/local/include - _DET_INC_LOCL := $(TOP)$(ROOT)external/libpng + _DET_INC_LOCL := $(realpath $(TOP)$(ROOT)external/libpng) _DET_INC_HEAD := /png.h include $(TOP)$(ROOT)config/detfun.mk diff --git a/harbour/external/libpng/Makefile b/harbour/external/libpng/Makefile index fb7ff6dcc7..85cb59fcaa 100644 --- a/harbour/external/libpng/Makefile +++ b/harbour/external/libpng/Makefile @@ -46,7 +46,7 @@ ifeq ($(HB_SUPPORTED),yes) _DET_FLT_PLAT := _DET_FLT_COMP := _DET_INC_DEFP := /usr/include /boot/develop/headers/3rdparty - _DET_INC_LOCL := $(TOP)$(ROOT)external/libpng + _DET_INC_LOCL := $(realpath $(TOP)$(ROOT)external/libpng) _DET_INC_HEAD := /png.h include $(TOP)$(ROOT)config/detfun.mk diff --git a/harbour/external/sqlite3/Makefile b/harbour/external/sqlite3/Makefile index 4dd22a1861..ab8c85e627 100644 --- a/harbour/external/sqlite3/Makefile +++ b/harbour/external/sqlite3/Makefile @@ -41,7 +41,7 @@ ifeq ($(HB_SUPPORTED),yes) _DET_FLT_PLAT := _DET_FLT_COMP := _DET_INC_DEFP := /usr/include - _DET_INC_LOCL := $(TOP)$(ROOT)external/sqlite3 + _DET_INC_LOCL := $(realpath $(TOP)$(ROOT)external/sqlite3) _DET_INC_HEAD := /sqlite3.h include $(TOP)$(ROOT)config/detfun.mk diff --git a/harbour/source/rtl/hbsocket.c b/harbour/source/rtl/hbsocket.c index 9277f86a39..43aa32f1ff 100644 --- a/harbour/source/rtl/hbsocket.c +++ b/harbour/source/rtl/hbsocket.c @@ -58,6 +58,10 @@ # endif #endif +#if defined( HB_OS_BEOS ) +# define HB_SOCKET_TRANSLATE_TYPE +#endif + #if !defined( HB_SOCKET_OFF ) /* we do not use autoconf so we can only guess what is supported diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 7b21d501bd..2f621eeea8 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2225,7 +2225,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) CASE hbmk[ _HBMK_cPLAT ] == "beos" AAdd( hbmk[ _HBMK_aLIBPATH ], "/system/lib" ) AAdd( l_aLIBSYS, "root" ) - AAdd( l_aLIBSYS, "socket" ) + AAdd( l_aLIBSYS, "network" ) ENDCASE IF ! Empty( cLIB_BASE_PCRE ) .AND. ! hb_FileExists( DirAddPathSep( l_cHB_LIB_INSTALL ) + hb_osPathSeparator() + cLibLibPrefix + cLIB_BASE_PCRE + cLibLibExt )