configure.ac 5.46 KB
Newer Older
1 2 3 4
dnl Copyright (C) 2005-2006 Nokia Corporation
dnl Contact: Pekka Pessi <pekka.pessi@nokia.com>
dnl Licensed under LGPL. See file COPYING.

Pekka Pessi's avatar
Pekka Pessi committed
5 6 7 8 9 10 11 12
dnl 
dnl ref: http://www.gnu.org/software/autoconf/manual/autoconf.info.gz
dnl
AC_PREREQ(2.57)

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

13
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
14
AC_INIT([sofia-sip], [1.12.3work])
15
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
16
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.12])
17
dnl Includedir specific to this sofia version
18
AC_SUBST(include_sofiadir, '${includedir}/sofia-sip-1.12')
19
AC_SUBST(LIBVER_SOFIA_SIP_UA_CUR, [3])
20
AC_SUBST(LIBVER_SOFIA_SIP_UA_REV, [0])
21
AC_SUBST(LIBVER_SOFIA_SIP_UA_AGE, [3])
22
AC_SUBST(LIBVER_SOFIA_SIP_UA_SOVER, [0]) # CUR-AGE
23
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_CUR, [1])
24
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_REV, [0])
25
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_AGE, [1])
26
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_SOVER, [0]) # CUR-AGE
27
					    
Pekka Pessi's avatar
Pekka Pessi committed
28
# dnl calls AC_CANONICAL_ macros that are required by AM_INIT_AUTOMAKE
29
SAC_CANONICAL_SYSTEM_CACHE_CHECK
Pekka Pessi's avatar
Pekka Pessi committed
30 31 32

AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
33
AC_CONFIG_HEADERS([config.h])
Pekka Pessi's avatar
Pekka Pessi committed
34 35

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

Pekka Pessi's avatar
Pekka Pessi committed
38 39
AC_GNU_SOURCE

40 41
### checks for programs
### -------------------
42
AC_LANG([C])
Martti Mela's avatar
Martti Mela committed
43 44
AC_CHECK_COMPILATION_ENVIRONMENT

Pekka Pessi's avatar
Pekka Pessi committed
45 46 47 48 49 50 51 52
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

53 54 55
dnl Add parameters for aclocal
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")

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

59 60 61 62 63 64 65 66 67 68
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])

69 70
### checks for libraries
### --------------------
Pekka Pessi's avatar
Pekka Pessi committed
71 72 73 74 75 76

SAC_SOFIA_SU
SAC_OPENSSL
SAC_TPORT
SAC_SU

77 78
### internal modules
### ----------------
79 80 81
AC_DEFINE([HAVE_SOFIA_SIP], 1, [Define to 1 always])
AC_DEFINE([HAVE_SOFIA_SRESOLV], 1, [Define to 1 if we use DNS library])
AC_DEFINE([HAVE_SOFIA_SMIME], 0, [Define to 1 if we use S/MIME library])
Pekka Pessi's avatar
Pekka Pessi committed
82

Pekka Pessi's avatar
Pekka Pessi committed
83
AC_ARG_ENABLE(stun,
84
[  --disable-stun              disable stun module (enabled)],
85
 , enable_stun=yes)
Pekka Pessi's avatar
Pekka Pessi committed
86 87 88 89 90

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
91
  AC_MSG_WARN([** TLS support for STUN disabled as OpenSSL headers and/or libraries were not found **])
92
  AC_DEFINE([HAVE_SOFIA_STUN], 1, [Define to 1 if we use STUN library])
93
else
94
  AC_DEFINE([HAVE_SOFIA_STUN], 1, [Define to 1 if we use STUN library])
95 96
fi

97 98 99 100 101
dnl Disable NTLM support by default
AC_ARG_ENABLE(ntlm,
[  --enable-ntlm               enable NTLM support (disabled)],
 , enable_ntlm=no)

102
if test x$enable_ntlm = xyes ; then
103
  AC_DEFINE([HAVE_SOFIA_NTLM], 1, [Define to 1 if we use NTLM library])
104
fi
105
AM_CONDITIONAL([HAVE_NTLM], [test "x$enable_ntlm" = xyes])
106 107


108 109
AC_DEFINE([HAVE_SRTP], 0, [Define to 1 if we use SRTP])
AC_DEFINE([HAVE_UPNP], 0, [Define to 1 if we use UPnP])
Pekka Pessi's avatar
Pekka Pessi committed
110

111 112
### checks for header files
### -----------------------
113
AC_HEADER_STDC
Pekka Pessi's avatar
Pekka Pessi committed
114

Pekka Pessi's avatar
Pekka Pessi committed
115 116 117
### checks for declarations
### -----------------------
AC_CHECK_DECL([SIGPIPE], [
118
AC_DEFINE([HAVE_SIGPIPE], 1, [Define to 1 if you have SIGPIPE])],,[
Pekka Pessi's avatar
Pekka Pessi committed
119
#include <signal.h>
Pekka Pessi's avatar
Pekka Pessi committed
120 121
])

Pekka Pessi's avatar
Pekka Pessi committed
122 123 124 125
### checks for types
### ----------------

AC_TYPE_SIGNAL
Pekka Pessi's avatar
Pekka Pessi committed
126
AC_TYPE_LONGLONG([
127 128 129
AC_DEFINE([LLU], ["%llu"], [Define to format (%llu) for unsigned long long])dnl
AC_DEFINE([LLI], ["%lli"], [Define to format (%lli) for long long])dnl
AC_DEFINE([LLX], ["%llx"], [Define to format (%llx) for long long hex])dnl
Pekka Pessi's avatar
Pekka Pessi committed
130
])
131 132
AC_DEFINE([MOD_ZD], ["%zd"], [Define printf() modifier for ssize_t])
AC_DEFINE([MOD_ZU], ["%zu"], [Define printf() modifier for size_t])
Pekka Pessi's avatar
Pekka Pessi committed
133

134 135
### checks for structures
### ---------------------
Pekka Pessi's avatar
Pekka Pessi committed
136

137 138
### checks for typedefs, structures, and compiler characteristics.
### --------------------------------------------------------------
Pekka Pessi's avatar
Pekka Pessi committed
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
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

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

157 158
### checks for system services
### --------------------------
159 160

AC_DEV_URANDOM
Pekka Pessi's avatar
Pekka Pessi committed
161

162 163
### output
### ------
Pekka Pessi's avatar
Pekka Pessi committed
164 165 166

AC_CONFIG_FILES([
Makefile
Pekka Pessi's avatar
Pekka Pessi committed
167
packages/Makefile
168
packages/sofia-sip-ua.pc
169
packages/sofia-sip-ua-glib.pc
Pekka Pessi's avatar
Pekka Pessi committed
170 171 172 173 174
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
175
libsofia-sip-ua/features/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
176 177 178 179 180 181 182 183 184 185
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
186
libsofia-sip-ua/soa/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
187 188 189 190 191
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
192
libsofia-sip-ua/features/sofia-sip/sofia_features.h
193 194 195
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
196
utils/Makefile
197
utils/Doxyfile.build
Pekka Pessi's avatar
Pekka Pessi committed
198
win32/Makefile
199
win32/config.h
Pekka Pessi's avatar
Pekka Pessi committed
200 201
])

202 203 204
AC_CONFIG_COMMANDS([version],,[PACKAGE_VERSION=${PACKAGE_VERSION}])
AC_CONFIG_FILES([packages/sofia-sip-${PACKAGE_VERSION}.spec:packages/sofia-sip.spec.in])

Pekka Pessi's avatar
Pekka Pessi committed
205
AC_OUTPUT