2007-06-01 13:00 UTC+0200 Lorenzo Fiorini (lorenzo.fiorini/at/gmail.com)

* harbour/make_gnu.sh
    * updated msgs
  * harbour/pach_src.sh
    * added contrib/gd
  * harbour/make_rpm.sh
  * harbour/harbour.spec
    * added support for --with gd, --with pgsql, --with pgsql4 and --without tip
  * contrib/tip/cgi.prg
    * added lDumpHtml to create a dump of the html useful for syntax check
	 * added support for "var" and "src" in both scripts and styles
  * contrib/pgsql/tpostgre.prg
  	 * added ::Read() method to use in forward only loop
	 * instead of while !::eof() ... ::skip()
    * several optimizations now in a typical loop it is 30% faster
	 * !!! now char fields are not sized to len !!!
This commit is contained in:
Lorenzo Fiorini
2007-06-01 11:00:01 +00:00
parent 6a1642a388
commit bbde486ff1
7 changed files with 520 additions and 434 deletions

View File

@@ -8,6 +8,23 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-06-01 13:00 UTC+0200 Lorenzo Fiorini (lorenzo.fiorini/at/gmail.com)
* harbour/make_gnu.sh
* updated msgs
* harbour/pach_src.sh
* added contrib/gd
* harbour/make_rpm.sh
* harbour/harbour.spec
* added support for --with gd, --with pgsql, --with pgsql4 and --without tip
* contrib/tip/cgi.prg
* added lDumpHtml to create a dump of the html useful for syntax check
* added support for "var" and "src" in both scripts and styles
* contrib/pgsql/tpostgre.prg
* added ::Read() method to use in forward only loop
* instead of while !::eof() ... ::skip()
* several optimizations now in a typical loop it is 30% faster
* !!! now char fields are not sized to len !!!
2007-06-01 02:08 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* harbour/bin/bld.sh
! Updated list of libs for linux/gcc.

View File

