dnl dnl dnl ProLinga-Soap dnl dnl Copyright (C) 2002-2009 Xobas Software. dnl All rights reserved. dnl dnl This file is part of ProLinga-Soap. dnl dnl ProLinga-Soap 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-Soap 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-Soap. 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 dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT(ProLinga-Soap,0.0.4,prolinga-list@prolinga.org,prolinga-soap) AC_CONFIG_SRCDIR(src/SoapProLinga.cpp) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR([m4]) 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 check for gtk-doc dnl GTK_DOC_CHECK(1.0) dnl set required libxml2 version LIBXML_REQUIRED_VERSION=2.6.5 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 By default build static and no shared libs AC_ENABLE_SHARED(yes) AC_ENABLE_STATIC(yes) dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_CXXCPP AC_PROG_INSTALL dnl AC_PROG_RANLIB dnl Set additional link flags dnl cygwin requires no undefined links in dlls. dnl XbSoapLink.cpp must be undefined, so no dll possible here. SOAPCLIENT_LDFLAGS="" SOAPSERVER_LDFLAGS="" case "$host_os" in *cygwin) SOAPCLIENT_LDFLAGS="-no-undefined" AC_LIBTOOL_WIN32_DLL ;; esac AC_SUBST(SOAPCLIENT_LDFLAGS) AC_SUBST(SOAPSERVER_LDFLAGS) AC_PROG_LIBTOOL dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdarg.h sys/socket.h sys/time.h sys/timeb.h) dnl Checks for typedefs, structures and compiler characteristics. #AC_HEADER_STDBOOL AC_C_CONST AC_STRUCT_TM AC_TYPE_SIZE_T dnl Checks for library functions. AC_FUNC_MKTIME AC_FUNC_SELECT_ARGTYPES AC_FUNC_STRFTIME AC_FUNC_STRTOD AC_FUNC_VPRINTF AC_CHECK_FUNCS(ftime gettimeofday localtime_r tzset) #AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname)) #AC_CHECK_FUNCS(inet_ntoa,,AC_CHECK_LIB(nsl,inet_ntoa)) AC_CHECK_FUNCS(socket inet_ntoa gethostbyname) AC_CHECK_FUNCS(memset putenv select) AC_CHECK_FUNCS(strchr strerror strrchr strstr strtol strtoul) #AC_CHECK_FUNC(bla, :, AC_MSG_ERROR([bla() required.])) dnl Check 3rd party products dnl specify location of libxml2 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 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-Soap) 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) AC_OUTPUT(Makefile prolinga-soap.pc prolinga-soapclient.pc src/Makefile prolinga/Makefile doc/Makefile doc/version.txt)