2006-06-06 10:51:22 +02:00
|
|
|
|
# -*- Autoconf -*-
|
|
|
|
|
# $Id: configure.ac,v 1.11 2006/04/09 13:59:44 r3mi Exp $
|
|
|
|
|
#
|
|
|
|
|
# Top-level configure.ac file for libupnp
|
|
|
|
|
#
|
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
#
|
|
|
|
|
# (C) Copyright 2005-2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
|
|
|
|
#
|
|
|
|
|
|
2007-02-02 04:44:55 +01:00
|
|
|
|
AC_PREREQ(2.60)
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
2007-02-02 04:44:55 +01:00
|
|
|
|
AC_INIT([libupnp], [1.4.2], [mroberto@users.sourceforge.net])
|
2006-06-06 10:51:22 +02:00
|
|
|
|
# *Independently* of the above libupnp package version, the libtool version
|
|
|
|
|
# of the 3 libraries need to be updated whenever there is a change released :
|
|
|
|
|
# "current:revision:age" (this is NOT the same as the package version), where:
|
|
|
|
|
# - library code modified: revision++
|
|
|
|
|
# - interfaces changed/added/removed: current++ and revision=0
|
|
|
|
|
# - interfaces added: age++
|
|
|
|
|
# - interfaces removed: age=0
|
|
|
|
|
# *please update only once, before a formal release, not for each change*
|
2007-01-06 20:16:12 +01:00
|
|
|
|
#
|
|
|
|
|
# For release 1.4.1, we had:
|
|
|
|
|
#AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
|
|
|
|
#AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
|
|
|
|
#AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
|
|
|
|
#
|
|
|
|
|
# "current:revision:age"
|
|
|
|
|
#
|
|
|
|
|
# - Code has changed in ixml
|
|
|
|
|
# revision: 2 -> 3
|
|
|
|
|
# - Code has changed in threadutil
|
|
|
|
|
# revision: 2 -> 3
|
|
|
|
|
# - Interface added in threadutil
|
|
|
|
|
# current: 2 -> 3
|
|
|
|
|
# revisiion: 3 -> 0
|
|
|
|
|
# age: 0 -> 1
|
|
|
|
|
# - Code has changed in upnp (revision 2 -> 3)
|
|
|
|
|
# revision: 2 -> 3
|
|
|
|
|
AC_SUBST([LT_VERSION_IXML], [2:3:0])
|
|
|
|
|
AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
|
|
|
|
|
AC_SUBST([LT_VERSION_UPNP], [2:3:0])
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AC_CONFIG_AUX_DIR(config.aux)
|
|
|
|
|
AC_CONFIG_MACRO_DIR(m4)
|
|
|
|
|
AC_CONFIG_SRCDIR(upnp/inc/upnp.h)
|
|
|
|
|
|
2007-02-02 05:21:21 +01:00
|
|
|
|
AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects dist-bzip2])
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# There are 3 configuration files :
|
|
|
|
|
# 1) "./autoconfig.h" is auto-generated and used only internally during build
|
|
|
|
|
# (usually named "config.h" but conflicts with the file below)
|
|
|
|
|
# 2) "./upnp/src/inc/config.h" is static and contains some compile-time
|
|
|
|
|
# parameters. This file was previously in "./upnp/inc" but is no longer
|
|
|
|
|
# installed (contains internal definitions only).
|
|
|
|
|
# 3) "./upnp/inc/upnpconfig.h" is auto-generated and installed with the
|
|
|
|
|
# libraries : it contains information on the configuration of the
|
|
|
|
|
# installed libraries.
|
|
|
|
|
#
|
|
|
|
|
AC_CONFIG_HEADERS([autoconfig.h upnp/inc/upnpconfig.h])
|
2006-08-17 07:16:23 +02:00
|
|
|
|
#AC_SYS_LARGEFILE_SENSITIVE
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
|
AC_REVISION([$Revision: 1.11 $])
|
|
|
|
|
|
|
|
|
|
upnpmaj=`echo "$PACKAGE_VERSION" | sed 's/\..*//' `
|
|
|
|
|
upnpmin=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.// ; s/[^0-9].*$//' `]
|
|
|
|
|
upnppatch=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.[^.]\.// ; s/[^0-9].*$//' `]
|
|
|
|
|
AC_DEFINE_UNQUOTED([UPNP_VERSION_STRING], "$PACKAGE_VERSION",
|
|
|
|
|
[see upnpconfig.h])
|
|
|
|
|
AC_DEFINE_UNQUOTED([UPNP_VERSION_MAJOR], $upnpmaj, [see upnpconfig.h])
|
|
|
|
|
AC_DEFINE_UNQUOTED([UPNP_VERSION_MINOR], $upnpmin, [see upnpconfig.h])
|
|
|
|
|
AC_DEFINE_UNQUOTED([UPNP_VERSION_PATCH], $upnppatch, [see upnpconfig.h])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Check for DEBUG flag
|
|
|
|
|
#
|
|
|
|
|
RT_BOOL_ARG_ENABLE([debug], [no], [extra debugging code])
|
|
|
|
|
if test "x$enable_debug" = xyes ; then
|
|
|
|
|
AC_DEFINE(UPNP_HAVE_DEBUG, 1, [see upnpconfig.h])
|
|
|
|
|
AC_DEFINE(DEBUG, 1, [Define to 1 to compile debug code])
|
|
|
|
|
else
|
|
|
|
|
AC_DEFINE(NO_DEBUG, 1, [Define to 1 to prevent some debug code])
|
|
|
|
|
AC_DEFINE(NDEBUG, 1, [Define to 1 to prevent compilation of assert()])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Check for libupnp subsets
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
RT_BOOL_ARG_ENABLE([client], [yes], [control point code (client)])
|
|
|
|
|
if test "x$enable_client" = xyes ; then
|
|
|
|
|
AC_DEFINE(UPNP_HAVE_CLIENT, 1, [see upnpconfig.h])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RT_BOOL_ARG_ENABLE([device], [yes],
|
|
|
|
|
[device specific code (implies --disable-webserver if disabled)])
|
|
|
|
|
if test "x$enable_device" = xyes ; then
|
|
|
|
|
AC_DEFINE(UPNP_HAVE_DEVICE, 1, [see upnpconfig.h])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if test "x$enable_device" = xno ; then
|
|
|
|
|
enable_webserver=no
|
|
|
|
|
else
|
|
|
|
|
RT_BOOL_ARG_ENABLE([webserver], [yes], [integrated web server])
|
|
|
|
|
fi
|
|
|
|
|
AM_CONDITIONAL(ENABLE_WEBSERVER, test x"$enable_webserver" = xyes)
|
|
|
|
|
if test "x$enable_webserver" = xyes ; then
|
|
|
|
|
AC_DEFINE(UPNP_HAVE_WEBSERVER, 1, [see upnpconfig.h])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RT_BOOL_ARG_ENABLE([tools], [yes], [helper APIs in upnptools.h])
|
|
|
|
|
if test "x$enable_tools" = xyes ; then
|
|
|
|
|
AC_DEFINE(UPNP_HAVE_TOOLS, 1, [see upnpconfig.h])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RT_BOOL_ARG_ENABLE([samples], [yes], [compilation of upnp/sample/ code])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# doc installation
|
2007-02-02 04:44:55 +01:00
|
|
|
|
# autoconf >= 2.60 already defines ${docdir}.
|
|
|
|
|
AC_MSG_CHECKING([for documentation directory])
|
|
|
|
|
AC_ARG_WITH([documentation],
|
|
|
|
|
AS_HELP_STRING([--with-documentation=directory_name],
|
|
|
|
|
[where documentation is installed
|
|
|
|
|
@<:@[DATADIR/doc/]AC_PACKAGE_NAME[-]AC_PACKAGE_VERSION@:>@])
|
|
|
|
|
AS_HELP_STRING([--without-documentation],
|
|
|
|
|
[do not install the documentation]),
|
|
|
|
|
[],
|
|
|
|
|
[with_documentation=no])
|
|
|
|
|
|
|
|
|
|
# If something has been entered after an equal sign, assume it is the directory
|
|
|
|
|
if test x"$with_documentation" != xyes -a x"$with_documentation" != xno; then
|
|
|
|
|
docdir="$with_documentation"
|
|
|
|
|
fi
|
|
|
|
|
AM_CONDITIONAL(WITH_DOCUMENTATION, test x"$with_documentation" != xno)
|
|
|
|
|
AC_SUBST(docdir)
|
|
|
|
|
AC_MSG_RESULT($docdir)
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Checks for programs
|
|
|
|
|
#
|
|
|
|
|
AC_PROG_CC
|
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
AC_PROG_MAKE_SET
|
2006-07-05 04:56:34 +02:00
|
|
|
|
AC_PROG_EGREP
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Default compilation flags
|
|
|
|
|
#
|
|
|
|
|
if test x"$enable_debug" = xyes; then
|
|
|
|
|
# AC_PROG_CC already sets CFLAGS to "-g -O2" by default
|
|
|
|
|
:
|
|
|
|
|
else
|
|
|
|
|
# add optimise for size
|
|
|
|
|
AX_CFLAGS_GCC_OPTION([-Os])
|
|
|
|
|
fi
|
|
|
|
|
AX_CFLAGS_WARN_ALL
|
|
|
|
|
|
2006-08-17 07:16:23 +02:00
|
|
|
|
#
|
|
|
|
|
# Lot's of stuff to ensure large file support
|
|
|
|
|
#
|
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
|
AC_DEFINE(_LARGE_FILE_SOURCE, [], [Large files support])
|
|
|
|
|
AC_DEFINE(_FILE_OFFSET_BITS, [64], [File Offset size])
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Checks for header files
|
|
|
|
|
#
|
|
|
|
|
AC_HEADER_STDC
|
|
|
|
|
# libupnp code doesn't use autoconf variables yet,
|
|
|
|
|
# so just abort if a header file is not found.
|
2006-07-09 18:52:20 +02:00
|
|
|
|
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h],[],[AC_MSG_ERROR([required header file missing])])
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics
|
|
|
|
|
#
|
|
|
|
|
AC_C_CONST
|
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
|
TYPE_SOCKLEN_T
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Checks for library functions
|
|
|
|
|
#
|
|
|
|
|
AC_FUNC_VPRINTF
|
|
|
|
|
AC_FUNC_FSEEKO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Checks for POSIX Threads
|
|
|
|
|
#
|
|
|
|
|
ACX_PTHREAD([],[AC_MSG_ERROR([POSIX threads are required to build this program])])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
|
ixml/Makefile
|
|
|
|
|
ixml/doc/Makefile
|
|
|
|
|
threadutil/Makefile
|
|
|
|
|
upnp/Makefile
|
|
|
|
|
upnp/doc/Makefile
|
2006-07-06 14:37:29 +02:00
|
|
|
|
docs/dist/Makefile
|
2006-06-06 10:51:22 +02:00
|
|
|
|
libupnp.pc
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
AC_OUTPUT
|
|
|
|
|
|