dnl dnl dnl ProLinga-UI dnl dnl Copyright (C) 2002-2008 Xobas Software. dnl All rights reserved. dnl dnl This file is part of ProLinga-UI. dnl dnl ProLinga-UI is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation, either version 3 of the License, or dnl (at your option) any later version. dnl dnl ProLinga-UI is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with ProLinga-UI. If not, see . dnl dnl More information is available at the following addresses: dnl dnl Website : http://www.prolinga.org dnl dnl Email : prolinga-list@prolinga.org dnl dnl dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT(ProLinga-UI,0.0.1,prolinga-list@prolinga.org,prolinga-ui) AC_CONFIG_SRCDIR(src/UIConfig.cpp) AC_CONFIG_AUX_DIR(config) dnl Check for CPU / Vendor / OS AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET AC_LANG(C++) AM_CONFIG_HEADER(src/config.h:src/config-h.in) AM_INIT_AUTOMAKE dnl set host/node name HOST_NODE_NAME=`(hostname || uname -n) 2>/dev/null | sed 1q` AC_SUBST(HOST_NODE_NAME) dnl set home dir HOME_DIR=`echo $HOME` AC_SUBST(HOME_DIR) dnl set required 3rd party versions PKG_CONFIG_REQUIRED_VERSION=0.7.0 LIBXML_REQUIRED_VERSION=2.6.5 LIBXSLT_REQUIRED_VERSION=1.0.33 GTK_REQUIRED_VERSION=2.6.0 LIBGLADE_PACKAGE="libglade-2.0" LIBGLADE_REQUIRED_VERSION=2.6.0 PROLINGASOAP_PACKAGE="prolinga-soap" PROLINGASOAP_REQUIRED_VERSION=0.0.1 dnl Set default pkg search path PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig" dnl Enable debugging mode AC_ARG_ENABLE(debug, [ --enable-debug Enable debug messages], CFLAGS="$CFLAGS -DDEBUG -O0 -g" CXXFLAGS="$CFLAGS -DDEBUG -O0 -g") AC_ARG_ENABLE(gprof, [ --enable-gprof Enable profiling with gprof], CFLAGS="$CFLAGS -pg" CXXFLAGS="$CFLAGS -pg" LDFLAGS="$LDFLAGS -pg" ) dnl Enable stripped and optimized release builds AC_ARG_ENABLE(final, [ --enable-final Build release executables (GCC only)], if test "x$GCC" != xyes; then CFLAGS="$CFLAGS -DNDEBUG -Os -s -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS" CXXFLAGS="$CXXFLAGS -DNDEBUG -Os -s -fno-exceptions -fno-check-new -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS" fi) dnl Enable compiler warnings AC_ARG_ENABLE(warnings, [ --enable-warnings Enable compiler warnings (GCC only)], if test "x$GCC" != xyes; then CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wmissing-declarations -Wparentheses -Wpointer-arith" CXXFLAGS="$CXXFLAGS -Wall -Wparentheses -Wpointer-arith" fi) dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_CXXCPP AC_PROG_INSTALL #AC_PROG_RANLIB dnl cygwin dlls do not accept undefined links case "$host_os" in *cygwin) LDFLAGS="-no-undefined $LDFLAGS" AC_LIBTOOL_WIN32_DLL ;; esac AC_PROG_LIBTOOL dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(ctype.h fcntl.h signal.h stddef.h time.h) dnl Checks for typedefs, structures and compiler characteristics. AC_C_CONST AC_CHECK_TYPES(bool) AC_HEADER_STDBOOL AC_STRUCT_TM AC_TYPE_PID_T AC_TYPE_SIGNAL #AC_TYPE_SIZE_T dnl Checks for library functions. AC_FUNC_FORK AC_FUNC_STRTOD AC_CHECK_FUNCS(strcspn strstr) dnl Check 3rd party products dnl dnl If pkg-config available use it, otherwise ignore dnl Not sure how widely accepted/available pkg-config is dnl AC_PATH_PROG(PKG_CONFIG, pkg-config, no) dnl test if pkg-config is available and if so if correct version if test "x$PKG_CONFIG" = "xno" then AC_MSG_NOTICE([Could not find pkg-config anywhere (optional). It is recommended to have pkg-config available for library compile/link flag detections during configure. Check http://www.freedesktop.org/software/pkgconfig/ for details.]) else AC_MSG_CHECKING(for pkg-config >= $PKG_CONFIG_REQUIRED_VERSION) if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_REQUIRED_VERSION then AC_MSG_RESULT(yes) else PKG_CONFIG_VERS=`$PKG_CONFIG --version` AC_MSG_RESULT(Version $PKG_CONFIG_VERS found. You need at least pkg-config $PKG_CONFIG_REQUIRED_VERSION for this version of ProLinga-Web) PKG_CONFIG="no" fi fi dnl dnl specify location of libxml2 dnl LIBXML_CONFIG_PREFIX="" LIBXML_CXXFLAGS="" LIBXML_LIBS="" AC_ARG_WITH(libxml-prefix, [ --with-libxml-prefix=[PFX] Specify location of libxml config], LIBXML_CONFIG_PREFIX=$withval ) AC_ARG_WITH(libxml-include-prefix, [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers], LIBXML_CXXFLAGS="-I$withval" ) AC_ARG_WITH(libxml-libs-prefix, [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs], LIBXML_LIBS="-L$withval" ) dnl where is xml2-config AC_SUBST(LIBXML_REQUIRED_VERSION) AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION) if test "x$LIBXML_CONFIG_PREFIX" != "x" then XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config else XML_CONFIG=xml2-config fi dnl check version number AC_DEFUN([VERSION_TO_NUMBER], [`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`]) if ${XML_CONFIG} --libs print > /dev/null 2>&1 then XMLVERS=`$XML_CONFIG --version` if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION) then PKG_CONFIG_PATH="`$XML_CONFIG --prefix`/lib/pkgconfig:$PKG_CONFIG_PATH" LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`" LIBXML_CXXFLAGS="$LIBXML_CXXFLAGS `$XML_CONFIG --cflags`" AC_MSG_RESULT($XMLVERS found) else AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of ProLinga-Run) fi else AC_MSG_ERROR([Could not find libxml2 anywhere, check http://xmlsoft.org/.]) fi AC_SUBST(XML_CONFIG) AC_SUBST(LIBXML_LIBS) AC_SUBST(LIBXML_CXXFLAGS) dnl dnl specify location of GTK dnl GTK_PREFIX="" GTK_CXXFLAGS="" GTK_LIBS="" AC_ARG_WITH(gtk-prefix, [ --with-gtk-prefix=[PFX] Specify location of GTK+], GTK_PREFIX=$withval ) AC_ARG_WITH(gtk-include-prefix, [ --with-gtk-include-prefix=[PFX] Specify location of GTK+ headers], GTK_CXXFLAGS="-I$withval" ) AC_ARG_WITH(gtk-libs-prefix, [ --with-gtk-libs-prefix=[PFX] Specify location of GTK+ libs], GTK_LIBS="-L$withval" ) if test $GTK_PREFIX then PKG_CONFIG_PATH="$GTK_PREFIX:$PKG_CONFIG_PATH" fi if test $GTK_LIBS then PKG_CONFIG_PATH="`echo $GTK_LIBS | sed -e 's/-L//'`:$PKG_CONFIG_PATH" fi AC_MSG_CHECKING(for GTK+ libraries >= $GTK_REQUIRED_VERSION) PKG_CONFIG=pkg-config if `$PKG_CONFIG --atleast-version $GTK_REQUIRED_VERSION gtk+-2.0` then AC_MSG_RESULT(found) else AC_MSG_ERROR(You need at least GTK+ $GTK_REQUIRED_VERSION for this version of ProLinga-Run) fi GTK_CXXFLAGS="$GTK_CXXFLAGS `$PKG_CONFIG --cflags gtk+-2.0`" GTK_LIBS="$GTK_LIBS `$PKG_CONFIG --libs gtk+-2.0`" AC_SUBST(GTK_CXXFLAGS) AC_SUBST(GTK_LIBS) dnl dnl specify location of Libglade-2.0 dnl LIBGLADE_PREFIX="" LIBGLADE_CXXFLAGS="" LIBGLADE_LIBS="" AC_ARG_WITH(libglade-prefix, [ --with-libglade-prefix=[PFX] Specify location of Libglade-2.0], LIBGLADE_PREFIX=$withval ) AC_ARG_WITH(libglade-include-prefix, [ --with-libglade-include-prefix=[PFX] Specify location of Libglade-2.0 headers], LIBGLADE_CXXFLAGS="-I$withval" ) AC_ARG_WITH(libglade-libs-prefix, [ --with-libglade-libs-prefix=[PFX] Specify location of Libglade-2.0 libs], LIBGLADE_LIBS="-L$withval" ) dnl dnl use pkg-config if available dnl if test "x$PKG_CONFIG" != "xno" then dnl use pkg-config for version check and compile/link flag detection. AC_MSG_CHECKING(for Libglade-2.0 libraries >= $LIBGLADE_REQUIRED_VERSION) dnl create pkg-config search path PKG_CONFIG_SEARCH="" if test $LIBGLADE_PREFIX then PKG_CONFIG_SEARCH="$LIBGLADE_PREFIX/lib/pkgconfig" fi if test $LIBGLADE_LIBS then SEARCH_LIB=`echo $LIBGLADE_LIBS | sed -e 's/-L//'` PKG_CONFIG_SEARCH="$PKG_CONFIG_SEARCH:$SEARCH_LIB/pkgconfig" fi PKG_CONFIG_PATH="$PKG_CONFIG_SEARCH:$PKG_CONFIG_PATH" dnl check version if `export PKG_CONFIG_PATH; $PKG_CONFIG --modversion $LIBGLADE_PACKAGE >/dev/null 2>&1` then LIBGLADEVERS=`export PKG_CONFIG_PATH; $PKG_CONFIG --modversion $LIBGLADE_PACKAGE` if `export PKG_CONFIG_PATH; $PKG_CONFIG --atleast-version=$LIBGLADE_REQUIRED_VERSION $LIBGLADE_PACKAGE` then LIBGLADE_CXXFLAGS="$LIBGLADE_CXXFLAGS `export PKG_CONFIG_PATH; $PKG_CONFIG --cflags $LIBGLADE_PACKAGE`" LIBGLADE_LIBS="$LIBGLADE_LIBS `export PKG_CONFIG_PATH; $PKG_CONFIG --libs $LIBGLADE_PACKAGE`" AC_MSG_RESULT($LIBGLADEVERS found) else AC_MSG_ERROR(Version $LIBGLADEVERS found. You need at least Libglade-2.0 $LIBGLADE_REQUIRED_VERSION for this version of ProLinga-Run) fi else `export PKG_CONFIG_PATH; $PKG_CONFIG --modversion $LIBGLADE_PACKAGE` AC_MSG_ERROR([Could not find Libglade-2.0 or one of its dependencies. Check that PKG_CONFIG_PATH contains the correct package settings. Check http://www.daa.com.au/~james/software/libglade/ for more info.]) fi else dnl check if libraries are there AC_MSG_CHECKING(for Libglade-2.0 libraries ) if test -f `echo $LIBGLADE_LIBS | sed -e 's/-L//'`/libglade-2.0.la || test -f $LIBGLADE_PREFIX/lib/libglade-2.0.la \ || test -f /usr/lib/libglade-2.0.la || test -f /usr/local/lib/libglade-2.0.la then AC_MSG_RESULT(found) else AC_MSG_ERROR([Could not find Libglade-2.0 anywhere, check http://www.daa.com.au/~james/software/libglade/.]) fi if test $LIBGLADE_PREFIX then LIBGLADE_CXXFLAGS="$LIBGLADE_CXXFLAGS -I$LIBGLADE_PREFIX/include/libglade-2.0" LIBGLADE_LIBS="$LIBGLADE_LIBS -L$LIBGLADE_PREFIX/lib" fi fi dnl export values AC_SUBST(LIBGLADE_LIBS) AC_SUBST(LIBGLADE_CXXFLAGS) dnl dnl specify location of ProLinga-Soap dnl PROLINGASOAP_PREFIX="" PROLINGASOAP_CXXFLAGS="" PROLINGASOAP_LIBS="" if test "x$DISABLE_SOAP" != xyes then AC_ARG_WITH(prolingasoap-prefix, [ --with-prolingasoap-prefix=[PFX] Specify location of ProLinga-Soap], PROLINGASOAP_PREFIX=$withval ) AC_ARG_WITH(prolingasoap-include-prefix, [ --with-prolingasoap-include-prefix=[PFX] Specify location of ProLinga-Soap headers], PROLINGASOAP_CXXFLAGS="-I$withval" ) AC_ARG_WITH(prolingasoap-libs-prefix, [ --with-prolingasoap-libs-prefix=[PFX] Specify location of ProLinga-Soap libs], PROLINGASOAP_LIBS="-L$withval" ) dnl dnl use pkg-config if available dnl if test "x$PKG_CONFIG" != "xno" then dnl use pkg-config for version check and compile/link flag detection. AC_MSG_CHECKING(for ProLinga-Soap libraries >= $PROLINGASOAP_REQUIRED_VERSION) dnl create pkg-config search path PKG_CONFIG_SEARCH="" if test $PROLINGASOAP_PREFIX then PKG_CONFIG_SEARCH="$PROLINGASOAP_PREFIX/lib/pkgconfig" fi if test $PROLINGASOAP_LIBS then SEARCH_LIB=`echo $PROLINGASOAP_LIBS | sed -e 's/-L//'` PKG_CONFIG_SEARCH="$PKG_CONFIG_SEARCH:$SEARCH_LIB/pkgconfig" fi PKG_CONFIG_PATH="$PKG_CONFIG_SEARCH:$PKG_CONFIG_PATH" dnl check version if `export PKG_CONFIG_PATH; $PKG_CONFIG --modversion $PROLINGASOAP_PACKAGE >/dev/null 2>&1` then SOAPVERS=`export PKG_CONFIG_PATH; $PKG_CONFIG --modversion $PROLINGASOAP_PACKAGE` if `export PKG_CONFIG_PATH; $PKG_CONFIG --atleast-version=$PROLINGASOAP_REQUIRED_VERSION $PROLINGASOAP_PACKAGE` then PROLINGASOAP_CXXFLAGS="$PROLINGASOAP_CXXFLAGS `export PKG_CONFIG_PATH; $PKG_CONFIG --cflags $PROLINGASOAP_PACKAGE`" PROLINGASOAP_LIBS="$PROLINGASOAP_LIBS `export PKG_CONFIG_PATH; $PKG_CONFIG --libs-only-L $PROLINGASOAP_PACKAGE`" AC_MSG_RESULT($SOAPVERS found) else AC_MSG_ERROR(Version $SOAPVERS found. You need at least ProLinga-Soap $PROLINGASOAP_REQUIRED_VERSION for this version of ProLinga-Run) fi else `export PKG_CONFIG_PATH; $PKG_CONFIG --modversion $PROLINGASOAP_PACKAGE` AC_MSG_ERROR([Could not find ProLinga-Soap or one of its dependencies. Check that PKG_CONFIG_PATH contains the correct package settings. Check http://www.prolinga.org/ for more info.]) fi else dnl check if libraries are there AC_MSG_CHECKING(for ProLinga-Soap libraries ) if test -f `echo $PROLINGASOAP_LIBS | sed -e 's/-L//'`/libprolingasoapclient.la || test -f $PROLINGASOAP_PREFIX/lib/libprolingasoapclient.la \ || test -f /usr/lib/libprolingasoapclient.la || test -f /usr/local/lib/libprolingasoapclient.la then AC_MSG_RESULT(found) else AC_MSG_ERROR([Could not find ProLinga-Soap anywhere, check http://www.prolinga.org/.]) fi if test $PROLINGASOAP_PREFIX then PROLINGASOAP_CXXFLAGS="$PROLINGASOAP_CXXFLAGS -I$PROLINGASOAP_PREFIX/include" PROLINGASOAP_LIBS="$PROLINGASOAP_LIBS -L$PROLINGASOAP_PREFIX/lib" fi fi DEFINE_NOBUILD_SOAP="-DNOBUILD_SOAP" AC_SUBST(DEFINE_NOBUILD_SOAP) fi dnl export values AC_SUBST(PROLINGASOAP_LIBS) AC_SUBST(PROLINGASOAP_CXXFLAGS) dnl create output values AC_OUTPUT(Makefile prolinga-ui.pc src/Makefile prolinga/prolingauicfg.xml prolinga/prolingauisvc.xml prolinga/Makefile doc/Makefile doc/version.txt)