blob: 5368afbcdfcfa2c249b40ca6651895b2de0b9392 [file] [log] [blame]
Emeric Vigier2f625822012-08-06 11:09:52 -04001# Copyright (C) 1999-2005 Open Source Telecom Corporation.
2# Copyright (C) 2006-2010 David Sugar, Tycho Softworks.
3#
4# This file is free software; as a special exception the author gives
5# unlimited permission to copy and/or distribute it, with or without
6# modifications, as long as this notice is preserved.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
12AC_INIT(src/ccrtp/rtp.h)
13
14cfg_options=""
15if test -z "$*" ; then
16 if test -f ~/.configure ; then
17 cfg_options=`grep ^ccrtp: ~/.configure | sed -e s/^ccrtp://`
18 elif test -f /etc/configure.conf ; then
19 cfg_options=`grep ^ccrtp: /etc/configure.conf | sed -e s/^ccrtp://`
20 fi
21fi
22
23if test ! -z "$cfg_options" ; then
24 echo "using ~/.configure defaults...$cfg_options"
25 case "$SHELL" in
26 */bash*)
27 exec $SHELL $0 $cfg_options
28 exit -1
29 ;;
30 esac
31 exec $0 $cfg_options
32 exit -1
33fi
34
Alexandre Lisionddd731e2014-01-31 11:50:08 -050035VERSION="2.0.4"
36REQUIRES="5.0.0"
37LT_VERSION="2:2:0"
Emeric Vigier2f625822012-08-06 11:09:52 -040038AC_CONFIG_AUX_DIR(autoconf)
39AC_CANONICAL_SYSTEM
40AC_PROG_CPP
41AC_PROG_CXXCPP
42AC_PROG_CXX
43# OST_PROG_CC_POSIX
44AM_PROG_LIBTOOL
45AM_INIT_AUTOMAKE(ccrtp,[$VERSION])
Alexandre Lisionddd731e2014-01-31 11:50:08 -050046AM_CONFIG_HEADER(ccrtp-config.h)
Emeric Vigier2f625822012-08-06 11:09:52 -040047
48AC_C_RESTRICT
49AC_C_VOLATILE
50AC_C_INLINE
51
52if test -z "$PKG_CONFIG_PATH" ; then
53 PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
54fi
55
56if test "$prefix" != "NONE" ; then
57 PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
58fi
59
60export PKG_CONFIG_PATH
61
62# use "-no-undefined" on Cygwin to force (trigger) libtool to create
63# the shared lib. If this is not set this library
64# is not created. Be sure that the LIBS variable above contains _all_
65# libraries necessary to build ours, Cygwin does not allow undefined
66# symbols.
67case $host in
68# *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
69 *-*-cygwin*)
70 LDFLAGS="$LDFLAGS -no-undefined"
71 ;;
72 *)
73 ;;
74esac
75
76# SRTP support
77AC_ARG_ENABLE(srtp,
78 AS_HELP_STRING([--enable-srtp],
79 [enable SRTP support (default enabled)]))
80if test -z "$enable_srtp"; then
81 enable_srtp="yes"
82 AC_DEFINE(SRTP_SUPPORT, [], [SRTP support])
83fi
84
Emeric Vigier2f625822012-08-06 11:09:52 -040085# availability of gcrypt or openSSL crypto library if SRTP support is enabled
86if test "${enable_srtp}" = "yes"
87then
88 openssl="false"
89 gcrypt="false"
90 AM_PATH_LIBGCRYPT_CCRTP([1:1.2.3],
91 [AC_CHECK_HEADERS([gcrypt.h],
92 [], AC_MSG_ERROR([libgcrypt headers not found.]))
93 LIBS="$LIBGCRYPT_LIBS $LIBS"
94 gcrypt="true"
95 ],
96 [AC_CHECK_LIB([crypto],
97 [EVP_CipherInit_ex],
98 [AC_CHECK_HEADERS([openssl/bn.h openssl/aes.h openssl/sha.h],
99 [], AC_MSG_ERROR([OpenSSL headers not found.]))
100 LIBS="-lcrypto $LIBS"
101 openssl="true"
102 ],
103 [AC_MSG_ERROR([Cannot find libgcrypt or OpenSSL crypto library.])]
104 )
105 ]
106 )
107 AM_CONDITIONAL(SRTP_OPENSSL, test "$openssl" = "true")
108 AM_CONDITIONAL(SRTP_GCRYPT, test "$gcrypt" = "true")
109
110fi
111
112OST_PROG_COMMON
113OST_PROG_LIBVER
114OST_PROG_LIBRARY(CCXX,[$LT_VERSION])
115OST_AUTOMAKE_MODE
116OST_MAINTAINER_MODE
Alexandre Lisionddd731e2014-01-31 11:50:08 -0500117PKG_CHECK_MODULES(COMMONCPP, commoncpp >= $REQUIRES)
118CXXFLAGS="$CXXFLAGS $COMMONCPP_CFLAGS"
119GNULIBS="$COMMONCPP_LIBS $LIBS"
Emeric Vigier2f625822012-08-06 11:09:52 -0400120AC_SUBST(GNULIBS)
121# OST_CC_ENDIAN - now in Common C++
122# Are we using the GNU compiler?
123if test $GCC = yes ; then
124 WARN_FLAGS="-fno-strict-aliasing -Wall -ansi -pedantic"
125else
126 WARN_FLAGS=""
127fi
128AC_SUBST(WARN_FLAGS)
129
130OST_DEBUG
131
132dnl --with-nana: check for nana, the GNU assertion checking and logging library
133AC_ARG_WITH(nana,[ --with-nana use GNU nana for asserts and logging],[
134 AC_CHECK_HEADER(nana.h, [
135 AC_CHECK_HEADERS(DL.h, [
136 AC_CHECK_LIB(nana, main)
137 ])
138 ])
139])
140
141KDOC_DIR="\$(top_srcdir)/doc"
Emeric Vigier2f625822012-08-06 11:09:52 -0400142AC_SUBST(KDOC_DIR)
Alexandre Lisionddd731e2014-01-31 11:50:08 -0500143AC_SUBST(LT_VERSION)
Emeric Vigier2f625822012-08-06 11:09:52 -0400144
145AC_PATH_PROG(DOXYGEN, doxygen, no)
146AC_SUBST(DOXYGEN)
147AM_CONDITIONAL(DOXY, test "$DOXYGEN" != "no")
148
Emeric Vigier2f625822012-08-06 11:09:52 -0400149AC_OUTPUT(Makefile m4/Makefile src/Makefile src/ccrtp/Makefile
150doc/Makefile demo/Makefile phone/Makefile w32/Makefile ccrtp.spec
Alexandre Lisionddd731e2014-01-31 11:50:08 -0500151libccrtp.spec ccrtp.list libccrtp.pc src/ccrtp/crypto/Makefile)