configure.ac 4.45 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
dnl 
dnl ref: http://www.gnu.org/software/autoconf/manual/autoconf.info.gz
dnl
AC_PREREQ(2.57)

dnl information on the package
dnl ---------------------------

dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
AC_INIT([sofia-sip], [1.11.7work])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.11])
dnl Includedir specific to this sofia version
AC_SUBST(include_sofiadir, '${includedir}/sofia-sip-1.11')
AC_SUBST(VER_LIBSOFIA_SIP_UA_INTERFACE_CURRENT, [0])
AC_SUBST(VER_LIBSOFIA_SIP_UA_INTERFACE_AGE, [0])
					    
Pekka Pessi's avatar
Pekka Pessi committed
# dnl calls AC_CANONICAL_ macros that are required by AM_INIT_AUTOMAKE
Pekka Pessi's avatar
Pekka Pessi committed

AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)

SAC_ENABLE_NDEBUG
Pekka Pessi's avatar
Pekka Pessi committed
SAC_ENABLE_EXPENSIVE_CHECKS
Pekka Pessi's avatar
Pekka Pessi committed

Pekka Pessi's avatar
Pekka Pessi committed
AC_GNU_SOURCE

### checks for programs
### -------------------
Martti Mela's avatar
Martti Mela committed
AC_CHECK_COMPILATION_ENVIRONMENT

Pekka Pessi's avatar
Pekka Pessi committed
AX_TOOL_CC
AC_PROG_INSTALL
AC_PROG_CPP
AC_CHECK_PROG(ETAGS, etags, etags, echo)
AC_CHECK_TOOL(AR, ar, ar)
AC_CHECK_TOOL(LD, ld, ld)
AC_PROG_LIBTOOL

AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen], [echo])
AM_CONDITIONAL([HAVE_DOXYGEN], [test $DOXYGEN = doxygen])

AC_ARG_WITH([aclocal],
[  --with-aclocal          Install m4 files in aclocal --print-ac-dir],
[if test "$with_aclocal" = "yes" ;  then
	m4dir=`$ACLOCAL --print-ac-dir`
else
	m4dir=`$with_aclocal --print-ac-dir`
fi], [m4dir='${datadir}/aclocal'])

AC_SUBST([m4dir])

### checks for libraries
### --------------------
Pekka Pessi's avatar
Pekka Pessi committed

SAC_SOFIA_SU
SAC_OPENSSL
SAC_TPORT
SAC_SU

### internal modules
### ----------------
Pekka Pessi's avatar
Pekka Pessi committed
AC_DEFINE([HAVE_SOFIA_SIP], 1, [Define as 1 always])
AC_DEFINE([HAVE_SOFIA_SRESOLV], 1, [Define as 1 if we use DNS library])
AC_DEFINE([HAVE_SOFIA_SMIME], 0, [Define as 1 if we use S/MIME library])

Pekka Pessi's avatar
Pekka Pessi committed
dnl Disable stun by default while it is broken
AC_ARG_ENABLE(stun,
[  --enable-stun               enable stun module (enabled)],
 , enable_stun=yes)
Pekka Pessi's avatar
Pekka Pessi committed

if test x$enable_stun = xno ; then
  AC_MSG_WARN([** STUN support disabled **])
elif test x${HAVE_OPENSSL} != x1 ; then
  dnl compile STUN only if OPENSSL is available
Martti Mela's avatar
Martti Mela committed
  AC_MSG_WARN([** TLS support for STUN disabled as OpenSSL headers and/or libraries were not found **])
  AC_DEFINE([HAVE_SOFIA_STUN], 1, [Define as 1 if we use STUN library])
  AC_DEFINE([HAVE_SOFIA_STUN], 1, [Define as 1 if we use STUN library])
Pekka Pessi's avatar
Pekka Pessi committed
AC_DEFINE([HAVE_SRTP], 0, [Define as 1 if we use SRTP])
AC_DEFINE([HAVE_UPNP], 0, [Define as 1 if we use UPnP])

