blob: e2cf0483f5778e6bb0d6c4df0b27b30302e8b50e [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
35VERSION="1.8.0"
36REQUIRES="1.3.0"
37LT_RELEASE="1.8"
38LT_VERSION="0:0"
39AC_CONFIG_AUX_DIR(autoconf)
40AC_CANONICAL_SYSTEM
41AC_PROG_CPP
42AC_PROG_CXXCPP
43AC_PROG_CXX
44# OST_PROG_CC_POSIX
45AM_PROG_LIBTOOL
46AM_INIT_AUTOMAKE(ccrtp,[$VERSION])
47AM_CONFIG_HEADER(src/config.h)
48
49AC_C_RESTRICT
50AC_C_VOLATILE
51AC_C_INLINE
52
53if test -z "$PKG_CONFIG_PATH" ; then
54 PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
55fi
56
57if test "$prefix" != "NONE" ; then
58 PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
59fi
60
61export PKG_CONFIG_PATH
62
63# use "-no-undefined" on Cygwin to force (trigger) libtool to create
64# the shared lib. If this is not set this library
65# is not created. Be sure that the LIBS variable above contains _all_
66# libraries necessary to build ours, Cygwin does not allow undefined
67# symbols.
68case $host in
69# *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
70 *-*-cygwin*)
71 LDFLAGS="$LDFLAGS -no-undefined"
72 ;;
73 *)
74 ;;
75esac
76
77# SRTP support
78AC_ARG_ENABLE(srtp,
79 AS_HELP_STRING([--enable-srtp],
80 [enable SRTP support (default enabled)]))
81if test -z "$enable_srtp"; then
82 enable_srtp="yes"
83 AC_DEFINE(SRTP_SUPPORT, [], [SRTP support])
84fi
85
86AM_CONDITIONAL(SRTP_OPENSSL, test "$openssl" = "true")
87AM_CONDITIONAL(SRTP_GCRYPT, test "$gcrypt" = "true")
88# availability of gcrypt or openSSL crypto library if SRTP support is enabled
89if test "${enable_srtp}" = "yes"
90then
91 openssl="false"
92 gcrypt="false"
93 AM_PATH_LIBGCRYPT_CCRTP([1:1.2.3],
94 [AC_CHECK_HEADERS([gcrypt.h],
95 [], AC_MSG_ERROR([libgcrypt headers not found.]))
96 LIBS="$LIBGCRYPT_LIBS $LIBS"
97 gcrypt="true"
98 ],
99 [AC_CHECK_LIB([crypto],
100 [EVP_CipherInit_ex],
101 [AC_CHECK_HEADERS([openssl/bn.h openssl/aes.h openssl/sha.h],
102 [], AC_MSG_ERROR([OpenSSL headers not found.]))
103 LIBS="-lcrypto $LIBS"
104 openssl="true"
105 ],
106 [AC_MSG_ERROR([Cannot find libgcrypt or OpenSSL crypto library.])]
107 )
108 ]
109 )
110 AM_CONDITIONAL(SRTP_OPENSSL, test "$openssl" = "true")
111 AM_CONDITIONAL(SRTP_GCRYPT, test "$gcrypt" = "true")
112
113fi
114
115OST_PROG_COMMON
116OST_PROG_LIBVER
117OST_PROG_LIBRARY(CCXX,[$LT_VERSION])
118OST_AUTOMAKE_MODE
119OST_MAINTAINER_MODE
120PKG_CHECK_MODULES(COMMON, libccgnu2 >= $REQUIRES)
121CXXFLAGS="$CXXFLAGS $COMMON_CFLAGS"
122COMMON_LIBPATH=`pkg-config --variable=libdir libccgnu2`
123GNULIBS="-L$COMMON_LIBPATH $COMMON_LIBS $LIBS"
124AC_SUBST(GNULIBS)
125# OST_CC_ENDIAN - now in Common C++
126# Are we using the GNU compiler?
127if test $GCC = yes ; then
128 WARN_FLAGS="-fno-strict-aliasing -Wall -ansi -pedantic"
129else
130 WARN_FLAGS=""
131fi
132AC_SUBST(WARN_FLAGS)
133
134OST_DEBUG
135
136dnl --with-nana: check for nana, the GNU assertion checking and logging library
137AC_ARG_WITH(nana,[ --with-nana use GNU nana for asserts and logging],[
138 AC_CHECK_HEADER(nana.h, [
139 AC_CHECK_HEADERS(DL.h, [
140 AC_CHECK_LIB(nana, main)
141 ])
142 ])
143])
144
145KDOC_DIR="\$(top_srcdir)/doc"
146AC_SUBST(LT_RELEASE)
147AC_SUBST(KDOC_DIR)
148
149AC_PATH_PROG(DOXYGEN, doxygen, no)
150AC_SUBST(DOXYGEN)
151AM_CONDITIONAL(DOXY, test "$DOXYGEN" != "no")
152
153LIB_VERSION=`echo $LT_RELEASE | sed -e 's/[\.]/_/'`
154LIB_MAJOR=`echo $LT_VERSION | sed -e 's/[:].*$//'`
155
156AC_SUBST(LIB_VERSION)
157AC_SUBST(LIB_MAJOR)
158
159AC_OUTPUT(Makefile m4/Makefile src/Makefile src/ccrtp/Makefile
160doc/Makefile demo/Makefile phone/Makefile w32/Makefile ccrtp.spec
161libccrtp.spec ccrtp.list libccrtp1.pc src/ccrtp/crypto/Makefile)