@@ -331,7 +331,7 @@ $hb_collect contrib/dot/*.txt
# CONTRIB\TIP
$hb_collect contrib/tip/Makefile
$hb_collect contrib/tip/Changelog
$hb_collect contrib/tip/Change[Ll]og*
$hb_collect contrib/tip/*.[ch]
$hb_collect contrib/tip/*.prg
$hb_collect contrib/tip/*.ch
@@ -346,7 +346,7 @@ $hb_collect contrib/odbc/*.txt
# CONTRIB\PGSQL
$hb_collect contrib/pgsql/[mM]akefile*
$hb_collect contrib/pgsql/Changelog
$hb_collect contrib/pgsql/Change[Ll]og*
$hb_collect contrib/pgsql/README
$hb_collect contrib/pgsql/*.[ch]
$hb_collect contrib/pgsql/*.ch
@@ -354,6 +354,17 @@ $hb_collect contrib/pgsql/*.prg
$hb_collect contrib/pgsql/*.txt
$hb_collect contrib/pgsql/*.bat
# CONTRIB\GD
$hb_collect contrib/gd/[mM]akefile*
$hb_collect contrib/gd/Change[Ll]og*
$hb_collect contrib/gd/README
$hb_collect contrib/gd/*.[ch]
$hb_collect contrib/gd/include/*.[ch]
$hb_collect contrib/gd/*.ch
$hb_collect contrib/gd/*.prg
$hb_collect contrib/gd/*.txt
$hb_collect contrib/gd/*.bat
# CONTRIB\MYSQL
$hb_collect contrib/mysql/[mM]akefile*
$hb_collect contrib/mysql/*.[ch]

File diff suppressed because it is too large Load Diff

View File

@@ -88,6 +88,8 @@ CLASS TIpCgi
DATA bSavedErrHandler
DATA cSessionSavePath
DATA cSID
DATA cDumpSavePath
DATA lDumpHtml INIT FALSE
METHOD New()
METHOD Header( hOptions )
@@ -220,6 +222,16 @@ METHOD Flush() CLASS TIpCgi
lRet := ( Fwrite( CGI_OUT, cStream, nLen ) == nLen )
if ::lDumpHtml
if empty( ::cDumpSavePath )
::cDumpSavePath := "/tmp/"
endif
if ( nH := FCreate( ::cDumpSavePath + "dump.html", FC_NORMAL ) ) != -1
Fwrite( nH, ::cHtmlPage, len( ::cHtmlPage ) )
endif
fclose( nH )
endif
::cCgiHeader := ''
::cHtmlPage := ''
@@ -309,7 +321,7 @@ METHOD StartHtml( hOptions ) CLASS TIpCgi
'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' + _CRLF + ;
'<html xmlns="http://www.w3.org/1999/xhtml">' + ;
'<head>' + ;
HtmlTag( hOptions, 'title' ) + ;
HtmlTag( hOptions, 'title', 'title' ) + ;
HtmlScript( hOptions ) + ;
HtmlStyle( hOptions ) + ;
'</head>' + ;
@@ -332,7 +344,7 @@ METHOD StartFrameSet( hOptions ) CLASS TIpCgi
'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' + _CRLF + ;
'<html xmlns="http://www.w3.org/1999/xhtml">' + ;
'<head>' + ;
HtmlTag( hOptions, 'title' ) + ;
HtmlTag( hOptions, 'title', 'title' ) + ;
HtmlScript( hOptions ) + ;
HtmlStyle( hOptions ) + ;
'</head>' + ;
@@ -438,20 +450,27 @@ METHOD SessionDecode( cData ) CLASS TIpCgi
RETURN Valtype( ::hSession ) == "H"
STATIC FUNCTION HtmlTag( xVal, cKey )
STATIC FUNCTION HtmlTag( xVal, cKey, cDefault )
local cVal := ''
if !empty( xVal )
if empty( cKey )
cVal := xVal
elseif hHasKey( xVal, cKey )
DEFAULT cDefault TO ''
if !empty( xVal ) .and. !empty( cKey )
if hHasKey( xVal, cKey )
cVal := hGet( xVal, cKey )
cVal := '<' + cKey + '>' + cVal + '</' + cKey + '>'
hDel( xVal, cKey )
endif
endif
if cVal == ''
cVal := cDefault
endif
if '' != cVal
cVal := '<' + cKey + '>' + cVal + '</' + cKey + '>'
endif
return cVal
STATIC FUNCTION HtmlAllTag( hTags, cSep )
@@ -460,7 +479,7 @@ STATIC FUNCTION HtmlAllTag( hTags, cSep )
DEFAULT cSep TO ' '
hEval( hTags, { |k,v,p| cVal += HtmlTag( hTags, k, v, p ) + cSep } )
hEval( hTags, { |k| cVal += HtmlTag( hTags, k ) + cSep } )
return cVal
@@ -506,13 +525,15 @@ STATIC FUNCTION HtmlValue( xVal, cKey, cDefault )
DEFAULT cDefault TO ''
if empty( xVal )
if !empty( xVal ) .and. !empty( cKey )
if hHasKey( xVal, cKey )
cVal := hGet( xVal, cKey )
hDel( xVal, cKey )
endif
endif
if cVal == ''
cVal := cDefault
elseif empty( cKey )
cVal := xVal
elseif hHasKey( xVal, cKey )
cVal := hGet( xVal, cKey )
hDel( xVal, cKey )
endif
return cVal
@@ -540,23 +561,29 @@ STATIC FUNCTION HtmlScript( xVal, cKey )
if !empty( xVal )
if ( nPos := hGetPos( xVal, cKey ) ) != 0
cVal := hGetValueAt( xVal, nPos )
if valtype( cVal ) == "C"
cVal := '<script type="text/javascript">' + _CRLF +;
'<!--' + _CRLF +;
cVal + _CRLF +;
'-->' + _CRLF +;
'</script>'
elseif valtype( cVal ) == "H"
if valtype( cVal ) == "H"
if ( nPos := hGetPos( cVal, 'src' ) ) != 0
cVal := hGetValueAt( cVal, nPos )
if valtype( cVal ) == "C"
cVal := '<script src="' + cVal + '" type="text/javascript">' + _CRLF
elseif valtype( cVal ) == "A"
cVal := { cVal }
endif
if valtype( cVal ) == "A"
cTmp := ''
ascan( cVal, { |cFile| cTmp += '<script src="' + cFile + '" type="text/javascript">' + _CRLF } )
cVal := cTmp
endif
endif
if ( nPos := hGetPos( cVal, 'var' ) ) != 0
cVal := hGetValueAt( cVal, nPos )
if valtype( cVal ) == "C"
cVal := { cVal }
endif
if valtype( cVal ) == "A"
cTmp := ''
ascan( cVal, { |cVar| cTmp += cVar } )
cVal := '<script type="text/javascript">' + _CRLF + '<!--' + _CRLF + cTmp + _CRLF + '-->' + _CRLF + '</script>' + _CRLF
endif
endif
endif
hDel( xVal, cKey )
endif
@@ -575,26 +602,34 @@ STATIC FUNCTION HtmlStyle( xVal, cKey )
if !empty( xVal )
if ( nPos := hGetPos( xVal, cKey ) ) != 0
cVal := hGetValueAt( xVal, nPos )
if valtype( cVal ) == "C"
cVal := '<style type="text/css">' + _CRLF +;
cVal + _CRLF +;
'</style>'
elseif valtype( cVal ) == "H"
if valtype( cVal ) == "H"
if ( nPos := hGetPos( cVal, 'src' ) ) != 0
cVal := hGetValueAt( cVal, nPos )
if valtype( cVal ) == "C"
cVal := '<link rel="StyleSheet" href="' + cVal + '" type="text/css" />'
elseif valtype( cVal ) == "A"
cVal := { cVal }
endif
if valtype( cVal ) == "A"
cTmp := ''
ascan( cVal, { |cFile| cTmp += '<link rel="StyleSheet" href="' + cFile + '" type="text/css" />' + _CRLF } )
cVal := cTmp
endif
endif
if ( nPos := hGetPos( cVal, 'var' ) ) != 0
cVal := hGetValueAt( cVal, nPos )
if valtype( cVal ) == "C"
cVal := { cVal }
endif
if valtype( cVal ) == "A"
cTmp := ''
ascan( cVal, { |cVar| cTmp += cVar } )
cVal := '<style type="text/css">' + _CRLF + '<!--' + _CRLF + cTmp + _CRLF + '-->' + _CRLF + '</style>' + _CRLF
endif
endif
endif
hDel( xVal, cKey )
endif
endif
return cVal
STATIC FUNCTION GenerateSID( cCRCKey )

View File

@@ -14,14 +14,18 @@
# Conditional build:
# --with static - link all binaries with static libs
# --with mysql - build mysql lib (unused)
# --with pgsql - build pgsql lib (unused)
# --with odbc - build build odbc lib
# --with pgsql - build pgsql lib
# --with pgsql4 - build pgsql4 lib
# --with gd - build gd lib
# --with tip - build tip lib
# --with odbc - build odbc lib
# --without adsrdd - do not build ADS RDD
# --without gpl - do not build libs which needs GPL 3-rd party code
# --without nf - do not build nanforum lib
# --without x11 - do not build GTXVT and GTXWC (unused)
# --without gpm - build GTSLN and GTCRS without GPM support
# --without gtsln - do not build GTSLN
# --without tip - do not build tip lib
######################################################################
######################################################################
@@ -64,10 +68,11 @@
%define hb_pref hb
%define hb_arch export HB_ARCHITECTURE=linux
%define hb_cc export HB_COMPILER=gcc
%define hb_cflag export C_USR="-DHB_FM_STATISTICS_OFF -O3"
%define hb_cflag export C_USR="${C_USR}"
%define hb_lflag export L_USR="${CC_L_USR} %{?_with_static:-static}"
%define hb_mt export HB_MT=no
%define hb_gt export HB_GT_LIB=gtcrs
%define hb_defgt export HB_GT_DEFAULT="${HB_GT_DEFAULT}"
%define hb_gpm export HB_GPM_MOUSE=%{!?_without_gpm:yes}
%define hb_sln export HB_WITHOUT_GTSLN=%{?_without_gtsln:yes}
%define hb_x11 export HB_WITHOUT_X11=%{?_without_x11:yes}
@@ -76,7 +81,7 @@
%define hb_ldir export HB_LIB_INSTALL=%{_libdir}/%{name}
%define hb_opt export HB_GTALLEG=%{?_with_allegro:yes}
%define hb_cmrc export HB_COMMERCE=%{?_without_gpl:yes}
%define hb_env %{hb_arch} ; %{hb_cc} ; %{hb_cflag} ; %{hb_lflag} ; %{hb_mt} ; %{hb_gt} ; %{hb_gpm} ; %{hb_sln} ; %{hb_x11} ; %{hb_bdir} ; %{hb_idir} ; %{hb_ldir} ; %{hb_opt} ; %{hb_cmrc}
%define hb_env %{hb_arch} ; %{hb_cc} ; %{hb_cflag} ; %{hb_lflag} ; %{hb_mt} ; %{hb_gt} ; %{hb_defgt} ; %{hb_gpm} ; %{hb_sln} ; %{hb_x11} ; %{hb_bdir} ; %{hb_idir} ; %{hb_ldir} ; %{hb_opt} ; %{hb_cmrc}
%define hb_host www.harbour-project.org
%define readme README.RPM
@@ -321,6 +326,7 @@ mkdir -p $HB_LIB_INSTALL
make -r -i install
[ "%{?_without_gtsln:1}" ] && rm -f $HB_LIB_INSTALL/libgtsln.a
[ "%{?_without_tip:1}" ] && rm -f $HB_LIB_INSTALL/libtip.a
[ "%{?_with_odbc:1}" ] || rm -f $HB_LIB_INSTALL/libhbodbc.a
[ "%{?_with_allegro:1}" ] || rm -f $HB_LIB_INSTALL/libgtalleg.a
@@ -333,14 +339,14 @@ mkdir -p $RPM_BUILD_ROOT/etc/harbour
install -m644 source/rtl/gtcrs/hb-charmap.def $RPM_BUILD_ROOT/etc/harbour/hb-charmap.def
cat > $RPM_BUILD_ROOT/etc/harbour.cfg <<EOF
CC=gcc
CFLAGS=-c -I$_DEFAULT_INC_DIR -O2
CFLAGS=-c -I$_DEFAULT_INC_DIR -O3
VERBOSE=YES
DELTMP=YES
EOF
# Create PP
pushd contrib/dot
$HB_BIN_INSTALL/%{hb_pref}mk pp -n -w -D_DEFAULT_INC_DIR=\"$_DEFAULT_INC_DIR\"
$HB_BIN_INSTALL/%{hb_pref}mk pp -n -w %{?_with_pgsql:-lpq} %{?_with_gd:-lgd} -D_DEFAULT_INC_DIR=\"$_DEFAULT_INC_DIR\"
install -m755 -s pp $HB_BIN_INSTALL/pp
ln -s pp $HB_BIN_INSTALL/pprun
install -m644 rp_dot.ch $HB_INC_INSTALL/
@@ -350,7 +356,7 @@ popd
if [ "%{!?_with_static:1}" ]
then
unset HB_GTALLEG
export L_USR="${CC_L_USR} -L${HB_LIB_INSTALL} -l%{name} -lncurses %{!?_without_gtsln:-lslang} %{!?_without_gpm:-lgpm} %{!?_without_x11:-L/usr/X11R6/%{_lib} -lX11}"
export L_USR="${CC_L_USR} -L${HB_LIB_INSTALL} -l%{name} -lncurses %{!?_without_gtsln:-lslang} %{!?_without_gpm:-lgpm} %{!?_without_x11:-L/usr/X11R6/%{_lib} -lX11} %{?_with_pgsql4:/usr/lib/libpq.so.4} %{?_with_pgsql:-lpq} %{?_with_gd:-lgd}"
export PRG_USR="\"-D_DEFAULT_INC_DIR='${_DEFAULT_INC_DIR}'\" ${PRG_USR}"
for utl in hbmake hbrun hbpp hbdoc
@@ -562,9 +568,12 @@ rm -rf $RPM_BUILD_ROOT
%{?_with_odbc: %{_libdir}/%{name}/libhbodbc.a}
%{!?_without_nf: %{_libdir}/%{name}/libnf*.a}
%{!?_without_adsrdd: %{_libdir}/%{name}/librddads*.a}
#%{?_with_mysql: %{_libdir}/%{name}/libmysql*.a}
#%{?_with_pgsql: %{_libdir}/%{name}/libpgsql*.a}
#%{_libdir}/%{name}/libtip.a
%{?_with_mysql: %{_libdir}/%{name}/libmysql*.a}
%{?_with_pgsql: %{_libdir}/%{name}/libhbpg*.a}
%{?_with_pgsql4: %{_libdir}/%{name}/libhbpg*.a}
%{?_with_gd: %{_libdir}/%{name}/libhbgd*.a}
%{!?_without_tip: %{_libdir}/%{name}/libtip.a}
%{_libdir}/%{name}/libhbbtree.a
%{_libdir}/%{name}/libhtml.a
%{_libdir}/%{name}/libmisc.a

View File

@@ -168,11 +168,12 @@ if [ -z "$HB_ARCHITECTURE" ] || [ -z "$HB_COMPILER" ]; then
echo " - gtwvt (Win32 win console) (for w32 architecture)"
echo " - gtos2 (OS/2 console) (for os2 architecture)"
echo " - gtpca (PC ANSI console) (for all architectures)"
echo " - gtcrs (Curses console) (for linux, w32 architectures)"
echo " - gtsln (Slang console) (for linux, w32 architectures)"
echo " - gtcrs (Curses console) (for *nixes, w32 architectures)"
echo " - gtsln (Slang console) (for *nixes, w32 architectures)"
echo " - gtxwc (XWindow console) (for *nixes architecture)"
echo
echo " - Use these optional envvars to configure the make process"
echo " when using the 'all' command:"
echo " when using the 'all' target:"
echo
echo " PRG_USR - Extra Harbour compiler options"
echo " C_USR - Extra C compiler options"

View File

@@ -15,14 +15,16 @@
# --with static - link all binaries with static libs
# --with mysql - build mysql lib
# --with pgsql - build pgsql lib
# --with odbc - build build odbc lib
# --with gd - build gd lib
# --with odbc - build odbc lib
# --with allegro - build GTALLEG - Allegro based GT driver
# --without adsrdd - do not build ADS RDD
# --without gpl - do not build libs which needs GPL 3-rd party code
# --without nf - do not build nanforum lib
# --without x11 - do not build GTXVT and GTXWC
# --without x11 - do not build GTXWC
# --without gpm - build GTSLN and GTCRS without GPM support
# --without gtsln - do not build GTSLN
# --without tip - do not build tip lib
######################################################################
test_reqrpm()
@@ -93,6 +95,10 @@ if test_reqrpm "postgresql-devel"
then
INST_PARAM="${INST_PARAM} --with pgsql"
fi
if test_reqrpm "gd-devel"
then
INST_PARAM="${INST_PARAM} --with gd"
fi
if test_reqrpm "unixodbc-devel" || test_reqrpm "unixODBC-devel"
then
INST_PARAM="${INST_PARAM} --with odbc"
@@ -113,7 +119,9 @@ if ! test_reqrpm "XFree86-devel"
then
INST_PARAM="${INST_PARAM} --without X11"
fi
if [ "${C_USR//-DHB_COMPAT_XHB/}" = "${C_USR}" ]; then
INST_PARAM="${INST_PARAM} --without tip"
fi
TOINST_LST=""
for i in ${NEED_RPM}