### checks for header files
### -----------------------
Pekka Pessi's avatar
Pekka Pessi committed

Pekka Pessi's avatar
Pekka Pessi committed
### checks for declarations
### -----------------------
AC_CHECK_DECL([SIGPIPE], [
Pekka Pessi's avatar
Pekka Pessi committed
AC_DEFINE([HAVE_SIGPIPE], 1, [Define as 1 if you have SIGPIPE])],,[
#include <signal.h>
Pekka Pessi's avatar
Pekka Pessi committed
])

Pekka Pessi's avatar
Pekka Pessi committed
### checks for types
### ----------------

AC_TYPE_SIGNAL
Pekka Pessi's avatar
Pekka Pessi committed
AC_TYPE_LONGLONG([
AC_DEFINE([LLU], ["%llu"], [Define as format (%llu) for unsigned long long])dnl
AC_DEFINE([LLI], ["%lli"], [Define as format (%lli) for long long])dnl
AC_DEFINE([LLX], ["%llx"], [Define as format (%llx) for long long hex])dnl
Pekka Pessi's avatar
Pekka Pessi committed
])
Pekka Pessi's avatar
Pekka Pessi committed

### checks for structures
### ---------------------
Pekka Pessi's avatar
Pekka Pessi committed

### checks for typedefs, structures, and compiler characteristics.
### --------------------------------------------------------------
Pekka Pessi's avatar
Pekka Pessi committed
AC_C_CONST
AC_C_INLINE
AC_C_INLINE_DEFINE
AC_C_BIGENDIAN

AC_C_VAR_FUNC
AC_C_MACRO_FUNCTION
AC_C_KEYWORD_STRUCT

AC_HEADER_TIME
AC_TYPE_SIZE_T

AC_STRUCT_SIN6
AC_SYS_SA_LEN

### checks for library functions
### ----------------------------
Pekka Pessi's avatar
Pekka Pessi committed

### checks for system services
### --------------------------
Pekka Pessi's avatar
Pekka Pessi committed

### output
### ------
Pekka Pessi's avatar
Pekka Pessi committed

AC_CONFIG_FILES([
Makefile
Pekka Pessi's avatar
Pekka Pessi committed
packages/Makefile
packages/sofia-sip.spec
packages/sofia-sip-ua.pc
packages/sofia-sip-ua-glib.pc
Pekka Pessi's avatar
Pekka Pessi committed
libsofia-sip-ua/Makefile
libsofia-sip-ua/bnf/Makefile
libsofia-sip-ua/docs/Makefile
libsofia-sip-ua/docs/Doxyfile.version
libsofia-sip-ua/docs/sofia-footer.html
Pekka Pessi's avatar
Pekka Pessi committed
libsofia-sip-ua/features/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
libsofia-sip-ua/http/Makefile
libsofia-sip-ua/ipt/Makefile
libsofia-sip-ua/iptsec/Makefile
libsofia-sip-ua/msg/Makefile
libsofia-sip-ua/nea/Makefile
libsofia-sip-ua/nta/Makefile
libsofia-sip-ua/nth/Makefile
libsofia-sip-ua/nua/Makefile
libsofia-sip-ua/sdp/Makefile
libsofia-sip-ua/sip/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
libsofia-sip-ua/soa/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
libsofia-sip-ua/sresolv/Makefile 
libsofia-sip-ua/stun/Makefile
libsofia-sip-ua/su/Makefile
libsofia-sip-ua/tport/Makefile
libsofia-sip-ua/url/Makefile
libsofia-sip-ua/features/sofia-sip/sofia_features.h
libsofia-sip-ua-glib/Makefile
libsofia-sip-ua-glib/nua-glib/Makefile
libsofia-sip-ua-glib/su-glib/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
utils/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
win32/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
win32/config.h
Pekka Pessi's avatar
Pekka Pessi committed
])

AC_OUTPUT