configure.ac 8.69 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.7devel])
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, [6])
20
AC_SUBST(LIBVER_SOFIA_SIP_UA_REV, [0])
21
AC_SUBST(LIBVER_SOFIA_SIP_UA_AGE, [6])
22
AC_SUBST(LIBVER_SOFIA_SIP_UA_SOVER, [0]) # CUR-AGE
23
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_CUR, [3])
24
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_REV, [0])
25
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_AGE, [0])
26
AC_SUBST(LIBVER_SOFIA_SIP_UA_GLIB_SOVER, [3]) # 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

Pekka Pessi's avatar
Pekka Pessi committed
35 36
AC_GNU_SOURCE

37 38
### checks for programs
### -------------------
39
AC_LANG([C])
Martti Mela's avatar
Martti Mela committed
40 41
AC_CHECK_COMPILATION_ENVIRONMENT

42
SAC_TOOL_CC
Pekka Pessi's avatar
Pekka Pessi committed
43 44 45 46 47 48 49
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

50 51 52
SAC_ENABLE_NDEBUG
SAC_ENABLE_EXPENSIVE_CHECKS

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

56 57 58 59 60 61 62 63 64
AC_ARG_WITH(doxygen,
[  --with-doxygen[[=CMD]]    use doxygen command CMD [[doxygen]]],[
case $enable_doxygen in 
yes ) doxygen=doxygen ;;
no ) doxygen=echo ;;
esac], doxygen=doxygen)

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

66 67
### checks for libraries
### --------------------
Pekka Pessi's avatar
Pekka Pessi committed
68 69 70 71 72

SAC_SOFIA_SU
SAC_OPENSSL
SAC_TPORT

73 74 75 76
dnl Check is used for testing
PKG_CHECK_MODULES(CHECK, check >= 0.9.4, have_check="yes", have_check="no")
AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")

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
fi
96 97 98
AM_CONDITIONAL([HAVE_STUN], [test "x$enable_stun" = xyes])

AC_ARG_ENABLE(nth,
99
[  --disable-nth           disable HTTP-related modules nth and http (enabled)],
100 101 102 103
 , enable_nth=yes)
AM_CONDITIONAL([HAVE_NTH], [test "x$enable_nth" = xyes])
if test x$enable_nth = xyes ; then
  AC_DEFINE([HAVE_SOFIA_NTH], 1, [Define to 1 if we use NTH library])
104
  AC_DEFINE([HAVE_SOFIA_HTTP], 1, [Define to 1 if we use HTTP parser library])
105
fi
106

107 108
dnl Disable NTLM support by default
AC_ARG_ENABLE(ntlm,
109
[  --enable-ntlm           enable NTLM support [[disabled]]],
110 111
 , enable_ntlm=no)

112
if test x$enable_ntlm = xyes ; then
113
  AC_DEFINE([HAVE_SOFIA_NTLM], 1, [Define to 1 if we use NTLM library])
114
fi
115
AM_CONDITIONAL([HAVE_NTLM], [test "x$enable_ntlm" = xyes])
116 117


118 119
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
120

121 122
### checks for header files
### -----------------------
123
AC_HEADER_STDC
Pekka Pessi's avatar
Pekka Pessi committed
124

Pekka Pessi's avatar
Pekka Pessi committed
125 126 127
### checks for declarations
### -----------------------

Pekka Pessi's avatar
Pekka Pessi committed
128 129 130 131
### checks for types
### ----------------

AC_TYPE_SIGNAL
Pekka Pessi's avatar
Pekka Pessi committed
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
AC_TYPE_LONGLONG

dnl
dnl Define HAVE_C99_FORMAT to 1 if the formatted IO functions (printf/scanf
dnl et.al.) support the C99 'size specifiers', namely ll, hh, j, z, t
dnl (representing long long int, char, intmax_t, size_t, ptrdiff_t). Some C
dnl compilers supported these specifiers prior to C99 as an extension.
dnl
AC_CACHE_CHECK([whether IO functions support C99 size specifiers],
[ac_cv_c_c99_format],[

ac_cv_c_c99_format=yes

AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[64];
 if (sprintf(buf, "%lld%hhd%jd%zd%td", (long long int)1, (char)2, (intmax_t)3, (size_t)4, (ptrdiff_t)5) != 5)
  exit(1);
 else if (strcmp(buf, "12345"))
  exit(2);]])],
 [ac_cv_c_c99_format=yes],
 [ac_cv_c_c99_format=no],
 [ac_cv_c_c99_format=yes])
])

if test $ac_cv_c_c99_format = yes; then
  AC_DEFINE([HAVE_C99_FORMAT], [1], [Define to 1 if printf supports C99 size specifiers])dnl

  AC_DEFINE([LLU], ["%llu"], [Format (%llu) for unsigned long long])dnl
  AC_DEFINE([LLI], ["%lli"], [Format (%lli) for long long])dnl
  AC_DEFINE([LLX], ["%llx"], [Format (%llx) for long long hex])dnl
  AC_DEFINE([MOD_ZD], ["%zd"], [Define printf() modifier for ssize_t])dnl
  AC_DEFINE([MOD_ZU], ["%zu"], [Define printf() modifier for size_t])dnl

else

AC_CACHE_CHECK([whether IO functions support size specifier for long long],
[ac_cv_c_ll_format],[

ac_cv_c_ll_format=yes

AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[64];
 if (sprintf(buf, "%lld", (long long int)1) != 1)
  exit(1);
 else if (strcmp(buf, "1"))
  exit(2);]])],
 [ac_cv_c_ll_format=yes],
 [ac_cv_c_ll_format=no],
 [ac_cv_c_ll_format=yes])
