[Gambas-user] Zlib

Daniel Campos danielcampos at ...282...
Tue Feb 17 20:21:48 CET 2004


Hi:

I'm at 'network' hollydays now, so I'm writting a ZLIB wrapper
( http://www.gzip.org/zlib ) to relax a little. 

By now, it has a class 'ZStream' to allow read and write from
gzippez files directly as if it were usual files.

I can not use 'OPEN' stream method by now, as it does not accept
my object as a valid 'FILE?', but the rest of streams methods
works.

Once you untar this file, copy 'zlib' folder to {gambas sources}/src/lib
, then copy attacheed configure.in to replace current gambas
configure.in, type ./reconf, and ./configure with your usual
options, go to {gambas sources}/src/lib/zlib, do 'make' and 'make
install'.

You have also a very little example at zlib/example

Regards,

Daniel Campos

 


-- 
Daniel Campos <danielcampos at ...282...>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zlib.tar.gz
Type: application/x-compressed-tar
Size: 5160 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20040217/cd797491/attachment.bin>
-------------- next part --------------
dnl ---------------------------------
dnl
dnl   configure.in for Gambas
dnl   (c) Beno?t 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 ---- 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/net/Makefile \
src/lib/net/curl/Makefile \
src/lib/vb/Makefile \
)


More information about the User mailing list