dnl Process this file with autoconf to produce a configure script. AC_INIT(configure.in) AM_INIT_AUTOMAKE(entity, 0.7.2) AM_CONFIG_HEADER(entity-config.h) AM_CONDITIONAL(DEBIAN_ENTITY_MAGIC, test "x$DEBIAN_ENTITY_MAGIC" = "xvoodoo") if test "x$DEBIAN_ENTITY_MAGIC" = "xvoodoo"; then AC_DEFINE(DEBIAN_ENTITY_MAGIC, $DEBIAN_ENTITY_MAGIC) fi dnl All shared libraries that are built for installation are currently dnl only for dlopen()'ing, so it makes sense to disable static library dnl builds. AM_DISABLE_STATIC AM_PROG_LIBTOOL AC_PROG_CC AC_PROG_RANLIB AC_C_INLINE AC_PATH_PROG(sedpath, sed) if test "_$sedpath" = _; then AC_MSG_ERROR("Cannot find sed: I need it\!") fi AC_CANONICAL_HOST AC_DEFINE_UNQUOTED(CANONICAL_HOST, "$host") AC_DEFINE_UNQUOTED(CANONICAL_HOST_CPU, "$host_cpu") AC_DEFINE_UNQUOTED(CANONICAL_HOST_VENDOR, "$host_vendor") AC_DEFINE_UNQUOTED(CANONICAL_HOST_OS, "$host_os") AC_PATH_PROG(gmakepath, gmake) AM_PATH_GLIB(1.2.6, , AC_MSG_ERROR(Cannot find GLIB: is glib-config in path?), gmodule) AM_PATH_GTK(1.2.6, , AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?)) top_dir=`pwd` CFLAGS="$CFLAGS $GTK_CFLAGS" dnl Only use -Wall if we have gcc if test "x$GCC" = "xyes"; then if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then CFLAGS="$CFLAGS -Wall" fi if test "$socks" = yes; then CFLAGS="$CFLAGS -w" fi fi AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(sys/stat.h sys/types.h fcntl.h sys/dir.h) AC_CHECK_HEADERS(utime.h signal.h) AC_CHECK_FUNCS(bzero signal sigaction memset fcntl fsync vsnprintf) AC_CHECK_FUNCS(lstat stat umask utime memmove bcopy) AC_CHECK_FUNCS(srand48 drand48 sleep usleep lstat) AC_FUNC_ALLOCA AC_STDC_HEADERS AC_HAVE_HEADERS(string.h stdlib.h unistd.h errno.h float.h limits.h) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) dnl Checks for libraries. AC_CHECK_SIZEOF(unsigned long long int, 8) AC_CHECK_SIZEOF(unsigned long int, 4) AC_CHECK_SIZEOF(unsigned int, 4) AC_CHECK_SIZEOF(unsigned short int, 2) AC_CHECK_SIZEOF(unsigned char, 1) AC_C_BIGENDIAN AC_ARG_ENABLE(gdkimlib, [ --enable-gdkimlib=(yes|no) Use gdk imlib for tag.],, [enable_gdk_imlib="yes"]) if test "yes" = "$enable_gdk_imlib"; then AC_PATH_PROG(imlibpath, imlib-config) AC_MSG_CHECKING(for gdk_imlib) IMLIB_CFLAGS=`$imlibpath --cflags-gdk 2>/dev/null` IMLIB_LDFLAGS=`$imlibpath --libs-gdk 2>/dev/null` if test "_$IMLIB_CFLAGS" = _ ; then AC_MSG_RESULT([not found, building without imlib.]) imlib=no else AC_MSG_RESULT(ok) AC_DEFINE(USE_IMLIB) HAVE_IMLIB=`$imlibpath --version` AC_SUBST(IMLIB_CFLAGS) AC_SUBST(IMLIB_LDFLAGS) fi fi dnl ************************************************** dnl * Check if we're doing exec-class stuff dnl ************************************************** AC_ARG_ENABLE(exec_class, [ --enable-exec-class=(yes|no) Include support for offloading programs to a running entity.],, [enable_exec_class="yes"]) if test "yes" = "$enable_exec_class"; then AC_DEFINE(USE_ENTITY_EXEC_CLASS) fi dnl ******* Check for pthread library if building python ******* AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread", [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads", [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r", [AC_CHECK_FUNC(pthread_create)] )] )] ) AC_SUBST(PTHREAD_LIB) dnl ******* Check for -lsocket on solaris ******* AC_CHECK_LIB(socket, socket, RENDERER_LDFLAGS="$RENDERER_LDFLAGS -lsocket", ) AC_CHECK_LIB(nsl, gethostbyname, RENDERER_LDFLAGS="$RENDERER_LDFLAGS -lnsl", ) AC_CHECK_LIB(nsl, inet_ntoa, CSINK_RESOLVER_LIBS="-lnsl", ) AC_SUBST(CSINK_RESOLVER_LIBS) dnl ************************************************** dnl * Check dynamic/static GTK dnl ************************************************** dnl find out if we're building gtk static or dynamic AC_ARG_ENABLE(gtk, [ --enable-gtk=(static|module) Include static or modular gtk+ support.],, [enable_gtk="module"]) if test "static" = "$enable_gtk"; then RENDERER_LDFLAGS="$RENDERER_LDFLAGS $GTK_LIBS $IMLIB_LDFLAGS $top_dir/renderers/gtk/librendgtk.a" AM_CONDITIONAL(STATIC_GTK, true) AC_DEFINE(STATIC_GTK) else AM_CONDITIONAL(STATIC_GTK, false) fi dnl ************************************************** dnl * Check for pcre dnl ************************************************** AC_PATH_PROG(pcreconfig, 'pcre-config') if test "_$pcreconfig" = _ ; then AC_CHECK_HEADER(pcre.h, PCRETWO=yes, AC_MSG_ERROR([Unable to locate pcre-config or pcre.h. pcre 3.1 (the Perl Compatible Regular Expression library) is requied. See http://www.pcre.org/]) ) fi dnl This test for PCRE 2.08 is simplistic: It looks for pcre.h as a system dnl header. It is mainly intended as a hack-around for Debian systems. if test "$PCRETWO" = yes; then AC_EGREP_CPP([2 . 08], [ #include PCRE_MAJOR.PCRE_MINOR ], [ PCRE_CFLAGS= PCRE_LIBS=-lpcre ], AC_MSG_ERROR([pcre version 2.08 or 3.1 is required.])) else PCRE_CFLAGS=`$pcreconfig --cflags` PCRE_LIBS=`$pcreconfig --libs` fi AC_SUBST(PCRE_LIBS) CFLAGS="$CFLAGS $PCRE_CFLAGS" dnl ************************************************* dnl * Check for openssl dnl ************************************************* AC_ARG_ENABLE(openssl, [ --enable-openssl Enable SSL sockets in csink.],, [enable_openssl="no"]) AC_MSG_CHECKING([whether to build with openssl csink]) dnl TODO: actually find them instead of hardcoding if test "yes" = "$enable_openssl"; then CFLAGS="$CFLAGS -I/usr/local/ssl/include/ -L/usr/local/ssl/lib/" AC_MSG_RESULT([yes, using include dir /usr/local/ssl/include]) AC_DEFINE(HAVE_OPENSSL) AM_CONDITIONAL(BUILD_CSINKSSL, true) RENDERER_LDFLAGS="$RENDERER_LDFLAGS -lssl -lcrypto" else AM_CONDITIONAL(BUILD_CSINKSSL, false) AC_MSG_RESULT([no openssl.]) fi dnl ************************************************* dnl * Check whether to build sdl dnl ************************************************* AC_ARG_ENABLE(sdl, [ --enable-sdl Enable building of SDL support.],, [enable_sdl="no"]) AC_MSG_CHECKING([whether to build sdl]) if test "no" = "$enable_sdl"; then AM_CONDITIONAL(BUILD_SDL, false) AC_MSG_RESULT([no sdl.]) else AC_MSG_RESULT([yes.]) AC_PATH_PROG(sdlconfigpath, "sdl-config") if test "_$sdlconfigpath" = "_"; then AC_MSG_RESULT(["Cannot find sdl-config, not building SDL."]) else SDL_CFLAGS=`$sdlconfigpath --cflags` SDL_LIBS=`$sdlconfigpath --libs` AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) AM_CONDITIONAL(BUILD_SDL, true) fi fi dnl ************************************************* dnl * Check whether to build csink dnl ************************************************* AC_ARG_ENABLE(csink, [ --enable-csink Enable building of csink.],, [enable_csink="yes"]) AC_MSG_CHECKING([whether to build csink]) if test "no" = "$enable_csink"; then AM_CONDITIONAL(BUILD_CSINK, false) AC_MSG_RESULT([no csink.]) else AC_MSG_RESULT([yes.]) AC_DEFINE(USE_CSINK) AM_CONDITIONAL(BUILD_CSINK, true) RENDERER_LDFLAGS="$RENDERER_LDFLAGS \$(top_builddir)/renderers/csink/librendcsink.la" fi dnl ************************************************* dnl * Check whether to build gl renderer dnl ************************************************* AC_ARG_ENABLE(gtkgl, [ --enable-gtkgl Enable building of the gtk glarea renderer.],, [enable_gtkgl="no"]) AC_MSG_CHECKING([whether to build gtk gl renderer]) if test "no" = "$enable_gtkgl"; then AM_CONDITIONAL(BUILD_GTKGL, false) AC_MSG_RESULT([no gl renderer.]) else AC_MSG_RESULT([yes.]) AM_CONDITIONAL(BUILD_GTKGL, true) fi dnl ************************************************* dnl * Check whether to build gnome panel gnome renderer dnl ************************************************* AC_ARG_ENABLE(gnome, [ --enable-gnome Enable building of the gnome specific renderers.],, [enable_gnome="no"]) AC_MSG_CHECKING([whether to build gnome renderers]) if test "no" = "$enable_gnome"; then AM_CONDITIONAL(BUILD_RENDGNOME, false) AC_MSG_RESULT([no gnome renderer.]) else AC_MSG_RESULT([yes.]) AM_CONDITIONAL(BUILD_RENDGNOME, true) GNOME_CFLAGS=`gnome-config --cflags gnome` GNOME_LIBS=`gnome-config --libs gnome` AC_SUBST(GNOME_CFLAGS) AC_SUBST(GNOME_LIBS) fi dnl ************************************************* dnl * Check for profiling flags. dnl ************************************************* AC_ARG_ENABLE(profiling, [ --enable-profiling Enable C Profiling.],, [enable_profiling="no"]) dnl AC_MSG_RESULT($enable_profiling) if test "yes" = "$enable_profiling"; then CFLAGS="$CFLAGS -pg"; fi dnl ************************************************** dnl * Check for Perl dnl ************************************************** dnl AC_ARG_ENABLE(perl, [ --enable-perl=(static|module|no) Include static or modular perl support.],, [enable_perl="static"]) AM_CONDITIONAL(BUILD_PERL, false) if test "no" != "$enable_perl"; then AC_PATH_PROG(perlpath, perl) if test "_$perlpath" != _; then AC_MSG_CHECKING(for Perl compile flags) PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null` if test "_$PERL_CFLAGS" = _ ; then AC_MSG_RESULT(Unable to determine CFLAGS from perl interp.) else PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts |$sedpath 's/-lgdbm//'` AC_SUBST(PERL_CFLAGS) AC_SUBST(PERL_LDFLAGS) AC_MSG_RESULT(ok) HAVE_PERL=`$perlpath -MConfig -e 'print $Config{version}'` AC_DEFINE(USE_PERL) AM_CONDITIONAL(BUILD_PERL, true) dnl Check to see if we are building static or dynamic if test "static" = "$enable_perl"; then RENDERER_LDFLAGS="$RENDERER_LDFLAGS $top_dir/renderers/perl/librendperl.a $PERL_LDFLAGS" AM_CONDITIONAL(STATIC_PERL, true) AC_DEFINE(STATIC_PERL) else AM_CONDITIONAL(STATIC_PERL, false) fi fi else AC_MSG_RESULT([ Can't find Perl interpreter Continuing build without Perl support.]) fi fi dnl ************************************************** dnl * Check for Python dnl ************************************************** dnl AC_ARG_ENABLE(python, [ --enable-python=(static|module|no) Enable Python language support.],, [enable_python="no"]) AM_CONDITIONAL(BUILD_PYTHON, false) if test "no" != "$enable_python"; then AC_CHECK_PROG(python_val, python, true, false) if $python_val; then PY_PREFIX=`python -c 'import sys ; print sys.prefix'` PY_EXEC_PREFIX=`python -c 'import sys ; print sys.exec_prefix'` changequote(<<, >>)dnl PY_VERSION=`python -c 'import sys ; print sys.version[0:3]'` changequote([, ])dnl if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then PY_LIBS="-lpython$PY_VERSION" if test "x$DEBIAN_ENTITY_MAGIC" != "xvoodoo"; then PY_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config" fi PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION" PYTHON_LDFLAGS="$PY_LIB_LOC $PY_EXTRA_LIBS $PY_LIBS $PTHREAD_LIB" AC_SUBST(PYTHON_LDFLAGS) AC_SUBST(PYTHON_CFLAGS) AC_DEFINE(USE_PYTHON) AM_CONDITIONAL(BUILD_PYTHON, true) HAVE_PYTHON="$PY_VERSION" if test "static" = "$enable_python"; then RENDERER_LDFLAGS="$RENDERER_LDFLAGS $PYTHON_LDFLAGS" RENDERER_LDFLAGS="$RENDERER_LDFLAGS $top_dir/renderers/python/librendpython.a" AM_CONDITIONAL(STATIC_PYTHON, true) AC_DEFINE(STATIC_PYTHON) else AM_CONDITIONAL(STATIC_PYTHON, false) fi else AC_MSG_RESULT([ Can't find Python headers or libraries Continuing build without Python support.]) fi fi fi dnl ************************************************** dnl * Check for Tcl dnl ************************************************** dnl dnl tcl is the only langauge that has a sensible default dnl install with .so's, so we enable it as a module. AC_ARG_ENABLE(tcl, [ --enable-tcl=(static|module|no) Enable Tcl language support.],, [enable_tcl="module"]) AM_CONDITIONAL(BUILD_TCL, false) if test "no" != "$enable_tcl" -a "x" != "x$enable_tcl"; then dnl let tclsh tell us where it was dnl installed (prefer new tcl versions). AC_CHECK_PROGS(TCLSH, tclsh8.4 tclsh8.3 tclsh8.2 tclsh8.1 tclsh8.0 tclsh) if test "$TCLSH" != ""; then tclpath=`echo 'puts [[lindex $tcl_pkgPath 0]] ' | $TCLSH` fi dnl let the user overwrite the installation dnl directory which was just found. AC_ARG_WITH(tcl, [ --with-tcl=PATH Directory containing tclConfig.sh], tclpath="$withval") dnl check, if tclConfig.sh can be found in dnl tclsh's installation directory. dir=`echo $TCLSH | $sedpath 's/sh//'` fulltclpath=$tclpath/$dir/tclConfig.sh if test -r $fulltclpath; then tclconf=$fulltclpath else if test -r $tclpath/tclConfig.sh; then tclconf=$tclpath/tclConfig.sh fi fi if test ! -r $tclconf; then AC_MSG_RESULT( [ Can't find Tcl libraries. Use --with-tcl to specify the directory containing tclConfig.sh on your system. Continuing build without Tcl support.]) else dnl source tclsh's configuration file dnl and tell the user about the version. . $tclconf AC_MSG_CHECKING([for the tcl version number]) AC_MSG_RESULT([$TCL_VERSION, patchlevel $TCL_PATCH_LEVEL]) dnl Check, if tcl_version is > 8.0 if test $TCL_MAJOR_VERSION -lt 8; then AC_MSG_RESULT([ Entity requires tcl version 8.0 or higher. Continuing build without Tcl support.]) else dnl TCL_PREFIX='/usr/local' AC_SUBST(TCL_PREFIX) dnl TCL_DBGX= AC_SUBST(TCL_DBGX) dnl TCL_LIBS='-ldl -lpthread -lieee -lm' if test "x$DEBIAN_ENTITY_MAGIC" = "xvoodoo"; then TCL_LIBS=`echo $TCL_LIBS | $sedpath 's/-lieee//'` fi AC_SUBST(TCL_LIBS) dnl TCL_LIB_SPEC='-L/usr/local/lib -ltcl8.4${TCL_DBGX}' AC_SUBST(TCL_LIB_SPEC) TCL_CFLAGS="-I${TCL_PREFIX}/include/ -I${TCL_PREFIX}/include/tcl${TCL_VERSION}" AC_SUBST(TCL_CFLAGS) TCL_LDFLAGS="$TCL_LIB_SPEC $TCL_LIBS" AC_SUBST(TCL_LDFLAGS) AC_DEFINE(USE_TCL) HAVE_TCL="$TCL_VERSION$TCL_PATCH_LEVEL" dnl We're definately building tcl now. AM_CONDITIONAL(BUILD_TCL, true) dnl Check to see if we are building static or dynamic if test "static" = "$enable_tcl"; then RENDERER_LDFLAGS="$RENDERER_LDFLAGS $top_dir/renderers/tcl/librendtcl.a $TCL_LDFLAGS" AM_CONDITIONAL(STATIC_TCL, true) AC_DEFINE(STATIC_TCL) else AM_CONDITIONAL(STATIC_TCL, false) fi fi fi fi dnl ************************************************** dnl * Check for C dnl ************************************************** dnl AC_ARG_ENABLE(c, [ --enable-c=(static|module) Enable C language support.],, [enable_c="module"]) if test "static" = "$enable_c"; then RENDERER_LDFLAGS="$RENDERER_LDFLAGS $top_dir/renderers/C/librendcembed.a" AM_CONDITIONAL(STATIC_C, true) AC_DEFINE(STATIC_C) else AM_CONDITIONAL(STATIC_C, false) fi dnl ************************************************** dnl * Check for JavaScript dnl ************************************************** AC_ARG_ENABLE(javascript, [ --enable-javascript=(static|module|no) Enable JavaScript language support.],, [enable_javascript="module"]) AC_ARG_WITH(included-njs, [ --with-included-njs Use the included NJS engine instead of system's], [case "${withval}" in yes) entitynjs=true ;; no) entitynjs=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --with-included-njs) ;; esac], [entitynjs=false]) AM_CONDITIONAL(BUILD_JAVASCRIPT, false) if test "no" != "$enable_javascript"; then AC_PATH_PROG(NJS_CONFIG, njs-config, no) if test "x$entitynjs" = "xtrue"; then # If we force the included NJS, we didn't find njs-config NJS_CONFIG=no fi if test "x$NJS_CONFIG" != "xno"; then AC_PATH_PROG(NJS, njs, no) if test "x$NJS" = "xno"; then AC_MSG_ERROR([Found njs-config, but cannot find njs (check your \$PATH)]) fi AC_PATH_PROG(JIG, jig, no) if test "x$JIG" = "xno"; then AC_MSG_ERROR([Found njs-config, but cannot find jig (che ck your \$PATH)]) fi NJS_CFLAGS=`$NJS_CONFIG --cflags` NJS_LIBS=`$NJS_CONFIG --libs` AC_SUBST(NJS_CFLAGS) AC_SUBST(NJS_LIBS) AC_DEFINE(USE_JAVASCRIPT) AM_CONDITIONAL(BUILD_JAVASCRIPT, true) AM_CONDITIONAL(BUILD_ENTITYNJS, false) HAVE_NJS=`$NJS_CONFIG --version` if test "static" = "$enable_javascript"; then RENDERER_LDFLAGS="$RENDERER_LDFLAGS $NJS_LIBS $top_dir/renderers/javascript/librendnjs.a" AM_CONDITIONAL(STATIC_JAVASCRIPT, true) AC_DEFINE(STATIC_JAVASCRIPT) else AM_CONDITIONAL(STATIC_JAVASCRIPT, false) fi else AC_MSG_RESULT([ Can't find njs-config Will buid internal njs library.]) HAVE_NJS="0.3.0 (Builtin)" AM_CONDITIONAL(BUILD_ENTITYNJS, true) AC_DEFINE(USE_JAVASCRIPT) NJS_CFLAGS="-I$top_dir/libentitynjs" AM_CONDITIONAL(BUILD_JAVASCRIPT, true) if test "static" = "$enable_javascript"; then RENDERER_LDFLAGS="$RENDERER_LDFLAGS $NJS_LIBS $top_dir/renderers/javascript/librendnjs.a -lm -lentitynjs -L$top_dir/libentitynjs/.libs" AM_CONDITIONAL(STATIC_JAVASCRIPT, true) AC_DEFINE(STATIC_JAVASCRIPT) else NJS_LIBS="-lm -lentitynjs -L$top_dir/libentitynjs/.libs" AM_CONDITIONAL(STATIC_JAVASCRIPT, false) fi fi fi dnl ************************************************** dnl * Final dynamic gathering dnl ************************************************** AC_SUBST(RENDERER_LDFLAGS) AC_DEFINE_UNQUOTED(ENTITY_DATADIR,"$prefix/lib/entity") AC_DEFINE_UNQUOTED(ENTITY_CLIBDIR,"$prefix/lib/entity/clib") AC_DEFINE_UNQUOTED(ENTITY_VERSION,"$VERSION") AC_MSG_CHECKING(for intelligent life) AC_MSG_RESULT(not found) AC_MSG_CHECKING(to see if the last check was funny) AC_MSG_RESULT(nope) dnl For now, these are not even built. dnl renderers/C/Makefile AC_OUTPUT( Makefile \ expat-1.1/Makefile \ t/Makefile \ libentitynjs/Makefile \ libentitynjs/njs/Makefile \ apps/Makefile \ stembuilder/Makefile \ stembuilder/images/Makefile \ docs/Makefile \ g-extensions/Makefile \ examples/Makefile \ \ renderers/Makefile \ renderers/entitylang/Makefile \ renderers/perl/Makefile \ renderers/C/Makefile \ renderers/tcl/Makefile \ renderers/generic/Makefile \ renderers/system/Makefile \ renderers/sdl/Makefile \ renderers/gtk/Makefile \ renderers/python/Makefile \ renderers/javascript/Makefile \ renderers/csink/Makefile \ renderers/gtkglarea/Makefile \ renderers/gnome/Makefile \ \ entity/Makefile \ entity-config) echo echo \-\*\- Entity $VERSION \-\*\- echo echo Build Configuration: echo echo - GTK version `$GTK_CONFIG --version`. if test "$HAVE_PERL" != ""; then echo - Perl $HAVE_PERL. else echo - No Perl support. fi if test "$HAVE_TCL" != ""; then echo - Tcl $HAVE_TCL. else echo - No Tcl support. fi if test "$HAVE_PYTHON" != ""; then echo - Python version $HAVE_PYTHON. else echo - No Python support. fi if test "$HAVE_NJS" != ""; then echo - NJS version $HAVE_NJS. else echo - No JavaScript support. fi if test "$HAVE_IMLIB" != ""; then echo - gdk_imlib version $HAVE_IMLIB. else echo - No image support - gdk_imlib not found. fi echo if test _"$gmakepath" = _; then echo configure complete, now type \'make\' else echo configure complete, now type \'gmake\' fi echo