[Gambas-user] Zlib and BZlib
Daniel Campos
danielcampos at ...282...
Sun Feb 22 19:42:16 CET 2004
Hi all!
These are the final versions of Zlib and BZLib components,
that allows to compress data using zlib and bzlib2 libraries.
I've implemented the bzlib component today, and made some changes
in zlib component.
Their interfaces are quite similar, however there are some differences:
ZEngine has two methods to compress strings directly :
'DeflateString' and 'InflateString', that uses an algorithm a little
different from Gzip one.
BZEngine provides:
'BzipString'and 'BuzipString' which works exatly using the same bzip2
format.
This is due to the capabilities of both libraries.
To compile these libraries:
0) You need gambas-0.84 or newer
1) Copy both 'zlib' and 'bzlib' folders to {gambas sources}/src/lib
2) Copy the attached configure.in to {gambas sources} instead of the
original configure.in
3) Type : ./reconf
4) Type : ./configure (with your options)
5) Go to {gambas sources}/src/lib/zlib, then 'make' and 'make install'
6) Go to {gambas sources}/src/lib/bzlib, then 'make' and 'make install'
7) OK, done
Regards,
--
Daniel Campos <danielcampos at ...282...>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compression_1_0.tar.bz2
Type: application/x-bzip
Size: 7539 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20040222/165690bd/attachment.bin>
-------------- next part --------------
dnl ---------------------------------
dnl
dnl configure.in for Gambas
dnl (c) Beno??? Minisini 2000-2003
dnl
dnl ---------------------------------
dnl ---- Initialization
AC_INIT(src/share/gambas.h)
AM_MAINTAINER_MODE
AC_CONFIG_SUBDIRS(libltdl)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gambas, 0.84a)
AC_PREFIX_DEFAULT(/opt/gambas)
AC_DISABLE_STATIC
AC_CANONICAL_HOST
dnl ---- Checks for programs
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
dnl ---- Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h)
dnl ---- Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
dnl ---- Checks for library functions.
AC_FUNC_ALLOCA
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_STRCOLL
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_FUNC_WAIT3
AC_CHECK_FUNCS(getcwd gettimeofday mkdir rmdir select socket strdup strerror strtod strtol)
AC_REPLACE_FUNCS(setenv unsetenv)
dnl ---- Support for libltdl
AC_LIBTOOL_DLOPEN
AC_LIBLTDL_CONVENIENCE
AC_PROG_LIBTOOL
AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)
LD_FLAGS=-no-undefined
AC_SUBST(LD_FLAGS)
dnl ---- Checks for libraries
AC_CHECK_LIB(m, main, echo -n)
AC_CHECK_LIB(z, main, echo -n)
C_LIB=-lc
AC_SUBST(C_LIB)
AC_CHECK_LIB(gcc_s, main, CXX_LIB="$CXX_LIB -lgcc_s")
AC_CHECK_LIB(stdc++, main, CXX_LIB="$CXX_LIB -lstdc++")
AC_SUBST(CXX_LIB)
dnl ---- Check for shared library extension
GB_SHARED_LIBRARY_EXT()
dnl ---- Check for threading
GB_THREAD()
dnl ---- Check for internationalization library
GB_COMPONENT(
intl,
INTL,
[internationalization library (if not present in C library)],
[GB_FIND(libintl.h, /usr/local /usr, include)],
[GB_FIND(libintl.$SHLIBEXT, /usr/local /usr, lib)],
[-lintl])
dnl ---- Check for charset conversion library
GB_COMPONENT(
conv,
CONV,
[charset conversion library (if not present in C library)],
[GB_FIND(iconv.h, /usr/local /usr, include)],
[GB_FIND(libiconv.$SHLIBEXT, /usr/local /usr, lib)],
[-liconv])
dnl ---- Checks for components
GB_COMPONENT(
qt,
QT,
[QT component],
[GB_FIND(qptrlist.h, /usr/lib /usr/local /usr/X11 /usr/X11R6 /usr, include qt*/include qt/*/include)],
[GB_FIND(libqt-mt.$SHLIBEXT, /usr/local /usr/qt /usr/qt/* /usr/X11 /usr/X11R6 /usr, lib, libqt-mt.so.3)],
[$CXX_LIB $THREAD_LIB $X_LIBS -lqt-mt],
[$THREAD_INC])
if test "$have_qt"="yes"; then
AC_PATH_X
AC_PATH_XTRA
AC_CHECK_LIB(X11, XOpenDisplay, echo -n,
AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
$X_LIBS)
AC_CHECK_LIB(Xext, XShmAttach, echo -n,
AC_MSG_ERROR([*** libXext not found. Check 'config.log' for more details.]),
$X_LIBS)
dnl AC_MSG_CHECKING(for QT meta-object compiler)
AC_PATH_QT_MOC($QT_PATH)
GB_COMPONENT(
kde,
KDE,
[KDE 3.x component],
[GB_FIND(kapplication.h, `kde-config --prefix 2> /dev/null`, include)],
[GB_FIND(libkdecore.$SHLIBEXT, `kde-config --prefix 2> /dev/null`, lib)],
[-lkdecore -lkdeui -lDCOP -lkio])
fi
dnl ---- Networking component
GB_COMPONENT(
net,
NET,
[Networking component],
[],
[],
[$C_LIB $THREAD_LIB],
[$THREAD_INC])
dnl ---- Advanced networking component
GB_COMPONENT(
curl,
CURL,
[Advanced networking component],
[GB_FIND(curl.h, `curl-config --prefix 2> /dev/null`, include)],
[GB_FIND(libcurl.$SHLIBEXT, `curl-config --prefix 2> /dev/null`, lib)],
[$C_LIB `curl-config --libs 2> /dev/null`])
dnl ---- Database components
GB_COMPONENT(
postgresql,
PGSQL,
[PostgreSQL driver],
[GB_FIND(libpq-fe.h postgres.h pg_type.h, /usr/lib /usr/local /usr /opt, include/pgsql* pgsql*/include include/postgresql* postgresql*/include include)],
[GB_FIND(libpq.$SHLIBEXT, /usr/local /usr /opt, lib pgsql*/lib postgresql*/lib)],
[$C_LIB -lpq])
GB_COMPONENT(
mysql,
MYSQL,
[MySQL driver],
[GB_FIND(mysql.h my_config.h, /usr/lib /usr/local /opt /usr, include mysql*/include)],
[GB_FIND(libmysqlclient.$SHLIBEXT, /usr/local /opt /usr, lib mysql*/lib)],
[$C_LIB -lmysqlclient -lz])
dnl ---- SDL component needs: libvorbisfile.la libsmpeg.la libogg.la
GB_COMPONENT(
sdl,
SDL,
[SDL component],
[GB_FIND(SDL.h SDL_mixer.h, /usr/local /usr, include SDL*/include include/SDL*)],
[GB_FIND(libSDL.$SHLIBEXT libSDL_mixer.$SHLIBEXT, /usr/local /usr, lib SDL*/lib lib/SDL*)],
[$C_LIB $THREAD_LIB -lSDL -lSDL_mixer],
[$THREAD_INC])
dnl ---- VB component
GB_COMPONENT(
vb,
VB,
[Visual Basic compatibility component],
[],
[],
[$C_LIB $THREAD_LIB],
[$THREAD_INC])
dnl ---- Zlib component
GB_COMPONENT(
zlib,
ZLIB,
[ZLIB wrapper],
[],
[],
[$C_LIB],
[])
dnl ---- BZlib component
GB_COMPONENT(
bzlib,
BZLIB,
[BZLIB wrapper],
[],
[],
[$C_LIB],
[])
dnl ---- Other options
AC_ARG_ENABLE(
debug,
[ --enable-debug compile for debugging (default: yes)],
gambas_debug=$enableval,
gambas_debug=yes
)
AM_CONDITIONAL(DEBUG, test "$gambas_debug" = yes)
AC_ARG_ENABLE(
optimization,
[ --enable-optimization compile with optimizations (default: no)],
gambas_optimization=$enableval,
gambas_optimization=no
)
AM_CONDITIONAL(OPTIMIZE, test "$gambas_optimization" = yes)
AC_ARG_ENABLE(
profiling,
[ --enable-profiling compile with profiling (default: no)],
gambas_prof=$enableval,
gambas_prof=no
)
AC_ARG_ENABLE(
preloading,
[ --enable-preloading enable preloading (default: yes)],
gambas_preloading=$enableval,
gambas_preloading=yes
)
if test "$gambas_preloading" = "yes"; then
AC_DEFINE(DO_PRELOADING, 1, allows shared library preloading )
fi
CFLAGS="$CFLAGS -pipe -Wall"
CXXFLAGS="$CXXFLAGS -pipe -Wall -fno-exceptions"
if test "$gambas_prof" = "yes"; then
CFLAGS="$CFLAGS -pg"
CXXFLAGS="$CXXFLAGS -pg"
# if test "$gambas_optimization" = "yes"; then
# echo -e "\n**** Warning: --enable-profiling implies --disable-optimization\n"
# gambas_optimization="no";
# fi
fi
if test "$gambas_debug" = "yes"; then
CFLAGS="$CFLAGS -g"
CXXFLAGS="$CXXFLAGS -g"
fi
# gambas_flag="-O2 -fstrength-reduce -frerun-loop-opt -fexpensive-optimizations -fschedule-insns2 -funroll-loops"
# gambas_flags="$gambas_flags -fno-strict-aliasing -falign-loops=2 -falign-jumps=2"
# gambas_flags="$gambas_flags -falign-functions=2 -ffast-math"
if test "$gambas_prof" = "no"; then
gambas_flags="$gambas_flags -fomit-frame-pointer"
fi
if test "x$gambas_optimization" = "xyes"; then
CFLAGS="$CFLAGS -Os"
CXXFLAGS="$CXXFLAGS -Os"
else
CFLAGS="$CFLAGS -O0"
CXXFLAGS="$CXXFLAGS -O0"
fi
dnl ---- Create makefiles
AC_OUTPUT( \
Makefile \
src/Makefile \
src/share/Makefile \
src/comp/Makefile \
src/exec/Makefile \
src/lib/Makefile \
src/lib/eval/Makefile \
src/lib/example/Makefile \
src/lib/qt/Makefile \
src/lib/qt/editor/Makefile \
src/lib/qt/ext/Makefile \
src/lib/qt/kde/Makefile \
src/lib/qt/kde/html/Makefile \
src/lib/db/Makefile \
src/lib/db/mysql/Makefile \
src/lib/db/postgresql/Makefile \
src/lib/sdl/Makefile \
src/lib/zlib/Makefile \
src/lib/bzlib/Makefile \
src/lib/net/Makefile \
src/lib/net/curl/Makefile \
src/lib/vb/Makefile \
)
More information about the User
mailing list