Pekka Pessi's avatar
Pekka Pessi committed
181
])
Pekka Pessi's avatar
Pekka Pessi committed
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217

if test $ac_cv_c_ll_format = yes; then
  AC_DEFINE([LLU], ["%llu"], [Format (%llu) for unsigned long long])dnl
  AC_DEFINE([LLI], ["%lli"], [Format (%lli) for long long])dnl
  AC_DEFINE([LLX], ["%llx"], [Format (%llx) for long long hex])dnl
else
  AC_MSG_ERROR("printf cannot handle 64-bit integers")
fi

AC_CACHE_CHECK([whether IO functions support size specifier for size_t],
[ac_cv_c_z_format],[

ac_cv_c_z_format=yes

AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[64];
 if (sprintf(buf, "%zd", (size_t)1) != 1)
  exit(1);
 else if (strcmp(buf, "1"))
  exit(2);]])],
 [ac_cv_c_z_format=yes],
 [ac_cv_c_z_format=no],
 [ac_cv_c_z_format=yes])
])

if test $ac_cv_c_z_format = yes; then
  AC_DEFINE([MOD_ZD], ["%ld"], [Define printf() modifier for ssize_t])dnl
  AC_DEFINE([MOD_ZU], ["%lu"], [Define printf() modifier for size_t])dnl
else 
  dnl Cross fingers
  AC_MSG_WARN("printf cannot handle size_t, using long instead")
  AC_DEFINE([MOD_ZD], ["%ld"], [Define printf() modifier for ssize_t])dnl
  AC_DEFINE([MOD_ZU], ["%lu"], [Define printf() modifier for size_t])dnl
fi 

fi
Pekka Pessi's avatar
Pekka Pessi committed
218

219 220
### checks for structures
### ---------------------
Pekka Pessi's avatar
Pekka Pessi committed
221

222 223
### checks for typedefs, structures, and compiler characteristics.
### --------------------------------------------------------------
Pekka Pessi's avatar
Pekka Pessi committed
224 225 226 227 228 229 230 231 232 233 234 235 236 237
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_SYS_SA_LEN

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

241 242
### checks for system services
### --------------------------
243 244

AC_DEV_URANDOM
Pekka Pessi's avatar
Pekka Pessi committed
245

246 247
### output
### ------
Pekka Pessi's avatar
Pekka Pessi committed
248 249 250

AC_CONFIG_FILES([
Makefile
Pekka Pessi's avatar
Pekka Pessi committed
251
packages/Makefile
252
packages/sofia-sip-ua.pc
253
packages/sofia-sip-ua-glib.pc
Pekka Pessi's avatar
Pekka Pessi committed
254 255
libsofia-sip-ua/Makefile
libsofia-sip-ua/bnf/Makefile
256
libsofia-sip-ua/bnf/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
257
libsofia-sip-ua/docs/Makefile
258
libsofia-sip-ua/docs/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
259 260
libsofia-sip-ua/docs/Doxyfile.version
libsofia-sip-ua/docs/sofia-footer.html
261
libsofia-sip-ua/features/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
262
libsofia-sip-ua/features/Makefile
263
libsofia-sip-ua/http/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
264
libsofia-sip-ua/http/Makefile
265
libsofia-sip-ua/ipt/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
266
libsofia-sip-ua/ipt/Makefile
267
libsofia-sip-ua/iptsec/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
268
libsofia-sip-ua/iptsec/Makefile
269
libsofia-sip-ua/msg/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
270
libsofia-sip-ua/msg/Makefile
271
libsofia-sip-ua/nea/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
272
libsofia-sip-ua/nea/Makefile
273
libsofia-sip-ua/nta/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
274
libsofia-sip-ua/nta/Makefile
275
libsofia-sip-ua/nth/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
276
libsofia-sip-ua/nth/Makefile
277
libsofia-sip-ua/nua/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
278
libsofia-sip-ua/nua/Makefile
279
libsofia-sip-ua/sdp/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
280
libsofia-sip-ua/sdp/Makefile
281
libsofia-sip-ua/sip/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
282
libsofia-sip-ua/sip/Makefile
283
libsofia-sip-ua/soa/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
284
libsofia-sip-ua/soa/Makefile
285
libsofia-sip-ua/sresolv/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
286
libsofia-sip-ua/sresolv/Makefile 
287
libsofia-sip-ua/stun/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
288
libsofia-sip-ua/stun/Makefile
289
libsofia-sip-ua/su/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
290
libsofia-sip-ua/su/Makefile
291
libsofia-sip-ua/tport/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
292
libsofia-sip-ua/tport/Makefile
293
libsofia-sip-ua/url/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
294
libsofia-sip-ua/url/Makefile
295
libsofia-sip-ua/features/sofia-sip/sofia_features.h
296 297
libsofia-sip-ua-glib/Makefile
libsofia-sip-ua-glib/su-glib/Makefile
298
libsofia-sip-ua-glib/su-glib/Doxyfile
Pekka Pessi's avatar
Pekka Pessi committed
299
utils/Makefile
300
utils/Doxyfile
301
tests/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
302
win32/Makefile
303
win32/config.h
304 305
open_c/Makefile
open_c/config.h
Pekka Pessi's avatar
Pekka Pessi committed
306 307
])

308 309 310
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
311
AC_OUTPUT