configure.ac 3.79 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.0.2005.10.06])
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 53 54 55 56 57
AC_CHECK_LIB(pthread, pthread_create)

PKG_CHECK_MODULES(GLIB, glib-2.0)
AC_SUBST(GLIB_LIBS)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_VERSION)

SAC_GNU_SOURCE
SAC_SOFIA_SU
SAC_OPENSSL
SAC_TPORT
SAC_SU

58 59
### internal modules
### ----------------
Pekka Pessi's avatar
Pekka Pessi committed
60 61 62 63
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])

64 65 66 67 68 69
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 **])
fi
AC_DEFINE_UNQUOTED([HAVE_SOFIA_STUN], $HAVE_OPENSSL, [Define as 1 if we use STUN library])

Pekka Pessi's avatar
Pekka Pessi committed
70 71 72
AC_DEFINE([HAVE_SRTP], 0, [Define as 1 if we use SRTP])
AC_DEFINE([HAVE_UPNP], 0, [Define as 1 if we use UPnP])

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

Pekka Pessi's avatar
Pekka Pessi committed
76 77 78 79
### checks for types
### ----------------

AC_TYPE_SIGNAL
80 81 82 83 84 85
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
86

87 88
### checks for structures
### ---------------------
Pekka Pessi's avatar
Pekka Pessi committed
89 90 91 92 93
AC_HEADER_STDC
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_HEADERS(stdint.h)
AC_CHECK_HEADERS(inttypes.h)

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

111 112
### checks for library functions
### ----------------------------
Pekka Pessi's avatar
Pekka Pessi committed
113 114 115 116 117 118 119
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)

120 121
### checks for system services
### --------------------------
Pekka Pessi's avatar
Pekka Pessi committed
122 123
dnl XXX

124 125
### output
### ------
Pekka Pessi's avatar
Pekka Pessi committed
126 127 128

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

AC_OUTPUT