configure.ac 3.89 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 ---------------------------

9
AC_INIT([sofia-sip], [1.11.0.2005.09.23])
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 20 21 22 23 24 25 26 27 28 29 30

AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)

SAC_ENABLE_NDEBUG

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

31 32 33 34 35 36 37 38 39 40 41

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

42 43
### checks for libraries
### --------------------
Pekka Pessi's avatar
Pekka Pessi committed
44 45 46 47 48 49 50 51 52 53 54 55 56
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

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

63 64 65 66 67 68
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
69 70 71
AC_DEFINE([HAVE_SRTP], 0, [Define as 1 if we use SRTP])
AC_DEFINE([HAVE_UPNP], 0, [Define as 1 if we use UPnP])

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

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

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

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

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

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

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

123 124
### output
### ------
Pekka Pessi's avatar
Pekka Pessi committed
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155

AC_CONFIG_FILES([
Makefile
sofia-sip.spec
libsofia-sip-ua/Makefile
libsofia-sip-ua/bnf/Makefile
libsofia-sip-ua/docs/Makefile
libsofia-sip-ua/docs/pictures/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/sdp/tests/Makefile
libsofia-sip-ua/soa/Makefile
libsofia-sip-ua/sip/Makefile
libsofia-sip-ua/sip/images/Makefile
libsofia-sip-ua/sip/tests/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
sofia-sip-ua.pc
Pekka Pessi's avatar
Pekka Pessi committed
156
win32/Makefile
Pekka Pessi's avatar
Pekka Pessi committed
157 158 159
])

AC_OUTPUT