configure.ac 3.77 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7 8
dnl 
dnl ref: http://www.gnu.org/software/autoconf/manual/autoconf.info.gz
dnl
AC_PREREQ(2.57)

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

Pekka Pessi's avatar
Pekka Pessi committed
9
AC_INIT([sofia-sip], [1.11.2])
Pekka Pessi's avatar
Pekka Pessi committed
10 11 12
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sip.h])

# dnl calls AC_CANONICAL_ macros that are required by AM_INIT_AUTOMAKE
13
SAC_CANONICAL_SYSTEM_CACHE_CHECK
Pekka Pessi's avatar
Pekka Pessi committed
14 15 16 17 18 19

AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)

SAC_ENABLE_NDEBUG
Pekka Pessi's avatar
Pekka Pessi committed
20
SAC_ENABLE_EXPENSIVE_CHECKS
Pekka Pessi's avatar
Pekka Pessi committed
21 22 23 24 25 26 27 28 29 30 31

dnl checks for programs
dnl -------------------
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

32 33 34 35 36 37 38 39 40 41 42

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])

43 44
### checks for libraries
### --------------------
Pekka Pessi's avatar
Pekka Pessi committed
45 46 47 48 49 50 51 52
AC_CHECK_LIB(pthread, pthread_create)

SAC_GNU_SOURCE
SAC_SOFIA_SU
SAC_OPENSSL
SAC_TPORT
SAC_SU

53 54
### internal modules
### ----------------
Pekka Pessi's avatar
Pekka Pessi committed
55 56 57 58
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])

59 60 61
dnl compile STUN only if OPENSSL is available
if test x${HAVE_OPENSSL} != x1 ; then
  AC_MSG_WARN([** STUN support disabled as OpenSSL headers and/or libraries were not found **])
62 63
else
  AC_DEFINE_UNQUOTED([HAVE_SOFIA_STUN], 1, [Define as 1 if we use STUN library])
64 65
fi

Pekka Pessi's avatar
Pekka Pessi committed
66 67 68
AC_DEFINE([HAVE_SRTP], 0, [Define as 1 if we use SRTP])
AC_DEFINE([HAVE_UPNP], 0, [Define as 1 if we use UPnP])

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

Pekka Pessi's avatar
Pekka Pessi committed
72 73 74 75
### checks for types
### ----------------

AC_TYPE_SIGNAL
76 77 78 79 80 81
AC_CHECK_TYPE([long long],[
AC_DEFINE([longlong], [long long], [Define as at least 64-bit int type])dnl
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
])dnl
Pekka Pessi's avatar
Pekka Pessi committed
82

83 84
### checks for structures
### ---------------------
Pekka Pessi's avatar
Pekka Pessi committed
85 86 87 88 89
AC_HEADER_STDC
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_HEADERS(stdint.h)
AC_CHECK_HEADERS(inttypes.h)

90 91
### checks for typedefs, structures, and compiler characteristics.
### --------------------------------------------------------------
Pekka Pessi's avatar
Pekka Pessi committed
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
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

107 108
### checks for library functions
### ----------------------------
Pekka Pessi's avatar
Pekka Pessi committed
109 110 111 112 113 114 115
AC_SEARCH_LIBS(gethostbyname, xnet nsl)
AC_SEARCH_LIBS(getipnodebyname, xnet socket nsl)
AC_SEARCH_LIBS(getaddrinfo, xnet socket nsl)
AC_SEARCH_LIBS(socket, xnet socket)
AC_SEARCH_LIBS(inet_ntop, socket nsl)
AC_SEARCH_LIBS(inet_pton, socket nsl)

116 117
### checks for system services
### --------------------------
Pekka Pessi's avatar
Pekka Pessi committed
118 119
dnl XXX

120 121
### output
### ------
Pekka Pessi's avatar
Pekka Pessi committed
122 123 124

AC_CONFIG_FILES([
Makefile
Pekka Pessi's avatar
Pekka Pessi committed
125
packages/Makefile
126 127
packages/sofia-sip.spec
packages/sofia-sip-ua.pc
Pekka Pessi's avatar
Pekka Pessi committed
128 129 130 131 132
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
133 134
libsofia-sip-ua/features/Makefile
libsofia-sip-ua/features/sofia_sip_features.h
Pekka Pessi's avatar
Pekka Pessi committed
135 136 137 138 139 140 141 142 143 144
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
145
libsofia-sip-ua/soa/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
146 147 148 149 150 151
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
utils/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
152
win32/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
153 154 155
])

AC_OUTPUT