[Gambas-devel] sdl component update

Laurent Carlier lordheavy at ...141...
Tue Jan 11 11:07:07 CET 2005


sdl component update, major changes :
- first step for a cdrom-sdl component.

joined : configure.in and the sdl component.
a small cdrom test demo

Replace the sdl dir from gambas2-1.9.1 with this one.
Update the configure.in with this one.

./reconf
./configure
make
make install

Have fun,

-- 

Laurent Carlier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sdl-20050111.tar.bz2
Type: application/x-tbz
Size: 27021 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20050111/5e7d007a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cdromtest-0.0.1.tar.gz
Type: application/x-tgz
Size: 1338 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20050111/5e7d007a/attachment-0001.bin>
-------------- next part --------------
dnl ---------------------------------
dnl
dnl   configure.in for Gambas
dnl   (c) Benoît Minisini 2000-2005
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(gambas2, 1.9.1)

AC_PREFIX_DEFAULT(/usr/local)

AC_DISABLE_STATIC

AC_CANONICAL_HOST


dnl ---- Gambas version

GAMBAS_VERSION=2
AC_SUBST(GAMBAS_VERSION)
AC_DEFINE(GAMBAS_VERSION, 2, Gambas version)
AC_DEFINE(GAMBAS_VERSION_STRING, "2", Gambas version string)


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 sysinfo)
AC_REPLACE_FUNCS(setenv unsetenv getdomainname)


dnl ---- Support for libltdl

AC_LIBTOOL_DLOPEN
AC_LIBLTDL_CONVENIENCE
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL

AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)

#LD_FLAGS="-z defs"
LD_FLAGS="-no-undefined"
AC_SUBST(LD_FLAGS)


dnl ---- Support for ccache

dnl AC_PATH_PROG(CCACHE, ccache)

if test x"$CCACHE" != x; then
  CC="ccache $CC"
  CXX="ccache $CXX"
fi


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 system

GB_SYSTEM()


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,
  [external internationalization 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,
  [external charset conversion library],
  [GB_FIND(iconv.h, /usr/local /usr, include)],
  [GB_FIND(libiconv.$SHLIBEXT, /usr/local /usr, lib)],
  [-liconv])

dnl ---- Check for gettext library

GB_COMPONENT(
  gettext,
  GETTEXT,
  [external gettext library],
  [],
  [GB_FIND(gettextlib.$SHLIBEXT, /usr/local /usr, lib)],
  [-lgettextlib])

dnl ---- Checks for components

dnl ---- QT & KDE component

GB_COMPONENT(
  qt,
  QT,
  [QT component],
  [GB_FIND(qptrlist.h, /usr/local/lib /usr/local /usr/lib /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)


  GB_FIND_QT_MOC

  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 ---- GTK+ component

GB_COMPONENT_PKG_CONFIG(
  gtk,
  GTK,
  [GTK+ component],
  gtk+-2.0)

  
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/local/lib /usr/local /opt /usr/lib /usr, include/pgsql* pgsql*/include include/postgresql* postgresql*/include include)],
  [GB_FIND(libpq.$SHLIBEXT, /usr/local /opt /usr, lib pgsql*/lib postgresql*/lib)],
  [$C_LIB -lpq])

GB_COMPONENT(
  mysql,
  MYSQL,
  [MySQL driver],
  [GB_FIND(mysql.h my_config.h, /usr/local/lib /usr/local /opt /usr/lib /usr, include mysql*/include)],
  [GB_FIND(libmysqlclient.$SHLIBEXT, /usr/local /opt /usr, lib mysql*/lib)],
  [$C_LIB -lmysqlclient -lz])

GB_COMPONENT(
  sqlite,
  SQLITE,
  [SQLite driver],
  [GB_FIND(sqlite.h, /usr/local/lib /usr/local /opt /usr/lib /usr, include sqlite*/include)],
  [GB_FIND(libsqlite.$SHLIBEXT, /usr/local /opt /usr, lib sqlite*/lib)],
  [$C_LIB -lsqlite -lstdc++])

dnl GB_COMPONENT(
dnl   sqlite3,
dnl   SQLITE3,
dnl   [SQLite3 driver],
dnl   [GB_FIND(sqlite3.h, /usr/local/lib /usr/local /opt /usr/lib /usr, include sqlite*/include)],
dnl   [GB_FIND(libsqlite3.$SHLIBEXT, /usr/local /opt /usr, lib sqlite*/lib)],
dnl   [$C_LIB -lsqlite3 -lstdc++])

GB_COMPONENT(
  odbc,
  ODBC,
  [ODBC Connection driver],
  [GB_FIND(sql.h sqlext.h sqltypes.h, /usr/local/lib /usr/local /opt /usr/lib /usr, include odbc*/include)],
  [GB_FIND(libodbc.$SHLIBEXT, /usr/local /opt /usr, lib odbc*/lib )],
  [$C_LIB -lodbc])

dnl ---- SDL component needs: libvorbisfile.la libsmpeg.la libogg.la

GB_COMPONENT(
  sdl,
  SDL,
  [SDL component],
  [GB_FIND(SDL.h, /usr/local/lib /usr/local /opt /usr/lib /usr, include SDL*/include include/SDL*)],
  [GB_FIND(libSDL.$SHLIBEXT, /usr/local /opt /usr, lib SDL*/lib lib/SDL*)],
  [$C_LIB $THREAD_LIB -lSDL -lm],
  [$THREAD_INC])

GB_COMPONENT(
  sdl_cdrom,
  SDL_CDROM,
  [SDL CDROM component],
  [],
  [],
  [$C_LIB $THREAD_LIB],
  [$THREAD_INC])

GB_COMPONENT(
  sdl_sound,
  SDL_SOUND,
  [SDL sound component],
  [GB_FIND(SDL_mixer.h, /usr/local/lib /usr/local /opt /usr/lib /usr, include SDL*/include include/SDL*)],
  [GB_FIND(libSDL_mixer.$SHLIBEXT, /usr/local /opt /usr, lib SDL*/lib lib/SDL*)],
  [-lSDL_mixer],
  [$THREAD_INC])


GB_COMPONENT(
  sdl_image,
  SDL_IMAGE,
  [SDL 2D image component],
  [GB_FIND(SDL_image.h SDL_gfxPrimitives.h SDL_ttf.h, /usr/local/lib /usr/local /opt /usr/lib /usr, include SDL*/include include/SDL*)],
  [GB_FIND(libSDL_image.$SHLIBEXT libSDL_gfx.$SHLIBEXT libSDL_ttf.$SHLIBEXT, /usr/local /opt /usr, lib SDL*/lib lib/SDL*)],
  [-lSDL_image -lSDL_gfx -lSDL_ttf],
  [$THREAD_INC])


dnl ---- VB component

GB_COMPONENT(
  vb,
  VB,
  [Visual Basic compatibility component],
  [],
  [],
  [$C_LIB $THREAD_LIB -lm],
  [$THREAD_INC])

dnl ---- Compression components

GB_COMPONENT(
  zlib,
  ZLIB,
  [zlib compression],
  [GB_FIND(zlib.h, /usr/local/lib /usr/local /opt /usr/lib /usr, include)],
  [GB_FIND(libz.$SHLIBEXT, /usr/local /opt /usr, lib)],
  [$C_LIB -lz])

GB_COMPONENT(
  bzlib2,
  BZLIB2,
  [bzlib2 compression],
  [GB_FIND(bzlib.h, /usr/local/lib /usr/local /opt /usr/lib /usr, include)],
  [GB_FIND(libbz2.$SHLIBEXT, /usr/local /opt /usr, lib)],
  [$C_LIB -lbz2])

dnl ---- XML components

GB_COMPONENT_PKG_CONFIG(
  libxml,
  LIBXML,
  [XML parser component],
  libxml-2.0)

dnl GB_COMPONENT(
dnl   libxml,
dnl   LIBXML,
dnl   [XML parser component],
dnl   [GB_FIND(libxml, /usr/local/lib /usr/local /opt /usr/lib /usr, include/libxml* include)],
dnl   [GB_FIND(libxml2.$SHLIBEXT, /usr/local /opt /usr, lib)],
dnl   [$C_LIB $THREAD_LIB -lxml2 -lm],
dnl   [$THREAD_INC])
  
GB_COMPONENT(
  xslt,
  XSLT,
  [XSLT/XML parser component],
  [GB_FIND(libxslt, /usr/local/lib /usr/local /opt /usr/lib /usr, include/libxml* include/libxslt* include)],
  [GB_FIND(libxslt.$SHLIBEXT, /usr/local /opt /usr, lib)],
  [$LIBXML_LIB -lxslt])

dnl ---- Perl Compatible Regular Expression component

GB_COMPONENT(
  pcre,
  PCRE,
  [Perl Compatible Regular Expression component],
  [GB_FIND(pcre.h, /usr/local/lib /usr/local /usr/lib /usr, include)],
  [GB_FIND(libpcre.$SHLIBEXT, /usr/local /usr, lib)],
  [-lpcre])
    
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: yes)],
  gambas_optimization=$enableval,
  gambas_optimization=yes
)

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 -fno-strict-aliasing"
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 -fno-omit-frame-pointer"
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/debug/Makefile \
src/lib/eval/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/gtk/Makefile \
src/lib/db/Makefile \
src/lib/db/mysql/Makefile \
src/lib/db/postgresql/Makefile \
src/lib/db/sqlite/Makefile \
src/lib/db/odbc/Makefile \
src/lib/sdl/Makefile \
src/lib/sdl/sdl_cdrom/Makefile \
src/lib/sdl/sdl_image/Makefile \
src/lib/sdl/sdl_sound/Makefile \
src/lib/net/Makefile \
src/lib/net/curl/Makefile \
src/lib/vb/Makefile \
src/lib/compress/Makefile \
src/lib/compress/zlib/Makefile \
src/lib/compress/bzlib2/Makefile \
src/lib/xml/Makefile \
src/lib/xml/libxml/Makefile \
src/lib/xml/libxml/xslt/Makefile \
src/lib/xml/libxml/rpc/Makefile \
src/lib/pcre/Makefile \
)


More information about the Devel mailing list